1 #include <stddef.h> 2 #include <stdio.h> 3 #include <stdlib.h> 4 #include <string.h> 5 6 #include "json.h" 7 #include "parse_flags.h" 8 9 #ifdef TEST_FORMATTED 10 #define json_object_to_json_string(obj) json_object_to_json_string_ext(obj, sflags) 11 #else 12 /* no special define */ 13 #endif 14 15 int main(int argc, char **argv) 16 { 17 json_object *new_obj; 18 #ifdef TEST_FORMATTED 19 int sflags = 0; 20 #endif 21 22 MC_SET_DEBUG(1); 23 24 #ifdef TEST_FORMATTED 25 sflags = parse_flags(argc, argv); 26 #endif 27 28 new_obj = json_tokener_parse( 29 "/* more difficult test case */" 30 "{ \"glossary\": { \"title\": \"example glossary\", \"GlossDiv\": { \"title\": \"S\", " 31 "\"GlossList\": [ { \"ID\": \"SGML\", \"SortAs\": \"SGML\", \"GlossTerm\": \"Standard " 32 "Generalized Markup Language\", \"Acronym\": \"SGML\", \"Abbrev\": \"ISO 8879:1986\", " 33 "\"GlossDef\": \"A meta-markup language, used to create markup languages such as " 34 "DocBook.\", \"GlossSeeAlso\": [\"GML\", \"XML\", \"markup\"] } ] } } }"); 35 printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj)); 36 json_object_put(new_obj); 37 38 return EXIT_SUCCESS; 39 } 40
This page was automatically generated by LXR 0.3.1. • OpenWrt