From 9e662e494d20183ccd193adf0fad75c7c2cec353 Mon Sep 17 00:00:00 2001 From: Kenny Kwok Date: Mon, 5 Jul 2021 11:00:36 +0800 Subject: [PATCH] Add json_object_update_recursive_new() --- src/jansson.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/jansson.h b/src/jansson.h index b93a401..d846dbf 100644 --- a/src/jansson.h +++ b/src/jansson.h @@ -286,6 +286,12 @@ static JSON_INLINE int json_object_update_missing_new(json_t *object, json_t *ot return ret; } +static JSON_INLINE int json_object_update_recursive_new(json_t *object, json_t *other) { + int ret = json_object_update_recursive(object, other); + json_decref(other); + return ret; +} + size_t json_array_size(const json_t *array); json_t *json_array_get(const json_t *array, size_t index) JANSSON_ATTRS((warn_unused_result));