X-Git-Url: http://git.archive.openwrt.org/?p=project%2Flibubox.git;a=blobdiff_plain;f=examples%2Fblobmsg-example.c;h=5d0a8d069a65ad9919a33246f86a277d6de8dfbf;hp=3630208be16b3937f2fb7b07d835d46dad3474b4;hb=79b56268b46ea2eaf7f79af7a64c57e2be37636a;hpb=5129bc940168d080e9b3aa63ae0f92a531455b0e diff --git a/examples/blobmsg-example.c b/examples/blobmsg-example.c index 3630208..5d0a8d0 100644 --- a/examples/blobmsg-example.c +++ b/examples/blobmsg-example.c @@ -1,6 +1,7 @@ #include #include "blobmsg.h" +#include "blobmsg_json.h" static const char *indent_str = "\t\t\t\t\t\t\t\t\t\t\t\t\t"; @@ -94,11 +95,11 @@ static void dump_message(struct blob_buf *buf) if (tb[FOO_LIST]) { fprintf(stderr, "List: "); - dump_table(blobmsg_data(tb[FOO_LIST]), blob_len(tb[FOO_LIST]), 0, true); + dump_table(blobmsg_data(tb[FOO_LIST]), blobmsg_data_len(tb[FOO_LIST]), 0, true); } if (tb[FOO_TESTDATA]) { fprintf(stderr, "Testdata: "); - dump_table(blobmsg_data(tb[FOO_TESTDATA]), blob_len(tb[FOO_TESTDATA]), 0, false); + dump_table(blobmsg_data(tb[FOO_TESTDATA]), blobmsg_data_len(tb[FOO_TESTDATA]), 0, false); } } @@ -128,7 +129,7 @@ int main(int argc, char **argv) blobmsg_buf_init(&buf); fill_message(&buf); dump_message(&buf); - fprintf(stderr, "json: %s\n", blobmsg_format_json(buf.head)); + fprintf(stderr, "json: %s\n", blobmsg_format_json(buf.head, false)); if (buf.buf) free(buf.buf);