Zen-C
Loading...
Searching...
No Matches
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.

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   19
 
#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_CIRCULAR_LIMIT   10000
 
#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_SetBoolValue(object, boolValue)
 
#define cJSON_ArrayForEach(element, array)
 

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_ParseWithOpts (const char *value, const char **return_parse_end, cJSON_bool require_null_terminated)
 
 cJSON_ParseWithLengthOpts (const char *value, size_t buffer_length, const char **return_parse_end, cJSON_bool require_null_terminated)
 
 CJSON_PUBLIC (char *) cJSON_Print(const cJSON *item)
 
 cJSON_PrintPreallocated (cJSON *item, char *buffer, const int length, const cJSON_bool format)
 
 CJSON_PUBLIC (int) cJSON_GetArraySize(const cJSON *array)
 
 cJSON_GetObjectItemCaseSensitive (const cJSON *const object, const char *const string)
 
 CJSON_PUBLIC (double) cJSON_GetNumberValue(const cJSON *const item)
 
 cJSON_AddItemToObjectCS (cJSON *object, const char *string, cJSON *item)
 
 cJSON_AddItemReferenceToObject (cJSON *object, const char *string, cJSON *item)
 
 cJSON_DetachItemFromObjectCaseSensitive (cJSON *object, const char *string)
 
 cJSON_InsertItemInArray (cJSON *array, int which, cJSON *newitem)
 
 cJSON_ReplaceItemViaPointer (cJSON *const parent, cJSON *const item, cJSON *replacement)
 
 cJSON_ReplaceItemInObject (cJSON *object, const char *string, cJSON *newitem)
 
 cJSON_ReplaceItemInObjectCaseSensitive (cJSON *object, const char *string, cJSON *newitem)
 
 cJSON_Compare (const cJSON *const a, const cJSON *const b, const cJSON_bool case_sensitive)
 
 cJSON_AddBoolToObject (cJSON *const object, const char *const name, const cJSON_bool boolean)
 
 cJSON_AddNumberToObject (cJSON *const object, const char *const name, const double number)
 
 cJSON_AddStringToObject (cJSON *const object, const char *const name, const char *const string)
 
 cJSON_AddRawToObject (cJSON *const object, const char *const name, const char *const raw)
 
 CJSON_PUBLIC (void *) cJSON_malloc(size_t size)
 

Variables

size_t buffer_length
 
int prebuffer
 
int cJSON_bool fmt
 
int index
 
const char *const string
 
int count
 
cJSONitem
 
int which
 
int cJSONnewitem
 
cJSON_bool recurse
 
const char *const name
 
double number
 
const char * valuestring
 

Macro Definition Documentation

◆ cJSON_Array

#define cJSON_Array   (1 << 5)

◆ cJSON_ArrayForEach

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

◆ CJSON_CDECL

#define CJSON_CDECL

◆ CJSON_CIRCULAR_LIMIT

#define CJSON_CIRCULAR_LIMIT   10000

◆ cJSON_False

#define cJSON_False   (1 << 0)

◆ cJSON_Invalid

#define cJSON_Invalid   (0)

◆ cJSON_IsReference

#define cJSON_IsReference   256

◆ CJSON_NESTING_LIMIT

#define CJSON_NESTING_LIMIT   1000

◆ cJSON_NULL

#define cJSON_NULL   (1 << 2)

◆ cJSON_Number

#define cJSON_Number   (1 << 3)

◆ cJSON_Object

#define cJSON_Object   (1 << 6)

◆ CJSON_PUBLIC

#define CJSON_PUBLIC (   type)    type

◆ cJSON_Raw

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

◆ 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) \
#define cJSON_False
Definition cJSON.h:95
#define cJSON_Invalid
Definition cJSON.h:94
#define cJSON_True
Definition cJSON.h:96

◆ cJSON_SetIntValue

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

◆ cJSON_SetNumberValue

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

◆ CJSON_STDCALL

#define CJSON_STDCALL

◆ cJSON_String

#define cJSON_String   (1 << 4)

◆ cJSON_StringIsConst

#define cJSON_StringIsConst   512

◆ cJSON_True

#define cJSON_True   (1 << 1)

◆ CJSON_VERSION_MAJOR

#define CJSON_VERSION_MAJOR   1

◆ CJSON_VERSION_MINOR

#define CJSON_VERSION_MINOR   7

◆ CJSON_VERSION_PATCH

#define CJSON_VERSION_PATCH   19

Typedef Documentation

◆ cJSON

typedef struct cJSON cJSON

◆ cJSON_bool

typedef int cJSON_bool

◆ cJSON_Hooks

typedef struct cJSON_Hooks cJSON_Hooks

Function Documentation

◆ cJSON_AddBoolToObject()

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

◆ cJSON_AddItemReferenceToObject()

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

◆ cJSON_AddItemToObjectCS()

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

◆ cJSON_AddNumberToObject()

cJSON_AddNumberToObject ( cJSON *const  object,
const char *const  name,
const double  number 
)
Here is the caller graph for this function:

◆ cJSON_AddRawToObject()

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

◆ cJSON_AddStringToObject()

cJSON_AddStringToObject ( cJSON *const  object,
const char *const  name,
const char *const  string 
)
Here is the caller graph for this function:

◆ cJSON_Compare()

cJSON_Compare ( const cJSON *const  a,
const cJSON *const  b,
const cJSON_bool  case_sensitive 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cJSON_DetachItemFromObjectCaseSensitive()

cJSON_DetachItemFromObjectCaseSensitive ( cJSON object,
const char *  string 
)

◆ cJSON_GetObjectItemCaseSensitive()

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

◆ cJSON_InsertItemInArray()

cJSON_InsertItemInArray ( cJSON array,
int  which,
cJSON newitem 
)

◆ cJSON_ParseWithLengthOpts()

cJSON_ParseWithLengthOpts ( const char *  value,
size_t  buffer_length,
const char **  return_parse_end,
cJSON_bool  require_null_terminated 
)
Here is the caller graph for this function:

◆ cJSON_ParseWithOpts()

cJSON_ParseWithOpts ( const char *  value,
const char **  return_parse_end,
cJSON_bool  require_null_terminated 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cJSON_PrintPreallocated()

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

◆ CJSON_PUBLIC() [1/7]

CJSON_PUBLIC ( char *  ) const

◆ CJSON_PUBLIC() [2/7]

CJSON_PUBLIC ( cJSON ) const

◆ CJSON_PUBLIC() [3/7]

CJSON_PUBLIC ( const char *  )

◆ CJSON_PUBLIC() [4/7]

CJSON_PUBLIC ( double  ) const

◆ CJSON_PUBLIC() [5/7]

CJSON_PUBLIC ( int  ) const

◆ CJSON_PUBLIC() [6/7]

CJSON_PUBLIC ( void *  )
Here is the call graph for this function:

◆ CJSON_PUBLIC() [7/7]

CJSON_PUBLIC ( void  )

◆ cJSON_ReplaceItemInObject()

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

◆ cJSON_ReplaceItemInObjectCaseSensitive()

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

◆ cJSON_ReplaceItemViaPointer()

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

Variable Documentation

◆ buffer_length

size_t buffer_length

◆ count

int count

◆ fmt

int cJSON_bool fmt

◆ index

int index

◆ item

cJSON *const item

◆ name

const char *const name

◆ newitem

int cJSON* newitem

◆ number

double number

◆ prebuffer

int prebuffer

◆ recurse

cJSON_bool recurse

◆ string

const char * string

◆ valuestring

const char* valuestring

◆ which

int which