34#define ty_cJSON_False 0
35#define ty_cJSON_True 1
36#define ty_cJSON_NULL 2
37#define ty_cJSON_Number 3
38#define ty_cJSON_String 4
39#define ty_cJSON_Array 5
40#define ty_cJSON_Object 6
42#define ty_cJSON_IsReference 256
59extern ty_cJSON *ty_cJSON_Parse(
const char *value);
61extern char *ty_cJSON_Print(
ty_cJSON *item);
63extern char *ty_cJSON_PrintUnformatted(
ty_cJSON *item);
64extern void ty_cJSON_FreeBuffer(
char *buffer);
66extern void ty_cJSON_Delete(
ty_cJSON *c);
69extern int ty_cJSON_GetArraySize(
ty_cJSON *array);
73extern ty_cJSON *ty_cJSON_GetObjectItem(
ty_cJSON *
object,
const char *
string);
76extern const char *ty_cJSON_GetErrorPtr(
void);
79extern ty_cJSON *ty_cJSON_CreateNull(
void);
80extern ty_cJSON *ty_cJSON_CreateTrue(
void);
81extern ty_cJSON *ty_cJSON_CreateFalse(
void);
82extern ty_cJSON *ty_cJSON_CreateBool(
int b);
83extern ty_cJSON *ty_cJSON_CreateNumber(
double num);
84extern ty_cJSON *ty_cJSON_CreateString(
const char *
string);
85extern ty_cJSON *ty_cJSON_CreateArray(
void);
86extern ty_cJSON *ty_cJSON_CreateObject(
void);
89extern ty_cJSON *ty_cJSON_CreateIntArray(
const int *numbers,
int count);
90extern ty_cJSON *ty_cJSON_CreateFloatArray(
const float *numbers,
int count);
91extern ty_cJSON *ty_cJSON_CreateDoubleArray(
const double *numbers,
int count);
92extern ty_cJSON *ty_cJSON_CreateStringArray(
const char **strings,
int count);
96extern void ty_cJSON_AddItemToObject(
ty_cJSON *
object,
const char *
string,
ty_cJSON *item);
98extern void ty_cJSON_AddItemReferenceToArray(
ty_cJSON *array,
ty_cJSON *item);
99extern void ty_cJSON_AddItemReferenceToObject(
ty_cJSON *
object,
const char *
string,
ty_cJSON *item);
103extern void ty_cJSON_DeleteItemFromArray(
ty_cJSON *array,
int which);
104extern ty_cJSON *ty_cJSON_DetachItemFromObject(
ty_cJSON *
object,
const char *
string);
105extern void ty_cJSON_DeleteItemFromObject(
ty_cJSON *
object,
const char *
string);
108extern void ty_cJSON_ReplaceItemInArray(
ty_cJSON *array,
int which,
ty_cJSON *newitem);
109extern void ty_cJSON_ReplaceItemInObject(
ty_cJSON *
object,
const char *
string,
ty_cJSON *newitem);
118extern ty_cJSON *ty_cJSON_ParseWithOpts(
const char *value,
const char **return_parse_end,
int require_null_terminated);
120extern void ty_cJSON_Minify(
char *json);
123extern ty_cJSON * ty_cJSON_GetObjectItemCaseSensitive(
ty_cJSON *
object,
const char *
string);
124extern int ty_cJSON_IsObject(
const ty_cJSON *
object);
125extern int ty_cJSON_IsArray(
const ty_cJSON *
object);
126extern int ty_cJSON_IsString(
const ty_cJSON *
object);
127extern int ty_cJSON_IsNumber(
const ty_cJSON *
object);
128extern int ty_cJSON_IsBool(
const ty_cJSON *
object);
133#define ty_cJSON_AddNullToObject(object,name) ty_cJSON_AddItemToObject(object, name, ty_cJSON_CreateNull())
134#define ty_cJSON_AddTrueToObject(object,name) ty_cJSON_AddItemToObject(object, name, ty_cJSON_CreateTrue())
135#define ty_cJSON_AddFalseToObject(object,name) ty_cJSON_AddItemToObject(object, name, ty_cJSON_CreateFalse())
136#define ty_cJSON_AddBoolToObject(object,name,b) ty_cJSON_AddItemToObject(object, name, ty_cJSON_CreateBool(b))
137#define ty_cJSON_AddNumberToObject(object,name,n) ty_cJSON_AddItemToObject(object, name, ty_cJSON_CreateNumber(n))
138#define ty_cJSON_AddStringToObject(object,name,s) ty_cJSON_AddItemToObject(object, name, ty_cJSON_CreateString(s))
141#define ty_cJSON_SetIntValue(object,val) ((object)?(object)->valueint=(object)->valuedouble=(val):(val))
144#define ty_cJSON_ArrayForEach(pos, head) for(pos = (head)->child; pos != NULL; pos = pos->next)
Definition: ty_cJSON.h:45