Rename json entities

This commit is contained in:
Abdelrahman Said 2023-06-28 20:50:37 +01:00
parent 14ad503d4d
commit 0a7e2f7f0c

View File

@ -5,21 +5,21 @@
#include "dstring.h"
#include <stdbool.h>
typedef struct jentity jentity_t;
typedef struct jcoll jcoll_t;
typedef struct jval jval_t;
typedef struct jpair jpair_t;
typedef struct json_entity jentity_t;
typedef struct json_collection jcoll_t;
typedef struct json_value jval_t;
typedef struct json_pair jpair_t;
typedef enum {
JSON_VALUE_COLLECTION,
JSON_VALUE_STRING,
JSON_VALUE_INTEGER,
JSON_VALUE_DOUBLE,
JSON_VALUE_BOOLEAN,
JSON_VALUE_NULL,
JVAL_COLLECTION,
JVAL_STRING,
JVAL_INTEGER,
JVAL_DOUBLE,
JVAL_BOOLEAN,
JVAL_NULL,
} jval_type;
struct jval {
struct json_value {
jval_type type;
union {
jcoll_t *collection;
@ -30,17 +30,17 @@ struct jval {
};
};
struct jpair {
struct json_pair {
dstr_t *key;
jval_t value;
};
typedef enum {
JVAL_SINGLE,
JVAL_PAIR,
JENTITY_SINGLE,
JENTITY_PAIR,
} jentity_type;
struct jentity {
struct json_entity {
jentity_type type;
union {
jval_t value;
@ -55,7 +55,7 @@ typedef enum {
JCOLL_ARRAY,
} jcoll_type;
struct jcoll {
struct json_collection {
u64 size;
jcoll_type type;
jentity_t *first_child;