9 .\" .ta 0.75i 1.5i 2.25i 3i 3.75i 4.5i
10 .ta 0.7i +0.7i +0.7i +0.7i +0.7i +0.7i +0.7i
25 typedef struct JSONEl JSONEl;
32 typedef struct JSON JSON;
43 JSON* jsonparse(char *s);
44 void jsonfree(JSON *j);
45 JSON* jsonbyname(JSON *j, char *s);
46 char* jsonstr(JSON *j);
48 void JSONfmtinstall(void);
53 structure represents a variant json value. The variant type
56 member of the structure. String values use
58 booleans and numbers use the
60 members in the structure.
61 Arrays and objects (dictionaries) are represented by
62 a singly-linked list of
64 structures referred to from the
73 pointer to the associated value and a
75 pointer to the next element in the array or object.
76 Dictionary objects have the
78 member set to the key of the association.
80 A json object is parsed by calling
84 string of the json encoded data. On success, a non-nil pointer to a
87 structure is returned.
88 To free the parsed objects,
94 function returns the associated value of a dictionary item.
98 returns the string value of a json object or
100 for any other object type.
105 formatting routine that prints a well-formatted JSON structure.
106 It can be installed by hand but
108 installs it under the standard format character J. The header
110 contains a #pragma statement so the compiler can
126 on error and set an error string (see