X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwrap-json.h;h=d014d0b7727a22525ba3cf10ab43b880155a2135;hb=65353dce81a629e042800bb7b86fcd869a76727e;hp=1e95dcf2b0c5f97f9b3a34d34e7123010771fa1f;hpb=4a3d0c568ec5ee1296f4a50f269a1eadc4898e27;p=src%2Fapp-framework-binder.git diff --git a/src/wrap-json.h b/src/wrap-json.h index 1e95dcf2..d014d0b7 100644 --- a/src/wrap-json.h +++ b/src/wrap-json.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2016, 2017 "IoT.bzh" + Copyright (C) 2015-2020 "IoT.bzh" author: José Bollo @@ -18,12 +18,45 @@ #pragma once +#ifdef __cplusplus + extern "C" { +#endif + #include #include -extern int wrap_json_pack_error_position(int rc); -extern int wrap_json_pack_error_code(int rc); -extern const char *wrap_json_pack_error_string(int rc); +extern int wrap_json_get_error_position(int rc); +extern int wrap_json_get_error_code(int rc); +extern const char *wrap_json_get_error_string(int rc); + extern int wrap_json_vpack(struct json_object **result, const char *desc, va_list args); extern int wrap_json_pack(struct json_object **result, const char *desc, ...); +extern int wrap_json_vunpack(struct json_object *object, const char *desc, va_list args); +extern int wrap_json_unpack(struct json_object *object, const char *desc, ...); +extern int wrap_json_vcheck(struct json_object *object, const char *desc, va_list args); +extern int wrap_json_check(struct json_object *object, const char *desc, ...); +extern int wrap_json_vmatch(struct json_object *object, const char *desc, va_list args); +extern int wrap_json_match(struct json_object *object, const char *desc, ...); + +extern void wrap_json_optarray_for_all(struct json_object *object, void (*callback)(void*,struct json_object*), void *closure); +extern void wrap_json_array_for_all(struct json_object *object, void (*callback)(void*,struct json_object*), void *closure); +extern void wrap_json_object_for_all(struct json_object *object, void (*callback)(void*,struct json_object*,const char*), void *closure); +extern void wrap_json_optobject_for_all(struct json_object *object, void (*callback)(void*,struct json_object*,const char*), void *closure); +extern void wrap_json_for_all(struct json_object *object, void (*callback)(void*,struct json_object*,const char*), void *closure); + +extern struct json_object *wrap_json_clone(struct json_object *object); +extern struct json_object *wrap_json_clone_deep(struct json_object *object); +extern struct json_object *wrap_json_clone_depth(struct json_object *object, int depth); + +extern struct json_object *wrap_json_object_add(struct json_object *dest, struct json_object *added); + +extern struct json_object *wrap_json_sort(struct json_object *array); +extern struct json_object *wrap_json_keys(struct json_object *object); +extern int wrap_json_cmp(struct json_object *x, struct json_object *y); +extern int wrap_json_equal(struct json_object *x, struct json_object *y); +extern int wrap_json_contains(struct json_object *x, struct json_object *y); + +#ifdef __cplusplus + } +#endif