Start working on json_entities

This commit is contained in:
Abdelrahman Said
2023-06-26 18:32:53 +01:00
parent 55ca87c425
commit a6b45834fc
5 changed files with 71 additions and 216 deletions

View File

@@ -0,0 +1,30 @@
#ifndef JSON_ENTITIES_H
#define JSON_ENTITIES_H
#include "aliases.h"
#include "dstring.h"
#include <stdbool.h>
typedef struct json_value jval_t;
typedef enum {
JVAL_OBJECT,
JVAL_ARRAY,
JVAL_STRING,
JVAL_INTEGER,
JVAL_DOUBLE,
JVAL_BOOLEAN,
JVAL_NULL,
} jval_type_t;
struct json_value {
jval_type_t type;
union {
dstr_t *string;
i64 num_int;
f64 num_dbl;
bool boolean;
};
};
#endif // !JSON_ENTITIES_H