RTS API Documentation
1.10.11
|
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <limits.h>
#include <ctype.h>
#include "switch_cJSON.h"
Go to the source code of this file.
Data Structures | |
struct | error |
struct | internal_hooks |
struct | parse_buffer |
struct | printbuffer |
Macros | |
#define | true ((cJSON_bool)1) |
#define | false ((cJSON_bool)0) |
#define | internal_malloc malloc |
#define | internal_free free |
#define | internal_realloc realloc |
#define | static_strlen(string_literal) (sizeof(string_literal) - sizeof("")) |
#define | can_read(buffer, size) ((buffer != NULL) && (((buffer)->offset + size) <= (buffer)->length)) |
#define | can_access_at_index(buffer, index) ((buffer != NULL) && (((buffer)->offset + index) < (buffer)->length)) |
#define | cannot_access_at_index(buffer, index) (!can_access_at_index(buffer, index)) |
#define | buffer_at_offset(buffer) ((buffer)->content + (buffer)->offset) |
#define | cjson_min(a, b) ((a < b) ? a : b) |
Typedefs | |
typedef struct internal_hooks | internal_hooks |
Functions | |
CJSON_PUBLIC (const char *) | |
CJSON_PUBLIC (char *) | |
static int | case_insensitive_strcmp (const unsigned char *string1, const unsigned char *string2) |
static unsigned char * | cJSON_strdup (const unsigned char *string, const internal_hooks *const hooks) |
CJSON_PUBLIC (void) | |
static cJSON * | cJSON_New_Item (const internal_hooks *const hooks) |
static unsigned char | get_decimal_point (void) |
static cJSON_bool | parse_number (cJSON *const item, parse_buffer *const input_buffer) |
CJSON_PUBLIC (double) | |
static unsigned char * | ensure (printbuffer *const p, size_t needed) |
static void | update_offset (printbuffer *const buffer) |
static cJSON_bool | print_number (const cJSON *const item, printbuffer *const output_buffer) |
static unsigned | parse_hex4 (const unsigned char *const input) |
static unsigned char | utf16_literal_to_utf8 (const unsigned char *const input_pointer, const unsigned char *const input_end, unsigned char **output_pointer) |
static cJSON_bool | parse_string (cJSON *const item, parse_buffer *const input_buffer) |
static cJSON_bool | print_string_ptr (const unsigned char *const input, printbuffer *const output_buffer) |
static cJSON_bool | print_string (const cJSON *const item, printbuffer *const p) |
static cJSON_bool | parse_value (cJSON *const item, parse_buffer *const input_buffer) |
static cJSON_bool | print_value (const cJSON *const item, printbuffer *const output_buffer) |
static cJSON_bool | parse_array (cJSON *const item, parse_buffer *const input_buffer) |
static cJSON_bool | print_array (const cJSON *const item, printbuffer *const output_buffer) |
static cJSON_bool | parse_object (cJSON *const item, parse_buffer *const input_buffer) |
static cJSON_bool | print_object (const cJSON *const item, printbuffer *const output_buffer) |
static parse_buffer * | buffer_skip_whitespace (parse_buffer *const buffer) |
static parse_buffer * | skip_utf8_bom (parse_buffer *const buffer) |
CJSON_PUBLIC (cJSON *) | |
static unsigned char * | print (const cJSON *const item, cJSON_bool format, const internal_hooks *const hooks) |
CJSON_PUBLIC (cJSON_bool) | |
static cJSON * | get_array_item (const cJSON *array, size_t index) |
static cJSON * | get_object_item (const cJSON *const object, const char *const name, const cJSON_bool case_sensitive) |
static void | suffix_object (cJSON *prev, cJSON *item) |
static cJSON * | create_reference (const cJSON *item, const internal_hooks *const hooks) |
static cJSON_bool | add_item_to_array (cJSON *array, cJSON *item) |
static void * | cast_away_const (const void *string) |
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 | replace_item_in_object (cJSON *object, const char *string, cJSON *replacement, cJSON_bool case_sensitive) |
static void | skip_oneline_comment (char **input) |
static void | skip_multiline_comment (char **input) |
static void | minify_string (char **input, char **output) |
CJSON_PUBLIC (void *) | |
Variables | |
static error | global_error = { NULL, 0 } |
static internal_hooks | global_hooks = { internal_malloc, internal_free, internal_realloc } |
Definition at line 270 of file cJSON.c.
Referenced by buffer_skip_whitespace(), CJSON_PUBLIC(), parse_array(), parse_number(), parse_object(), parse_string(), parse_value(), and skip_utf8_bom().
#define can_access_at_index | ( | buffer, | |
index | |||
) | ((buffer != NULL) && (((buffer)->offset + index) < (buffer)->length)) |
Definition at line 267 of file cJSON.c.
Referenced by buffer_skip_whitespace(), parse_array(), parse_number(), parse_object(), parse_value(), and skip_utf8_bom().
#define can_read | ( | buffer, | |
size | |||
) | ((buffer != NULL) && (((buffer)->offset + size) <= (buffer)->length)) |
Definition at line 265 of file cJSON.c.
Referenced by parse_value().
#define cannot_access_at_index | ( | buffer, | |
index | |||
) | (!can_access_at_index(buffer, index)) |
Definition at line 268 of file cJSON.c.
Referenced by parse_array(), and parse_object().
#define false ((cJSON_bool)0) |
#define static_strlen | ( | string_literal | ) | (sizeof(string_literal) - sizeof("")) |
Definition at line 152 of file cJSON.c.
Referenced by minify_string(), skip_multiline_comment(), and skip_oneline_comment().
#define true ((cJSON_bool)1) |
Definition at line 61 of file cJSON.c.
Referenced by Event::addBody(), Event::addHeader(), Event::delHeader(), and running().
typedef struct internal_hooks internal_hooks |
|
static |
Definition at line 1847 of file cJSON.c.
References cJSON::child, CJSON_PUBLIC(), item, cJSON::next, and suffix_object().
Referenced by add_item_to_object().
|
static |
Definition at line 1898 of file cJSON.c.
References add_item_to_array(), cast_away_const(), cJSON::child, cJSON_Invalid, CJSON_PUBLIC(), cJSON_strdup(), cJSON_StringIsConst, create_reference(), get_array_item(), item, name, newitem, cJSON::next, number, cJSON::prev, raw, replacement, cJSON::string, string, cJSON::type, internal_hooks::void(), and which.
|
static |
Definition at line 970 of file cJSON.c.
References buffer, buffer_at_offset, can_access_at_index, parse_buffer::content, parse_buffer::length, and parse_buffer::offset.
Referenced by CJSON_PUBLIC(), parse_array(), and parse_object().
|
static |
|
static |
Definition at line 1889 of file cJSON.c.
References string.
Referenced by add_item_to_object(), and replace_item_in_object().
|
static |
Definition at line 209 of file cJSON.c.
References internal_hooks::allocate(), cJSON::child, cJSON_IsReference, CJSON_PUBLIC(), cJSON_StringIsConst, item, memset(), cJSON::next, cJSON::string, cJSON::type, and cJSON::valuestring.
Referenced by CJSON_PUBLIC(), create_reference(), parse_array(), parse_object(), and replace_item_in_object().
CJSON_PUBLIC | ( | const char * | ) |
Definition at line 74 of file cJSON.c.
References error::json, and error::position.
Referenced by add_item_to_array(), add_item_to_object(), cJSON_New_Item(), CJSON_PUBLIC(), get_array_item(), get_object_item(), minify_string(), print(), print_object(), and replace_item_in_object().
CJSON_PUBLIC | ( | char * | ) |
Definition at line 79 of file cJSON.c.
References CJSON_PUBLIC(), CJSON_VERSION_MAJOR, CJSON_VERSION_MINOR, CJSON_VERSION_PATCH, and cJSON::valuestring.
CJSON_PUBLIC | ( | void | ) |
Definition at line 177 of file cJSON.c.
References internal_hooks::allocate(), cJSON_Hooks::malloc_fn(), and internal_hooks::reallocate().
CJSON_PUBLIC | ( | cJSON * | ) |
Definition at line 1007 of file cJSON.c.
References buffer, buffer_at_offset, buffer_skip_whitespace(), cJSON_New_Item(), CJSON_PUBLIC(), parse_buffer::content, fail, global_hooks, parse_buffer::hooks, item, error::json, parse_buffer::length, parse_buffer::offset, parse_value(), error::position, skip_utf8_bom(), and value.
CJSON_PUBLIC | ( | cJSON_bool | ) |
Definition at line 1191 of file cJSON.c.
References printbuffer::buffer, fmt, printbuffer::format, global_hooks, printbuffer::hooks, printbuffer::length, printbuffer::noalloc, printbuffer::offset, and print_value().
CJSON_PUBLIC | ( | void * | ) |
Definition at line 2962 of file cJSON.c.
References internal_hooks::allocate(), and CJSON_PUBLIC().
|
static |
Definition at line 156 of file cJSON.c.
References internal_hooks::allocate(), and length.
Referenced by add_item_to_object(), and replace_item_in_object().
|
static |
Definition at line 1826 of file cJSON.c.
References cJSON_IsReference, cJSON_New_Item(), cJSON::next, cJSON::prev, cJSON::string, and cJSON::type.
Referenced by add_item_to_object().
|
static |
Definition at line 380 of file cJSON.c.
References internal_hooks::allocate(), printbuffer::buffer, printbuffer::hooks, length, printbuffer::length, printbuffer::noalloc, printbuffer::offset, and internal_hooks::reallocate().
Referenced by print_array(), print_number(), print_object(), print_string_ptr(), and print_value().
Definition at line 1742 of file cJSON.c.
References cJSON::child, CJSON_PUBLIC(), index, and cJSON::next.
Referenced by add_item_to_object().
|
static |
Definition at line 245 of file cJSON.c.
Referenced by parse_number(), and print_number().
|
static |
Definition at line 1771 of file cJSON.c.
References case_insensitive_strcmp(), cJSON::child, CJSON_PUBLIC(), cJSON::next, and cJSON::string.
Referenced by minify_string(), and replace_item_in_object().
|
static |
Definition at line 2667 of file cJSON.c.
References b, case_sensitive, cJSON::child, cJSON_Array, cJSON_ArrayForEach, cJSON_False, cJSON_Invalid, cJSON_NULL, cJSON_Number, cJSON_Object, CJSON_PUBLIC(), cJSON_Raw, cJSON_String, cJSON_True, get_object_item(), cJSON::next, skip_multiline_comment(), skip_oneline_comment(), static_strlen, cJSON::string, cJSON::type, cJSON::valuedouble, cJSON::valuestring, and internal_hooks::void().
|
static |
Definition at line 1340 of file cJSON.c.
References buffer_at_offset, buffer_skip_whitespace(), can_access_at_index, cannot_access_at_index, cJSON::child, cJSON_Array, CJSON_NESTING_LIMIT, cJSON_New_Item(), parse_buffer::depth, fail, parse_buffer::hooks, cJSON::next, parse_buffer::offset, parse_value(), cJSON::prev, and cJSON::type.
Referenced by parse_value(), and print_string().
|
static |
|
static |
Definition at line 273 of file cJSON.c.
References buffer_at_offset, can_access_at_index, cJSON_Number, parse_buffer::content, get_decimal_point(), number, parse_buffer::offset, cJSON::type, cJSON::valuedouble, and cJSON::valueint.
Referenced by parse_value().
|
static |
Definition at line 1496 of file cJSON.c.
References buffer_at_offset, buffer_skip_whitespace(), can_access_at_index, cannot_access_at_index, cJSON::child, CJSON_NESTING_LIMIT, cJSON_New_Item(), cJSON_Object, parse_buffer::depth, fail, parse_buffer::hooks, cJSON::next, parse_buffer::offset, parse_string(), parse_value(), cJSON::prev, cJSON::string, cJSON::type, and cJSON::valuestring.
Referenced by parse_value(), and print_string().
|
static |
Definition at line 705 of file cJSON.c.
References internal_hooks::allocate(), buffer_at_offset, cJSON_String, parse_buffer::content, fail, parse_buffer::hooks, parse_buffer::length, parse_buffer::offset, cJSON::type, utf16_literal_to_utf8(), and cJSON::valuestring.
Referenced by parse_object(), and parse_value().
|
static |
Definition at line 1211 of file cJSON.c.
References buffer_at_offset, can_access_at_index, can_read, cJSON_False, cJSON_NULL, cJSON_True, parse_buffer::content, parse_buffer::offset, parse_array(), parse_number(), parse_object(), parse_string(), cJSON::type, and cJSON::valueint.
Referenced by CJSON_PUBLIC(), parse_array(), parse_object(), and print_string().
|
static |
Definition at line 1094 of file cJSON.c.
References internal_hooks::allocate(), buffer, printbuffer::buffer, cjson_min, CJSON_PUBLIC(), fail, fmt, format, printbuffer::format, global_hooks, printbuffer::hooks, printbuffer::length, memset(), printbuffer::noalloc, printbuffer::offset, prebuffer, print_value(), internal_hooks::reallocate(), and update_offset().
|
static |
Definition at line 1434 of file cJSON.c.
References cJSON::child, printbuffer::depth, ensure(), printbuffer::format, length, cJSON::next, printbuffer::offset, print_value(), and update_offset().
Referenced by print_string(), and print_value().
|
static |
Definition at line 481 of file cJSON.c.
References ensure(), get_decimal_point(), length, printbuffer::offset, and cJSON::valuedouble.
Referenced by print_value().
|
static |
Definition at line 1605 of file cJSON.c.
References cJSON::child, CJSON_PUBLIC(), printbuffer::depth, ensure(), printbuffer::format, length, cJSON::next, printbuffer::offset, print_string_ptr(), print_value(), cJSON::string, and update_offset().
Referenced by print_string(), and print_value().
|
static |
Definition at line 956 of file cJSON.c.
References parse_array(), parse_object(), parse_value(), print_array(), print_object(), print_string_ptr(), print_value(), and cJSON::valuestring.
Referenced by print_value().
|
static |
Definition at line 834 of file cJSON.c.
References ensure(), and internal_hooks::void().
Referenced by print_object(), and print_string().
|
static |
Definition at line 1266 of file cJSON.c.
References cJSON_Array, cJSON_False, cJSON_NULL, cJSON_Number, cJSON_Object, cJSON_Raw, cJSON_String, cJSON_True, ensure(), print_array(), print_number(), print_object(), print_string(), cJSON::type, and cJSON::valuestring.
Referenced by CJSON_PUBLIC(), print(), print_array(), print_object(), and print_string().
|
static |
Definition at line 2226 of file cJSON.c.
References b, cast_away_const(), cJSON::child, cJSON_Array, cJSON_False, cJSON_IsReference, cJSON_New_Item(), cJSON_NULL, cJSON_Number, cJSON_Object, CJSON_PUBLIC(), cJSON_Raw, cJSON_strdup(), cJSON_String, cJSON_StringIsConst, cJSON_True, count, fail, get_object_item(), global_hooks, item, newitem, cJSON::next, cJSON::prev, raw, recurse, cJSON::string, string, suffix_object(), cJSON::type, cJSON::valuedouble, cJSON::valueint, and cJSON::valuestring.
|
static |
|
static |
|
static |
Definition at line 991 of file cJSON.c.
References buffer, buffer_at_offset, can_access_at_index, parse_buffer::content, and parse_buffer::offset.
Referenced by CJSON_PUBLIC().
Definition at line 1819 of file cJSON.c.
References item, cJSON::next, and cJSON::prev.
Referenced by add_item_to_array(), and replace_item_in_object().
|
static |
Definition at line 468 of file cJSON.c.
References printbuffer::buffer, and printbuffer::offset.
Referenced by print(), print_array(), and print_object().
|
static |
Definition at line 584 of file cJSON.c.
References fail, and parse_hex4().
Referenced by parse_string().
|
static |
Definition at line 154 of file cJSON.c.
Referenced by CJSON_PUBLIC(), print(), and replace_item_in_object().