Classes | Macros | Typedefs | Functions | Variables
cJSON.h File Reference
#include <stddef.h>
Include dependency graph for cJSON.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  cJSON
 
struct  cJSON_Hooks
 

Macros

#define cJSON_Array   (1 << 5)
 
#define cJSON_ArrayForEach(element, array)
 
#define CJSON_CDECL
 
#define cJSON_False   (1 << 0)
 
#define cJSON_Invalid   (0)
 
#define cJSON_IsReference   256
 
#define CJSON_NESTING_LIMIT   1000
 
#define cJSON_NULL   (1 << 2)
 
#define cJSON_Number   (1 << 3)
 
#define cJSON_Object   (1 << 6)
 
#define CJSON_PUBLIC(type)   type
 
#define cJSON_Raw   (1 << 7) /* raw json */
 
#define cJSON_SetBoolValue(object, boolValue)
 
#define cJSON_SetIntValue(object, number)
 
#define cJSON_SetNumberValue(object, number)
 
#define CJSON_STDCALL
 
#define cJSON_String   (1 << 4)
 
#define cJSON_StringIsConst   512
 
#define cJSON_True   (1 << 1)
 
#define CJSON_VERSION_MAJOR   1
 
#define CJSON_VERSION_MINOR   7
 
#define CJSON_VERSION_PATCH   17
 

Typedefs

typedef struct cJSON cJSON
 
typedef int cJSON_bool
 
typedef struct cJSON_Hooks cJSON_Hooks
 

Functions

 cJSON_AddArrayToObject (cJSON *const object, const char *const name)
 
 cJSON_AddBoolToObject (cJSON *const object, const char *const name, const cJSON_bool boolean)
 
 cJSON_AddFalseToObject (cJSON *const object, const char *const name)
 
 cJSON_AddItemReferenceToArray (cJSON *array, cJSON *item)
 
 cJSON_AddItemReferenceToObject (cJSON *object, const char *string, cJSON *item)
 
 cJSON_AddItemToObject (cJSON *object, const char *string, cJSON *item)
 
 cJSON_AddItemToObjectCS (cJSON *object, const char *string, cJSON *item)
 
 cJSON_AddNullToObject (cJSON *const object, const char *const name)
 
 cJSON_AddNumberToObject (cJSON *const object, const char *const name, const double number)
 
 cJSON_AddObjectToObject (cJSON *const object, const char *const name)
 
 cJSON_AddRawToObject (cJSON *const object, const char *const name, const char *const raw)
 
 cJSON_AddStringToObject (cJSON *const object, const char *const name, const char *const string)
 
 cJSON_AddTrueToObject (cJSON *const object, const char *const name)
 
 cJSON_Compare (const cJSON *const a, const cJSON *const b, const cJSON_bool case_sensitive)
 
 cJSON_CreateStringArray (const char *const *strings, int count)
 
 cJSON_DeleteItemFromObject (cJSON *object, const char *string)
 
 cJSON_DeleteItemFromObjectCaseSensitive (cJSON *object, const char *string)
 
 cJSON_DetachItemFromObject (cJSON *object, const char *string)
 
 cJSON_DetachItemFromObjectCaseSensitive (cJSON *object, const char *string)
 
 cJSON_DetachItemViaPointer (cJSON *parent, cJSON *const item)
 
 cJSON_GetObjectItem (const cJSON *const object, const char *const string)
 
 cJSON_GetObjectItemCaseSensitive (const cJSON *const object, const char *const string)
 
 cJSON_HasObjectItem (const cJSON *object, const char *string)
 
 cJSON_InsertItemInArray (cJSON *array, int which, cJSON *newitem)
 
 cJSON_ParseWithLength (const char *value, size_t buffer_length)
 
 cJSON_ParseWithLengthOpts (const char *value, size_t buffer_length, const char **return_parse_end, cJSON_bool require_null_terminated)
 
 cJSON_ParseWithOpts (const char *value, const char **return_parse_end, cJSON_bool require_null_terminated)
 
 cJSON_PrintBuffered (const cJSON *item, int prebuffer, cJSON_bool fmt)
 
 cJSON_PrintPreallocated (cJSON *item, char *buffer, const int length, const cJSON_bool format)
 
 CJSON_PUBLIC (char *) cJSON_Print(const cJSON *item)
 
 CJSON_PUBLIC (cJSON *) cJSON_Parse(const char *value)
 
 CJSON_PUBLIC (const char *) cJSON_Version(void)
 
 CJSON_PUBLIC (double) cJSON_GetNumberValue(const cJSON *const item)
 
 CJSON_PUBLIC (int) cJSON_GetArraySize(const cJSON *array)
 
 CJSON_PUBLIC (void *) cJSON_malloc(size_t size)
 
 CJSON_PUBLIC (void) cJSON_InitHooks(cJSON_Hooks *hooks)
 
 cJSON_ReplaceItemInArray (cJSON *array, int which, cJSON *newitem)
 
 cJSON_ReplaceItemInObject (cJSON *object, const char *string, cJSON *newitem)
 
 cJSON_ReplaceItemInObjectCaseSensitive (cJSON *object, const char *string, cJSON *newitem)
 
 cJSON_ReplaceItemViaPointer (cJSON *const parent, cJSON *const item, cJSON *replacement)
 
 cJSON_SetValuestring (cJSON *object, const char *valuestring)
 

Variables

int count
 
int index
 
cJSONitem
 
double number
 
cJSON_bool recurse
 
int which
 

Macro Definition Documentation

◆ cJSON_Array

#define cJSON_Array   (1 << 5)

Definition at line 97 of file cJSON.h.

◆ cJSON_ArrayForEach

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

Definition at line 342 of file cJSON.h.

◆ CJSON_CDECL

#define CJSON_CDECL

Definition at line 72 of file cJSON.h.

◆ cJSON_False

#define cJSON_False   (1 << 0)

Definition at line 92 of file cJSON.h.

◆ cJSON_Invalid

#define cJSON_Invalid   (0)

Definition at line 91 of file cJSON.h.

◆ cJSON_IsReference

#define cJSON_IsReference   256

Definition at line 101 of file cJSON.h.

◆ CJSON_NESTING_LIMIT

#define CJSON_NESTING_LIMIT   1000

Definition at line 137 of file cJSON.h.

◆ cJSON_NULL

#define cJSON_NULL   (1 << 2)

Definition at line 94 of file cJSON.h.

◆ cJSON_Number

#define cJSON_Number   (1 << 3)

Definition at line 95 of file cJSON.h.

◆ cJSON_Object

#define cJSON_Object   (1 << 6)

Definition at line 98 of file cJSON.h.

◆ CJSON_PUBLIC

#define CJSON_PUBLIC (   type)    type

Definition at line 79 of file cJSON.h.

◆ cJSON_Raw

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

Definition at line 99 of file cJSON.h.

◆ cJSON_SetBoolValue

#define cJSON_SetBoolValue (   object,
  boolValue 
)
Value:
((object != NULL && ((object)->type & (cJSON_False | cJSON_True))) \
? (object)->type = ((object)->type & (~(cJSON_False | cJSON_True))) | \
((boolValue) ? cJSON_True : cJSON_False) \

Definition at line 335 of file cJSON.h.

◆ cJSON_SetIntValue

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

Definition at line 322 of file cJSON.h.

◆ cJSON_SetNumberValue

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

Definition at line 327 of file cJSON.h.

◆ CJSON_STDCALL

#define CJSON_STDCALL

Definition at line 73 of file cJSON.h.

◆ cJSON_String

#define cJSON_String   (1 << 4)

Definition at line 96 of file cJSON.h.

◆ cJSON_StringIsConst

#define cJSON_StringIsConst   512

Definition at line 102 of file cJSON.h.

◆ cJSON_True

#define cJSON_True   (1 << 1)

Definition at line 93 of file cJSON.h.

◆ CJSON_VERSION_MAJOR

#define CJSON_VERSION_MAJOR   1

Definition at line 84 of file cJSON.h.

◆ CJSON_VERSION_MINOR

#define CJSON_VERSION_MINOR   7

Definition at line 85 of file cJSON.h.

◆ CJSON_VERSION_PATCH

#define CJSON_VERSION_PATCH   17

Definition at line 86 of file cJSON.h.

Typedef Documentation

◆ cJSON

typedef struct cJSON cJSON

◆ cJSON_bool

typedef int cJSON_bool

Definition at line 132 of file cJSON.h.

◆ cJSON_Hooks

typedef struct cJSON_Hooks cJSON_Hooks

Function Documentation

◆ cJSON_AddArrayToObject()

cJSON_AddArrayToObject ( cJSON *const  object,
const char *const  name 
)

Definition at line 1982 of file cJSON.c.

◆ cJSON_AddBoolToObject()

cJSON_AddBoolToObject ( cJSON *const  object,
const char *const  name,
const cJSON_bool  boolean 
)

Definition at line 1923 of file cJSON.c.

◆ cJSON_AddFalseToObject()

cJSON_AddFalseToObject ( cJSON *const  object,
const char *const  name 
)

Definition at line 1912 of file cJSON.c.

◆ cJSON_AddItemReferenceToArray()

cJSON_AddItemReferenceToArray ( cJSON array,
cJSON item 
)

Definition at line 1870 of file cJSON.c.

◆ cJSON_AddItemReferenceToObject()

cJSON_AddItemReferenceToObject ( cJSON object,
const char *  string,
cJSON item 
)

Definition at line 1879 of file cJSON.c.

◆ cJSON_AddItemToObject()

cJSON_AddItemToObject ( cJSON object,
const char *  string,
cJSON item 
)

Definition at line 1859 of file cJSON.c.

◆ cJSON_AddItemToObjectCS()

cJSON_AddItemToObjectCS ( cJSON object,
const char *  string,
cJSON item 
)

Definition at line 1865 of file cJSON.c.

◆ cJSON_AddNullToObject()

cJSON_AddNullToObject ( cJSON *const  object,
const char *const  name 
)

Definition at line 1890 of file cJSON.c.

◆ cJSON_AddNumberToObject()

cJSON_AddNumberToObject ( cJSON *const  object,
const char *const  name,
const double  number 
)

Definition at line 1935 of file cJSON.c.

◆ cJSON_AddObjectToObject()

cJSON_AddObjectToObject ( cJSON *const  object,
const char *const  name 
)

Definition at line 1971 of file cJSON.c.

◆ cJSON_AddRawToObject()

cJSON_AddRawToObject ( cJSON *const  object,
const char *const  name,
const char *const  raw 
)

Definition at line 1959 of file cJSON.c.

◆ cJSON_AddStringToObject()

cJSON_AddStringToObject ( cJSON *const  object,
const char *const  name,
const char *const  string 
)

Definition at line 1947 of file cJSON.c.

◆ cJSON_AddTrueToObject()

cJSON_AddTrueToObject ( cJSON *const  object,
const char *const  name 
)

Definition at line 1901 of file cJSON.c.

◆ cJSON_Compare()

cJSON_Compare ( const cJSON *const  a,
const cJSON *const  b,
const cJSON_bool  case_sensitive 
)

Definition at line 2685 of file cJSON.c.

◆ cJSON_CreateStringArray()

cJSON_CreateStringArray ( const char *const *  strings,
int  count 
)

Definition at line 2412 of file cJSON.c.

◆ cJSON_DeleteItemFromObject()

cJSON_DeleteItemFromObject ( cJSON object,
const char *  string 
)

Definition at line 2050 of file cJSON.c.

◆ cJSON_DeleteItemFromObjectCaseSensitive()

cJSON_DeleteItemFromObjectCaseSensitive ( cJSON object,
const char *  string 
)

Definition at line 2055 of file cJSON.c.

◆ cJSON_DetachItemFromObject()

cJSON_DetachItemFromObject ( cJSON object,
const char *  string 
)

Definition at line 2036 of file cJSON.c.

◆ cJSON_DetachItemFromObjectCaseSensitive()

cJSON_DetachItemFromObjectCaseSensitive ( cJSON object,
const char *  string 
)

Definition at line 2043 of file cJSON.c.

◆ cJSON_DetachItemViaPointer()

cJSON_DetachItemViaPointer ( cJSON parent,
cJSON *const  item 
)

Definition at line 1993 of file cJSON.c.

◆ cJSON_GetObjectItem()

cJSON_GetObjectItem ( const cJSON *const  object,
const char *const  string 
)

Definition at line 1734 of file cJSON.c.

◆ cJSON_GetObjectItemCaseSensitive()

cJSON_GetObjectItemCaseSensitive ( const cJSON *const  object,
const char *const  string 
)

Definition at line 1739 of file cJSON.c.

◆ cJSON_HasObjectItem()

cJSON_HasObjectItem ( const cJSON object,
const char *  string 
)

Definition at line 1745 of file cJSON.c.

◆ cJSON_InsertItemInArray()

cJSON_InsertItemInArray ( cJSON array,
int  which,
cJSON newitem 
)

Definition at line 2061 of file cJSON.c.

◆ cJSON_ParseWithLength()

cJSON_ParseWithLength ( const char *  value,
size_t  buffer_length 
)

Definition at line 1068 of file cJSON.c.

◆ cJSON_ParseWithLengthOpts()

cJSON_ParseWithLengthOpts ( const char *  value,
size_t  buffer_length,
const char **  return_parse_end,
cJSON_bool  require_null_terminated 
)

Definition at line 991 of file cJSON.c.

◆ cJSON_ParseWithOpts()

cJSON_ParseWithOpts ( const char *  value,
const char **  return_parse_end,
cJSON_bool  require_null_terminated 
)

Definition at line 974 of file cJSON.c.

◆ cJSON_PrintBuffered()

cJSON_PrintBuffered ( const cJSON item,
int  prebuffer,
cJSON_bool  fmt 
)

Definition at line 1143 of file cJSON.c.

◆ cJSON_PrintPreallocated()

cJSON_PrintPreallocated ( cJSON item,
char *  buffer,
const int  length,
const cJSON_bool  format 
)

Definition at line 1170 of file cJSON.c.

◆ CJSON_PUBLIC() [1/7]

CJSON_PUBLIC ( char *  ) const

◆ CJSON_PUBLIC() [2/7]

CJSON_PUBLIC ( cJSON ) const

◆ CJSON_PUBLIC() [3/7]

CJSON_PUBLIC ( const char *  )

Definition at line 94 of file cJSON.c.

◆ CJSON_PUBLIC() [4/7]

CJSON_PUBLIC ( double  ) const

◆ CJSON_PUBLIC() [5/7]

CJSON_PUBLIC ( int  ) const

◆ CJSON_PUBLIC() [6/7]

CJSON_PUBLIC ( void )

Definition at line 2793 of file cJSON.c.

◆ CJSON_PUBLIC() [7/7]

CJSON_PUBLIC ( void  )

◆ cJSON_ReplaceItemInArray()

cJSON_ReplaceItemInArray ( cJSON array,
int  which,
cJSON newitem 
)

Definition at line 2132 of file cJSON.c.

◆ cJSON_ReplaceItemInObject()

cJSON_ReplaceItemInObject ( cJSON object,
const char *  string,
cJSON newitem 
)

Definition at line 2166 of file cJSON.c.

◆ cJSON_ReplaceItemInObjectCaseSensitive()

cJSON_ReplaceItemInObjectCaseSensitive ( cJSON object,
const char *  string,
cJSON newitem 
)

Definition at line 2171 of file cJSON.c.

◆ cJSON_ReplaceItemViaPointer()

cJSON_ReplaceItemViaPointer ( cJSON *const  parent,
cJSON *const  item,
cJSON replacement 
)

Definition at line 2090 of file cJSON.c.

◆ cJSON_SetValuestring()

cJSON_SetValuestring ( cJSON object,
const char *  valuestring 
)

Definition at line 362 of file cJSON.c.

Variable Documentation

◆ count

int count

Definition at line 229 of file cJSON.h.

◆ index

int index

Definition at line 179 of file cJSON.h.

◆ item

cJSON* item

Definition at line 236 of file cJSON.h.

◆ number

double number

Definition at line 326 of file cJSON.h.

◆ recurse

cJSON_bool recurse

Definition at line 281 of file cJSON.h.

◆ which

int which

Definition at line 253 of file cJSON.h.

NULL
NULL
Definition: test_security_zap.cpp:405
cJSON_Invalid
#define cJSON_Invalid
Definition: cJSON.h:91
googletest-filter-unittest.child
child
Definition: googletest-filter-unittest.py:62
cJSON_True
#define cJSON_True
Definition: cJSON.h:93
type
GLenum type
Definition: glcorearb.h:2695
number
double number
Definition: cJSON.h:326
cJSON_False
#define cJSON_False
Definition: cJSON.h:92
array
PHP_PROTO_OBJECT_FREE_END PHP_PROTO_OBJECT_DTOR_END intern array
Definition: array.c:111


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:02