mirror of
https://github.com/DaveGamble/cJSON
synced 2025-01-11 09:19:41 +00:00
Tidy comments. Add cJSON_SetIntValue.
git-svn-id: http://svn.code.sf.net/p/cjson/code@53 e3330c51-1366-4df0-8b21-3ccf24e3d50e
This commit is contained in:
parent
2c9474e9e3
commit
15adf71272
7
cJSON.h
7
cJSON.h
@ -120,10 +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.
|
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. */
|
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 */
|
/* 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);
|
extern cJSON *cJSON_ParseWithOpts(const char *value,const char **return_parse_end,int require_null_terminated);
|
||||||
|
|
||||||
|
/* Macros for creating things quickly. */
|
||||||
#define cJSON_AddNullToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateNull())
|
#define cJSON_AddNullToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateNull())
|
||||||
#define cJSON_AddTrueToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateTrue())
|
#define cJSON_AddTrueToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateTrue())
|
||||||
#define cJSON_AddFalseToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateFalse())
|
#define cJSON_AddFalseToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateFalse())
|
||||||
@ -131,6 +131,9 @@ extern cJSON *cJSON_ParseWithOpts(const char *value,const char **return_parse_en
|
|||||||
#define cJSON_AddNumberToObject(object,name,n) cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n))
|
#define cJSON_AddNumberToObject(object,name,n) cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n))
|
||||||
#define cJSON_AddStringToObject(object,name,s) cJSON_AddItemToObject(object, name, cJSON_CreateString(s))
|
#define cJSON_AddStringToObject(object,name,s) cJSON_AddItemToObject(object, name, cJSON_CreateString(s))
|
||||||
|
|
||||||
|
/* When assigning an integer value, it needs to be propagated to valuedouble too. */
|
||||||
|
#define cJSON_SetIntValue(object,val) ((object)?(object)->valueint=(object)->valuedouble=(val):(val))
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user