JSON libraries

 JSON libraries
Output JSON objects in C as JSON formatted strings and parse 
JSON formatted strings back into the C presentation of 
the JSON objects.
• C and C++ complaint portable.
• Several extra format specifiers supported.
JSON token:
This stucture contains-
Pointer pointing to beginning of the value.
Value length 
Type of the token
Token types are string,number,true,false,null,
object start, object end,array start and array end.
• json_scanf
Scans json string directly into c/c++ variables.
• json_printf
Print c/c++ variables directly into output stream.
• json_setf
Modifies existing json_string.
• json_fread
Reads json from a file.
• json_fprintf
Writes json to a file.
• json_scanf_array_elem
Scan array element with given path and index
• json_printf_array
prints contiguous C arrays.
SIZE of object file is 42 kBytes.
Minimalistic JSON parser in C.
Compatible with C89
Single head library
easily integrated into resource limited or
emb projects
API contains only 2 functions.
JSON token:
This structure contains-
start position in JSON data string
end position in JSON data string
Token types are-object,array,string,
•  jsmn_init
Create JSON parser over array of tokens.
•  jsmn_parse
Parses JSON data string into array of tokens,
each describing JSON object.
SIZE of object file is upto 26 kBytes.
JSON-C implements referrence counting object that 
allows you to easily construct JSON objects in c,
output them as JSON formatted strings and parse 
JSON formatted strings back into c 
representation of JSON objects.
JSON token:
Token types are boolean,double,int,object,array,string.
• json_object_to_json_string
Stringify object to JSON format grabbing the 
shared ownership of object.
• json_object_get
Increament reference count of json_object.
• json_object_put
Decrement reference count of json_object,and free 
it if reaches to zero.
• json_object_userdata_to_json_string
Copy the userdata string to over the 
destination buffer.
• json_object_new_array
Create a new empty json_object of type 
• json_object_get_array
Get the arraylist of json_object of type 
• json_object_array_add
Add an element to the end of json_object 
of type json_type_array.
• json_obect_array_put_idx
Insert or replace an element at a specified 
index of the array.
• json_object_array_get_idx
Get the element at specifies index of the 
All these functions for array are also defined for 
following json_types- 
boolean,double,int,int64,object .
SIZE of object file is upto 300 kBytes.