blob: 9544a1e65244c408e324eaffc29abc89c9dd1359 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#pragma src "/sys/src/libjson"
#pragma lib "libjson.a"
typedef struct JSONEl JSONEl;
typedef struct JSON JSON;
enum {
JSONNull,
JSONBool,
JSONNumber,
JSONString,
JSONArray,
JSONObject,
};
struct JSONEl {
char *name;
JSON *val;
JSONEl *next;
};
struct JSON
{
int t;
union {
double n;
char *s;
JSONEl *first;
};
};
JSON* jsonparse(char *);
void jsonfree(JSON *);
JSON* jsonbyname(JSON *, char *);
char* jsonstr(JSON *);
|