RTS API Documentation  1.10.11
Data Structures | Macros | Typedefs | Functions | Variables
switch_cJSON.h File Reference
#include <stddef.h>
+ Include dependency graph for switch_cJSON.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  cJSON
 
struct  cJSON_Hooks
 

Macros

#define CJSON_CDECL
 
#define CJSON_STDCALL
 
#define CJSON_PUBLIC(type)   type
 
#define CJSON_VERSION_MAJOR   1
 
#define CJSON_VERSION_MINOR   7
 
#define CJSON_VERSION_PATCH   12
 
#define cJSON_Invalid   (0)
 
#define cJSON_False   (1 << 0)
 
#define cJSON_True   (1 << 1)
 
#define cJSON_NULL   (1 << 2)
 
#define cJSON_Number   (1 << 3)
 
#define cJSON_String   (1 << 4)
 
#define cJSON_Array   (1 << 5)
 
#define cJSON_Object   (1 << 6)
 
#define cJSON_Raw   (1 << 7) /* raw json */
 
#define cJSON_IsReference   256
 
#define cJSON_StringIsConst   512
 
#define CJSON_NESTING_LIMIT   1000
 
#define cJSON_SetIntValue(object, number)   ((object) ? (object)->valueint = (object)->valuedouble = (number) : (number))
 
#define cJSON_SetNumberValue(object, number)   ((object != NULL) ? cJSON_SetNumberHelper(object, (double)number) : (number))
 
#define cJSON_ArrayForEach(element, array)   for(element = (array != NULL) ? (array)->child : NULL; element != NULL; element = element->next)
 

Typedefs

typedef struct cJSON cJSON
 
typedef struct cJSON_Hooks cJSON_Hooks
 
typedef int cJSON_bool
 

Functions

 CJSON_PUBLIC (const char *) cJSON_Version(void)
 
 CJSON_PUBLIC (void) cJSON_InitHooks(cJSON_Hooks *hooks)
 
 CJSON_PUBLIC (cJSON *) cJSON_Parse(const char *value)
 
 CJSON_PUBLIC (char *) cJSON_Print(const cJSON *item)
 
 CJSON_PUBLIC (cJSON_bool) cJSON_PrintPreallocated(cJSON *item
 
 CJSON_PUBLIC (double) cJSON_SetNumberHelper(cJSON *object
 
 CJSON_PUBLIC (void *) cJSON_malloc(size_t size)
 

Variables

const char ** return_parse_end
 
const char cJSON_bool require_null_terminated
 
int prebuffer
 
int cJSON_bool fmt
 
char * buffer
 
char const int length
 
char const int const cJSON_bool format
 
int index
 
const char *const string
 
int count
 
cJSONitem
 
int which
 
int cJSONnewitem
 
cJSON *const cJSONreplacement
 
cJSON_bool recurse
 
const cJSON *const b
 
const cJSON *const const cJSON_bool case_sensitive
 
const char *const name
 
const char *const const cJSON_bool boolean
 
const char *const const double number
 
const char *const const char *const raw
 

Macro Definition Documentation

◆ cJSON_Array

#define cJSON_Array   (1 << 5)

◆ cJSON_ArrayForEach

#define cJSON_ArrayForEach (   element,
  array 
)    for(element = (array != NULL) ? (array)->child : NULL; element != NULL; element = element->next)

◆ CJSON_CDECL

#define CJSON_CDECL

Definition at line 63 of file switch_cJSON.h.

◆ cJSON_False

#define cJSON_False   (1 << 0)

Definition at line 82 of file switch_cJSON.h.

Referenced by minify_string(), parse_value(), print_value(), and replace_item_in_object().

◆ cJSON_Invalid

#define cJSON_Invalid   (0)

Definition at line 81 of file switch_cJSON.h.

Referenced by add_item_to_object(), apply_patch(), and minify_string().

◆ cJSON_IsReference

#define cJSON_IsReference   256

Definition at line 91 of file switch_cJSON.h.

Referenced by cJSON_New_Item(), create_reference(), and replace_item_in_object().

◆ CJSON_NESTING_LIMIT

#define CJSON_NESTING_LIMIT   1000

Definition at line 129 of file switch_cJSON.h.

Referenced by parse_array(), and parse_object().

◆ cJSON_NULL

#define cJSON_NULL   (1 << 2)

Definition at line 84 of file switch_cJSON.h.

Referenced by minify_string(), parse_value(), print_value(), and replace_item_in_object().

◆ cJSON_Number

#define cJSON_Number   (1 << 3)

◆ cJSON_Object

#define cJSON_Object   (1 << 6)

◆ CJSON_PUBLIC

#define CJSON_PUBLIC (   type)    type

Definition at line 69 of file switch_cJSON.h.

◆ cJSON_Raw

#define cJSON_Raw   (1 << 7) /* raw json */

Definition at line 89 of file switch_cJSON.h.

Referenced by minify_string(), print_value(), and replace_item_in_object().

◆ cJSON_SetIntValue

#define cJSON_SetIntValue (   object,
  number 
)    ((object) ? (object)->valueint = (object)->valuedouble = (number) : (number))

Definition at line 261 of file switch_cJSON.h.

◆ cJSON_SetNumberValue

#define cJSON_SetNumberValue (   object,
  number 
)    ((object != NULL) ? cJSON_SetNumberHelper(object, (double)number) : (number))

Definition at line 264 of file switch_cJSON.h.

◆ CJSON_STDCALL

#define CJSON_STDCALL

Definition at line 64 of file switch_cJSON.h.

◆ cJSON_String

#define cJSON_String   (1 << 4)

◆ cJSON_StringIsConst

#define cJSON_StringIsConst   512

Definition at line 92 of file switch_cJSON.h.

Referenced by add_item_to_object(), cJSON_New_Item(), and replace_item_in_object().

◆ cJSON_True

#define cJSON_True   (1 << 1)

◆ CJSON_VERSION_MAJOR

#define CJSON_VERSION_MAJOR   1

Definition at line 74 of file switch_cJSON.h.

Referenced by CJSON_PUBLIC().

◆ CJSON_VERSION_MINOR

#define CJSON_VERSION_MINOR   7

Definition at line 75 of file switch_cJSON.h.

Referenced by CJSON_PUBLIC().

◆ CJSON_VERSION_PATCH

#define CJSON_VERSION_PATCH   12

Definition at line 76 of file switch_cJSON.h.

Referenced by CJSON_PUBLIC().

Typedef Documentation

◆ cJSON

typedef struct cJSON cJSON

◆ cJSON_bool

typedef int cJSON_bool

Definition at line 124 of file switch_cJSON.h.

◆ cJSON_Hooks

typedef struct cJSON_Hooks cJSON_Hooks

Function Documentation

◆ CJSON_PUBLIC() [1/7]

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().

75 {
76  return (const char*) (global_error.json + global_error.position);
77 }
static error global_error
Definition: cJSON.c:72
size_t position
Definition: cJSON.c:70
const unsigned char * json
Definition: cJSON.c:69

◆ CJSON_PUBLIC() [2/7]

CJSON_PUBLIC ( void  )

◆ CJSON_PUBLIC() [3/7]

CJSON_PUBLIC ( cJSON ) const

◆ CJSON_PUBLIC() [4/7]

CJSON_PUBLIC ( char *  ) const

◆ CJSON_PUBLIC() [5/7]

CJSON_PUBLIC ( cJSON_bool  )

◆ CJSON_PUBLIC() [6/7]

CJSON_PUBLIC ( double  )

◆ CJSON_PUBLIC() [7/7]

CJSON_PUBLIC ( void *  )

Definition at line 2962 of file cJSON.c.

References internal_hooks::allocate(), and CJSON_PUBLIC().

2963 {
2964  return global_hooks.allocate(size);
2965 }
void *CJSON_CDECL * allocate(size_t size)
static internal_hooks global_hooks
Definition: cJSON.c:154

Variable Documentation

◆ b

const cJSON* const b

◆ boolean

const char* const const cJSON_bool boolean

Definition at line 253 of file switch_cJSON.h.

◆ buffer

char* buffer

◆ case_sensitive

const cJSON* const const cJSON_bool case_sensitive

Definition at line 243 of file switch_cJSON.h.

Referenced by minify_string().

◆ count

int count

◆ fmt

int cJSON_bool fmt

◆ format

char const int const cJSON_bool format

Definition at line 153 of file switch_cJSON.h.

Referenced by main(), print(), switch_core_perform_file_open(), and switch_strftime().

◆ index

int index

◆ item

cJSON *const item

◆ length

char const int length

◆ name

const char *const name

◆ newitem

const char cJSON * newitem

◆ number

double number

◆ prebuffer

int prebuffer

Definition at line 150 of file switch_cJSON.h.

Referenced by print().

◆ raw

const char* const const char* const raw

Definition at line 256 of file switch_cJSON.h.

Referenced by add_item_to_object(), and replace_item_in_object().

◆ recurse

cJSON_bool recurse

Definition at line 237 of file switch_cJSON.h.

Referenced by replace_item_in_object().

◆ replacement

cJSON* const cJSON* replacement

Definition at line 231 of file switch_cJSON.h.

Referenced by add_item_to_object(), and merge_patch().

◆ require_null_terminated

const char cJSON_bool require_null_terminated

Definition at line 143 of file switch_cJSON.h.

◆ return_parse_end

const char** return_parse_end

Definition at line 143 of file switch_cJSON.h.

◆ string

const char *const const char *const string

◆ which

int which

Definition at line 222 of file switch_cJSON.h.

Referenced by add_item_to_object().