From 98c64eae99425fb44d96d6775d6cde3d0058cf6d Mon Sep 17 00:00:00 2001 From: José Bollo Date: Tue, 29 May 2018 10:10:27 +0200 Subject: wrap-json: Add clone facility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds 3 new facilities: - wrap_json_clone: clones any json object superficially - wrap_json_clone_deep: clones any json object deeply - wrap_json_add: adds to an object the fields of an other object Change-Id: I3844d972aa6477c9dde6f66ad0b0604284a853a7 Signed-off-by: José Bollo --- wrap-json.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'wrap-json.h') diff --git a/wrap-json.h b/wrap-json.h index f5e6996..fd5b7c3 100644 --- a/wrap-json.h +++ b/wrap-json.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2016, 2017 "IoT.bzh" + Copyright (C) 2016, 2017, 2018 "IoT.bzh" author: José Bollo @@ -48,6 +48,10 @@ extern void wrap_json_object_for_all(struct json_object *object, void (*callback 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 void wrap_json_object_add(struct json_object *dest, struct json_object *added); + #ifdef __cplusplus } #endif -- cgit 1.2.3-korg