sm
lib
json-c
test2.c
Go to the documentation of this file.
1
#include <stdio.h>
2
#include <stdlib.h>
3
#include <string.h>
4
5
#include "
json.h
"
6
7
8
int
main
(
int
argc,
char
**argv)
9
{
10
argc = 0; argv = (
char
**)0;
11
struct
json_object
*new_obj;
12
13
mc_set_debug
(1);
14
15
new_obj =
json_tokener_parse
(
"/* more difficult test case */ { \"glossary\": { \"title\": \"example glossary\", \"GlossDiv\": { \"title\": \"S\", \"GlossList\": [ { \"ID\": \"SGML\", \"SortAs\": \"SGML\", \"GlossTerm\": \"Standard Generalized Markup Language\", \"Acronym\": \"SGML\", \"Abbrev\": \"ISO 8879:1986\", \"GlossDef\": \"A meta-markup language, used to create markup languages such as DocBook.\", \"GlossSeeAlso\": [\"GML\", \"XML\", \"markup\"] } ] } } }"
);
16
printf(
"new_obj.to_string()=%s\n"
,
json_object_to_json_string
(new_obj));
17
json_object_put
(new_obj);
18
19
return
0;
20
}
main
int main(int argc, char **argv)
Definition:
test2.c:8
mc_set_debug
void mc_set_debug(int debug)
Definition:
debug.c:36
json_object_put
void json_object_put(struct json_object *this)
Definition:
json_object.c:144
json_tokener_parse
struct json_object * json_tokener_parse(const char *str)
Definition:
json_tokener.c:92
json.h
json_object
Definition:
json_object_private.h:21
json_object_to_json_string
const char * json_object_to_json_string(struct json_object *this)
Definition:
json_object.c:199
csm
Author(s): Andrea Censi
autogenerated on Wed Aug 17 2022 02:50:34