提交 0d089c4b authored 作者: Anthony Minessale's avatar Anthony Minessale

put SWITCH_DECLARE marcos on the json api to make it exported

上级 d6374535
...@@ -61,56 +61,56 @@ typedef struct cJSON_Hooks { ...@@ -61,56 +61,56 @@ typedef struct cJSON_Hooks {
} cJSON_Hooks; } cJSON_Hooks;
// Supply malloc, realloc and free functions to cJSON // Supply malloc, realloc and free functions to cJSON
extern void cJSON_InitHooks(cJSON_Hooks* hooks); SWITCH_DECLARE(void) cJSON_InitHooks(cJSON_Hooks* hooks);
// Supply a block of JSON, and this returns a cJSON object you can interrogate. Call cJSON_Delete when finished. // Supply a block of JSON, and this returns a cJSON object you can interrogate. Call cJSON_Delete when finished.
extern cJSON *cJSON_Parse(const char *value); SWITCH_DECLARE(cJSON *)cJSON_Parse(const char *value);
// Render a cJSON entity to text for transfer/storage. Free the char* when finished. // Render a cJSON entity to text for transfer/storage. Free the char* when finished.
extern char *cJSON_Print(cJSON *item); SWITCH_DECLARE(char *)cJSON_Print(cJSON *item);
// Render a cJSON entity to text for transfer/storage without any formatting. Free the char* when finished. // Render a cJSON entity to text for transfer/storage without any formatting. Free the char* when finished.
extern char *cJSON_PrintUnformatted(cJSON *item); SWITCH_DECLARE(char *)cJSON_PrintUnformatted(cJSON *item);
// Delete a cJSON entity and all subentities. // Delete a cJSON entity and all subentities.
extern void cJSON_Delete(cJSON *c); SWITCH_DECLARE(void) cJSON_Delete(cJSON *c);
// Returns the number of items in an array (or object). // Returns the number of items in an array (or object).
extern int cJSON_GetArraySize(cJSON *array); SWITCH_DECLARE(int) cJSON_GetArraySize(cJSON *array);
// Retrieve item number "item" from array "array". Returns NULL if unsuccessful. // Retrieve item number "item" from array "array". Returns NULL if unsuccessful.
extern cJSON *cJSON_GetArrayItem(cJSON *array,int item); SWITCH_DECLARE(cJSON *)cJSON_GetArrayItem(cJSON *array,int item);
// Get item "string" from object. Case insensitive. // Get item "string" from object. Case insensitive.
extern cJSON *cJSON_GetObjectItem(cJSON *object,const char *string); SWITCH_DECLARE(cJSON *)cJSON_GetObjectItem(cJSON *object,const char *string);
// These calls create a cJSON item of the appropriate type. // These calls create a cJSON item of the appropriate type.
extern cJSON *cJSON_CreateNull(void); SWITCH_DECLARE(cJSON *)cJSON_CreateNull(void);
extern cJSON *cJSON_CreateTrue(void); SWITCH_DECLARE(cJSON *)cJSON_CreateTrue(void);
extern cJSON *cJSON_CreateFalse(void); SWITCH_DECLARE(cJSON *)cJSON_CreateFalse(void);
extern cJSON *cJSON_CreateNumber(double num); SWITCH_DECLARE(cJSON *)cJSON_CreateNumber(double num);
extern cJSON *cJSON_CreateString(const char *string); SWITCH_DECLARE(cJSON *)cJSON_CreateString(const char *string);
extern cJSON *cJSON_CreateArray(void); SWITCH_DECLARE(cJSON *)cJSON_CreateArray(void);
extern cJSON *cJSON_CreateObject(void); SWITCH_DECLARE(cJSON *)cJSON_CreateObject(void);
// These utilities create an Array of count items. // These utilities create an Array of count items.
extern cJSON *cJSON_CreateIntArray(int *numbers,int count); SWITCH_DECLARE(cJSON *)cJSON_CreateIntArray(int *numbers,int count);
extern cJSON *cJSON_CreateFloatArray(float *numbers,int count); SWITCH_DECLARE(cJSON *)cJSON_CreateFloatArray(float *numbers,int count);
extern cJSON *cJSON_CreateDoubleArray(double *numbers,int count); SWITCH_DECLARE(cJSON *)cJSON_CreateDoubleArray(double *numbers,int count);
extern cJSON *cJSON_CreateStringArray(const char **strings,int count); SWITCH_DECLARE(cJSON *)cJSON_CreateStringArray(const char **strings,int count);
// Append item to the specified array/object. // Append item to the specified array/object.
extern void cJSON_AddItemToArray(cJSON *array, cJSON *item); SWITCH_DECLARE(void) cJSON_AddItemToArray(cJSON *array, cJSON *item);
extern void cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item); SWITCH_DECLARE(void) cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item);
// 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. // 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.
extern void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item); SWITCH_DECLARE(void) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item);
extern void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item); SWITCH_DECLARE(void) cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item);
// Remove/Detatch items from Arrays/Objects. // Remove/Detatch items from Arrays/Objects.
extern cJSON *cJSON_DetachItemFromArray(cJSON *array,int which); SWITCH_DECLARE(cJSON *)cJSON_DetachItemFromArray(cJSON *array,int which);
extern void cJSON_DeleteItemFromArray(cJSON *array,int which); SWITCH_DECLARE(void) cJSON_DeleteItemFromArray(cJSON *array,int which);
extern cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string); SWITCH_DECLARE(cJSON *)cJSON_DetachItemFromObject(cJSON *object,const char *string);
extern void cJSON_DeleteItemFromObject(cJSON *object,const char *string); SWITCH_DECLARE(void) cJSON_DeleteItemFromObject(cJSON *object,const char *string);
// Update array items. // Update array items.
extern void cJSON_ReplaceItemInArray(cJSON *array,int which,cJSON *newitem); SWITCH_DECLARE(void) cJSON_ReplaceItemInArray(cJSON *array,int which,cJSON *newitem);
extern void cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem); SWITCH_DECLARE(void) cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem);
#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())
......
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论