C Object Notation. C support for JSON
git clone https://github.com/Friedchicken-42/con con-main
cd con-main
make
on *o = NULL;
json_err* err = json_load("file.json", &o);
json_dump(obj, "file.json");
int x = 42;
on *obj = on_create_object();
on_add(obj, "question", "What is the answer to the utlimate question?", ON_STRING);
on_add(obj, "answer", &x, ON_INTEGER);
on* arr = on_create_array();
on_add(arr, NULL, "test1", ON_STRING);
on_add(arr, NULL, "test2", ON_STRING);
on_add(arr, NULL, "test3", ON_STRING);
char *question = on_get(obj, "question");
printf("question: %s\n", question);
on_free(obj);
- add load/dump for other format
- toml
- xml
- yarn
- ini