RetroArch
jsonsax_full.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2012 John-Anthony Owens
3 
4  Permission is hereby granted, free of charge, to any person obtaining a
5  copy of this software and associated documentation files (the "Software"),
6  to deal in the Software without restriction, including without limitation
7  the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  and/or sell copies of the Software, and to permit persons to whom the
9  Software is furnished to do so, subject to the following conditions:
10 
11  The above copyright notice and this permission notice shall be included
12  in all copies or substantial portions of the Software.
13 
14  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20  IN THE SOFTWARE.
21 */
22 
23 #ifndef JSONSAX_H_INCLUDED
24 #define JSONSAX_H_INCLUDED
25 
26 /* The library version */
27 #define JSON_MAJOR_VERSION 1
28 #define JSON_MINOR_VERSION 4
29 #define JSON_MICRO_VERSION 5
30 
31 /* JSON_NO_PARSER and JSON_NO_WRITER, if defined, remove the corresponding
32  * APIs and functionality from the library.
33  */
34 #if defined(JSON_NO_PARSER) && defined(JSON_NO_WRITER)
35 #error JSON_NO_PARSER and JSON_NO_WRITER cannot both be defined!
36 #endif
37 
38 #include <stddef.h> /* for size_t and NULL */
39 
40 /* The library API is C and should not be subjected to C++ name mangling. */
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 /* JSON_EXPORT controls the library's public API import/export linkage
46  * specifiers. By default, the library will be compiled to support dynamic
47  * linkage. In order to build the library for static linkage, the JSON_STATIC
48  * macro must be defined when the library itself is built AND when the client
49  * includes jsonsax.h.
50  */
51 #if defined(JSON_STATIC)
52 #define JSON_EXPORT /* nothing */
53 #else
54 #if defined(_MSC_VER)
55 #if defined(JSON_BUILDING)
56 #define JSON_EXPORT __declspec(dllexport)
57 #else
58 #define JSON_EXPORT __declspec(dllimport)
59 #endif
60 #else
61 #if defined(JSON_BUILDING)
62 #define JSON_EXPORT __attribute__ ((visibility("default")))
63 #else
64 #define JSON_EXPORT /* nothing */
65 #endif
66 #endif
67 #endif
68 
69 /* JSON_CALL controls the library's public API calling-convention. Clients'
70  * handler functions should be declared with JSON_CALL in order to ensure
71  * that the calling convention matches.
72  */
73 #ifndef JSON_CALL
74 #if defined(_MSC_VER)
75 #define JSON_CALL __cdecl
76 #elif defined(__GNUC__) && defined(__i386) && !defined(__INTEL_COMPILER)
77 #define JSON_CALL __attribute__((cdecl))
78 #else
79 #define JSON_CALL /* nothing */
80 #endif
81 #endif
82 
83 #define JSON_API(t) JSON_EXPORT t JSON_CALL
84 
85 /* Boolean values used by the library. */
86 typedef enum tag_JSON_Boolean
87 {
90 } JSON_Boolean;
91 
92 /* Values returned by library APIs to indicate success or failure. */
93 typedef enum tag_JSON_Status
94 {
97 } JSON_Status;
98 
99 /* Error codes. */
100 typedef enum tag_JSON_Error
101 {
119 } JSON_Error;
120 
121 /* Text encodings. */
122 typedef enum tag_JSON_Encoding
123 {
130 } JSON_Encoding;
131 
132 /* Attributes of a string value. */
134 {
136  JSON_ContainsNullCharacter = 1 << 0, /* U+0000 */
137  JSON_ContainsControlCharacter = 1 << 1, /* U+0000 - U+001F */
138  JSON_ContainsNonASCIICharacter = 1 << 2, /* U+0080 - U+10FFFF */
139  JSON_ContainsNonBMPCharacter = 1 << 3, /* U+10000 - U+10FFFF */
140  JSON_ContainsReplacedCharacter = 1 << 4 /* an invalid encoding sequence was replaced by U+FFFD */
142 typedef unsigned int JSON_StringAttributes;
143 
144 /* Attributes of a number value. */
146 {
148  JSON_IsNegative = 1 << 0,
149  JSON_IsHex = 1 << 1,
154 typedef unsigned int JSON_NumberAttributes;
155 
156 /* Types of "special" number. */
158 {
159  JSON_NaN = 0,
163 
164 /* Information identifying a location in a parser instance's input stream. */
165 typedef struct tag_JSON_Location
166 {
167  /* The zero-based index of the byte in the input stream. Note that this
168  * is the only value that unambiguously identifies the location, since
169  * line and column refer to characters (which may be encoded in the input
170  * as multi-byte sequences) rather than bytes.
171  */
172  size_t byte;
173 
174  /* The zero-based line number of the character in the input stream. Note
175  * that the parser treats each of the following character sequences as a
176  * single line break for purposes of computing line numbers:
177  *
178  * U+000A (LINE FEED)
179  * U+000D (CARRIAGE RETURN)
180  * U+000D U+000A (CARRIAGE RETURN, LINE FEED)
181  *
182  */
183  size_t line;
184 
185  /* The zero-based column number of the character in the input stream. */
186  size_t column;
187 
188  /* The zero-based depth in the JSON document structure at the location. */
189  size_t depth;
190 } JSON_Location;
191 
192 /* Custom memory management handlers.
193  *
194  * The semantics of these handlers correspond exactly to those of standard
195  * realloc(), and free(). The handlers also receive the value of the memory
196  * suite's user data parameter, which clients can use to implement memory
197  * pools or impose custom allocation limits, if desired.
198  */
199 typedef void* (JSON_CALL * JSON_ReallocHandler)(void* userData, void* ptr, size_t size);
200 typedef void (JSON_CALL * JSON_FreeHandler)(void* userData, void* ptr);
201 
202 /* A suite of custom memory management functions. */
203 typedef struct tag_JSON_MemorySuite
204 {
205  void* userData;
209 
210 /******************** JSON Parser ********************/
211 
212 #ifndef JSON_NO_PARSER
213 
214 /* Parser instance. */
215 struct JSON_Parser_Data; /* opaque data */
217 
218 /* Create a parser instance.
219  *
220  * If pMemorySuite is null, the library will use the C runtime realloc() and
221  * free() as the parser's memory management suite. Otherwise, all the
222  * handlers in the memory suite must be non-null or the call will fail and
223  * return null.
224  */
226 
227 /* Free a parser instance.
228  *
229  * Every successful call to JSON_Parser_Create() must eventually be paired
230  * with a call to JSON_Parser_Free() in order to avoid leaking memory.
231  *
232  * This function returns failure if the parser parameter is null or if the
233  * function was called reentrantly from inside a handler.
234  */
236 
237 /* Reset a parser instance so that it can be used to parse a new input stream.
238  *
239  * This function returns failure if the parser parameter is null or if the
240  * function was called reentrantly from inside a handler.
241  *
242  * After a parser is reset, its state is indistinguishable from its state
243  * when it was returned by JSON_Parser_Create(). The parser's custom memory
244  * suite, if any, is preserved; all other settings, state, and handlers are
245  * restored to their default values.
246  */
248 
249 /* Get and set the user data value associated with a parser instance.
250  *
251  * This setting allows clients to associate additional data with a
252  * parser instance. The parser itself does not use the value.
253  *
254  * The default value of this setting is null.
255  *
256  * This setting can be changed at any time, even inside handlers.
257  */
260 
261 /* Get and set the input encoding for a parser instance.
262  *
263  * If the client does not explicitly set the input encoding before calling
264  * JSON_Parser_Parse() on the parser instance, the parser will use the first
265  * 4 bytes of input to detect the input encoding automatically. Once the
266  * parser has detected the encoding, calls to JSON_Parser_GetInputEncoding()
267  * will return the detected value.
268  *
269  * The default value of this setting is JSON_UnknownEncoding.
270  *
271  * This setting cannot be changed once the parser has started parsing.
272  */
275 
276 /* Get and set the string encoding for a parser instance.
277  *
278  * This setting controls the encoding of the string values that are
279  * passed to the string and object member handlers.
280  *
281  * The default value of this setting is JSON_UTF8.
282  *
283  * This setting cannot be set to JSON_UnknownEncoding.
284  *
285  * This setting cannot be changed once the parser has started parsing.
286  */
289 
290 /* Get and set the maximum length of strings that a parser instance allows.
291  *
292  * This setting controls the maximum length, in bytes (NOT characters), of
293  * the encoded strings that are passed to the string and object member
294  * handlers. If the parser encounters a string that, when encoded in the
295  * string encoding, is longer than the maximum string length, it triggers
296  * the JSON_TooLongString error.
297  *
298  * The default value of this setting is SIZE_MAX.
299  *
300  * This setting cannot be changed once the parser has started parsing.
301  */
304 
305 /* Get and set the number encoding for a parser instance.
306  *
307  * This setting controls the encoding of the number values that are
308  * passed to the number handler.
309  *
310  * The default value of this setting is JSON_UTF8.
311  *
312  * This setting cannot be set to JSON_UnknownEncoding.
313  *
314  * This setting cannot be changed once the parser has started parsing.
315  */
318 
319 /* Get and set the maximum length of numbers that a parser instance allows.
320  *
321  * This setting controls the maximum length, in bytes (NOT characters), of
322  * the encoded numbers that are passed to the number handler. If the parser
323  * encounters a number that, when encoded in the number encoding, is longer
324  * than the maximum number length, it triggers the JSON_TooLongNumber error.
325  *
326  * The default value of this setting is SIZE_MAX.
327  *
328  * This setting cannot be changed once the parser has started parsing.
329  */
332 
333 /* Get and set whether a parser instance allows the input to begin with a
334  * byte-order-mark (BOM).
335  *
336  * RFC 4627 does not allow JSON text to begin with a BOM, but some clients
337  * may find it convenient to be lenient in this regard; for example, if the
338  * JSON text is being read from a file that has a BOM.
339  *
340  * The default value of this setting is JSON_False.
341  *
342  * This setting cannot be changed once the parser has started parsing.
343  */
346 
347 /* Get and set whether a parser instance allows Javascript-style comments to
348  * appear in the JSON text.
349  *
350  * RFC 4627 does not allow JSON text to contain comments, but some clients
351  * may find it useful to allow them.
352  *
353  * Both types of comment described by ECMA-262 (multi-line and single-line)
354  * are supported.
355  *
356  * The default value of this setting is JSON_False.
357  *
358  * This setting cannot be changed once the parser has started parsing.
359  */
362 
363 /* Get and set whether a parser instance allows the "special" number literals
364  * NaN, Infinity, and -Infinity.
365  *
366  * RFC 4627 does not provide any way to represent NaN, Infinity, or -Infinity,
367  * but some clients may find it convenient to recognize these as literals,
368  * since they are emitted by many common JSON generators.
369  *
370  * The default value of this setting is JSON_False.
371  *
372  * This setting cannot be changed once the parser has started parsing.
373  */
376 
377 /* Get and set whether a parser instance allows hexadecimal notation to be
378  * used for specifying number values.
379  *
380  * RFC 4627 does not allow hexadecimal numbers, but some clients may find it
381  * convenient to allow them, in order to represent binary bit patterns more
382  * easily.
383  *
384  * The parser recognizes hexadecimal numbers that conform to the syntax of
385  * HexIntegerLiteral, as described in section 7.8.3 of ECMA-262. That is, a
386  * valid hexadecimal number must comprise the prefix '0x' or '0X', followed
387  * by a sequence of one or more of the following characters: '0' - '9',
388  * 'a' - 'f', and 'A' - 'F'.
389  *
390  * Hexadecimal numbers cannot be prefixed by a minus sign.
391  *
392  * The default value of this setting is JSON_False.
393  *
394  * This setting cannot be changed once the parser has started parsing.
395  */
398 
399 /* Get and set whether a parser instance allows unescaped control characters
400  * (U+0000 - U+001F) to appear inside string values.
401  *
402  * RFC 4627 does not allow JSON text to contain unescaped control characters,
403  * but some clients may find it useful to allow them.
404  *
405  * The default value of this setting is JSON_False.
406  *
407  * This setting cannot be changed once the parser has started parsing.
408  */
411 
412 /* Get and set whether a parser instance replaces invalid encoding sequences
413  * it encounters inside string tokens with the Unicode replacement character
414  * (U+FFFD) rather than triggering an error.
415  *
416  * By default, the parser is strict when decoding the input stream, and will
417  * fail if it encounters an encoding sequence that is not valid for the input
418  * encoding. Note especially that this includes (but is not limited to) the
419  * following:
420  *
421  * - Overlong encoding sequences in UTF-8.
422  * - Surrogate codepoints encoded in UTF-8 or UTF-32.
423  * - Unpaired or improperly-paired surrogates in UTF-16.
424  * - Codepoints outside the Unicode range encoded in UTF-8 or UTF-32.
425  *
426  * The replacement follows the rules and recommendations described in section
427  * 3.9 of version 5.2.0 of [the Unicode Standard](http://www.unicode.org/versions/Unicode5.2.0/).
428  *
429  * The default value of this setting is JSON_False.
430  *
431  * This setting cannot be changed once the parser has started parsing.
432  */
435 
436 /* Get and set whether a parser instance tracks object member names for all
437  * open objects and detects duplicate members if any occur in the input.
438  *
439  * RFC 4627 stipulates that JSON parsers SHOULD check for duplicates, but
440  * may opt not to in light of reasonable implementation considerations.
441  * Checking for duplicate members necessarily incurs non-trivial memory
442  * overhead, and is therefore not enabled by default. Most clients use
443  * their parse handlers to build some sort of in-memory DOM representation
444  * of the JSON text and therefore already have the means to check for
445  * duplicate member names without incurring additional memory overhead; it
446  * is recommended that these clients implement duplicate member checking
447  * in their object member handler (refer to SetObjectMemberHandler() for
448  * details) and leave this setting disabled.
449  *
450  * The default value of this setting is JSON_False.
451  *
452  * This setting cannot be changed once the parser has started parsing.
453  */
456 
457 /* Get and set whether a parser instance stops parsing as soon as the end of
458  * the top-level JSON document is parsed.
459  *
460  * This setting allows the client to parse JSON content that is embedded
461  * inside a larger data stream. If this setting is enabled, the parser will,
462  * upon successfully parsing the end of the embedded JSON document, set its
463  * error to JSON_Error_StoppedAfterEmbeddedDocument, set its error location
464  * to the location in the input stream immediately following the end of the
465  * document, and return JSON_Failure from JSON_Parser_Parse().
466  *
467  * The default value of this setting is JSON_False.
468  *
469  * This setting cannot be changed once the parser has started parsing.
470  */
473 
474 /* Get the type of error, if any, encountered by a parser instance.
475  *
476  * If the parser encountered an error while parsing input, this function
477  * returns the type of the error. Otherwise, this function returns
478  * JSON_Error_None.
479  */
481 
482 /* Get the location in the input stream at which a parser instance
483  * encountered an error.
484  *
485  * If the parser encountered an error while parsing input, this function
486  * sets the members of the structure pointed to by pLocation to the location
487  * in the input stream at which the error occurred and returns success.
488  * Otherwise, it leaves the members unchanged and returns failure.
489  */
491 
492 /* Get the location in the input stream of the beginning of the token
493  * that is currently being handled by one of a parser instance's parse
494  * handlers.
495  *
496  * If the parser is inside a parse handler, this function sets the members
497  * of the structure pointed to by pLocation to the location and returns
498  * success. Otherwise, it leaves the members unchanged and returns failure.
499  */
501 
502 /* Get the location in the input stream that immediately follows the end of
503  * the token that is currently being handled by one of a parser instance's
504  * parse handlers.
505  *
506  * If the parser is inside a parse handler, this function sets the members
507  * of the structure pointed to by pLocation to the location and returns
508  * success. Otherwise, it leaves the members unchanged and returns failure.
509  */
511 
512 /* Parse handlers are callbacks that the client provides in order to
513  * be notified about the structure of the JSON document as it is being
514  * parsed. The following notes apply equally to all parse handlers:
515  *
516  * 1. Parse handlers are optional. In fact, a parser with no parse
517  * handlers at all can be used to simply validate that the input
518  * is valid JSON.
519  *
520  * 2. Parse handlers can be set, unset, or changed at any time, even
521  * from inside a parse handler.
522  *
523  * 3. If a parse handler returns JSON_Parser_Abort, the parser will
524  * abort the parse, set its error to JSON_Error_AbortedByHandler,
525  * set its error location to the start of the token that triggered
526  * the handler, and return JSON_Failure from the outer call to
527  * JSON_Parser_Parse().
528  *
529  * 4. A parse handler can get the location in the input stream of the
530  * token that triggered the handler by calling
531  * JSON_Parser_GetTokenLocation().
532  */
533 
534 /* Values returned by parse handlers to indicate whether parsing should
535  * continue or be aborted.
536  *
537  * Note that JSON_TreatAsDuplicateObjectMember should only be returned by
538  * object member handlers. Refer to JSON_Parser_SetObjectMemberHandler()
539  * for details.
540  */
542 {
547 
548 /* Get and set the handler that is called when a parser instance detects the
549  * input encoding.
550  *
551  * If the parser instance's input encoding was set to JSON_UnknownEncoding
552  * when parsing began, this handler will be called as soon as the actual
553  * input encoding has been detected.
554  *
555  * Note that JSON_Parser_GetTokenLocation() will return failure if called
556  * from inside this handler, since there is no token associated with this
557  * event.
558  */
562 
563 /* Get and set the handler that is called when a parser instance encounters
564  * a JSON null literal value.
565  */
569 
570 /* Get and set the handler that is called when a parser instance encounters
571  * a JSON boolean value (true or false).
572  */
576 
577 /* Get and set the handler that is called when a parser instance encounters
578  * a JSON string value.
579  *
580  * The pValue parameter points to a buffer containing the string value,
581  * encoded according to the parser instance's string encoding setting. The
582  * buffer is null-terminated (the null terminator character is also encoded).
583  * Note, however, that JSON strings may contain embedded null characters,
584  * which are specifiable using the escape sequence \u0000. The client is
585  * free to modify the contents of the buffer during the handler.
586  *
587  * The length parameter specifies the number of bytes (NOT characters) in
588  * the encoded string, not including the encoded null terminator.
589  *
590  * The attributes parameter provides information about the characters
591  * that comprise the string. If the option to replace invalid encoding
592  * sequences is enabled and the string contains any Unicode replacement
593  * characters (U+FFFD) that were the result of replacing invalid encoding
594  * sequences in the input, the attributes will include the value
595  * JSON_ContainsReplacedCharacter. Note that the absence of this attribute
596  * does not imply that the string does not contain any U+FFFD characters,
597  * since such characters may have been present in the original input, and
598  * not inserted by a replacement operation.
599  */
603 
604 /* Get and set the handler that is called when a parser instance encounters
605  * a JSON number value.
606  *
607  * JSON numbers do not have a defined binary representation or precision,
608  * and different clients may wish to interpret them differently, for
609  * example, as IEEE 754 doubles, 64-bit integers, or arbitrary-precision
610  * bignums. For this reason, the parser does not attempt to interpret
611  * number values, but leaves this to the client.
612  *
613  * The pValue parameter points to a buffer containing the number value,
614  * encoded according to the parser instance's number encoding setting. The
615  * buffer is null-terminated (the null terminator character is also encoded).
616  * The buffer is guaranteed to contain only characters allowed in JSON number
617  * values, that is: '0' - '9', '+', '-', '.', 'e', and 'E'; if the option
618  * to allow hex numbers is enabled, the text may also contain the characters
619  * 'x', 'X', 'a' - 'f', and 'A' - 'F'. The client is free to modify the
620  * contents of the buffer during the handler. This is especially useful
621  * to clients that wish to convert the number to a double using the C
622  * standard library's strtod() function, which is locale-sensitive; in this
623  * case, the client should modify the buffer to replace the '.' character
624  * with localconv()->decimal_point[0] before passing the buffer to strtod().
625  *
626  * The length parameter specifies the number of bytes (NOT characters) in
627  * the encoded number, not including the encoded null terminator.
628  *
629  * The attributes parameter provides information about the number.
630  */
634 
635 /* Get and set the handler that is called when a parser instance encounters
636  * one of the "special" number literals NaN, Infinity, and -Inifinity.
637  */
641 
642 /* Get and set the handler that is called when a parser instance encounters
643  * the left curly brace that starts an object.
644  */
648 
649 /* Get and set the handler that is called when a parser instance encounters
650  * the right curly brace that ends an object.
651  */
655 
656 /* Get and set the handler that is called when a parser instance encounters
657  * an object member name.
658  *
659  * The pValue parameter points to a buffer containing the member name,
660  * encoded according to the parser instance's string encoding setting. The
661  * buffer is null-terminated (the null terminator character is also encoded).
662  * Note, however, that JSON strings may contain embedded null characters,
663  * which are specifiable using the escape sequence \u0000. The client is
664  * free to modify the contents of the buffer during the handler.
665  *
666  * The length parameter specifies the number of bytes (NOT characters) in
667  * the encoded string, not including the encoded null terminator.
668  *
669  * The attributes parameter provides information about the characters
670  * that comprise the string. If the option to replace invalid encoding
671  * sequences is enabled and the string contains any Unicode replacement
672  * characters (U+FFFD) that were the result of replacing invalid encoding
673  * sequences in the input, the attributes will include the value
674  * JSON_ContainsReplacedCharacter. Note that the absence of this attribute
675  * does not imply that the string does not contain any U+FFFD characters,
676  * since such characters may have been present in the original input, and
677  * not inserted by a replacement operation.
678  *
679  * The handler can return JSON_Parser_TreatAsDuplicateObjectMember to
680  * indicate that the current object already contains a member with the
681  * specified name. This allows clients to implement duplicate member
682  * checking without incurring the additional memory overhead associated
683  * with enabling the TrackObjectMembers setting.
684  */
688 
689 /* Get and set the handler that is called when a parser instance encounters
690  * the left square brace that starts an array.
691  */
695 
696 /* Get and set the handler that is called when a parser instance encounters
697  * the right square brace that ends an array.
698  */
702 
703 /* Get and set the handler that is called when a parser instance encounters
704  * an array item.
705  *
706  * This event is always immediately followed by a null, boolean, string,
707  * number, special number, start object, or start array event.
708  */
712 
713 /* Push zero or more bytes of input to a parser instance.
714  *
715  * The pBytes parameter points to a buffer containing the bytes to be
716  * parsed, if any. pBytes may be NULL if and only if the length parameter
717  * is 0.
718  *
719  * The length parameter specifies the number of bytes (NOT characters)
720  * pointed to by pBytes.
721  *
722  * The isFinal parameter specifies whether the parser should treat the
723  * input to the call as the last chunk of input in the JSON document.
724  * If this parameter is JSON_False, the parser will assume that more
725  * input may be forthcoming.
726  *
727  * The parser adheres to [RFC 4627](http://www.ietf.org/rfc/rfc4627.txt),
728  * except that any JSON value (null, true, false, string, number, object,
729  * or array) is accepted as a valid top-level entity in the parsed text.
730  *
731  * This function returns failure if the parser parameter is null, if the
732  * function was called reentrantly from inside a handler, or if the
733  * parser instance has already finished parsing.
734  */
736 
737 #endif /* JSON_NO_PARSER */
738 
739 /******************** JSON Writer ********************/
740 
741 #ifndef JSON_NO_WRITER
742 
743 /* Writer instance. */
744 struct JSON_Writer_Data; /* opaque data */
746 
747 /* Create a writer instance.
748  *
749  * If pMemorySuite is null, the library will use the C runtime realloc() and
750  * free() as the writer's memory management suite. Otherwise, all the
751  * handlers in the memory suite must be non-null or the call will fail and
752  * return null.
753  */
755 
756 /* Free a writer instance.
757  *
758  * Every successful call to JSON_Writer_Create() must eventually be paired
759  * with a call to JSON_Writer_Free() in order to avoid leaking memory.
760  *
761  * This function returns failure if the writer parameter is null or if the
762  * function was called reentrantly from inside a handler.
763  */
765 
766 /* Reset a writer instance so that it can be used to write a new output
767  * stream.
768  *
769  * This function returns failure if the writer parameter is null or if the
770  * function was called reentrantly from inside a handler.
771  *
772  * After a writer is reset, its state is indistinguishable from its state
773  * when it was returned by JSON_Writer_Create(). The writer's custom memory
774  * suite, if any, is preserved; all other settings, state, and handlers are
775  * restored to their default values.
776  */
778 
779 /* Get and set the user data value associated with a writer instance.
780  *
781  * This setting allows clients to associate additional data with a
782  * writer instance. The writer itself does not use the value.
783  *
784  * The default value of this setting is NULL.
785  *
786  * This setting can be changed at any time, even inside handlers.
787  */
790 
791 /* Get and set the output encoding for a writer instance.
792  *
793  * The default value of this setting is JSON_UTF8.
794  *
795  * This setting cannot be set to JSON_UnknownEncoding.
796  *
797  * This setting cannot be changed once the writer has started writing.
798  */
801 
802 /* Get and set whether a writer instance uses CARRIAGE RETURN, LINE FEED
803  * (CRLF) as the new line sequence generated by JSON_Writer_WriteNewLine().
804  *
805  * The default value of this setting is JSON_False.
806  *
807  * This setting cannot be changed once the writer has started writing.
808  */
811 
812 /* Get and set whether a writer instance replaces invalid encoding sequences
813  * it encounters in string tokens with the Unicode replacement character
814  * (U+FFFD) rather than triggering an error.
815  *
816  * The default value of this setting is JSON_False.
817  *
818  * This setting cannot be changed once the writer has started writing.
819  */
822 
823 /* Get and set whether a writer instance escapes all non-ASCII characters
824  * that it outputs. This can be useful for debugging, or when the output
825  * will be consumed by a parser that does not support UTF-encoded input.
826  * It is not recommended as a general practice, since it bloats the size
827  * of non-ASCII strings considerably, compared to UTF encoding.
828  *
829  * The default value of this setting is JSON_False.
830  *
831  * This setting cannot be changed once the writer has started writing.
832  */
835 
836 /* Get the type of error, if any, encountered by a writer instance.
837  *
838  * If the writer encountered an error while writing input, this function
839  * returns the type of the error. Otherwise, this function returns
840  * JSON_Error_None.
841  */
843 
844 /* The JSON_Writer_WriteXXX() family of functions cause JSON text to be
845  * sent to a writer instance's output handler. The following notes apply
846  * equally to all these functions:
847  *
848  * 1. The output handler is optional, and can be set, unset, or changed
849  * at any time, even from inside the output handler.
850  *
851  * 2. A single call to JSON_Writer_WriteXXX() may trigger multiple calls
852  * to the output handler.
853  *
854  * 3. All output generated by a call to JSON_Writer_WriteXXX() is sent
855  * to the output handler before the call returns; that is, the writer
856  * does not aggregate output from multiple writes before sending it to
857  * the output handler.
858  *
859  * 4. A call to JSON_Writer_WriteXXX() will fail if the writer has
860  * already encountered an error.
861  *
862  * 5. A call to JSON_Writer_WriteXXX() will fail if the call was made
863  * reentrantly from inside a handler.
864  *
865  * 6. A call to JSON_Writer_WriteXXX() will fail if it would cause the
866  * writer to output grammatically-incorrect JSON text.
867  *
868  * 7. If an output handler returns JSON_Writer_Abort, the writer will
869  * abort the write, set its error to JSON_Error_AbortedByHandler,
870  * set its error location to the location in the output stream prior
871  * to the call to the handler, and return JSON_Failure from the outer
872  * call to JSON_Writer_WriteXXX().
873  */
874 
875 /* Values returned by write handlers to indicate whether writing should
876  * continue or be aborted.
877  */
879 {
883 
884 /* Get and set the handler that is called when a writer instance has output
885  * ready to be written.
886  *
887  * The pBytes parameter points to a buffer containing the bytes to be written,
888  * encoded according to the writer instance's output encoding setting. The
889  * buffer is NOT null-terminated.
890  *
891  * The length parameter specifies the number of bytes (NOT characters) in
892  * the encoded output.
893  */
897 
898 /* Write the JSON null literal to the output. */
900 
901 /* Write a JSON boolean value to the output. */
903 
904 /* Write a JSON string value to the output.
905  *
906  * The pValue parameter points to a buffer containing the string to be
907  * written. The buffer does NOT need to be null-terminated. This
908  * parameter can be null if and only if the length parameter is zero.
909  *
910  * The length parameter specifies the number of bytes (NOT characters)
911  * in the buffer. If the buffer is null-terminated, the length should
912  * NOT include the null terminator.
913  *
914  * The encoding parameter specifies the encoding of the text pointed
915  * to by pValue. This parameter cannot be JSON_UnknownEncoding.
916  *
917  * If the string contains invalid encoding sequences and the option to
918  * replace invalid encoding sequences with the Unicode replacement
919  * character (U+FFFD) is not enabled for the writer instance, the writer
920  * sets its error to JSON_Error_InvalidEncodingSequence and returns
921  * failure.
922  *
923  * The writer escapes the following codepoints:
924  *
925  * - BACKSPACE (U+0008) => \b
926  * - TAB (U+0009) => \t
927  * - LINE FEED (U+000A) => \n
928  * - FORM FEED (U+000C) => \f
929  * - CARRIAGE RETURN (U+000D) => \r
930  * - QUOTATION MARK (U+0022) => \"
931  * - SOLIDUS (U+002F) => \/
932  * - REVERSE SOLIDUS (U+005C) => \\
933  *
934  * The writer also escapes the following codepoints using hex-style escape
935  * sequences:
936  *
937  * - All control characters (U+0000 - U+001F) except those covered by the
938  * list above.
939  * - DELETE (U+007F)
940  * - LINE SEPARATOR (U+2028)
941  * - PARAGRAPH SEPARATOR (U+2029)
942  * - All 34 Unicode "noncharacter" codepoints whose values end in FE or FF.
943  * - All 32 Unicode "noncharacter" codepoints in the range U+FDD0 - U+FDEF.
944  * - REPLACEMENT CHARACTER (U+FFFD), if it did not appear in the original
945  * string provided by the client; in other words, if the writer introduced
946  * it in the output as a replacement for an invalid encoding sequence in
947  * the original string.
948  *
949  * If the setting to escape all non-ASCII characters is enabled, ALL
950  * codepoints above U+0080 are escaped using hex-style escape sequences.
951  */
953 
954 /* Write a JSON number value to the output.
955  *
956  * The pValue parameter points to a buffer containing the number to be
957  * written. The buffer does NOT need to be null-terminated.
958  *
959  * The length parameter specifies the number of bytes (NOT characters)
960  * in the buffer. If the buffer is null-terminated, the length should
961  * NOT include the null terminator.
962  *
963  * The encoding parameter specifies the encoding of the text pointed
964  * to by pValue. This parameter cannot be JSON_UnknownEncoding.
965  *
966  * If the number contains an invalid encoding sequence, the writer sets
967  * its error to JSON_Error_InvalidEncodingSequence and returns failure,
968  * regardless of whether the option to replace invalid encoding sequences
969  * with the Unicode replacement character (U+FFFD) is enabled (that
970  * setting only affects writing of string values).
971  *
972  * The number must be a valid JSON number as described by RFC 4627, or a
973  * hexadecimal number conforming to the syntax of HexIntegerLiteral, as
974  * described in section 7.8.3 of ECMA-262. Otherwise, the writer sets its
975  * error to JSON_Error_InvalidNumber and returns failure.
976  */
978 
979 /* Write a JSON "special" number literal to the output. */
981 
982 /* Write a left curly-brace character to the output. */
984 
985 /* Write a right curly-brace character to the output. */
987 
988 /* Write a left square-brace character to the output. */
990 
991 /* Write a right square-brace character to the output. */
993 
994 /* Write a colon character to the output. */
996 
997 /* Write a comma character to the output. */
999 
1000 /* Write space characters to the output. */
1002 
1003 /* Write a newline sequence to the output. */
1005 
1006 #endif /* JSON_NO_WRITER */
1007 
1008 /******************** Miscellaneous API ********************/
1009 
1010 /* Information about the library version. */
1011 typedef struct tag_JSON_Version
1012 {
1013  unsigned int major;
1014  unsigned int minor;
1015  unsigned int micro;
1016 } JSON_Version;
1017 
1018 /* Get a pointer to the library version information. */
1020 
1021 /* Get a constant, null-terminated, ASCII string describing an error code. */
1023 
1024 /* Get the UTF-16 encoding whose endianness matches the target platform.
1025  *
1026  * This function always returns either JSON_UTF16LE or JSON_UTF16BE.
1027  */
1029 
1030 /* Get the UTF-32 encoding whose endianness matches the target platform.
1031  *
1032  * This function always returns either JSON_UTF32LE or JSON_UTF32BE.
1033  */
1035 
1036 #ifdef __cplusplus
1037 }
1038 #endif
1039 
1040 #endif /* JSONSAX_H_INCLUDED */
Definition: jsonsax_full.h:114
tag_JSON_Status
Definition: jsonsax_full.h:93
struct tag_JSON_Location JSON_Location
Definition: jsonsax_full.h:161
JSON_Status JSON_CALL JSON_Parser_SetSpecialNumberHandler(JSON_Parser parser, JSON_Parser_SpecialNumberHandler handler)
Definition: jsonsax_full.c:2898
JSON_Status JSON_CALL JSON_Parser_SetAllowBOM(JSON_Parser parser, JSON_Boolean allowBOM)
Definition: jsonsax_full.c:2660
enum tag_JSON_Parser_HandlerResult JSON_Parser_HandlerResult
Definition: jsonsax_full.h:880
JSON_Status JSON_CALL JSON_Parser_Parse(JSON_Parser parser, const char *pBytes, size_t length, JSON_Boolean isFinal)
Definition: jsonsax_full.c:2997
const GLvoid * ptr
Definition: nx_glsym.h:242
enum tag_JSON_Boolean JSON_Boolean
void *(JSON_CALL * JSON_ReallocHandler)(void *userData, void *ptr, size_t size)
Definition: jsonsax_full.h:199
Definition: jsonsax_full.h:115
Definition: jsonsax_full.h:124
JSON_Boolean useCRLF
Definition: jsonsax_full.h:810
tag_JSON_Parser_HandlerResult
Definition: jsonsax_full.h:541
JSON_Status JSON_CALL JSON_Parser_SetNullHandler(JSON_Parser parser, JSON_Parser_NullHandler handler)
Definition: jsonsax_full.c:2838
const char * pValue
Definition: jsonsax_full.h:952
JSON_Parser_HandlerResult(JSON_CALL * JSON_Parser_ObjectMemberHandler)(JSON_Parser parser, char *pValue, size_t length, JSON_StringAttributes attributes)
Definition: jsonsax_full.h:685
JSON_Boolean JSON_CALL JSON_Parser_GetAllowBOM(JSON_Parser parser)
Definition: jsonsax_full.c:2655
JSON_Status JSON_CALL JSON_Parser_SetAllowHexNumbers(JSON_Parser parser, JSON_Boolean allowHexNumbers)
Definition: jsonsax_full.c:2699
#define JSON_CALL
Definition: jsonsax_full.h:79
JSON_Status JSON_CALL JSON_Parser_SetEndObjectHandler(JSON_Parser parser, JSON_Parser_EndObjectHandler handler)
Definition: jsonsax_full.c:2927
Definition: jsonsax_full.h:104
tag_JSON_Boolean
Definition: jsonsax_full.h:86
size_t depth
Definition: jsonsax_full.h:189
JSON_Boolean JSON_CALL JSON_Writer_GetReplaceInvalidEncodingSequences(JSON_Writer writer)
Definition: jsonsax_full.c:3632
Definition: jsonsax_full.h:103
JSON_Status JSON_CALL JSON_Parser_SetStartObjectHandler(JSON_Parser parser, JSON_Parser_StartObjectHandler handler)
Definition: jsonsax_full.c:2912
JSON_Encoding JSON_CALL JSON_Parser_GetStringEncoding(JSON_Parser parser)
Definition: jsonsax_full.c:2597
Definition: jsonsax_full.h:113
JSON_Boolean allowUnescapedControlCharacters
Definition: jsonsax_full.h:410
JSON_Status JSON_CALL JSON_Writer_WriteColon(JSON_Writer writer)
Definition: jsonsax_full.c:3818
enum tag_JSON_Error JSON_Error
JSON_Parser_StringHandler JSON_CALL JSON_Parser_GetStringHandler(JSON_Parser parser)
Definition: jsonsax_full.c:2863
size_t line
Definition: jsonsax_full.h:183
JSON_Parser_SpecialNumberHandler JSON_CALL JSON_Parser_GetSpecialNumberHandler(JSON_Parser parser)
Definition: jsonsax_full.c:2893
JSON_Status JSON_CALL JSON_Writer_WriteComma(JSON_Writer writer)
Definition: jsonsax_full.c:3826
JSON_Status JSON_CALL JSON_Writer_SetUserData(JSON_Writer writer, void *userData)
Definition: jsonsax_full.c:3595
Definition: jsonsax_full.c:997
JSON_Boolean JSON_CALL JSON_Writer_GetUseCRLF(JSON_Writer writer)
Definition: jsonsax_full.c:3618
JSON_Status JSON_CALL JSON_Parser_SetStopAfterEmbeddedDocument(JSON_Parser parser, JSON_Boolean stopAfterEmbeddedDocument)
Definition: jsonsax_full.c:2754
JSON_Encoding encoding
Definition: jsonsax_full.h:274
Definition: jsonsax_full.h:139
Definition: jsonsax_full.h:108
JSON_Status JSON_CALL JSON_Writer_WriteNumber(JSON_Writer writer, const char *pValue, size_t length, JSON_Encoding encoding)
Definition: jsonsax_full.c:3734
JSON_Parser_NullHandler JSON_CALL JSON_Parser_GetEncodingDetectedHandler(JSON_Parser parser)
Definition: jsonsax_full.c:2818
Definition: jsonsax_full.h:543
JSON_Boolean JSON_CALL JSON_Parser_GetStopAfterEmbeddedDocument(JSON_Parser parser)
Definition: jsonsax_full.c:2749
JSON_Parser_ObjectMemberHandler JSON_CALL JSON_Parser_GetObjectMemberHandler(JSON_Parser parser)
Definition: jsonsax_full.c:2937
JSON_Boolean replaceInvalidEncodingSequences
Definition: jsonsax_full.h:434
JSON_Status JSON_CALL JSON_Parser_SetAllowComments(JSON_Parser parser, JSON_Boolean allowComments)
Definition: jsonsax_full.c:2673
JSON_Status JSON_CALL JSON_Writer_Reset(JSON_Writer writer)
Definition: jsonsax_full.c:3579
JSON_Status JSON_CALL JSON_Parser_SetTrackObjectMembers(JSON_Parser parser, JSON_Boolean trackObjectMembers)
Definition: jsonsax_full.c:2739
JSON_Status JSON_CALL JSON_Writer_WriteString(JSON_Writer writer, const char *pValue, size_t length, JSON_Encoding encoding)
Definition: jsonsax_full.c:3719
GLsizeiptr size
Definition: glext.h:6559
JSON_Writer JSON_CALL JSON_Writer_Create(const JSON_MemorySuite *pMemorySuite)
Definition: jsonsax_full.c:3544
JSON_Parser_BooleanHandler JSON_CALL JSON_Parser_GetBooleanHandler(JSON_Parser parser)
Definition: jsonsax_full.c:2848
JSON_Status JSON_CALL JSON_Parser_GetTokenLocation(JSON_Parser parser, JSON_Location *pLocation)
Definition: jsonsax_full.c:2792
Definition: jsonsax_full.h:128
JSON_Error JSON_CALL JSON_Parser_GetError(JSON_Parser parser)
Definition: jsonsax_full.c:2765
JSON_Boolean JSON_CALL JSON_Writer_GetEscapeAllNonASCIICharacters(JSON_Writer writer)
Definition: jsonsax_full.c:3646
Definition: jsonsax_full.h:126
JSON_Status JSON_CALL JSON_Parser_SetEndArrayHandler(JSON_Parser parser, JSON_Parser_EndArrayHandler handler)
Definition: jsonsax_full.c:2972
Definition: jsonsax_full.h:106
JSON_Status JSON_CALL JSON_Parser_SetMaxStringLength(JSON_Parser parser, size_t maxLength)
Definition: jsonsax_full.c:2619
Definition: jsonsax_full.h:203
JSON_Encoding JSON_CALL JSON_Parser_GetInputEncoding(JSON_Parser parser)
Definition: jsonsax_full.c:2581
GLsizei maxLength
Definition: glext.h:7544
JSON_Parser_HandlerResult(JSON_CALL * JSON_Parser_StartArrayHandler)(JSON_Parser parser)
Definition: jsonsax_full.h:692
JSON_Status JSON_CALL JSON_Parser_SetObjectMemberHandler(JSON_Parser parser, JSON_Parser_ObjectMemberHandler handler)
Definition: jsonsax_full.c:2942
size_t JSON_CALL JSON_Parser_GetMaxNumberLength(JSON_Parser parser)
Definition: jsonsax_full.c:2641
typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void *pData)
void * userData
Definition: jsonsax_full.h:205
JSON_Boolean JSON_CALL JSON_Parser_GetAllowSpecialNumbers(JSON_Parser parser)
Definition: jsonsax_full.c:2681
tag_JSON_Encoding
Definition: jsonsax_full.h:122
JSON_Boolean trackObjectMembers
Definition: jsonsax_full.h:455
Definition: jsonsax_full.h:545
JSON_Boolean JSON_CALL JSON_Parser_GetAllowComments(JSON_Parser parser)
Definition: jsonsax_full.c:2668
JSON_Boolean allowHexNumbers
Definition: jsonsax_full.h:397
JSON_Status JSON_CALL JSON_Writer_Free(JSON_Writer writer)
Definition: jsonsax_full.c:3568
Definition: jsonsax_full.h:544
JSON_Parser_NumberHandler JSON_CALL JSON_Parser_GetNumberHandler(JSON_Parser parser)
Definition: jsonsax_full.c:2878
unsigned int major
Definition: jsonsax_full.h:1013
static GX2AttribVar attributes[]
Definition: bokeh.c:713
Definition: jsonsax_full.h:112
JSON_Status JSON_CALL JSON_Parser_GetErrorLocation(JSON_Parser parser, JSON_Location *pLocation)
Definition: jsonsax_full.c:2770
Definition: jsonsax_full.h:165
Definition: jsonsax_full.h:138
JSON_Boolean escapeAllNonASCIICharacters
Definition: jsonsax_full.h:834
JSON_Status JSON_CALL JSON_Writer_SetUseCRLF(JSON_Writer writer, JSON_Boolean useCRLF)
Definition: jsonsax_full.c:3623
JSON_Status JSON_CALL JSON_Parser_SetStringEncoding(JSON_Parser parser, JSON_Encoding encoding)
Definition: jsonsax_full.c:2602
JSON_Parser_HandlerResult(JSON_CALL * JSON_Parser_NullHandler)(JSON_Parser parser)
Definition: jsonsax_full.h:566
Definition: jsonsax_full.h:140
JSON_Boolean value
Definition: jsonsax_full.h:902
JSON_Boolean allowSpecialNumbers
Definition: jsonsax_full.h:375
JSON_Error JSON_CALL JSON_Writer_GetError(JSON_Writer writer)
Definition: jsonsax_full.c:3660
JSON_Status JSON_CALL JSON_Writer_WriteBoolean(JSON_Writer writer, JSON_Boolean value)
Definition: jsonsax_full.c:3689
JSON_Status JSON_CALL JSON_Parser_SetStartArrayHandler(JSON_Parser parser, JSON_Parser_StartArrayHandler handler)
Definition: jsonsax_full.c:2957
JSON_Status JSON_CALL JSON_Parser_Reset(JSON_Parser parser)
Definition: jsonsax_full.c:2558
Definition: jsonsax_full.h:150
Definition: jsonsax_full.h:159
void *JSON_CALL JSON_Writer_GetUserData(JSON_Writer writer)
Definition: jsonsax_full.c:3590
enum tag_JSON_NumberAttribute JSON_NumberAttribute
size_t byte
Definition: jsonsax_full.h:172
JSON_Status JSON_CALL JSON_Writer_WriteStartObject(JSON_Writer writer)
Definition: jsonsax_full.c:3786
enum tag_JSON_StringAttribute JSON_StringAttribute
JSON_Status JSON_CALL JSON_Parser_SetNumberEncoding(JSON_Parser parser, JSON_Encoding encoding)
Definition: jsonsax_full.c:2633
struct tag_JSON_MemorySuite JSON_MemorySuite
JSON_Parser_HandlerResult(JSON_CALL * JSON_Parser_ArrayItemHandler)(JSON_Parser parser)
Definition: jsonsax_full.h:709
JSON_Boolean JSON_CALL JSON_Parser_GetAllowHexNumbers(JSON_Parser parser)
Definition: jsonsax_full.c:2694
Definition: jsonsax_full.h:137
static l_noret error(LoadState *S, const char *why)
Definition: lundump.c:39
JSON_Parser_HandlerResult(JSON_CALL * JSON_Parser_EndObjectHandler)(JSON_Parser parser)
Definition: jsonsax_full.h:652
JSON_Status JSON_CALL JSON_Parser_SetReplaceInvalidEncodingSequences(JSON_Parser parser, JSON_Boolean replaceInvalidEncodingSequences)
Definition: jsonsax_full.c:2725
JSON_Boolean allowComments
Definition: jsonsax_full.h:361
tag_JSON_Writer_HandlerResult
Definition: jsonsax_full.h:878
Definition: jsonsax_full.h:149
static int writer(lua_State *L, const void *b, size_t size, void *B)
Definition: lstrlib.c:182
Definition: jsonsax_full.h:135
JSON_Writer_OutputHandler JSON_CALL JSON_Writer_GetOutputHandler(JSON_Writer writer)
Definition: jsonsax_full.c:3665
JSON_Boolean stopAfterEmbeddedDocument
Definition: jsonsax_full.h:472
JSON_Parser_HandlerResult(JSON_CALL * JSON_Parser_EndArrayHandler)(JSON_Parser parser)
Definition: jsonsax_full.h:699
const JSON_Version *JSON_CALL JSON_LibraryVersion(void)
Definition: jsonsax_full.c:3885
Definition: jsonsax_full.h:89
Definition: jsonsax_full.h:147
Definition: jsonsax_full.c:3055
JSON_Status JSON_CALL JSON_Parser_SetInputEncoding(JSON_Parser parser, JSON_Encoding encoding)
Definition: jsonsax_full.c:2586
JSON_Encoding JSON_CALL JSON_NativeUTF32Encoding(void)
Definition: jsonsax_full.c:3926
JSON_Status JSON_CALL JSON_Writer_WriteEndObject(JSON_Writer writer)
Definition: jsonsax_full.c:3794
JSON_Parser JSON_CALL JSON_Parser_Create(const JSON_MemorySuite *pMemorySuite)
Definition: jsonsax_full.c:2514
Definition: jsonsax_full.h:136
JSON_Parser_HandlerResult(JSON_CALL * JSON_Parser_BooleanHandler)(JSON_Parser parser, JSON_Boolean value)
Definition: jsonsax_full.h:573
Definition: jsonsax_full.h:96
JSON_Parser_HandlerResult(JSON_CALL * JSON_Parser_SpecialNumberHandler)(JSON_Parser parser, JSON_SpecialNumber value)
Definition: jsonsax_full.h:638
Definition: jsonsax_full.h:151
JSON_Status JSON_CALL JSON_Writer_WriteEndArray(JSON_Writer writer)
Definition: jsonsax_full.c:3810
Definition: jsonsax_full.h:88
JSON_Boolean allowBOM
Definition: jsonsax_full.h:345
JSON_Parser_HandlerResult(JSON_CALL * JSON_Parser_NumberHandler)(JSON_Parser parser, char *pValue, size_t length, JSON_NumberAttributes attributes)
Definition: jsonsax_full.h:631
enum tag_JSON_SpecialNumber JSON_SpecialNumber
JSON_Parser_HandlerResult(JSON_CALL * JSON_Parser_StringHandler)(JSON_Parser parser, char *pValue, size_t length, JSON_StringAttributes attributes)
Definition: jsonsax_full.h:600
enum tag_JSON_Encoding JSON_Encoding
tag_JSON_Error
Definition: jsonsax_full.h:100
JSON_Parser_HandlerResult(JSON_CALL * JSON_Parser_StartObjectHandler)(JSON_Parser parser)
Definition: jsonsax_full.h:645
tag_JSON_StringAttribute
Definition: jsonsax_full.h:133
JSON_Status JSON_CALL JSON_Parser_SetBooleanHandler(JSON_Parser parser, JSON_Parser_BooleanHandler handler)
Definition: jsonsax_full.c:2853
JSON_Status JSON_CALL JSON_Writer_SetOutputHandler(JSON_Writer writer, JSON_Writer_OutputHandler handler)
Definition: jsonsax_full.c:3670
JSON_Parser_EndObjectHandler JSON_CALL JSON_Parser_GetEndObjectHandler(JSON_Parser parser)
Definition: jsonsax_full.c:2922
enum tag_JSON_Writer_HandlerResult JSON_Writer_HandlerResult
JSON_Parser_ArrayItemHandler JSON_CALL JSON_Parser_GetArrayItemHandler(JSON_Parser parser)
Definition: jsonsax_full.c:2982
JSON_ReallocHandler realloc
Definition: jsonsax_full.h:206
JSON_Status JSON_CALL JSON_Writer_WriteSpecialNumber(JSON_Writer writer, JSON_SpecialNumber value)
Definition: jsonsax_full.c:3749
const char * pBytes
Definition: jsonsax_full.h:735
Definition: jsonsax_full.h:129
JSON_FreeHandler free
Definition: jsonsax_full.h:207
JSON_Status JSON_CALL JSON_Parser_SetAllowUnescapedControlCharacters(JSON_Parser parser, JSON_Boolean allowUnescapedControlCharacters)
Definition: jsonsax_full.c:2712
Definition: jsonsax_full.h:95
#define JSON_API(t)
Definition: jsonsax_full.h:83
const char *JSON_CALL JSON_ErrorString(JSON_Error error)
Definition: jsonsax_full.c:3891
JSON_Status JSON_CALL JSON_Parser_SetEncodingDetectedHandler(JSON_Parser parser, JSON_Parser_EncodingDetectedHandler handler)
Definition: jsonsax_full.c:2823
Definition: jsonsax_full.h:116
struct JSON_Writer_Data * JSON_Writer
Definition: jsonsax_full.h:745
JSON_Encoding JSON_CALL JSON_NativeUTF16Encoding(void)
Definition: jsonsax_full.c:3921
const char size_t length
Definition: jsonsax_full.h:735
JSON_Boolean JSON_CALL JSON_Parser_GetAllowUnescapedControlCharacters(JSON_Parser parser)
Definition: jsonsax_full.c:2707
Definition: jsonsax_full.h:160
JSON_Status JSON_CALL JSON_Parser_SetMaxNumberLength(JSON_Parser parser, size_t maxLength)
Definition: jsonsax_full.c:2646
struct JSON_Parser_Data * JSON_Parser
Definition: jsonsax_full.h:216
JSON_Parser_StartObjectHandler JSON_CALL JSON_Parser_GetStartObjectHandler(JSON_Parser parser)
Definition: jsonsax_full.c:2907
unsigned int JSON_StringAttributes
Definition: jsonsax_full.h:142
Definition: jsonsax_full.h:881
JSON_Parser_EncodingDetectedHandler handler
Definition: jsonsax_full.h:561
JSON_Boolean JSON_CALL JSON_Parser_GetTrackObjectMembers(JSON_Parser parser)
Definition: jsonsax_full.c:2734
Definition: jsonsax_full.h:111
JSON_Location * pLocation
Definition: jsonsax_full.h:490
Definition: jsonsax_full.h:117
Definition: jsonsax_full.h:127
Definition: jsonsax_full.h:125
JSON_Status JSON_CALL JSON_Parser_GetAfterTokenLocation(JSON_Parser parser, JSON_Location *pLocation)
Definition: jsonsax_full.c:2805
Definition: jsonsax_full.h:118
tag_JSON_SpecialNumber
Definition: jsonsax_full.h:157
Definition: jsonsax_full.h:109
GLsizei const GLfloat * value
Definition: glext.h:6709
JSON_Status JSON_CALL JSON_Parser_Free(JSON_Parser parser)
Definition: jsonsax_full.c:2540
struct tag_JSON_Version JSON_Version
void(JSON_CALL * JSON_FreeHandler)(void *userData, void *ptr)
Definition: jsonsax_full.h:200
JSON_Status JSON_CALL JSON_Parser_SetArrayItemHandler(JSON_Parser parser, JSON_Parser_ArrayItemHandler handler)
Definition: jsonsax_full.c:2987
JSON_Boolean JSON_CALL JSON_Parser_GetReplaceInvalidEncodingSequences(JSON_Parser parser)
Definition: jsonsax_full.c:2720
JSON_Status JSON_CALL JSON_Writer_WriteSpace(JSON_Writer writer, size_t numberOfSpaces)
Definition: jsonsax_full.c:3834
Definition: jsonsax_full.h:105
JSON_Encoding JSON_CALL JSON_Writer_GetOutputEncoding(JSON_Writer writer)
Definition: jsonsax_full.c:3604
void *JSON_CALL JSON_Parser_GetUserData(JSON_Parser parser)
Definition: jsonsax_full.c:2568
JSON_Encoding JSON_CALL JSON_Parser_GetNumberEncoding(JSON_Parser parser)
Definition: jsonsax_full.c:2628
JSON_Status JSON_CALL JSON_Parser_SetStringHandler(JSON_Parser parser, JSON_Parser_StringHandler handler)
Definition: jsonsax_full.c:2868
size_t numberOfSpaces
Definition: jsonsax_full.h:1001
void * userData
Definition: jsonsax_full.h:259
Definition: jsonsax_full.h:107
const char size_t JSON_Boolean isFinal
Definition: jsonsax_full.h:735
JSON_Status JSON_CALL JSON_Writer_SetEscapeAllNonASCIICharacters(JSON_Writer writer, JSON_Boolean escapeAllNonASCIICharacters)
Definition: jsonsax_full.c:3651
size_t JSON_CALL JSON_Parser_GetMaxStringLength(JSON_Parser parser)
Definition: jsonsax_full.c:2614
enum tag_JSON_Status JSON_Status
Definition: jsonsax_full.h:102
JSON_Parser_StartArrayHandler JSON_CALL JSON_Parser_GetStartArrayHandler(JSON_Parser parser)
Definition: jsonsax_full.c:2952
JSON_Status JSON_CALL JSON_Writer_WriteStartArray(JSON_Writer writer)
Definition: jsonsax_full.c:3802
unsigned int micro
Definition: jsonsax_full.h:1015
Definition: jsonsax_full.h:110
JSON_Parser_HandlerResult(JSON_CALL * JSON_Parser_EncodingDetectedHandler)(JSON_Parser parser)
Definition: jsonsax_full.h:559
unsigned int minor
Definition: jsonsax_full.h:1014
JSON_Parser_NullHandler JSON_CALL JSON_Parser_GetNullHandler(JSON_Parser parser)
Definition: jsonsax_full.c:2833
JSON_Status JSON_CALL JSON_Writer_SetOutputEncoding(JSON_Writer writer, JSON_Encoding encoding)
Definition: jsonsax_full.c:3609
tag_JSON_NumberAttribute
Definition: jsonsax_full.h:145
Definition: jsonsax_full.h:148
JSON_Writer_HandlerResult(JSON_CALL * JSON_Writer_OutputHandler)(JSON_Writer writer, const char *pBytes, size_t length)
Definition: jsonsax_full.h:894
JSON_Status JSON_CALL JSON_Writer_WriteNull(JSON_Writer writer)
Definition: jsonsax_full.c:3679
GLenum GLuint GLenum GLsizei length
Definition: glext.h:6233
unsigned int JSON_NumberAttributes
Definition: jsonsax_full.h:154
size_t column
Definition: jsonsax_full.h:186
JSON_Parser_EndArrayHandler JSON_CALL JSON_Parser_GetEndArrayHandler(JSON_Parser parser)
Definition: jsonsax_full.c:2967
JSON_Status JSON_CALL JSON_Writer_SetReplaceInvalidEncodingSequences(JSON_Writer writer, JSON_Boolean replaceInvalidEncodingSequences)
Definition: jsonsax_full.c:3637
Definition: jsonsax_full.h:152
Definition: jsonsax_full.h:1011
JSON_Status JSON_CALL JSON_Writer_WriteNewLine(JSON_Writer writer)
Definition: jsonsax_full.c:3846
JSON_Status JSON_CALL JSON_Parser_SetUserData(JSON_Parser parser, void *userData)
Definition: jsonsax_full.c:2573
JSON_Status JSON_CALL JSON_Parser_SetNumberHandler(JSON_Parser parser, JSON_Parser_NumberHandler handler)
Definition: jsonsax_full.c:2883
JSON_Status JSON_CALL JSON_Parser_SetAllowSpecialNumbers(JSON_Parser parser, JSON_Boolean allowSpecialNumbers)
Definition: jsonsax_full.c:2686