Wire in ParseWithOpts to allow detection of JSON with following garbage.

git-svn-id: http://svn.code.sf.net/p/cjson/code@50 e3330c51-1366-4df0-8b21-3ccf24e3d50e
This commit is contained in:
Dave Gamble
2013-02-06 12:44:17 +00:00
parent d755436ba7
commit 96c59f3e49
2 changed files with 14 additions and 2 deletions

View File

@ -120,6 +120,10 @@ extern cJSON *cJSON_Duplicate(cJSON *item,int recurse);
need to be released. With recurse!=0, it will duplicate any children connected to the item.
The item->next and ->prev pointers are always zero on return from Duplicate. */
/* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed */
extern cJSON *cJSON_ParseWithOpts(const char *value,const char **return_parse_end,int require_null_terminated);
#define cJSON_AddNullToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateNull())
#define cJSON_AddTrueToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateTrue())
#define cJSON_AddFalseToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateFalse())