summaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
authorBurnZeZ <brz-9dev@intma.in>2013-10-27 15:44:33 -0400
committerBurnZeZ <brz-9dev@intma.in>2013-10-27 15:44:33 -0400
commit2dc7e311f43c41ecc412c237cbcb6293953c17e9 (patch)
treec78a94a222c4eabf97db33d83061df7625897afd /sys/include
parent632b7adffbd137d9cbe95431fa6919f875c47e5b (diff)
make libjson from /sys/src/cmd/btc/json.c
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/json.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/sys/include/json.h b/sys/include/json.h
new file mode 100644
index 000000000..9544a1e65
--- /dev/null
+++ b/sys/include/json.h
@@ -0,0 +1,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 *);