1
0
Fork 0

Merging upstream version 1.14.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-16 11:31:10 +01:00
parent 868b5312e8
commit d6fd2fdea9
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
305 changed files with 20664 additions and 6099 deletions

View file

@ -2,7 +2,6 @@
#define __JSON__H
struct json_object;
struct json_array;
struct json_pair;
#define JSON_TYPE_STRING 0
@ -21,22 +20,18 @@ struct json_value {
long double float_number;
char *string;
struct json_object *object;
struct json_array *array;
struct json_object *array;
};
int parent_type;
union {
struct json_pair *parent_pair;
struct json_array *parent_array;
struct json_object *parent_array;
};
};
struct json_array {
struct json_object {
struct json_value **values;
int value_cnt;
struct json_value *parent;
};
struct json_object {
struct json_pair **pairs;
int pair_cnt;
struct json_value *parent;
@ -49,10 +44,10 @@ struct json_pair {
};
struct json_object *json_create_object(void);
struct json_array *json_create_array(void);
struct json_object *json_create_array(void);
void json_free_object(struct json_object *obj);
void json_free_array(struct json_array *array);
void json_free_array(struct json_object *array);
int json_object_add_value_type(struct json_object *obj, const char *name, int type, ...);
#define json_object_add_value_int(obj, name, val) \
@ -67,7 +62,7 @@ int json_object_add_value_type(struct json_object *obj, const char *name, int ty
json_object_add_value_type((obj), name, JSON_TYPE_OBJECT, (val))
#define json_object_add_value_array(obj, name, val) \
json_object_add_value_type((obj), name, JSON_TYPE_ARRAY, (val))
int json_array_add_value_type(struct json_array *array, int type, ...);
int json_array_add_value_type(struct json_object *array, int type, ...);
#define json_array_add_value_int(obj, val) \
json_array_add_value_type((obj), JSON_TYPE_INTEGER, (val))
#define json_array_add_value_uint(obj, val) \