#include <string.h>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <limits.h>
#include <ctype.h>
#include "cJSON.h"
Go to the source code of this file.
#define internal_malloc malloc |
#define internal_free free |
#define internal_realloc realloc |
#define static_strlen |
( |
|
string_literal | ) |
(sizeof(string_literal) - sizeof("")) |
#define cjson_min |
( |
|
a, |
|
|
|
b |
|
) |
| ((a < b) ? a : b) |
CJSON_PUBLIC |
( |
const char * |
| ) |
|
Definition at line 77 of file cJSON.c.
79 return (
const char*) (global_error.
json + global_error.
position);
const unsigned char * json
Definition at line 82 of file cJSON.c.
83 if (!cJSON_IsString(
item)) {
Definition at line 180 of file cJSON.c.
186 global_hooks.deallocate = free;
192 if (hooks->malloc_fn != NULL)
194 global_hooks.
allocate = hooks->malloc_fn;
197 global_hooks.deallocate = free;
198 if (hooks->free_fn != NULL)
200 global_hooks.deallocate = hooks->free_fn;
205 if ((global_hooks.
allocate == malloc) && (global_hooks.deallocate == free))
void *CJSON_CDECL * reallocate(void *pointer, size_t size)
void *CJSON_CDECL * allocate(size_t size)
Definition at line 353 of file cJSON.c.
357 object->valueint = INT_MAX;
359 else if (
number <= (
double)INT_MIN)
361 object->valueint = INT_MIN;
365 object->valueint = (int)
number;
368 return object->valuedouble =
number;
const char *const const double number
Definition at line 1010 of file cJSON.c.
1016 global_error.
json = NULL;
1024 buffer.
content = (
const unsigned char*)value;
1025 buffer.
length = strlen((
const char*)value) +
sizeof(
"");
1027 buffer.
hooks = global_hooks;
1029 item = cJSON_New_Item(&global_hooks);
1035 if (!parse_value(item, buffer_skip_whitespace(skip_utf8_bom(&buffer))))
1044 buffer_skip_whitespace(&buffer);
1066 local_error.
json = (
const unsigned char*)value;
1073 else if (buffer.
length > 0)
1083 global_error = local_error;
const unsigned char * content
const char cJSON_bool require_null_terminated
const unsigned char * json
const char ** return_parse_end
#define buffer_at_offset(buffer)
Definition at line 1202 of file cJSON.c.
1204 printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } };
1206 if ((len < 0) || (buf == NULL))
1211 p.
buffer = (
unsigned char*)buf;
1216 p.
hooks = global_hooks;
1218 return print_value(
item, &p);
Definition at line 2963 of file cJSON.c.
2965 return global_hooks.
allocate(size);
void *CJSON_CDECL * allocate(size_t size)