jansson icon indicating copy to clipboard operation
jansson copied to clipboard

can you give an example for make json object.

Open ygm521 opened this issue 7 years ago • 1 comments

can you give an example for make json object. thanks! like this: json_object_set_new(object, "tid", json_string(ctx->msgid)); json_object_set_new (object, "sip", json_string(/inet_addr(ctx->xforwardaddr)/"0")); json_object_set_new (object, "dip", json_string("0")); json_object_set_new (object, "spt", json_string(/ctx->port/"0")); json_object_set_new (object, "dpt", json_string("0")); json_object_set_new (object, "prt", json_integer(3)); json_object_set_new (object, "ts", json_string(nowtime)); json_object_set_new(object, "mac", json_string("")); json_object_set_new(object, "hostname", json_string(""));

json_object_set_new (object, "pattr", objectmsg);
json_object_set_new (objectmsg, "from", json_string(ctx->sender));
json_object_set_new (objectmsg, "to", tolist);

ygm521 avatar May 19 '17 04:05 ygm521

Have this problem been resolved?

If not, you can see this simple example: simple_parse.c

harkue avatar Sep 30 '19 02:09 harkue