31#if !defined(__WINDOWS__) && (defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32))
55#define CJSON_CDECL __cdecl
56#define CJSON_STDCALL __stdcall
59#if !defined(CJSON_HIDE_SYMBOLS) && !defined(CJSON_IMPORT_SYMBOLS) && !defined(CJSON_EXPORT_SYMBOLS)
60#define CJSON_EXPORT_SYMBOLS
63#if defined(CJSON_HIDE_SYMBOLS)
64#define CJSON_PUBLIC(type) type CJSON_STDCALL
65#elif defined(CJSON_EXPORT_SYMBOLS)
66#define CJSON_PUBLIC(type) __declspec(dllexport) type CJSON_STDCALL
67#elif defined(CJSON_IMPORT_SYMBOLS)
68#define CJSON_PUBLIC(type) __declspec(dllimport) type CJSON_STDCALL
74#if (defined(__GNUC__) || defined(__SUNPRO_CC) || defined (__SUNPRO_C)) && defined(CJSON_API_VISIBILITY)
75#define CJSON_PUBLIC(type) __attribute__((visibility("default"))) type
77#define CJSON_PUBLIC(type) type
82#define CJSON_VERSION_MAJOR 1
83#define CJSON_VERSION_MINOR 7
84#define CJSON_VERSION_PATCH 15
89#define ty_cJSON_False (0)
90#define ty_cJSON_True (1 << 0)
91#define ty_cJSON_NULL (1 << 1)
92#define ty_cJSON_Number (1 << 2)
93#define ty_cJSON_String (1 << 3)
94#define ty_cJSON_Array (1 << 4)
95#define ty_cJSON_Object (1 << 5)
96#define ty_cJSON_Raw (1 << 6)
97#define ty_cJSON_Invalid (1 << 7)
99#define ty_cJSON_IsReference 256
100#define ty_cJSON_StringIsConst 512
128 void *(CJSON_CDECL *malloc_fn)(
size_t sz);
129 void (CJSON_CDECL *free_fn)(
void *ptr);
132typedef int ty_cJSON_bool;
136#ifndef CJSON_NESTING_LIMIT
137#define CJSON_NESTING_LIMIT 1000
141CJSON_PUBLIC(
const char*) ty_cJSON_Version(
void);
148CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_Parse(
const char *value);
149CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_ParseWithLength(
const char *value,
size_t buffer_length);
152CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_ParseWithOpts(
const char *value,
const char **return_parse_end, ty_cJSON_bool require_null_terminated);
153CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_ParseWithLengthOpts(
const char *value,
size_t buffer_length,
const char **return_parse_end, ty_cJSON_bool require_null_terminated);
156CJSON_PUBLIC(
char *) ty_cJSON_Print(
const ty_cJSON *item);
158CJSON_PUBLIC(
char *) ty_cJSON_PrintUnformatted(
const ty_cJSON *item);
160CJSON_PUBLIC(
char *) ty_cJSON_PrintBuffered(
const ty_cJSON *item,
int prebuffer, ty_cJSON_bool fmt);
163CJSON_PUBLIC(ty_cJSON_bool) ty_cJSON_PrintPreallocated(
ty_cJSON *item,
char *buffer,
const int length,
const ty_cJSON_bool format);
165CJSON_PUBLIC(
void) ty_cJSON_Delete(
ty_cJSON *item);
166CJSON_PUBLIC(
void) ty_cJSON_FreeBuffer(
char *buffer);
169CJSON_PUBLIC(
int) ty_cJSON_GetArraySize(
const ty_cJSON *array);
171CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_GetArrayItem(
const ty_cJSON *array,
int index);
173CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_GetObjectItem(
const ty_cJSON *
const object,
const char *
const string);
174CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_GetObjectItemCaseSensitive(
const ty_cJSON *
const object,
const char *
const string);
175CJSON_PUBLIC(ty_cJSON_bool) ty_cJSON_HasObjectItem(
const ty_cJSON *
object,
const char *
string);
177CJSON_PUBLIC(
const char *) ty_cJSON_GetErrorPtr(
void);
180CJSON_PUBLIC(
char *) ty_cJSON_GetStringValue(
const ty_cJSON *
const item);
181CJSON_PUBLIC(
double) ty_cJSON_GetNumberValue(
const ty_cJSON *
const item);
184CJSON_PUBLIC(ty_cJSON_bool) ty_cJSON_IsInvalid(
const ty_cJSON *
const item);
185CJSON_PUBLIC(ty_cJSON_bool) ty_cJSON_IsFalse(
const ty_cJSON *
const item);
186CJSON_PUBLIC(ty_cJSON_bool) ty_cJSON_IsTrue(
const ty_cJSON *
const item);
187CJSON_PUBLIC(ty_cJSON_bool) ty_cJSON_IsBool(
const ty_cJSON *
const item);
188CJSON_PUBLIC(ty_cJSON_bool) ty_cJSON_IsNull(
const ty_cJSON *
const item);
189CJSON_PUBLIC(ty_cJSON_bool) ty_cJSON_IsNumber(
const ty_cJSON *
const item);
190CJSON_PUBLIC(ty_cJSON_bool) ty_cJSON_IsString(
const ty_cJSON *
const item);
191CJSON_PUBLIC(ty_cJSON_bool) ty_cJSON_IsArray(
const ty_cJSON *
const item);
192CJSON_PUBLIC(ty_cJSON_bool) ty_cJSON_IsObject(
const ty_cJSON *
const item);
193CJSON_PUBLIC(ty_cJSON_bool) ty_cJSON_IsRaw(
const ty_cJSON *
const item);
196CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_CreateNull(
void);
197CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_CreateTrue(
void);
198CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_CreateFalse(
void);
199CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_CreateBool(ty_cJSON_bool
boolean);
200CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_CreateNumber(
double num);
201CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_CreateString(
const char *
string);
203CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_CreateRaw(
const char *raw);
204CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_CreateArray(
void);
205CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_CreateObject(
void);
209CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_CreateStringReference(
const char *
string);
212CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_CreateObjectReference(
const ty_cJSON *child);
213CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_CreateArrayReference(
const ty_cJSON *child);
217CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_CreateIntArray(
const int *numbers,
int count);
218CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_CreateFloatArray(
const float *numbers,
int count);
219CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_CreateDoubleArray(
const double *numbers,
int count);
220CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_CreateStringArray(
const char *
const *strings,
int count);
223CJSON_PUBLIC(ty_cJSON_bool) ty_cJSON_AddItemToArray(
ty_cJSON *array,
ty_cJSON *item);
224CJSON_PUBLIC(ty_cJSON_bool) ty_cJSON_AddItemToObject(
ty_cJSON *
object,
const char *
string,
ty_cJSON *item);
228CJSON_PUBLIC(ty_cJSON_bool) ty_cJSON_AddItemToObjectCS(
ty_cJSON *
object,
const char *
string,
ty_cJSON *item);
230CJSON_PUBLIC(ty_cJSON_bool) ty_cJSON_AddItemReferenceToArray(
ty_cJSON *array,
ty_cJSON *item);
231CJSON_PUBLIC(ty_cJSON_bool) ty_cJSON_AddItemReferenceToObject(
ty_cJSON *
object,
const char *
string,
ty_cJSON *item);
235CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_DetachItemFromArray(
ty_cJSON *array,
int which);
236CJSON_PUBLIC(
void) ty_cJSON_DeleteItemFromArray(
ty_cJSON *array,
int which);
237CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_DetachItemFromObject(
ty_cJSON *
object,
const char *
string);
238CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_DetachItemFromObjectCaseSensitive(
ty_cJSON *
object,
const char *
string);
239CJSON_PUBLIC(
void) ty_cJSON_DeleteItemFromObject(
ty_cJSON *
object,
const char *
string);
240CJSON_PUBLIC(
void) ty_cJSON_DeleteItemFromObjectCaseSensitive(
ty_cJSON *
object,
const char *
string);
243CJSON_PUBLIC(ty_cJSON_bool) ty_cJSON_InsertItemInArray(
ty_cJSON *array,
int which,
ty_cJSON *newitem);
244CJSON_PUBLIC(ty_cJSON_bool) ty_cJSON_ReplaceItemViaPointer(
ty_cJSON *
const parent,
ty_cJSON *
const item,
ty_cJSON * replacement);
245CJSON_PUBLIC(ty_cJSON_bool) ty_cJSON_ReplaceItemInArray(
ty_cJSON *array,
int which,
ty_cJSON *newitem);
246CJSON_PUBLIC(ty_cJSON_bool) ty_cJSON_ReplaceItemInObject(
ty_cJSON *
object,
const char *
string,
ty_cJSON *newitem);
247CJSON_PUBLIC(ty_cJSON_bool) ty_cJSON_ReplaceItemInObjectCaseSensitive(
ty_cJSON *
object,
const char *
string,
ty_cJSON *newitem);
250CJSON_PUBLIC(
ty_cJSON *) ty_cJSON_Duplicate(
const ty_cJSON *item, ty_cJSON_bool recurse);
256CJSON_PUBLIC(ty_cJSON_bool) ty_cJSON_Compare(
const ty_cJSON *
const a,
const ty_cJSON *
const b,
const ty_cJSON_bool case_sensitive);
261CJSON_PUBLIC(
void) ty_cJSON_Minify(
char *json);
265CJSON_PUBLIC(
ty_cJSON*) ty_cJSON_AddNullToObject(
ty_cJSON *
const object,
const char *
const name);
266CJSON_PUBLIC(
ty_cJSON*) ty_cJSON_AddTrueToObject(
ty_cJSON *
const object,
const char *
const name);
267CJSON_PUBLIC(
ty_cJSON*) ty_cJSON_AddFalseToObject(
ty_cJSON *
const object,
const char *
const name);
268CJSON_PUBLIC(
ty_cJSON*) ty_cJSON_AddBoolToObject(
ty_cJSON *
const object,
const char *
const name,
const ty_cJSON_bool
boolean);
269CJSON_PUBLIC(
ty_cJSON*) ty_cJSON_AddNumberToObject(
ty_cJSON *
const object,
const char *
const name,
const double number);
270CJSON_PUBLIC(
ty_cJSON*) ty_cJSON_AddStringToObject(
ty_cJSON *
const object,
const char *
const name,
const char *
const string);
271CJSON_PUBLIC(
ty_cJSON*) ty_cJSON_AddRawToObject(
ty_cJSON *
const object,
const char *
const name,
const char *
const raw);
272CJSON_PUBLIC(
ty_cJSON*) ty_cJSON_AddObjectToObject(
ty_cJSON *
const object,
const char *
const name);
273CJSON_PUBLIC(
ty_cJSON*) ty_cJSON_AddArrayToObject(
ty_cJSON *
const object,
const char *
const name);
276#define ty_cJSON_SetIntValue(object, number) ((object) ? (object)->valueint = (object)->valuedouble = (number) : (number))
278CJSON_PUBLIC(
double) ty_cJSON_SetNumberHelper(
ty_cJSON *
object,
double number);
279#define ty_cJSON_SetNumberValue(object, number) ((object != NULL) ? ty_cJSON_SetNumberHelper(object, (double)number) : (number))
281CJSON_PUBLIC(
char*) ty_cJSON_SetValuestring(
ty_cJSON *
object,
const char *valuestring);
284#define ty_cJSON_ArrayForEach(element, array) for(element = (array != NULL) ? (array)->child : NULL; element != NULL; element = element->next)
287CJSON_PUBLIC(
void *) ty_cJSON_malloc(
size_t size);
288CJSON_PUBLIC(
void) ty_cJSON_free(
void *
object);
Definition: ty_cJSON.h:126
Definition: ty_cJSON.h:104