123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- #include "esl.h"
- #ifndef cJSON__h
- #define cJSON__h
- #ifdef __cplusplus
- extern "C"
- {
- #endif
- #define cJSON_False 0
- #define cJSON_True 1
- #define cJSON_NULL 2
- #define cJSON_Number 3
- #define cJSON_String 4
- #define cJSON_Array 5
- #define cJSON_Object 6
-
- #define cJSON_IsReference 256
- typedef struct cJSON {
- struct cJSON *next,*prev;
- struct cJSON *child;
- int type;
- char *valuestring;
- int valueint;
- double valuedouble;
- char *string;
- } cJSON;
- typedef struct cJSON_Hooks {
- void *(*malloc_fn)(size_t sz);
- void (*free_fn)(void *ptr);
- } cJSON_Hooks;
- ESL_DECLARE(void) cJSON_InitHooks(cJSON_Hooks* hooks);
- ESL_DECLARE(cJSON *)cJSON_Parse(const char *value);
- ESL_DECLARE(char *)cJSON_Print(cJSON *item);
- ESL_DECLARE(char *)cJSON_PrintUnformatted(cJSON *item);
- ESL_DECLARE(void) cJSON_Delete(cJSON *c);
- ESL_DECLARE(int) cJSON_GetArraySize(cJSON *array);
- ESL_DECLARE(cJSON *)cJSON_GetArrayItem(cJSON *array,int item);
- ESL_DECLARE(cJSON *)cJSON_GetObjectItem(cJSON *object,const char *string);
- ESL_DECLARE(const char *)cJSON_GetErrorPtr(void);
-
- ESL_DECLARE(cJSON *)cJSON_CreateNull(void);
- ESL_DECLARE(cJSON *)cJSON_CreateTrue(void);
- ESL_DECLARE(cJSON *)cJSON_CreateFalse(void);
- ESL_DECLARE(cJSON *)cJSON_CreateBool(int b);
- ESL_DECLARE(cJSON *)cJSON_CreateNumber(double num);
- ESL_DECLARE(cJSON *)cJSON_CreateString(const char *string);
- ESL_DECLARE(cJSON *)cJSON_CreateArray(void);
- ESL_DECLARE(cJSON *)cJSON_CreateObject(void);
- ESL_DECLARE(cJSON *)cJSON_CreateIntArray(int *numbers,int count);
- ESL_DECLARE(cJSON *)cJSON_CreateFloatArray(float *numbers,int count);
- ESL_DECLARE(cJSON *)cJSON_CreateDoubleArray(double *numbers,int count);
- ESL_DECLARE(cJSON *)cJSON_CreateStringArray(const char **strings,int count);
- ESL_DECLARE(void) cJSON_AddItemToArray(cJSON *array, cJSON *item);
- ESL_DECLARE(void) cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item);
- ESL_DECLARE(void) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item);
- ESL_DECLARE(void) cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item);
- ESL_DECLARE(cJSON *)cJSON_DetachItemFromArray(cJSON *array,int which);
- ESL_DECLARE(void) cJSON_DeleteItemFromArray(cJSON *array,int which);
- ESL_DECLARE(cJSON *)cJSON_DetachItemFromObject(cJSON *object,const char *string);
- ESL_DECLARE(void) cJSON_DeleteItemFromObject(cJSON *object,const char *string);
-
- ESL_DECLARE(void) cJSON_ReplaceItemInArray(cJSON *array,int which,cJSON *newitem);
- ESL_DECLARE(void) cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem);
- #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())
- #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))
- #ifdef __cplusplus
- }
- #endif
- #endif
|