Allow for global/local error pointers. If you supply a return_parse_end

to cJSON_ParseWithOpts, then that will store the error pointer (if
parsing fails).
This commit is contained in:
Dave Gamble
2016-03-19 18:41:44 +00:00
parent c6d868cf06
commit b4151361de
2 changed files with 36 additions and 35 deletions

View File

@ -126,6 +126,7 @@ need to be released. With recurse!=0, it will duplicate any children connected t
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. */
/* If you supply a ptr in return_parse_end and parsing fails, then return_parse_end will contain a pointer to the error. If not, then cJSON_GetErrorPtr() does the job. */
extern cJSON *cJSON_ParseWithOpts(const char *value,const char **return_parse_end,int require_null_terminated);
extern void cJSON_Minify(char *json);