Start working on json_entities
This commit is contained in:
30
include/json_entities/json_entities.h
Normal file
30
include/json_entities/json_entities.h
Normal 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
|
@@ -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
|
||||
|
Reference in New Issue
Block a user