From: Cloudwalk Date: Tue, 11 May 2021 01:32:42 +0000 (-0400) Subject: Add other types. Flesh out qjson_token_t X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9ba9d8f8301cadabc220c396370b25a60dbbc225;p=xonotic%2Fdarkplaces.git Add other types. Flesh out qjson_token_t --- diff --git a/json.c b/json.c index 756a8161..6bf6859b 100644 --- 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