aboutsummaryrefslogtreecommitdiff
path: root/json.h
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2025-07-21 14:26:06 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2025-07-21 14:26:06 +0200
commit88eb8c969f6abe119994c7ab307b9be58ff076a5 (patch)
tree3a8fed52b29bdf12f5a6ac65393df8abb0c8f437 /json.h
parenta378ff1b173f7a67272e574fb1a2c275ecb9661b (diff)
feat: JSON object parsing
Diffstat (limited to 'json.h')
-rw-r--r--json.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/json.h b/json.h
index 44b064e..5f2f4c0 100644
--- a/json.h
+++ b/json.h
@@ -5,10 +5,17 @@
#include "vec.h"
typedef struct {
+ Vec keys; // Vec<Str>
+ Vec values; // Vec<JSON>
+ ptrdiff_t len;
+} JSONObject;
+typedef struct {
int *integer;
- Vec *array;
+ Vec *array; // Vec<JSON>
Str *string;
+ JSONObject *object;
} JSON;
+JSON* JSONObject_get(JSONObject *obj, Str key);
JSON JSON_parse(Arena *a, char *src);
JSON JSON_Int(Arena *a, int val);
#endif