summaryrefslogtreecommitdiffstats
path: root/wrap-json.h
diff options
context:
space:
mode:
authorjobol <jose.bollo@iot.bzh>2018-06-11 14:28:01 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-12-13 14:12:02 +0100
commit0f7c627d2db92fd0a83fd19131dbb496fc4194c6 (patch)
tree71be9d4c10877f9acabffefea4c22315d620d4e3 /wrap-json.h
parent91866ef916e1371413038013d5780eac3c6254bf (diff)
wrap-json: new helper functions for comparison
The new functions are - wrap_json_clone_depth: clone with defined depth - wrap_json_sort: sort an array accordingly to wrap_json_cmp - wrap_json_keys: compute the array of sorted keys - wrap_json_cmp: compare 2 items - wrap_json_equal: test equallity - wrap_json_contains: test inclusion Change-Id: I9787bff6c262fa2702c27802d771e2d487ce6309 Signed-off-by: jose bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'wrap-json.h')
-rw-r--r--wrap-json.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/wrap-json.h b/wrap-json.h
index fd5b7c3..d75ebc4 100644
--- a/wrap-json.h
+++ b/wrap-json.h
@@ -50,7 +50,15 @@ extern void wrap_json_for_all(struct json_object *object, void (*callback)(void*
extern struct json_object *wrap_json_clone(struct json_object *object);
extern struct json_object *wrap_json_clone_deep(struct json_object *object);
-extern void wrap_json_object_add(struct json_object *dest, struct json_object *added);
+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
}