FreeSWITCH API Documentation
1.7.0
|
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <limits.h>
#include <ctype.h>
#include "switch.h"
#include "switch_json.h"
#include <float.h>
Go to the source code of this file.
Macros | |
#define | is_hexdigit(c) ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')) |
Functions | |
const char * | cJSON_GetErrorPtr () |
static int | cJSON_strcasecmp (const char *s1, const char *s2) |
static void * | glue_malloc (size_t theSize) |
static void | glue_free (void *thePtr) |
static char * | cJSON_strdup (const char *str) |
void | cJSON_InitHooks (cJSON_Hooks *hooks) |
static cJSON * | cJSON_New_Item () |
void | cJSON_Delete (cJSON *c) |
static const char * | parse_number (cJSON *item, const char *num) |
static char * | print_number (cJSON *item) |
static int | scan_unicode (const char *ptr, unsigned int *uc) |
static const char * | parse_string (cJSON *item, const char *str) |
static char * | print_string_ptr (const char *str) |
static char * | print_string (cJSON *item) |
static const char * | parse_value (cJSON *item, const char *value) |
static char * | print_value (cJSON *item, int depth, int fmt) |
static const char * | parse_array (cJSON *item, const char *value) |
static char * | print_array (cJSON *item, int depth, int fmt) |
static const char * | parse_object (cJSON *item, const char *value) |
static char * | print_object (cJSON *item, int depth, int fmt) |
static const char * | skip (const char *in) |
cJSON * | cJSON_Parse (const char *value) |
char * | cJSON_Print (cJSON *item) |
char * | cJSON_PrintUnformatted (cJSON *item) |
int | cJSON_GetArraySize (cJSON *array) |
cJSON * | cJSON_GetArrayItem (cJSON *array, int item) |
cJSON * | cJSON_GetObjectItem (const cJSON *object, const char *string) |
const char * | cJSON_GetObjectCstr (const cJSON *object, const char *string) |
static void | suffix_object (cJSON *prev, cJSON *item) |
static cJSON * | create_reference (cJSON *item) |
void | cJSON_AddItemToArray (cJSON *array, cJSON *item) |
void | cJSON_AddItemToObject (cJSON *object, const char *string, cJSON *item) |
void | cJSON_AddItemReferenceToArray (cJSON *array, cJSON *item) |
void | cJSON_AddItemReferenceToObject (cJSON *object, const char *string, cJSON *item) |
cJSON * | cJSON_DetachItemFromArray (cJSON *array, int which) |
void | cJSON_DeleteItemFromArray (cJSON *array, int which) |
cJSON * | cJSON_DetachItemFromObject (cJSON *object, const char *string) |
void | cJSON_DeleteItemFromObject (cJSON *object, const char *string) |
void | cJSON_ReplaceItemInArray (cJSON *array, int which, cJSON *newitem) |
void | cJSON_ReplaceItemInObject (cJSON *object, const char *string, cJSON *newitem) |
cJSON * | cJSON_CreateNull () |
cJSON * | cJSON_CreateTrue () |
cJSON * | cJSON_CreateFalse () |
cJSON * | cJSON_CreateBool (int b) |
cJSON * | cJSON_CreateNumber (double num) |
cJSON * | cJSON_CreateString (const char *string) |
cJSON * | cJSON_CreateArray () |
cJSON * | cJSON_CreateObject () |
cJSON * | cJSON_CreateIntArray (int *numbers, int count) |
cJSON * | cJSON_CreateFloatArray (float *numbers, int count) |
cJSON * | cJSON_CreateDoubleArray (double *numbers, int count) |
cJSON * | cJSON_CreateStringArray (const char **strings, int count) |
cJSON * | cJSON_Duplicate (cJSON *item, int recurse) |
cJSON * | cJSON_CreateStringPrintf (const char *fmt,...) |
Variables | |
static const char * | ep |
static void *(* | cJSON_malloc )(size_t sz) = glue_malloc |
static void(* | cJSON_free )(void *ptr) = glue_free |
static const unsigned char | firstByteMark [7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC } |
#define is_hexdigit | ( | c | ) | ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')) |
Definition at line 153 of file switch_json.c.
Referenced by scan_unicode().
Definition at line 521 of file switch_json.c.
References cJSON_AddItemToArray(), and create_reference().
Definition at line 522 of file switch_json.c.
References cJSON_AddItemToObject(), and create_reference().
Definition at line 519 of file switch_json.c.
References cJSON::child, cJSON::next, and suffix_object().
Referenced by cJSON_AddItemReferenceToArray(), cJSON_AddItemToObject(), switch_event_serialize_json_obj(), switch_ivr_generate_json_cdr(), switch_ivr_set_json_call_stats(), and switch_live_array_bootstrap().
Definition at line 520 of file switch_json.c.
References cJSON_AddItemToArray(), cJSON_free, and cJSON_strdup().
Referenced by cJSON_AddItemReferenceToObject(), json_add_child_array(), json_add_child_obj(), json_add_child_string(), switch_event_serialize_json_obj(), switch_ivr_generate_json_cdr(), switch_ivr_set_json_call_stats(), switch_ivr_set_json_chan_vars(), switch_ivr_set_json_profile_data(), switch_json_api_execute(), switch_live_array_add(), switch_live_array_bootstrap(), switch_live_array_clear(), switch_live_array_del(), and switch_live_array_visible().
cJSON* cJSON_CreateArray | ( | void | ) |
Definition at line 543 of file switch_json.c.
References cJSON_Array, cJSON_New_Item(), and cJSON::type.
Referenced by cJSON_CreateDoubleArray(), cJSON_CreateFloatArray(), cJSON_CreateIntArray(), cJSON_CreateStringArray(), json_add_child_array(), switch_event_serialize_json_obj(), switch_ivr_generate_json_cdr(), switch_ivr_set_json_call_stats(), and switch_live_array_bootstrap().
cJSON* cJSON_CreateBool | ( | int | b | ) |
Definition at line 540 of file switch_json.c.
References cJSON_False, cJSON_New_Item(), cJSON_True, and cJSON::type.
cJSON* cJSON_CreateDoubleArray | ( | double * | numbers, |
int | count | ||
) |
Definition at line 549 of file switch_json.c.
References cJSON_CreateArray(), cJSON_CreateNumber(), and suffix_object().
cJSON* cJSON_CreateFalse | ( | void | ) |
Definition at line 539 of file switch_json.c.
References cJSON_False, cJSON_New_Item(), and cJSON::type.
cJSON* cJSON_CreateFloatArray | ( | float * | numbers, |
int | count | ||
) |
Definition at line 548 of file switch_json.c.
References cJSON_CreateArray(), cJSON_CreateNumber(), and suffix_object().
cJSON* cJSON_CreateIntArray | ( | int * | numbers, |
int | count | ||
) |
Definition at line 547 of file switch_json.c.
References cJSON_CreateArray(), cJSON_CreateNumber(), and suffix_object().
cJSON* cJSON_CreateNull | ( | void | ) |
Definition at line 537 of file switch_json.c.
References cJSON_New_Item(), cJSON_NULL, and cJSON::type.
Referenced by switch_json_api_execute().
cJSON* cJSON_CreateNumber | ( | double | num | ) |
Definition at line 541 of file switch_json.c.
References cJSON_New_Item(), cJSON_Number, cJSON::type, cJSON::valuedouble, and cJSON::valueint.
Referenced by cJSON_CreateDoubleArray(), cJSON_CreateFloatArray(), cJSON_CreateIntArray(), switch_ivr_set_json_call_stats(), switch_live_array_add(), switch_live_array_bootstrap(), switch_live_array_clear(), switch_live_array_del(), and switch_live_array_visible().
cJSON* cJSON_CreateObject | ( | void | ) |
Definition at line 544 of file switch_json.c.
References cJSON_New_Item(), cJSON_Object, and cJSON::type.
Referenced by json_add_child_obj(), switch_event_serialize_json_obj(), switch_ivr_generate_json_cdr(), switch_ivr_set_json_call_stats(), switch_live_array_add(), switch_live_array_bootstrap(), switch_live_array_clear(), switch_live_array_del(), and switch_live_array_visible().
cJSON* cJSON_CreateString | ( | const char * | string | ) |
Definition at line 542 of file switch_json.c.
References cJSON_New_Item(), cJSON_strdup(), cJSON_String, cJSON::type, and cJSON::valuestring.
Referenced by cJSON_CreateStringArray(), json_add_child_string(), la_broadcast(), switch_event_serialize_json_obj(), switch_ivr_generate_json_cdr(), switch_ivr_set_json_chan_vars(), switch_ivr_set_json_profile_data(), switch_json_api_execute(), switch_live_array_add(), switch_live_array_bootstrap(), switch_live_array_clear(), switch_live_array_del(), and switch_live_array_visible().
cJSON* cJSON_CreateStringArray | ( | const char ** | strings, |
int | count | ||
) |
Definition at line 550 of file switch_json.c.
References cJSON_CreateArray(), cJSON_CreateString(), and suffix_object().
cJSON* cJSON_CreateStringPrintf | ( | const char * | fmt, |
... | |||
) |
Definition at line 580 of file switch_json.c.
References cJSON_New_Item(), cJSON_String, switch_vmprintf(), cJSON::type, and cJSON::valuestring.
cJSON* cJSON_CreateTrue | ( | void | ) |
Definition at line 538 of file switch_json.c.
References cJSON_New_Item(), cJSON_True, and cJSON::type.
void cJSON_Delete | ( | cJSON * | c | ) |
Definition at line 93 of file switch_json.c.
References cJSON_free, cJSON_IsReference, cJSON::next, and switch_jb_node_s::next.
Referenced by cJSON_DeleteItemFromArray(), cJSON_DeleteItemFromObject(), cJSON_Duplicate(), cJSON_Parse(), cJSON_ReplaceItemInArray(), destroy_ecd(), switch_event_channel_broadcast(), switch_event_create_json(), switch_event_serialize_json(), switch_ivr_multi_threaded_bridge(), switch_ivr_originate(), switch_live_array_add(), and switch_live_array_clear().
void cJSON_DeleteItemFromArray | ( | cJSON * | array, |
int | which | ||
) |
Definition at line 526 of file switch_json.c.
References cJSON_Delete(), and cJSON_DetachItemFromArray().
void cJSON_DeleteItemFromObject | ( | cJSON * | object, |
const char * | string | ||
) |
Definition at line 528 of file switch_json.c.
References cJSON_Delete(), and cJSON_DetachItemFromObject().
Definition at line 524 of file switch_json.c.
References cJSON::child, cJSON::next, and cJSON::prev.
Referenced by cJSON_DeleteItemFromArray(), and cJSON_DetachItemFromObject().
Definition at line 527 of file switch_json.c.
References cJSON::child, cJSON_DetachItemFromArray(), cJSON_strcasecmp(), cJSON::next, and cJSON::string.
Referenced by cJSON_DeleteItemFromObject().
Definition at line 553 of file switch_json.c.
References cJSON::child, cJSON_Delete(), cJSON_IsReference, cJSON_New_Item(), cJSON_strdup(), if(), cJSON::next, cJSON::prev, cJSON::string, cJSON::type, cJSON::valuedouble, cJSON::valueint, and cJSON::valuestring.
Referenced by la_broadcast(), switch_live_array_add(), switch_live_array_bootstrap(), switch_live_array_get(), and switch_live_array_get_idx().
Definition at line 497 of file switch_json.c.
References cJSON::child, and cJSON::next.
Referenced by switch_event_create_json().
int cJSON_GetArraySize | ( | cJSON * | array | ) |
Definition at line 496 of file switch_json.c.
References cJSON::child, and cJSON::next.
Referenced by switch_event_create_json().
const char* cJSON_GetErrorPtr | ( | void | ) |
const char* cJSON_GetObjectCstr | ( | const cJSON * | object, |
const char * | string | ||
) |
Definition at line 501 of file switch_json.c.
References cJSON_GetObjectItem(), cJSON_String, cJSON::type, and cJSON::valuestring.
Referenced by switch_live_array_parse_json().
Definition at line 498 of file switch_json.c.
References cJSON::child, cJSON_strcasecmp(), cJSON::next, and cJSON::string.
Referenced by cJSON_GetObjectCstr(), la_broadcast(), switch_json_api_execute(), and switch_live_array_parse_json().
void cJSON_InitHooks | ( | cJSON_Hooks * | hooks | ) |
|
static |
Definition at line 85 of file switch_json.c.
References cJSON_malloc, and memset().
Referenced by cJSON_CreateArray(), cJSON_CreateBool(), cJSON_CreateFalse(), cJSON_CreateNull(), cJSON_CreateNumber(), cJSON_CreateObject(), cJSON_CreateString(), cJSON_CreateStringPrintf(), cJSON_CreateTrue(), cJSON_Duplicate(), cJSON_Parse(), create_reference(), parse_array(), and parse_object().
cJSON* cJSON_Parse | ( | const char * | value | ) |
Definition at line 273 of file switch_json.c.
References cJSON_Delete(), cJSON_New_Item(), ep, parse_value(), and skip().
Referenced by switch_event_create_json().
char* cJSON_Print | ( | cJSON * | item | ) |
char* cJSON_PrintUnformatted | ( | cJSON * | item | ) |
Definition at line 285 of file switch_json.c.
References print_value().
Referenced by switch_event_serialize_json(), switch_ivr_multi_threaded_bridge(), and switch_ivr_originate().
Definition at line 531 of file switch_json.c.
References cJSON::child, cJSON_Delete(), cJSON::next, and cJSON::prev.
Referenced by cJSON_ReplaceItemInObject().
Definition at line 534 of file switch_json.c.
References cJSON::child, cJSON_ReplaceItemInArray(), cJSON_strcasecmp(), cJSON_strdup(), cJSON::next, and cJSON::string.
Referenced by la_broadcast().
|
static |
Definition at line 40 of file switch_json.c.
Referenced by cJSON_DetachItemFromObject(), cJSON_GetObjectItem(), and cJSON_ReplaceItemInObject().
|
static |
Definition at line 60 of file switch_json.c.
References cJSON_malloc, and switch_jb_node_s::len.
Referenced by cJSON_AddItemToObject(), cJSON_CreateString(), cJSON_Duplicate(), cJSON_ReplaceItemInObject(), print_string_ptr(), and print_value().
Definition at line 516 of file switch_json.c.
References cJSON_IsReference, cJSON_New_Item(), cJSON::next, cJSON::prev, cJSON::string, and cJSON::type.
Referenced by cJSON_AddItemReferenceToArray(), and cJSON_AddItemReferenceToObject().
|
static |
Definition at line 52 of file switch_json.c.
|
static |
Definition at line 47 of file switch_json.c.
|
static |
Definition at line 321 of file switch_json.c.
References cJSON::child, cJSON_Array, cJSON_New_Item(), ep, cJSON::next, parse_value(), cJSON::prev, skip(), and cJSON::type.
Referenced by parse_value().
|
static |
Definition at line 108 of file switch_json.c.
References cJSON_Number, cJSON::type, cJSON::valuedouble, and cJSON::valueint.
Referenced by parse_value().
|
static |
Definition at line 401 of file switch_json.c.
References cJSON::child, cJSON_New_Item(), cJSON_Object, ep, cJSON::next, parse_string(), parse_value(), cJSON::prev, skip(), cJSON::string, cJSON::type, and cJSON::valuestring.
Referenced by parse_value().
|
static |
Definition at line 162 of file switch_json.c.
References cJSON_malloc, cJSON_String, ep, firstByteMark, switch_jb_node_s::len, scan_unicode(), cJSON::type, and cJSON::valuestring.
Referenced by parse_object(), and parse_value().
|
static |
Definition at line 288 of file switch_json.c.
References cJSON_False, cJSON_NULL, cJSON_True, ep, parse_array(), parse_number(), parse_object(), parse_string(), cJSON::type, and cJSON::valueint.
Referenced by cJSON_Parse(), parse_array(), and parse_object().
|
static |
Definition at line 349 of file switch_json.c.
References cJSON::child, cJSON_free, cJSON_malloc, fail, switch_jb_node_s::len, memset(), cJSON::next, and print_value().
Referenced by print_value().
|
static |
Definition at line 131 of file switch_json.c.
References cJSON_malloc, cJSON::valuedouble, and cJSON::valueint.
Referenced by print_value().
|
static |
Definition at line 437 of file switch_json.c.
References cJSON::child, cJSON_free, cJSON_malloc, fail, switch_jb_node_s::len, memset(), cJSON::next, print_string_ptr(), and print_value().
Referenced by print_value().
|
static |
Definition at line 259 of file switch_json.c.
References print_string_ptr(), and cJSON::valuestring.
Referenced by print_value().
|
static |
Definition at line 224 of file switch_json.c.
References cJSON_malloc, cJSON_strdup(), and switch_jb_node_s::len.
Referenced by print_object(), and print_string().
|
static |
Definition at line 303 of file switch_json.c.
References cJSON_Array, cJSON_False, cJSON_NULL, cJSON_Number, cJSON_Object, cJSON_strdup(), cJSON_String, cJSON_True, print_array(), print_number(), print_object(), print_string(), and cJSON::type.
Referenced by cJSON_Print(), cJSON_PrintUnformatted(), print_array(), and print_object().
|
static |
Definition at line 154 of file switch_json.c.
References is_hexdigit.
Referenced by parse_string().
|
static |
Definition at line 270 of file switch_json.c.
References in.
Referenced by cJSON_Parse(), parse_array(), parse_object(), switch_close_extra_files(), switch_core_media_filter_sdp(), switch_core_media_negotiate_sdp(), switch_core_media_read_frame(), switch_core_sqldb_start(), and tone_detect_callback().
Definition at line 514 of file switch_json.c.
References cJSON::next, cJSON::prev, and switch_jb_node_s::prev.
Referenced by cJSON_AddItemToArray(), cJSON_CreateDoubleArray(), cJSON_CreateFloatArray(), cJSON_CreateIntArray(), and cJSON_CreateStringArray().
|
static |
Definition at line 58 of file switch_json.c.
Referenced by cJSON_AddItemToObject(), cJSON_Delete(), cJSON_InitHooks(), print_array(), and print_object().
|
static |
Definition at line 57 of file switch_json.c.
Referenced by cJSON_InitHooks(), cJSON_New_Item(), cJSON_strdup(), parse_string(), print_array(), print_number(), print_object(), and print_string_ptr().
|
static |
Definition at line 36 of file switch_json.c.
Referenced by cJSON_GetErrorPtr(), cJSON_Parse(), display_exec_cb(), eavesdrop_callback(), exec_cb(), expand_vars(), inherit_codec(), parse_array(), parse_object(), parse_string(), parse_value(), recover_callback(), switch_channel_event_set_extended_data(), switch_channel_get_scope_variables(), switch_channel_get_variable_dup(), switch_core_session_outgoing_channel(), switch_event_destroy(), switch_ivr_eavesdrop_pop_eavesdropper(), switch_ivr_eavesdrop_session(), switch_ivr_set_json_call_stats(), and switch_ivr_set_xml_call_stats().
|
static |
Definition at line 161 of file switch_json.c.
Referenced by parse_string().