Lines Matching refs:cJSON
2 Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
23 /* cJSON */
59 #include "cJSON.h"
99 CJSON_PUBLIC(char *) cJSON_GetStringValue(const cJSON * const item)
110 CJSON_PUBLIC(long long *) cJSON_GetInt64NumberValue(cJSON * const item)
121 CJSON_PUBLIC(double) cJSON_GetNumberValue(const cJSON * const item)
133 #error cJSON.h and cJSON.c have different versions. Make sure that both have the same.
253 static cJSON *cJSON_New_Item(const internal_hooks * const hooks)
255 cJSON* node = (cJSON*)hooks->allocate(sizeof(cJSON));
258 memset(node, '\0', sizeof(cJSON));
264 /* Delete a cJSON structure. */
265 CJSON_PUBLIC(void) cJSON_Delete(cJSON *item)
267 cJSON *next = NULL;
324 static cJSON_bool parse_number(cJSON * const item, parse_buffer * const input_buffer)
423 static cJSON_bool parse_number(cJSON * const item, parse_buffer * const input_buffer)
501 CJSON_PUBLIC(long long) cJSON_SetInt64NumberValue(cJSON * const object, const long long integer)
523 CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number)
542 CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number)
561 CJSON_PUBLIC(char*) cJSON_SetValuestring(cJSON *object, const char *valuestring)
712 static cJSON_bool print_number(const cJSON * const item, printbuffer * const output_buffer)
787 static cJSON_bool print_number(const cJSON * const item, printbuffer * const output_buffer)
1016 static cJSON_bool parse_string(cJSON * const item, parse_buffer * const input_buffer)
1267 static cJSON_bool print_string(const cJSON * const item, printbuffer * const p)
1273 static cJSON_bool parse_value(cJSON * const item, parse_buffer * const input_buffer);
1274 static cJSON_bool print_value(const cJSON * const item, printbuffer * const output_buffer);
1275 static cJSON_bool parse_array(cJSON * const item, parse_buffer * const input_buffer);
1276 static cJSON_bool print_array(const cJSON * const item, printbuffer * const output_buffer);
1277 static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_buffer);
1278 static cJSON_bool print_object(const cJSON * const item, printbuffer * const output_buffer);
1322 CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated)
1338 CJSON_PUBLIC(cJSON *) cJSON_ParseWithLengthOpts(const char *value, size_t buffer_length, const char **return_parse_end, cJSON_bool require_null_terminated)
1341 cJSON *item = NULL;
1418 CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value)
1423 CJSON_PUBLIC(cJSON *) cJSON_ParseWithLength(const char *value, size_t buffer_length)
1430 static unsigned char *print(const cJSON * const item, cJSON_bool format, const internal_hooks * const hooks)
1494 /* Render a cJSON item/entity/structure to text. */
1495 CJSON_PUBLIC(char *) cJSON_Print(const cJSON *item)
1500 CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON *item)
1505 CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt)
1535 CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format)
1555 static cJSON_bool parse_value(cJSON * const item, parse_buffer * const input_buffer)
1610 static cJSON_bool print_value(const cJSON * const item, printbuffer * const output_buffer)
1684 static cJSON_bool parse_array(cJSON * const item, parse_buffer * const input_buffer)
1686 cJSON *head = NULL; /* head of the linked list */
1687 cJSON *current_item = NULL;
1722 cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks));
1782 static cJSON_bool print_array(const cJSON * const item, printbuffer * const output_buffer)
1786 cJSON *current_element = item->child;
1844 static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_buffer)
1846 cJSON *head = NULL; /* linked list head */
1847 cJSON *current_item = NULL;
1880 cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks));
1962 static cJSON_bool print_object(const cJSON * const item, printbuffer * const output_buffer)
1966 cJSON *current_item = item->child;
2076 CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array)
2078 cJSON *child = NULL;
2099 static cJSON* get_array_item(const cJSON *array, size_t index)
2101 cJSON *current_child = NULL;
2118 CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index)
2128 static cJSON *get_object_item(const cJSON * const object, const char * const name, const cJSON_bool case_sensitive)
2130 cJSON *current_element = NULL;
2160 CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string)
2165 CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON * const object, const char * const string)
2170 CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *string)
2176 static void suffix_object(cJSON *prev, cJSON *item)
2183 static cJSON *create_reference(const cJSON *item, const internal_hooks * const hooks)
2185 cJSON *reference = NULL;
2197 memcpy(reference, item, sizeof(cJSON));
2204 static cJSON_bool add_item_to_array(cJSON *array, cJSON *item)
2206 cJSON *child = NULL;
2238 CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToArray(cJSON *array, cJSON *item)
2259 static cJSON_bool add_item_to_object(cJSON * const object, const char * const string, cJSON * const item, const internal_hooks * const hooks, const cJSON_bool constant_key)
2296 CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item)
2302 CJSON_PUBLIC(cJSON_bool) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item)
2307 CJSON_PUBLIC(cJSON_bool) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item)
2317 CJSON_PUBLIC(cJSON_bool) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item)
2327 CJSON_PUBLIC(cJSON*) cJSON_AddNullToObject(cJSON * const object, const char * const name)
2329 cJSON *null = cJSON_CreateNull();
2339 CJSON_PUBLIC(cJSON*) cJSON_AddTrueToObject(cJSON * const object, const char * const name)
2341 cJSON *true_item = cJSON_CreateTrue();
2351 CJSON_PUBLIC(cJSON*) cJSON_AddFalseToObject(cJSON * const object, const char * const name)
2353 cJSON *false_item = cJSON_CreateFalse();
2363 CJSON_PUBLIC(cJSON*) cJSON_AddBoolToObject(cJSON * const object, const char * const name, const cJSON_bool boolean)
2365 cJSON *bool_item = cJSON_CreateBool(boolean);
2376 CJSON_PUBLIC(cJSON*) cJSON_AddInt64NumberToObject(cJSON * const object, const char * const name, const long long integer)
2378 cJSON *int_item = cJSON_CreateInt64Number(integer);
2389 CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number)
2391 cJSON *number_item = cJSON_CreateNumber(number);
2401 CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string)
2403 cJSON *string_item = cJSON_CreateString(string);
2413 CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw)
2415 cJSON *raw_item = cJSON_CreateRaw(raw);
2425 CJSON_PUBLIC(cJSON*) cJSON_AddObjectToObject(cJSON * const object, const char * const name)
2427 cJSON *object_item = cJSON_CreateObject();
2437 CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * const name)
2439 cJSON *array = cJSON_CreateArray();
2449 CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item)
2485 CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which)
2495 CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which)
2500 CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string)
2502 cJSON *to_detach = cJSON_GetObjectItem(object, string);
2507 CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string)
2509 cJSON *to_detach = cJSON_GetObjectItemCaseSensitive(object, string);
2514 CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string)
2519 CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON *object, const char *string)
2525 CJSON_PUBLIC(cJSON_bool) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem)
2527 cJSON *after_inserted = NULL;
2559 CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement)
2608 CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem)
2618 static cJSON_bool replace_item_in_object(cJSON *object, const char *string, cJSON *replacement, cJSON_bool case_sensitive)
2641 CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInObject(cJSON *object, const char *string, cJSON *newitem)
2646 CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object, const char *string, cJSON *newitem)
2652 CJSON_PUBLIC(cJSON *) cJSON_CreateNull(void)
2654 cJSON *item = cJSON_New_Item(&global_hooks);
2663 CJSON_PUBLIC(cJSON *) cJSON_CreateTrue(void)
2665 cJSON *item = cJSON_New_Item(&global_hooks);
2674 CJSON_PUBLIC(cJSON *) cJSON_CreateFalse(void)
2676 cJSON *item = cJSON_New_Item(&global_hooks);
2685 CJSON_PUBLIC(cJSON *) cJSON_CreateBool(cJSON_bool boolean)
2687 cJSON *item = cJSON_New_Item(&global_hooks);
2697 CJSON_PUBLIC(cJSON *) cJSON_CreateInt64Number(long long integer)
2699 cJSON *item = cJSON_New_Item(&global_hooks);
2712 CJSON_PUBLIC(cJSON *) cJSON_CreateNumber(double num)
2714 cJSON *item = cJSON_New_Item(&global_hooks);
2739 CJSON_PUBLIC(cJSON *) cJSON_CreateNumber(double num)
2741 cJSON *item = cJSON_New_Item(&global_hooks);
2766 CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string)
2768 cJSON *item = cJSON_New_Item(&global_hooks);
2783 CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string)
2785 cJSON *item = cJSON_New_Item(&global_hooks);
2795 CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON *child)
2797 cJSON *item = cJSON_New_Item(&global_hooks);
2800 item->child = (cJSON*)cast_away_const(child);
2806 CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON *child) {
2807 cJSON *item = cJSON_New_Item(&global_hooks);
2810 item->child = (cJSON*)cast_away_const(child);
2816 CJSON_PUBLIC(cJSON *) cJSON_CreateRaw(const char *raw)
2818 cJSON *item = cJSON_New_Item(&global_hooks);
2833 CJSON_PUBLIC(cJSON *) cJSON_CreateArray(void)
2835 cJSON *item = cJSON_New_Item(&global_hooks);
2844 CJSON_PUBLIC(cJSON *) cJSON_CreateObject(void)
2846 cJSON *item = cJSON_New_Item(&global_hooks);
2856 CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count)
2859 cJSON *n = NULL;
2860 cJSON *p = NULL;
2861 cJSON *a = NULL;
2896 CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count)
2899 cJSON *n = NULL;
2900 cJSON *p = NULL;
2901 cJSON *a = NULL;
2936 CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count)
2939 cJSON *n = NULL;
2940 cJSON *p = NULL;
2941 cJSON *a = NULL;
2976 CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char *const *strings, int count)
2979 cJSON *n = NULL;
2980 cJSON *p = NULL;
2981 cJSON *a = NULL;
3017 CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool recurse)
3019 cJSON *newitem = NULL;
3020 cJSON *child = NULL;
3021 cJSON *next = NULL;
3022 cJSON *newchild = NULL;
3197 CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item)
3207 CJSON_PUBLIC(cJSON_bool) cJSON_IsFalse(const cJSON * const item)
3217 CJSON_PUBLIC(cJSON_bool) cJSON_IsTrue(const cJSON * const item)
3228 CJSON_PUBLIC(cJSON_bool) cJSON_IsBool(const cJSON * const item)
3237 CJSON_PUBLIC(cJSON_bool) cJSON_IsNull(const cJSON * const item)
3248 CJSON_PUBLIC(cJSON_bool) cJSON_IsInt64Number(const cJSON * const item)
3259 CJSON_PUBLIC(cJSON_bool) cJSON_IsNumber(const cJSON * const item)
3269 CJSON_PUBLIC(cJSON_bool) cJSON_IsString(const cJSON * const item)
3279 CJSON_PUBLIC(cJSON_bool) cJSON_IsArray(const cJSON * const item)
3289 CJSON_PUBLIC(cJSON_bool) cJSON_IsObject(const cJSON * const item)
3299 CJSON_PUBLIC(cJSON_bool) cJSON_IsRaw(const cJSON * const item)
3309 CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * const b, const cJSON_bool case_sensitive)
3391 cJSON *a_element = a->child;
3392 cJSON *b_element = b->child;
3415 cJSON *a_element = NULL;
3416 cJSON *b_element = NULL;