]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Add other types. Flesh out qjson_token_t
authorCloudwalk <cloudwalk009@gmail.com>
Tue, 11 May 2021 01:32:42 +0000 (21:32 -0400)
committerCloudwalk <cloudwalk009@gmail.com>
Tue, 11 May 2021 01:32:42 +0000 (21:32 -0400)
json.c

diff --git a/json.c b/json.c
index 756a8161709e739a55300668ed83980b66529689..6bf6859b69356b6096624ea68823c01ecbb68d11 100644 (file)
--- a/json.c
+++ b/json.c
@@ -27,14 +27,24 @@ typedef enum qjson_type_e
        JSON_TYPE_OBJECT = 1,
        JSON_TYPE_ARRAY = 2,
        JSON_TYPE_STRING = 3,
-       JSON_TYPE_PRIMITIVE = 4
+       JSON_TYPE_NUMBER = 4,
+       JSON_TYPE_BOOL = 5
 } qjson_type_t;
 
 typedef struct qjson_token_s
 {
        qjson_type_t type;
-       struct qjson_token_s *next; // if an array, next will be a NULL terminated array
-       char *string; // ASCII only for now
+
+       struct qjson_token_s *prev, *next; // Linked list for arrays
+       struct qjson_token_s *parent, *child;
+       
+       char *key;
+       union
+       {
+               char *string;
+               double decimal;
+               int number;
+       } value;
 } qjson_token_t;
 
 typedef struct qjson_state_s