From 9ba9d8f8301cadabc220c396370b25a60dbbc225 Mon Sep 17 00:00:00 2001 From: Cloudwalk Date: Mon, 10 May 2021 21:32:42 -0400 Subject: [PATCH] Add other types. Flesh out qjson_token_t --- json.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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 -- 2.39.2