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

View File

@@ -4,6 +4,8 @@
#include "aliases.h"
#include <stdbool.h>
#if 0
typedef struct json_obj_pair jobj_pair_t;
typedef struct json_coll jcoll_t;
typedef struct json_val jval_t;
@@ -48,4 +50,6 @@ struct json_coll {
};
};
#endif
#endif // !JSON_TEST_H