Lines Matching refs:JsonVariant

51 struct JsonVariant {  struct
60 JsonVariant *parent;
101 JsonVariant *reference; argument
120 #define INLINE_STRING_MAX (sizeof(JsonVariant) - offsetof(JsonVariant, string) - 1U)
125 assert_cc(sizeof(JsonVariant) == 40U);
177 static bool json_variant_is_magic(const JsonVariant *v) { in json_variant_is_magic()
184 static bool json_variant_is_const_string(const JsonVariant *v) { in json_variant_is_const_string()
195 static bool json_variant_is_regular(const JsonVariant *v) { in json_variant_is_regular()
203 static JsonVariant *json_variant_dereference(JsonVariant *v) { in json_variant_dereference()
219 static uint16_t json_variant_depth(JsonVariant *v) { in json_variant_depth()
231 static JsonVariant *json_variant_formalize(JsonVariant *v) { in json_variant_formalize()
274 static JsonVariant *json_variant_conservative_formalize(JsonVariant *v) { in json_variant_conservative_formalize()
291 static int json_variant_new(JsonVariant **ret, JsonVariantType type, size_t space) { in json_variant_new()
292 JsonVariant *v; in json_variant_new()
296 v = malloc0(MAX(sizeof(JsonVariant), in json_variant_new()
297 offsetof(JsonVariant, value) + space)); in json_variant_new()
308 int json_variant_new_integer(JsonVariant **ret, int64_t i) { in json_variant_new_integer()
309 JsonVariant *v; in json_variant_new_integer()
329 int json_variant_new_unsigned(JsonVariant **ret, uint64_t u) { in json_variant_new_unsigned()
330 JsonVariant *v; in json_variant_new_unsigned()
349 int json_variant_new_real(JsonVariant **ret, double d) { in json_variant_new_real()
350 JsonVariant *v; in json_variant_new_real()
378 int json_variant_new_boolean(JsonVariant **ret, bool b) { in json_variant_new_boolean()
389 int json_variant_new_null(JsonVariant **ret) { in json_variant_new_null()
396 int json_variant_new_stringn(JsonVariant **ret, const char *s, size_t n) { in json_variant_new_stringn()
397 JsonVariant *v; in json_variant_new_stringn()
428 int json_variant_new_base64(JsonVariant **ret, const void *p, size_t n) { in json_variant_new_base64()
442 int json_variant_new_hex(JsonVariant **ret, const void *p, size_t n) { in json_variant_new_hex()
455 int json_variant_new_id128(JsonVariant **ret, sd_id128_t id) { in json_variant_new_id128()
459 static void json_variant_set(JsonVariant *a, JsonVariant *b) { in json_variant_set()
516 static void json_variant_copy_source(JsonVariant *v, JsonVariant *from) { in json_variant_copy_source()
527 int json_variant_new_array(JsonVariant **ret, JsonVariant **array, size_t n) { in json_variant_new_array()
528 _cleanup_(json_variant_unrefp) JsonVariant *v = NULL; in json_variant_new_array()
538 v = new(JsonVariant, n + 1); in json_variant_new_array()
542 *v = (JsonVariant) { in json_variant_new_array()
548 JsonVariant *w = v + 1 + v->n_elements, in json_variant_new_array()
558 *w = (JsonVariant) { in json_variant_new_array()
576 int json_variant_new_array_bytes(JsonVariant **ret, const void *p, size_t n) { in json_variant_new_array_bytes()
584 JsonVariant *v = new(JsonVariant, n + 1); in json_variant_new_array_bytes()
588 *v = (JsonVariant) { in json_variant_new_array_bytes()
596 JsonVariant *w = v + 1 + i; in json_variant_new_array_bytes()
598 *w = (JsonVariant) { in json_variant_new_array_bytes()
612 int json_variant_new_array_strv(JsonVariant **ret, char **l) { in json_variant_new_array_strv()
613 _cleanup_(json_variant_unrefp) JsonVariant *v = NULL; in json_variant_new_array_strv()
625 v = new(JsonVariant, n + 1); in json_variant_new_array_strv()
629 *v = (JsonVariant) { in json_variant_new_array_strv()
636 JsonVariant *w = v + 1 + v->n_elements; in json_variant_new_array_strv()
639 *w = (JsonVariant) { in json_variant_new_array_strv()
669 int json_variant_new_object(JsonVariant **ret, JsonVariant **array, size_t n) { in json_variant_new_object()
670 _cleanup_(json_variant_unrefp) JsonVariant *v = NULL; in json_variant_new_object()
682 v = new(JsonVariant, n + 1); in json_variant_new_object()
686 *v = (JsonVariant) { in json_variant_new_object()
692 JsonVariant *w = v + 1 + v->n_elements, in json_variant_new_object()
717 *w = (JsonVariant) { in json_variant_new_object()
733 static size_t json_variant_size(JsonVariant* v) { in json_variant_size()
738 return offsetof(JsonVariant, reference) + sizeof(JsonVariant*); in json_variant_size()
743 return offsetof(JsonVariant, string) + strlen(v->string) + 1; in json_variant_size()
746 return offsetof(JsonVariant, value) + sizeof(double); in json_variant_size()
749 return offsetof(JsonVariant, value) + sizeof(uint64_t); in json_variant_size()
752 return offsetof(JsonVariant, value) + sizeof(int64_t); in json_variant_size()
755 return offsetof(JsonVariant, value) + sizeof(bool); in json_variant_size()
759 return offsetof(JsonVariant, n_elements) + sizeof(size_t); in json_variant_size()
762 return offsetof(JsonVariant, value); in json_variant_size()
769 static void json_variant_free_inner(JsonVariant *v, bool force_sensitive) { in json_variant_free_inner()
797 JsonVariant *json_variant_ref(JsonVariant *v) { in json_variant_ref()
813 JsonVariant *json_variant_unref(JsonVariant *v) { in json_variant_unref()
834 void json_variant_unref_many(JsonVariant **array, size_t n) { in json_variant_unref_many()
841 const char *json_variant_string(JsonVariant *v) { in json_variant_string()
867 bool json_variant_boolean(JsonVariant *v) { in json_variant_boolean()
888 int64_t json_variant_integer(JsonVariant *v) { in json_variant_integer()
935 uint64_t json_variant_unsigned(JsonVariant *v) { in json_variant_unsigned()
982 double json_variant_real(JsonVariant *v) { in json_variant_real()
1028 bool json_variant_is_negative(JsonVariant *v) { in json_variant_is_negative()
1064 bool json_variant_is_blank_object(JsonVariant *v) { in json_variant_is_blank_object()
1071 bool json_variant_is_blank_array(JsonVariant *v) { in json_variant_is_blank_array()
1077 JsonVariantType json_variant_type(JsonVariant *v) { in json_variant_type()
1113 bool json_variant_has_type(JsonVariant *v, JsonVariantType type) { in json_variant_has_type()
1169 size_t json_variant_elements(JsonVariant *v) { in json_variant_elements()
1189 JsonVariant *json_variant_by_index(JsonVariant *v, size_t idx) { in json_variant_by_index()
1211 JsonVariant *json_variant_by_key_full(JsonVariant *v, const char *key, JsonVariant **ret_key) { in json_variant_by_key_full()
1231 JsonVariant *p; in json_variant_by_key_full()
1258 JsonVariant *p; in json_variant_by_key_full()
1288 JsonVariant *json_variant_by_key(JsonVariant *v, const char *key) { in json_variant_by_key()
1292 bool json_variant_equal(JsonVariant *a, JsonVariant *b) { in json_variant_equal()
1350 JsonVariant *key_b; in json_variant_equal()
1388 void json_variant_sensitive(JsonVariant *v) { in json_variant_sensitive()
1408 bool json_variant_is_sensitive(JsonVariant *v) { in json_variant_is_sensitive()
1416 static void json_variant_propagate_sensitive(JsonVariant *from, JsonVariant *to) { in json_variant_propagate_sensitive()
1421 int json_variant_get_source(JsonVariant *v, const char **ret_source, unsigned *ret_line, unsigned *… in json_variant_get_source()
1436 static int print_source(FILE *f, JsonVariant *v, JsonFormatFlags flags, bool whitespace) { in print_source()
1539 static int json_format(FILE *f, JsonVariant *v, JsonFormatFlags flags, const char *prefix) { in json_format()
1636 JsonVariant *e; in json_format()
1689 JsonVariant *e; in json_format()
1734 int json_variant_format(JsonVariant *v, JsonFormatFlags flags, char **ret) { in json_variant_format()
1771 void json_variant_dump(JsonVariant *v, JsonFormatFlags flags, FILE *f, const char *prefix) { in json_variant_dump()
1802 int json_variant_filter(JsonVariant **v, char **to_remove) { in json_variant_filter()
1803 _cleanup_(json_variant_unrefp) JsonVariant *w = NULL; in json_variant_filter()
1804 _cleanup_free_ JsonVariant **array = NULL; in json_variant_filter()
1819 JsonVariant *p; in json_variant_filter()
1827 array = new(JsonVariant*, json_variant_elements(*v) - 2); in json_variant_filter()
1855 int json_variant_set_field(JsonVariant **v, const char *field, JsonVariant *value) { in json_variant_set_field()
1856 _cleanup_(json_variant_unrefp) JsonVariant *field_variant = NULL, *w = NULL; in json_variant_set_field()
1857 _cleanup_free_ JsonVariant **array = NULL; in json_variant_set_field()
1865 array = new(JsonVariant*, 2); in json_variant_set_field()
1874 JsonVariant *p; in json_variant_set_field()
1883 array = new(JsonVariant*, json_variant_elements(*v)); in json_variant_set_field()
1898 array = new(JsonVariant*, json_variant_elements(*v) + 2); in json_variant_set_field()
1924 int json_variant_set_field_string(JsonVariant **v, const char *field, const char *value) { in json_variant_set_field_string()
1925 _cleanup_(json_variant_unrefp) JsonVariant *m = NULL; in json_variant_set_field_string()
1935 int json_variant_set_field_integer(JsonVariant **v, const char *field, int64_t i) { in json_variant_set_field_integer()
1936 _cleanup_(json_variant_unrefp) JsonVariant *m = NULL; in json_variant_set_field_integer()
1946 int json_variant_set_field_unsigned(JsonVariant **v, const char *field, uint64_t u) { in json_variant_set_field_unsigned()
1947 _cleanup_(json_variant_unrefp) JsonVariant *m = NULL; in json_variant_set_field_unsigned()
1957 int json_variant_set_field_boolean(JsonVariant **v, const char *field, bool b) { in json_variant_set_field_boolean()
1958 _cleanup_(json_variant_unrefp) JsonVariant *m = NULL; in json_variant_set_field_boolean()
1968 int json_variant_set_field_strv(JsonVariant **v, const char *field, char **l) { in json_variant_set_field_strv()
1969 _cleanup_(json_variant_unrefp) JsonVariant *m = NULL; in json_variant_set_field_strv()
1979 int json_variant_merge(JsonVariant **v, JsonVariant *m) { in json_variant_merge()
1980 _cleanup_(json_variant_unrefp) JsonVariant *w = NULL; in json_variant_merge()
1981 _cleanup_free_ JsonVariant **array = NULL; in json_variant_merge()
2009 array = new(JsonVariant*, v_elements + m_elements); in json_variant_merge()
2015 JsonVariant *u; in json_variant_merge()
2042 int json_variant_append_array(JsonVariant **v, JsonVariant *element) { in json_variant_append_array()
2043 _cleanup_(json_variant_unrefp) JsonVariant *nv = NULL; in json_variant_append_array()
2059 r = json_variant_new_array(&nv, (JsonVariant*[]) { element }, 1); in json_variant_append_array()
2061 … _cleanup_free_ JsonVariant **array = new(JsonVariant*, json_variant_elements(*v) + 1); in json_variant_append_array()
2082 int json_variant_strv(JsonVariant *v, char ***ret) { in json_variant_strv()
2109 JsonVariant *e; in json_variant_strv()
2141 static int json_variant_copy(JsonVariant **nv, JsonVariant *v) { in json_variant_copy()
2143 JsonVariant *c; in json_variant_copy()
2196 c = malloc0(MAX(sizeof(JsonVariant), in json_variant_copy()
2197 offsetof(JsonVariant, reference) + sizeof(JsonVariant*))); in json_variant_copy()
2210 c = malloc0(MAX(sizeof(JsonVariant), in json_variant_copy()
2211 offsetof(JsonVariant, value) + k)); in json_variant_copy()
2226 static bool json_single_ref(JsonVariant *v) { in json_single_ref()
2240 static int json_variant_set_source(JsonVariant **v, JsonSource *source, unsigned line, unsigned col… in json_variant_set_source()
2241 JsonVariant *w; in json_variant_set_source()
2791 JsonVariant **elements;
2809 JsonVariant **ret, in json_parse_internal()
2839 _cleanup_(json_variant_unrefp) JsonVariant *add = NULL; in json_parse_internal()
3161 int json_parse(const char *input, JsonParseFlags flags, JsonVariant **ret, unsigned *ret_line, unsi… in json_parse()
3165 int json_parse_continue(const char **p, JsonParseFlags flags, JsonVariant **ret, unsigned *ret_line… in json_parse_continue()
3169 int json_parse_file_at(FILE *f, int dir_fd, const char *path, JsonParseFlags flags, JsonVariant **r… in json_parse_file_at()
3194 int json_buildv(JsonVariant **ret, va_list ap) { in json_buildv()
3209 _cleanup_(json_variant_unrefp) JsonVariant *add = NULL, *add_more = NULL; in json_buildv()
3398 add = va_arg(ap, JsonVariant*); in json_buildv()
3416 JsonVariant **array; in json_buildv()
3424 array = va_arg(ap, JsonVariant**); in json_buildv()
3915 JsonVariant *v; in json_buildv()
3924 v = va_arg(ap, JsonVariant *); in json_buildv()
4122 int json_build(JsonVariant **ret, ...) { in json_build()
4134 JsonVariant *variant, in json_log_internal()
4197 int json_dispatch(JsonVariant *v, const JsonDispatch table[], JsonDispatchCallback bad, JsonDispatc… in json_dispatch()
4219 JsonVariant *key, *value; in json_dispatch()
4310 int json_dispatch_boolean(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *us… in json_dispatch_boolean()
4323 int json_dispatch_tristate(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *u… in json_dispatch_tristate()
4341 int json_dispatch_int64(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *user… in json_dispatch_int64()
4354 int json_dispatch_uint64(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *use… in json_dispatch_uint64()
4367 int json_dispatch_uint32(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *use… in json_dispatch_uint32()
4383 int json_dispatch_int32(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *user… in json_dispatch_int32()
4399 int json_dispatch_string(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *use… in json_dispatch_string()
4424 int json_dispatch_const_string(const char *name, JsonVariant *variant, JsonDispatchFlags flags, voi… in json_dispatch_const_string()
4445 int json_dispatch_strv(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *userd… in json_dispatch_strv()
4448 JsonVariant *e; in json_dispatch_strv()
4491 int json_dispatch_variant(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *us… in json_dispatch_variant()
4492 JsonVariant **p = ASSERT_PTR(userdata); in json_dispatch_variant()
4499 int json_dispatch_uid_gid(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *us… in json_dispatch_uid_gid()
4526 int json_dispatch_user_group_name(const char *name, JsonVariant *variant, JsonDispatchFlags flags, … in json_dispatch_user_group_name()
4550 int json_dispatch_id128(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void *user… in json_dispatch_id128()
4569 int json_dispatch_unsupported(const char *name, JsonVariant *variant, JsonDispatchFlags flags, void… in json_dispatch_unsupported()
4574 JsonVariant *const *a = x, *const *b = y; in json_cmp_strings()
4582 int json_variant_sort(JsonVariant **v) { in json_variant_sort()
4583 _cleanup_free_ JsonVariant **a = NULL; in json_variant_sort()
4584 _cleanup_(json_variant_unrefp) JsonVariant *n = NULL; in json_variant_sort()
4599 a = new(JsonVariant*, m); in json_variant_sort()
4606 qsort(a, m/2, sizeof(JsonVariant*)*2, json_cmp_strings); in json_variant_sort()
4622 int json_variant_normalize(JsonVariant **v) { in json_variant_normalize()
4623 _cleanup_free_ JsonVariant **a = NULL; in json_variant_normalize()
4624 _cleanup_(json_variant_unrefp) JsonVariant *n = NULL; in json_variant_normalize()
4639 a = new(JsonVariant*, m); in json_variant_normalize()
4652 qsort(a, m/2, sizeof(JsonVariant*)*2, json_cmp_strings); in json_variant_normalize()
4683 bool json_variant_is_normalized(JsonVariant *v) { in json_variant_is_normalized()
4702 bool json_variant_is_sorted(JsonVariant *v) { in json_variant_is_sorted()
4715 int json_variant_unbase64(JsonVariant *v, void **ret, size_t *ret_size) { in json_variant_unbase64()
4722 int json_variant_unhex(JsonVariant *v, void **ret, size_t *ret_size) { in json_variant_unhex()