24 #if !defined(_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) 25 #define _CRT_SECURE_NO_DEPRECATE 29 #pragma GCC visibility push(default) 32 #pragma warning (push) 34 #pragma warning (disable : 4001) 52 #pragma GCC visibility pop 61 #define true ((cJSON_bool)1) 66 #define false ((cJSON_bool)0) 76 return (
const char*) (global_error.
json + global_error.
position);
80 if (!cJSON_IsString(item)) {
88 #if (CJSON_VERSION_MAJOR != 1) || (CJSON_VERSION_MINOR != 7) || (CJSON_VERSION_PATCH != 12) 89 #error cJSON.h and cJSON.c have different versions. Make sure that both have the same. 94 static char version[15];
103 if ((string1 == NULL) || (string2 == NULL))
108 if (string1 == string2)
113 for(; tolower(*string1) == tolower(*string2); (void)string1++, string2++)
115 if (*string1 ==
'\0')
121 return tolower(*string1) - tolower(*string2);
131 #if defined(_MSC_VER) 146 #define internal_malloc malloc 147 #define internal_free free 148 #define internal_realloc realloc 152 #define static_strlen(string_literal) (sizeof(string_literal) - sizeof("")) 159 unsigned char *copy = NULL;
166 length = strlen((
const char*)
string) +
sizeof(
"");
167 copy = (
unsigned char*)hooks->
allocate(length);
172 memcpy(copy,
string, length);
183 global_hooks.deallocate = free;
194 global_hooks.deallocate = free;
195 if (hooks->free_fn != NULL)
197 global_hooks.deallocate = hooks->free_fn;
202 if ((global_hooks.
allocate == malloc) && (global_hooks.deallocate == free))
229 cJSON_Delete(item->
child);
237 global_hooks.deallocate(item->
string);
239 global_hooks.deallocate(item);
247 #ifdef ENABLE_LOCALES 248 struct lconv *lconv = localeconv();
249 return (
unsigned char) lconv->decimal_point[0];
265 #define can_read(buffer, size) ((buffer != NULL) && (((buffer)->offset + size) <= (buffer)->length)) 267 #define can_access_at_index(buffer, index) ((buffer != NULL) && (((buffer)->offset + index) < (buffer)->length)) 268 #define cannot_access_at_index(buffer, index) (!can_access_at_index(buffer, index)) 270 #define buffer_at_offset(buffer) ((buffer)->content + (buffer)->offset) 276 unsigned char *after_end = NULL;
277 unsigned char number_c_string[64];
281 if ((input_buffer == NULL) || (input_buffer->
content == NULL))
289 for (i = 0; (i < (
sizeof(number_c_string) - 1)) &&
can_access_at_index(input_buffer, i); i++)
311 number_c_string[i] = decimal_point;
319 number_c_string[i] =
'\0';
321 number = strtod((
const char*)number_c_string, (
char**)&after_end);
322 if (number_c_string == after_end)
330 if (number >= INT_MAX)
334 else if (number <= (
double)INT_MIN)
345 input_buffer->
offset += (size_t)(after_end - number_c_string);
352 if (number >= INT_MAX)
354 object->valueint = INT_MAX;
356 else if (number <= (
double)INT_MIN)
358 object->valueint = INT_MIN;
362 object->valueint = (int)number;
365 return object->valuedouble =
number;
382 unsigned char *newbuffer = NULL;
385 if ((p == NULL) || (p->
buffer == NULL))
396 if (needed > INT_MAX)
413 if (needed > (INT_MAX / 2))
416 if (needed <= INT_MAX)
427 newsize = needed * 2;
434 if (newbuffer == NULL)
464 return newbuffer + p->
offset;
470 const unsigned char *buffer_pointer = NULL;
471 if ((buffer == NULL) || (buffer->
buffer == NULL))
477 buffer->
offset += strlen((
const char*)buffer_pointer);
483 unsigned char *output_pointer = NULL;
487 unsigned char number_buffer[26];
491 if (output_buffer == NULL)
499 length = sprintf((
char*)number_buffer,
"null");
504 length = sprintf((
char*)number_buffer,
"%1.15g", d);
507 if ((sscanf((
char*)number_buffer,
"%lg", &test) != 1) || ((
double)test != d))
510 length = sprintf((
char*)number_buffer,
"%1.17g", d);
515 if ((length < 0) || (length > (
int)(
sizeof(number_buffer) - 1)))
521 output_pointer =
ensure(output_buffer, (
size_t)length +
sizeof(
""));
522 if (output_pointer == NULL)
529 for (i = 0; i < ((size_t)length); i++)
531 if (number_buffer[i] == decimal_point)
533 output_pointer[i] =
'.';
537 output_pointer[i] = number_buffer[i];
539 output_pointer[i] =
'\0';
541 output_buffer->
offset += (size_t)length;
547 static unsigned parse_hex4(
const unsigned char *
const input)
552 for (i = 0; i < 4; i++)
555 if ((input[i] >=
'0') && (input[i] <=
'9'))
557 h += (
unsigned int) input[i] -
'0';
559 else if ((input[i] >=
'A') && (input[i] <=
'F'))
561 h += (
unsigned int) 10 + input[i] -
'A';
563 else if ((input[i] >=
'a') && (input[i] <=
'f'))
565 h += (
unsigned int) 10 + input[i] -
'a';
584 static unsigned char utf16_literal_to_utf8(
const unsigned char *
const input_pointer,
const unsigned char *
const input_end,
unsigned char **output_pointer)
586 long unsigned int codepoint = 0;
587 unsigned int first_code = 0;
588 const unsigned char *first_sequence = input_pointer;
589 unsigned char utf8_length = 0;
590 unsigned char utf8_position = 0;
591 unsigned char sequence_length = 0;
592 unsigned char first_byte_mark = 0;
594 if ((input_end - first_sequence) < 6)
604 if (((first_code >= 0xDC00) && (first_code <= 0xDFFF)))
610 if ((first_code >= 0xD800) && (first_code <= 0xDBFF))
612 const unsigned char *second_sequence = first_sequence + 6;
613 unsigned int second_code = 0;
614 sequence_length = 12;
616 if ((input_end - second_sequence) < 6)
622 if ((second_sequence[0] !=
'\\') || (second_sequence[1] !=
'u'))
629 second_code =
parse_hex4(second_sequence + 2);
631 if ((second_code < 0xDC00) || (second_code > 0xDFFF))
639 codepoint = 0x10000 + (((first_code & 0x3FF) << 10) | (second_code & 0x3FF));
644 codepoint = first_code;
650 if (codepoint < 0x80)
655 else if (codepoint < 0x800)
659 first_byte_mark = 0xC0;
661 else if (codepoint < 0x10000)
665 first_byte_mark = 0xE0;
667 else if (codepoint <= 0x10FFFF)
671 first_byte_mark = 0xF0;
680 for (utf8_position = (
unsigned char)(utf8_length - 1); utf8_position > 0; utf8_position--)
683 (*output_pointer)[utf8_position] = (
unsigned char)((codepoint | 0x80) & 0xBF);
689 (*output_pointer)[0] = (
unsigned char)((codepoint | first_byte_mark) & 0xFF);
693 (*output_pointer)[0] = (
unsigned char)(codepoint & 0x7F);
696 *output_pointer += utf8_length;
698 return sequence_length;
709 unsigned char *output_pointer = NULL;
710 unsigned char *output = NULL;
720 size_t allocation_length = 0;
721 size_t skipped_bytes = 0;
722 while (((
size_t)(input_end - input_buffer->
content) < input_buffer->
length) && (*input_end !=
'\"'))
725 if (input_end[0] ==
'\\')
727 if ((
size_t)(input_end + 1 - input_buffer->
content) >= input_buffer->
length)
737 if (((
size_t)(input_end - input_buffer->
content) >= input_buffer->
length) || (*input_end !=
'\"'))
743 allocation_length = (size_t) (input_end -
buffer_at_offset(input_buffer)) - skipped_bytes;
744 output = (
unsigned char*)input_buffer->
hooks.
allocate(allocation_length +
sizeof(
""));
751 output_pointer = output;
753 while (input_pointer < input_end)
755 if (*input_pointer !=
'\\')
757 *output_pointer++ = *input_pointer++;
762 unsigned char sequence_length = 2;
763 if ((input_end - input_pointer) < 1)
768 switch (input_pointer[1])
771 *output_pointer++ =
'\b';
774 *output_pointer++ =
'\f';
777 *output_pointer++ =
'\n';
780 *output_pointer++ =
'\r';
783 *output_pointer++ =
'\t';
788 *output_pointer++ = input_pointer[1];
794 if (sequence_length == 0)
804 input_pointer += sequence_length;
809 *output_pointer =
'\0';
814 input_buffer->
offset = (size_t) (input_end - input_buffer->
content);
822 input_buffer->
hooks.deallocate(output);
825 if (input_pointer != NULL)
827 input_buffer->
offset = (size_t)(input_pointer - input_buffer->
content);
836 const unsigned char *input_pointer = NULL;
837 unsigned char *output = NULL;
838 unsigned char *output_pointer = NULL;
839 size_t output_length = 0;
841 size_t escape_characters = 0;
843 if (output_buffer == NULL)
851 output =
ensure(output_buffer,
sizeof(
"\"\""));
856 strcpy((
char*)output,
"\"\"");
862 for (input_pointer = input; *input_pointer; input_pointer++)
864 switch (*input_pointer)
877 if (*input_pointer < 32)
880 escape_characters += 5;
885 output_length = (size_t)(input_pointer - input) + escape_characters;
887 output =
ensure(output_buffer, output_length +
sizeof(
"\"\""));
894 if (escape_characters == 0)
897 memcpy(output + 1, input, output_length);
898 output[output_length + 1] =
'\"';
899 output[output_length + 2] =
'\0';
905 output_pointer = output + 1;
907 for (input_pointer = input; *input_pointer !=
'\0'; (
void)input_pointer++, output_pointer++)
909 if ((*input_pointer > 31) && (*input_pointer !=
'\"') && (*input_pointer !=
'\\'))
912 *output_pointer = *input_pointer;
917 *output_pointer++ =
'\\';
918 switch (*input_pointer)
921 *output_pointer =
'\\';
924 *output_pointer =
'\"';
927 *output_pointer =
'b';
930 *output_pointer =
'f';
933 *output_pointer =
'n';
936 *output_pointer =
'r';
939 *output_pointer =
't';
943 sprintf((
char*)output_pointer,
"u%04x", *input_pointer);
949 output[output_length + 1] =
'\"';
950 output[output_length + 2] =
'\0';
972 if ((buffer == NULL) || (buffer->
content == NULL))
993 if ((buffer == NULL) || (buffer->
content == NULL) || (buffer->
offset != 0))
1013 global_error.
json = NULL;
1021 buffer.
content = (
const unsigned char*)value;
1022 buffer.
length = strlen((
const char*)value) +
sizeof(
"");
1039 if (require_null_terminated)
1047 if (return_parse_end)
1063 local_error.
json = (
const unsigned char*)value;
1070 else if (buffer.
length > 0)
1075 if (return_parse_end != NULL)
1077 *return_parse_end = (
const char*)local_error.
json + local_error.
position;
1080 global_error = local_error;
1089 return cJSON_ParseWithOpts(value, 0, 0);
1092 #define cjson_min(a, b) ((a < b) ? a : b) 1096 static const size_t default_buffer_size = 256;
1098 unsigned char *printed = NULL;
1100 memset(buffer, 0,
sizeof(buffer));
1103 buffer->
buffer = (
unsigned char*) hooks->
allocate(default_buffer_size);
1104 buffer->
length = default_buffer_size;
1106 buffer->
hooks = *hooks;
1108 if (buffer->
buffer == NULL) {
1122 if (printed == NULL) {
1129 if (printed == NULL) {
1134 printed[buffer->
offset] =
'\0';
1137 hooks->deallocate(buffer->
buffer);
1143 if (buffer->
buffer != NULL) {
1144 hooks->deallocate(buffer->
buffer);
1153 return (
char*)
print(item,
true, &global_hooks);
1158 return (
char*)
print(item,
false, &global_hooks);
1163 printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } };
1176 p.
length = (size_t)prebuffer;
1184 global_hooks.deallocate(p.
buffer);
1193 printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } };
1195 if ((len < 0) || (buf == NULL))
1200 p.
buffer = (
unsigned char*)buf;
1213 if ((input_buffer == NULL) || (input_buffer->
content == NULL))
1223 input_buffer->
offset += 4;
1230 input_buffer->
offset += 5;
1238 input_buffer->
offset += 4;
1268 unsigned char *output = NULL;
1270 if ((item == NULL) || (output_buffer == NULL))
1275 switch ((item->
type) & 0xFF)
1278 output =
ensure(output_buffer, 5);
1283 strcpy((
char*)output,
"null");
1287 output =
ensure(output_buffer, 6);
1292 strcpy((
char*)output,
"false");
1296 output =
ensure(output_buffer, 5);
1301 strcpy((
char*)output,
"true");
1309 size_t raw_length = 0;
1315 raw_length = strlen(item->
valuestring) +
sizeof(
"");
1316 output =
ensure(output_buffer, raw_length);
1343 cJSON *current_item = NULL;
1349 input_buffer->
depth++;
1379 if (new_item == NULL)
1388 current_item = head = new_item;
1393 current_item->
next = new_item;
1394 new_item->
prev = current_item;
1395 current_item = new_item;
1415 input_buffer->
depth--;
1436 unsigned char *output_pointer = NULL;
1440 if (output_buffer == NULL)
1447 output_pointer =
ensure(output_buffer, 1);
1448 if (output_pointer == NULL)
1453 *output_pointer =
'[';
1455 output_buffer->
depth++;
1457 while (current_element != NULL)
1464 if (current_element->
next)
1466 length = (size_t) (output_buffer->
format ? 2 : 1);
1467 output_pointer =
ensure(output_buffer, length + 1);
1468 if (output_pointer == NULL)
1472 *output_pointer++ =
',';
1473 if(output_buffer->
format)
1475 *output_pointer++ =
' ';
1477 *output_pointer =
'\0';
1480 current_element = current_element->
next;
1483 output_pointer =
ensure(output_buffer, 2);
1484 if (output_pointer == NULL)
1488 *output_pointer++ =
']';
1489 *output_pointer =
'\0';
1490 output_buffer->
depth--;
1499 cJSON *current_item = NULL;
1505 input_buffer->
depth++;
1533 if (new_item == NULL)
1542 current_item = head = new_item;
1547 current_item->
next = new_item;
1548 new_item->
prev = current_item;
1549 current_item = new_item;
1587 input_buffer->
depth--;
1607 unsigned char *output_pointer = NULL;
1611 if (output_buffer == NULL)
1617 length = (size_t) (output_buffer->
format ? 2 : 1);
1618 output_pointer =
ensure(output_buffer, length + 1);
1619 if (output_pointer == NULL)
1624 *output_pointer++ =
'{';
1625 output_buffer->
depth++;
1626 if (output_buffer->
format)
1628 *output_pointer++ =
'\n';
1632 while (current_item)
1634 if (output_buffer->
format)
1637 output_pointer =
ensure(output_buffer, output_buffer->
depth);
1638 if (output_pointer == NULL)
1642 for (i = 0; i < output_buffer->
depth; i++)
1644 *output_pointer++ =
'\t';
1656 length = (size_t) (output_buffer->
format ? 2 : 1);
1657 output_pointer =
ensure(output_buffer, length);
1658 if (output_pointer == NULL)
1662 *output_pointer++ =
':';
1663 if (output_buffer->
format)
1665 *output_pointer++ =
'\t';
1677 length = ((size_t)(output_buffer->
format ? 1 : 0) + (size_t)(current_item->
next ? 1 : 0));
1678 output_pointer =
ensure(output_buffer, length + 1);
1679 if (output_pointer == NULL)
1683 if (current_item->
next)
1685 *output_pointer++ =
',';
1688 if (output_buffer->
format)
1690 *output_pointer++ =
'\n';
1692 *output_pointer =
'\0';
1695 current_item = current_item->
next;
1698 output_pointer =
ensure(output_buffer, output_buffer->
format ? (output_buffer->
depth + 1) : 2);
1699 if (output_pointer == NULL)
1703 if (output_buffer->
format)
1706 for (i = 0; i < (output_buffer->
depth - 1); i++)
1708 *output_pointer++ =
'\t';
1711 *output_pointer++ =
'}';
1712 *output_pointer =
'\0';
1713 output_buffer->
depth--;
1721 cJSON *child = NULL;
1729 child = array->
child;
1731 while(child != NULL)
1734 child = child->
next;
1744 cJSON *current_child = NULL;
1751 current_child = array->
child;
1752 while ((current_child != NULL) && (index > 0))
1755 current_child = current_child->
next;
1758 return current_child;
1773 cJSON *current_element = NULL;
1775 if ((
object == NULL) || (name == NULL))
1780 current_element =
object->
child;
1783 while ((current_element != NULL) && (current_element->
string != NULL) && (strcmp(name, current_element->
string) != 0))
1785 current_element = current_element->
next;
1790 while ((current_element != NULL) && (
case_insensitive_strcmp((
const unsigned char*)name, (
const unsigned char*)(current_element->
string)) != 0))
1792 current_element = current_element->
next;
1796 if ((current_element == NULL) || (current_element->
string == NULL)) {
1800 return current_element;
1808 CJSON_PUBLIC(
cJSON *) cJSON_GetObjectItemCaseSensitive(
const cJSON *
const object,
const char *
const string)
1815 return cJSON_GetObjectItem(
object,
string) ? 1 : 0;
1828 cJSON *reference = NULL;
1835 if (reference == NULL)
1840 memcpy(reference, item,
sizeof(
cJSON));
1841 reference->
string = NULL;
1843 reference->
next = reference->
prev = NULL;
1849 cJSON *child = NULL;
1851 if ((item == NULL) || (array == NULL))
1856 child = array->
child;
1868 child = child->
next;
1882 #if defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))) 1883 #pragma GCC diagnostic push 1886 #pragma GCC diagnostic ignored "-Wcast-qual" 1893 #if defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))) 1894 #pragma GCC diagnostic pop 1900 char *new_key = NULL;
1903 if ((
object == NULL) || (
string == NULL) || (item == NULL))
1916 if (new_key == NULL)
1926 hooks->deallocate(item->
string);
1930 item->
type = new_type;
1965 if ((
object == NULL) || (
string == NULL))
1976 cJSON *null = cJSON_CreateNull();
1988 cJSON *true_item = cJSON_CreateTrue();
1994 cJSON_Delete(true_item);
2000 cJSON *false_item = cJSON_CreateFalse();
2006 cJSON_Delete(false_item);
2012 cJSON *bool_item = cJSON_CreateBool(
boolean);
2018 cJSON_Delete(bool_item);
2024 cJSON *number_item = cJSON_CreateNumber(number);
2030 cJSON_Delete(number_item);
2036 cJSON *string_item = cJSON_CreateString(
string);
2042 cJSON_Delete(string_item);
2048 cJSON *raw_item = cJSON_CreateRaw(raw);
2054 cJSON_Delete(raw_item);
2060 cJSON *object_item = cJSON_CreateObject();
2066 cJSON_Delete(object_item);
2072 cJSON *array = cJSON_CreateArray();
2078 cJSON_Delete(array);
2084 if ((parent == NULL) || (item == NULL))
2089 if (item->
prev != NULL)
2094 if (item->
next != NULL)
2100 if (item == parent->
child)
2119 return cJSON_DetachItemViaPointer(array,
get_array_item(array, (
size_t)which));
2124 cJSON_Delete(cJSON_DetachItemFromArray(array, which));
2129 cJSON *to_detach = cJSON_GetObjectItem(
object,
string);
2131 return cJSON_DetachItemViaPointer(
object, to_detach);
2136 cJSON *to_detach = cJSON_GetObjectItemCaseSensitive(
object,
string);
2138 return cJSON_DetachItemViaPointer(
object, to_detach);
2141 CJSON_PUBLIC(
void) cJSON_DeleteItemFromObject(
cJSON *
object,
const char *
string)
2143 cJSON_Delete(cJSON_DetachItemFromObject(
object,
string));
2146 CJSON_PUBLIC(
void) cJSON_DeleteItemFromObjectCaseSensitive(
cJSON *
object,
const char *
string)
2148 cJSON_Delete(cJSON_DetachItemFromObjectCaseSensitive(
object,
string));
2154 cJSON *after_inserted = NULL;
2162 if (after_inserted == NULL)
2168 newitem->
next = after_inserted;
2169 newitem->
prev = after_inserted->
prev;
2171 if (after_inserted == array->
child)
2183 if ((parent == NULL) || (replacement == NULL) || (item == NULL))
2188 if (replacement == item)
2196 if (replacement->
next != NULL)
2200 if (replacement->
prev != NULL)
2204 if (parent->
child == item)
2228 if ((replacement == NULL) || (
string == NULL))
2236 cJSON_free(replacement->
string);
2241 cJSON_ReplaceItemViaPointer(
object,
get_object_item(
object,
string, case_sensitive), replacement);
2251 CJSON_PUBLIC(
void) cJSON_ReplaceItemInObjectCaseSensitive(
cJSON *
object,
const char *
string,
cJSON *newitem)
2314 else if (num <= (
double)INT_MIN)
2424 if ((count < 0) || (numbers == NULL))
2429 a = cJSON_CreateArray();
2430 for(i = 0; a && (i < (size_t)count); i++)
2432 n = cJSON_CreateNumber(numbers[i]);
2459 if ((count < 0) || (numbers == NULL))
2464 a = cJSON_CreateArray();
2466 for(i = 0; a && (i < (size_t)count); i++)
2468 n = cJSON_CreateNumber((
double)numbers[i]);
2495 if ((count < 0) || (numbers == NULL))
2500 a = cJSON_CreateArray();
2502 for(i = 0;a && (i < (size_t)count); i++)
2504 n = cJSON_CreateNumber(numbers[i]);
2531 if ((count < 0) || (strings == NULL))
2536 a = cJSON_CreateArray();
2538 for (i = 0; a && (i < (size_t)count); i++)
2540 n = cJSON_CreateString(strings[i]);
2563 cJSON *newitem = NULL;
2564 cJSON *child = NULL;
2566 cJSON *newchild = NULL;
2605 child = item->
child;
2606 while (child != NULL)
2608 newchild = cJSON_Duplicate(child,
true);
2616 next->
next = newchild;
2617 newchild->
prev = next;
2623 newitem->
child = newchild;
2626 child = child->
next;
2632 if (newitem != NULL)
2634 cJSON_Delete(newitem);
2644 for (; (*input)[0] !=
'\0'; ++(*input))
2646 if ((*input)[0] ==
'\n') {
2657 for (; (*input)[0] !=
'\0'; ++(*input))
2659 if (((*input)[0] ==
'*') && ((*input)[1] ==
'/'))
2668 (*output)[0] = (*input)[0];
2673 for (; (*input)[0] !=
'\0'; (
void)++(*input), ++(*output)) {
2674 (*output)[0] = (*input)[0];
2676 if ((*input)[0] ==
'\"') {
2677 (*output)[0] =
'\"';
2681 }
else if (((*input)[0] ==
'\\') && ((*input)[1] ==
'\"')) {
2682 (*output)[1] = (*input)[1];
2698 while (json[0] !=
'\0')
2714 else if (json[1] ==
'*')
2839 if ((a == NULL) || (b == NULL) || ((a->
type & 0xFF) != (b->
type & 0xFF)) || cJSON_IsInvalid(a))
2845 switch (a->
type & 0xFF)
2867 switch (a->
type & 0xFF)
2900 for (; (a_element != NULL) && (b_element != NULL);)
2902 if (!cJSON_Compare(a_element, b_element, case_sensitive))
2907 a_element = a_element->
next;
2908 b_element = b_element->
next;
2912 if (a_element != b_element) {
2921 cJSON *a_element = NULL;
2922 cJSON *b_element = NULL;
2927 if (b_element == NULL)
2932 if (!cJSON_Compare(a_element, b_element, case_sensitive))
2943 if (a_element == NULL)
2948 if (!cJSON_Compare(b_element, a_element, case_sensitive))
2964 return global_hooks.
allocate(size);
2969 global_hooks.deallocate(
object);
const char cJSON_bool require_null_terminated
const char ** return_parse_end
static unsigned parse_hex4(const unsigned char *const input)
void *CJSON_CDECL * allocate(size_t size)
#define CJSON_NESTING_LIMIT
void *CJSON_CDECL * reallocate(void *pointer, size_t size)
const char *const const double number
#define CJSON_VERSION_PATCH
static cJSON_bool parse_value(cJSON *const item, parse_buffer *const input_buffer)
static void minify_string(char **input, char **output)
const char *const const char *const raw
static cJSON_bool parse_object(cJSON *const item, parse_buffer *const input_buffer)
const char *const const char *const const cJSON *const value
static cJSON * get_object_item(const cJSON *const object, const char *const name, const cJSON_bool case_sensitive)
static cJSON_bool print_number(const cJSON *const item, printbuffer *const output_buffer)
static cJSON_bool print_string_ptr(const unsigned char *const input, printbuffer *const output_buffer)
static int case_insensitive_strcmp(const unsigned char *string1, const unsigned char *string2)
char const int const cJSON_bool format
struct internal_hooks internal_hooks
static parse_buffer * skip_utf8_bom(parse_buffer *const buffer)
static cJSON_bool print_array(const cJSON *const item, printbuffer *const output_buffer)
#define buffer_at_offset(buffer)
static unsigned char * cJSON_strdup(const unsigned char *string, const internal_hooks *const hooks)
static cJSON_bool parse_number(cJSON *const item, parse_buffer *const input_buffer)
#define can_access_at_index(buffer, index)
#define CJSON_VERSION_MINOR
static cJSON_bool add_item_to_array(cJSON *array, cJSON *item)
switch_byte_t switch_byte_t * buf
static unsigned char get_decimal_point(void)
static cJSON * get_array_item(const cJSON *array, size_t index)
void(CJSON_CDECL *deallocate)(void *pointer)
static void suffix_object(cJSON *prev, cJSON *item)
#define cannot_access_at_index(buffer, index)
static void skip_oneline_comment(char **input)
static unsigned char * ensure(printbuffer *const p, size_t needed)
const cJSON *const const cJSON_bool case_sensitive
static unsigned char * print(const cJSON *const item, cJSON_bool format, const internal_hooks *const hooks)
CJSON_PUBLIC(const char *)
static void skip_multiline_comment(char **input)
static error global_error
static unsigned char utf16_literal_to_utf8(const unsigned char *const input_pointer, const unsigned char *const input_end, unsigned char **output_pointer)
#define static_strlen(string_literal)
static void update_offset(printbuffer *const buffer)
void *CJSON_CDECL * malloc_fn(size_t sz)
static parse_buffer * buffer_skip_whitespace(parse_buffer *const buffer)
static cJSON * cJSON_New_Item(const internal_hooks *const hooks)
static cJSON_bool parse_string(cJSON *const item, parse_buffer *const input_buffer)
cJSON *const cJSON * replacement
static cJSON_bool replace_item_in_object(cJSON *object, const char *string, cJSON *replacement, cJSON_bool case_sensitive)
#define cJSON_StringIsConst
static void * cast_away_const(const void *string)
static cJSON_bool print_object(const cJSON *const item, printbuffer *const output_buffer)
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)
static cJSON_bool print_value(const cJSON *const item, printbuffer *const output_buffer)
static cJSON_bool print_string(const cJSON *const item, printbuffer *const p)
#define CJSON_VERSION_MAJOR
#define can_read(buffer, size)
static cJSON * create_reference(const cJSON *item, const internal_hooks *const hooks)
static cJSON_bool parse_array(cJSON *const item, parse_buffer *const input_buffer)
const unsigned char * json
const unsigned char * content
static internal_hooks global_hooks
#define cJSON_ArrayForEach(element, array)
#define cJSON_IsReference