Merging upstream version 1.14.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
868b5312e8
commit
d6fd2fdea9
305 changed files with 20664 additions and 6099 deletions
17
util/json.h
17
util/json.h
|
@ -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) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue