Very simple JSON parser in C.



It is easy to serialize and deserialize by using reflection.
            
source code
#include "stdio.h" #include "gummo_json.h" static char json_data[512]; static test1_data obj; int main() { struct_type* type = &struct_types[TYPE_ID_TEST1_DATA]; char msg[] = "{\"a\" : 123 , \"data\" :[{ \"b\": [ 64 , 12 ], \"msg\" : \"foo bar\" },{ \"b\": [ 22 , 99 ], \"msg\" : \"ok\" }], \"msg\" : \"hello world\"}"; json_deserialize(&obj, type, msg); json_serialize(&obj, type, json_data, 512); }






View Source