Very low footprint JSON parser written in portable ANSI C.
- BSD licensed with no dependencies (i.e. just drop the C file into your project)
- Never recurses or allocates more memory than it needs
- Very simple API with operator sugar for C++
There is now a makefile which will produce a libjsonparser static and dynamic library. However, this
is not required to build json-parser, and the source files (json.c
and json.h
) should be happy
in any build system you already have in place.
json_value * json_value_dup (json_value const *);
void json_value_dump (FILE * fp, json_value const * v);
json_value * json_parse (const json_char * json,
size_t length);
json_value * json_parse_ex (json_settings * settings,
const json_char * json,
size_t length,
char * error);
void json_value_free (json_value *);
The type
field of json_value
is one of:
json_object
(seeu.object.length
,u.object.values[x].name
,u.object.values[x].value
)json_array
(seeu.array.length
,u.array.values
)json_integer
(seeu.integer
)json_double
(seeu.dbl
)json_string
(seeu.string.ptr
,u.string.length
)json_boolean
(seeu.boolean
)json_null