Commit graph

11 commits

Author SHA1 Message Date
Matthias Schiffer
d3fa561e5a blobmsg_json: add new functions blobmsg_format_json_value*
The current blobmsg_format_json* functions will return invalid JSON when
the "list" argument is given as false (blobmsg_format_element() will
output the name of the blob_attr as if the value is printed as part of a
JSON object).

To avoid breaking software relying on this behaviour, introduce new
functions which will never print the blob_attr name and thus always
produce valid JSON.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Acked-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Felix Fietkau <nbd@nbd.name> [cosmetic style fix]
2016-07-02 10:10:08 +02:00
Felix Fietkau
d133da5562 blobmsg_json: avoid redefinition of json_object
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-10-24 13:40:14 +02:00
Felix Fietkau
6f2c688d68 blobmsg_json: include json.h inside blobmsg_json.c instead of the public header file
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2014-09-23 12:03:32 +02:00
Felix Fietkau
54a0b49326 blobmsg_json: add blobmsg_add_json_from_file
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-05-29 12:14:48 +02:00
Thomas Gstädtner
49e6e062b8 add pkgconfig support for json-c
this includes a fallback for legacy support
2013-03-05 10:44:48 +01:00
Felix Fietkau
76f584c761 blobmsg_json: export blobmsg_add_object
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2013-01-06 02:15:48 +01:00
Felix Fietkau
6a2e4f449d switch blobmsg_json over to permissive license 2012-05-26 18:03:08 +02:00
Felix Fietkau
ed9b5c986b blobmsg_json: support indenting of output data 2011-07-18 13:04:23 +02:00
Felix Fietkau
0918243e90 move json formatting to the blobmsg_json library 2011-02-06 21:23:28 +01:00
Felix Fietkau
be41614060 add missing copyright headers 2011-02-06 16:20:57 +01:00
Felix Fietkau
7e9712363b add a json to blobmsg parsing library 2011-02-06 16:14:15 +01:00