]> git.lizzy.rs Git - plan9front.git/blob - sys/include/json.h
pc, pc64: add and enable ethervirtio driver
[plan9front.git] / sys / include / json.h
1 #pragma src "/sys/src/libjson"
2 #pragma lib "libjson.a"
3
4 typedef struct JSONEl JSONEl;
5 typedef struct JSON JSON;
6
7 enum {
8         JSONNull,
9         JSONBool,
10         JSONNumber,
11         JSONString,
12         JSONArray,
13         JSONObject,
14 };
15
16 struct JSONEl {
17         char *name;
18         JSON *val;
19         JSONEl *next;
20 };
21
22 struct JSON
23 {
24         int t;
25         union {
26                 double n;
27                 char *s;
28                 JSONEl *first;
29         };
30 };
31
32 JSON*   jsonparse(char *);
33 void    jsonfree(JSON *);
34 JSON*   jsonbyname(JSON *, char *);
35 char*   jsonstr(JSON *);