]> git.ipfire.org Git - thirdparty/iproute2.git/commit
json_print: Add new json object function not as array item
authorRon Diskin <rondi@mellanox.com>
Thu, 23 Jan 2020 10:32:27 +0000 (12:32 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 27 Jan 2020 13:43:54 +0000 (05:43 -0800)
commit98e48e7dd0e5d64752bcdbf07e30baae9b22f636
treeec5fbf11e78b859866396538c5cfb1302f5d7bb8
parent31ca29b2bec4020929686eb240fa1abd963819a4
json_print: Add new json object function not as array item

Currently new json object opens (and delete_json_obj closes) the object as
an array, what adds prints for the matching bracket '[' ']' at the
start/end of the object. This patch adds new_json_obj_plain() and the
matching delete_json_obj_plain() to enable opening and closing json object,
not as array and leave it to the using function to decide which type of
object to open/close as the main object.

Signed-off-by: Ron Diskin <rondi@mellanox.com>
Reviewed-by: Moshe Shemesh <moshe@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
include/json_print.h
lib/json_print.c