structcJSON*next,*prev;/* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */
structcJSON*child;/* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */
inttype;/* The type of the item, as above. */
char*valuestring;/* The item's string, if type==cJSON_String */
intvalueint;/* The item's number, if type==cJSON_Number */
doublevaluedouble;/* The item's number, if type==cJSON_Number */
char*string;/* The item's name string, if this item is the child of, or is in the list of subitems of an object. */
}cJSON;
typedefstructcJSON_Hooks{
void*(*malloc_fn)(size_tsz);
void(*free_fn)(void*ptr);
}cJSON_Hooks;
/* Supply malloc, realloc and free functions to cJSON */
externvoidcJSON_InitHooks(cJSON_Hooks*hooks);
/* Supply a block of JSON, and this returns a cJSON object you can interrogate. Call cJSON_Delete when finished. */
externcJSON*cJSON_Parse(constchar*value);
/* Render a cJSON entity to text for transfer/storage. Free the char* when finished. */
externchar*cJSON_Print(cJSON*item);
/* Render a cJSON entity to text for transfer/storage without any formatting. Free the char* when finished. */
externchar*cJSON_PrintUnformatted(cJSON*item);
/* Render a cJSON entity to text using a buffered strategy. prebuffer is a guess at the final size. guessing well reduces reallocation. fmt=0 gives unformatted, =1 gives formatted */
/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */
externconstchar*cJSON_GetErrorPtr(void);
/* These calls create a cJSON item of the appropriate type. */
externvoidcJSON_AddItemToObjectCS(cJSON*object,constchar*string,cJSON*item);/* Use this when string is definitely const (i.e. a literal, or as good as), and will definitely survive the cJSON object */
/* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */