diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2025-07-21 14:26:06 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2025-07-21 14:26:06 +0200 |
| commit | 88eb8c969f6abe119994c7ab307b9be58ff076a5 (patch) | |
| tree | 3a8fed52b29bdf12f5a6ac65393df8abb0c8f437 /json.h | |
| parent | a378ff1b173f7a67272e574fb1a2c275ecb9661b (diff) | |
feat: JSON object parsing
Diffstat (limited to 'json.h')
| -rw-r--r-- | json.h | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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 |
