PSoC64 Secure Boot Utilities Middleware Library 1.0
Functions

General Description

Functions

void cy_p64_cJSON_InitHooks (cy_p64_cJSON_Hooks *hooks)
 This function supply malloc and free functions to cy_p64_cJSON. More...
 
cy_p64_cJSONcy_p64_cJSON_Parse (const char *value)
 Supplies a block of JSON, and this returns a cy_p64_cJSON object you can interrogate. More...
 
char * cy_p64_cJSON_Print (const cy_p64_cJSON *item)
 Renders a cy_p64_cJSON entity to text for transfer/storage. More...
 
char * cy_p64_cJSON_PrintUnformatted (const cy_p64_cJSON *item)
 Renders a cy_p64_cJSON entity to text for transfer/storage without any formatting. More...
 
char * cy_p64_cJSON_PrintBuffered (const cy_p64_cJSON *item, int prebuffer, int fmt)
 Renders a cy_p64_cJSON entity to text using a buffered strategy. More...
 
int cy_p64_cJSON_PrintPreallocated (cy_p64_cJSON *item, char *buf, const int len, const int fmt)
 Renders a cy_p64_cJSON entity to text using a buffer already allocated in memory with length len. More...
 
void cy_p64_cJSON_Delete (cy_p64_cJSON *c)
 Deletes a cy_p64_cJSON entity and all sub-entities. More...
 
int cy_p64_cJSON_GetArraySize (const cy_p64_cJSON *array)
 Returns the number of items in an array (or object). More...
 
cy_p64_cJSONcy_p64_cJSON_GetArrayItem (const cy_p64_cJSON *array, int item)
 This function retrieves item number "item" from array "array". More...
 
cy_p64_cJSONcy_p64_cJSON_GetObjectItem (const cy_p64_cJSON *object, const char *string)
 Gets item "string" from the object. More...
 
int cy_p64_cJSON_HasObjectItem (const cy_p64_cJSON *object, const char *string)
 Returns "true" if it possible to get an item from the object. More...
 
const char * cy_p64_cJSON_GetErrorPtr (void)
 Analyses failed parses. More...
 
cy_p64_cJSONcy_p64_cJSON_CreateNull (void)
 Creates a cy_p64_cJSON item of the "null" type. More...
 
cy_p64_cJSONcy_p64_cJSON_CreateTrue (void)
 Creates a cy_p64_cJSON item of the "true" type. More...
 
cy_p64_cJSONcy_p64_cJSON_CreateFalse (void)
 Creates a cy_p64_cJSON item of the "false" type. More...
 
cy_p64_cJSONcy_p64_cJSON_CreateBool (int b)
 Creates a cy_p64_cJSON item of the "bool" type. More...
 
cy_p64_cJSONcy_p64_cJSON_CreateNumber (uint32_t num)
 This function create a cy_p64_cJSON item of the uint type. More...
 
cy_p64_cJSONcy_p64_cJSON_CreateString (const char *string)
 Creates a cy_p64_cJSON item of the "string" type. More...
 
cy_p64_cJSONcy_p64_cJSON_CreateRaw (const char *raw)
 Creates a cy_p64_cJSON item of the "raw" type. More...
 
cy_p64_cJSONcy_p64_cJSON_CreateArray (void)
 Creates a cy_p64_cJSON item of the raw "Array" type. More...
 
cy_p64_cJSONcy_p64_cJSON_CreateObject (void)
 Creates a cy_p64_cJSON item of the "object" type. More...
 
cy_p64_cJSONcy_p64_cJSON_CreateIntArray (const int *numbers, int count)
 Creates an array of count items. More...
 
cy_p64_cJSONcy_p64_cJSON_CreateStringArray (const char **strings, int count)
 Creates an array of string items. More...
 
void cy_p64_cJSON_AddItemToArray (cy_p64_cJSON *array, cy_p64_cJSON *item)
 Appends an item to the specified array. More...
 
void cy_p64_cJSON_AddItemToObject (cy_p64_cJSON *object, const char *string, cy_p64_cJSON *item)
 Appends an item to the specified object. More...
 
void cy_p64_cJSON_AddItemToObjectCS (cy_p64_cJSON *object, const char *string, cy_p64_cJSON *item)
 Use this function when string is definitely const (i.e. More...
 
void cy_p64_cJSON_AddItemReferenceToArray (cy_p64_cJSON *array, cy_p64_cJSON *item)
 Appends reference to an item to the specified array. More...
 
void cy_p64_cJSON_AddItemReferenceToObject (cy_p64_cJSON *object, const char *string, cy_p64_cJSON *item)
 This function append reference to item to the specified object. More...
 
cy_p64_cJSONcy_p64_cJSON_DetachItemFromArray (cy_p64_cJSON *array, int which)
 Detaches items from an array. More...
 
void cy_p64_cJSON_DeleteItemFromArray (cy_p64_cJSON *array, int which)
 Removes items from an array. More...
 
cy_p64_cJSONcy_p64_cJSON_DetachItemFromObject (cy_p64_cJSON *object, const char *string)
 Detaches items from an object. More...
 
void cy_p64_cJSON_DeleteItemFromObject (cy_p64_cJSON *object, const char *string)
 Removes items from an object. More...
 
void cy_p64_cJSON_InsertItemInArray (cy_p64_cJSON *array, int which, cy_p64_cJSON *newitem)
 Inserts items in an array. More...
 
void cy_p64_cJSON_ReplaceItemInArray (cy_p64_cJSON *array, int which, cy_p64_cJSON *newitem)
 Replaces items in an array. More...
 
void cy_p64_cJSON_ReplaceItemInObject (cy_p64_cJSON *object, const char *string, cy_p64_cJSON *newitem)
 Replaces items in an object. More...
 
cy_p64_cJSONcy_p64_cJSON_Duplicate (const cy_p64_cJSON *item, int recurse)
 Duplicates a cy_p64_cJSON item. More...
 
cy_p64_cJSONcy_p64_cJSON_ParseWithOpts (const char *value, const char **return_parse_end, int require_null_terminated)
 Allows you to require (and check) that the JSON is null- terminated, and to retrieve the pointer to the final byte parsed. More...
 
void cy_p64_cJSON_Minify (char *json)
 Removes not required characters from a string like whitespace characters. More...
 

Function Documentation

◆ cy_p64_cJSON_InitHooks()

void cy_p64_cJSON_InitHooks ( cy_p64_cJSON_Hooks hooks)

This function supply malloc and free functions to cy_p64_cJSON.

Parameters
hooksThe pointer to the structure with alternative malloc and free functions.

◆ cy_p64_cJSON_Parse()

cy_p64_cJSON* cy_p64_cJSON_Parse ( const char *  value)

Supplies a block of JSON, and this returns a cy_p64_cJSON object you can interrogate.

Call cy_p64_cJSON_Delete() when finished.

Parameters
valueThe pointer to a block of JSON.
Returns
Parsed a cy_p64_cJSON object.

◆ cy_p64_cJSON_Print()

char* cy_p64_cJSON_Print ( const cy_p64_cJSON item)

Renders a cy_p64_cJSON entity to text for transfer/storage.

Free the char* when finished.

Parameters
itemThe pointer to the cy_p64_cJSON object
Returns
The pointer to a string.

◆ cy_p64_cJSON_PrintUnformatted()

char* cy_p64_cJSON_PrintUnformatted ( const cy_p64_cJSON item)

Renders a cy_p64_cJSON entity to text for transfer/storage without any formatting.

Free the char* when finished.

Parameters
itemThe pointer to the cy_p64_cJSON object.
Returns
The pointer to a string.

◆ cy_p64_cJSON_PrintBuffered()

char* cy_p64_cJSON_PrintBuffered ( const cy_p64_cJSON item,
int  prebuffer,
int  fmt 
)

Renders a cy_p64_cJSON entity to text using a buffered strategy.

Parameters
itemThe pointer to the cy_p64_cJSON object.
prebufferGuess at the final size. Guessing well reduces the reallocation.
fmt0 gives unformatted, 1 gives formatted.
Returns
The pointer to a string.

◆ cy_p64_cJSON_PrintPreallocated()

int cy_p64_cJSON_PrintPreallocated ( cy_p64_cJSON item,
char *  buf,
const int  len,
const int  fmt 
)

Renders a cy_p64_cJSON entity to text using a buffer already allocated in memory with length len.

Returns 1 on success and 0 on a failure.

Parameters
itemThe pointer to the cy_p64_cJSON object.
bufThe pointer to the allocated buffer.
lenThe buffer length.
fmt0 gives unformatted, 1 gives formatted.
Returns
The pointer to a string.

◆ cy_p64_cJSON_Delete()

void cy_p64_cJSON_Delete ( cy_p64_cJSON c)

Deletes a cy_p64_cJSON entity and all sub-entities.

Parameters
cThe pointer to the cy_p64_cJSON object.

◆ cy_p64_cJSON_GetArraySize()

int cy_p64_cJSON_GetArraySize ( const cy_p64_cJSON array)

Returns the number of items in an array (or object).

Parameters
arrayThe pointer to the cy_p64_cJSON object
Returns
The number of items in an array (or object).

◆ cy_p64_cJSON_GetArrayItem()

cy_p64_cJSON* cy_p64_cJSON_GetArrayItem ( const cy_p64_cJSON array,
int  item 
)

This function retrieves item number "item" from array "array".

Returns NULL if fails.

Parameters
arrayThe pointer to the cy_p64_cJSON object.
itemThe item number.
Returns
The pointer to the cy_p64_cJSON object in the array or NULL if fails.

◆ cy_p64_cJSON_GetObjectItem()

cy_p64_cJSON* cy_p64_cJSON_GetObjectItem ( const cy_p64_cJSON object,
const char *  string 
)

Gets item "string" from the object.

Case-insensitive.

Parameters
objectThe pointer to the cy_p64_cJSON object.
stringThe pointer to the string to find.
Returns
The pointer to found the cy_p64_cJSON object or NULL if fails.

◆ cy_p64_cJSON_HasObjectItem()

int cy_p64_cJSON_HasObjectItem ( const cy_p64_cJSON object,
const char *  string 
)

Returns "true" if it possible to get an item from the object.

Case-insensitive.

Parameters
objectThe pointer to the cy_p64_cJSON object.
stringThe pointer to the string to find.
Returns
"true" if found or "false" if fails.

◆ cy_p64_cJSON_GetErrorPtr()

const char* cy_p64_cJSON_GetErrorPtr ( void  )

Analyses failed parses.

This returns a pointer to the parse error. Look a few chars back if you need to understand. Defined when cy_p64_cJSON_Parse() returns 0. 0 when cy_p64_cJSON_Parse() succeeds.

Returns
The pointer to the parse error.

◆ cy_p64_cJSON_CreateNull()

cy_p64_cJSON* cy_p64_cJSON_CreateNull ( void  )

Creates a cy_p64_cJSON item of the "null" type.

Returns
The pointer to the cy_p64_cJSON item.

◆ cy_p64_cJSON_CreateTrue()

cy_p64_cJSON* cy_p64_cJSON_CreateTrue ( void  )

Creates a cy_p64_cJSON item of the "true" type.

Returns
The pointer to the cy_p64_cJSON item.

◆ cy_p64_cJSON_CreateFalse()

cy_p64_cJSON* cy_p64_cJSON_CreateFalse ( void  )

Creates a cy_p64_cJSON item of the "false" type.

Returns
Pointer to cy_p64_cJSON item

◆ cy_p64_cJSON_CreateBool()

cy_p64_cJSON* cy_p64_cJSON_CreateBool ( int  b)

Creates a cy_p64_cJSON item of the "bool" type.

Parameters
bThe value for This function ccreated cy_p64_cJSON object.
Returns
The pointer to This function ccy_p64_cJSON item.

◆ cy_p64_cJSON_CreateNumber()

cy_p64_cJSON* cy_p64_cJSON_CreateNumber ( uint32_t  num)

This function create a cy_p64_cJSON item of the uint type.

Parameters
numThe value for the created cy_p64_cJSON object.
Returns
The pointer to the cy_p64_cJSON item.

◆ cy_p64_cJSON_CreateString()

cy_p64_cJSON* cy_p64_cJSON_CreateString ( const char *  string)

Creates a cy_p64_cJSON item of the "string" type.

Parameters
stringThe value for the created cy_p64_cJSON object.
Returns
The pointer to the cy_p64_cJSON item.

◆ cy_p64_cJSON_CreateRaw()

cy_p64_cJSON* cy_p64_cJSON_CreateRaw ( const char *  raw)

Creates a cy_p64_cJSON item of the "raw" type.

Parameters
rawThe value for the created cy_p64_cJSON object.
Returns
The pointer to the cy_p64_cJSON item.

◆ cy_p64_cJSON_CreateArray()

cy_p64_cJSON* cy_p64_cJSON_CreateArray ( void  )

Creates a cy_p64_cJSON item of the raw "Array" type.

Returns
The pointer to the cy_p64_cJSON item.

◆ cy_p64_cJSON_CreateObject()

cy_p64_cJSON* cy_p64_cJSON_CreateObject ( void  )

Creates a cy_p64_cJSON item of the "object" type.

Returns
The pointer to the cy_p64_cJSON item.

◆ cy_p64_cJSON_CreateIntArray()

cy_p64_cJSON* cy_p64_cJSON_CreateIntArray ( const int *  numbers,
int  count 
)

Creates an array of count items.

Parameters
numbersThe pointer to values for the created cy_p64_cJSON object.
countThe count of the values.
Returns
The pointer to the cy_p64_cJSON item.

◆ cy_p64_cJSON_CreateStringArray()

cy_p64_cJSON* cy_p64_cJSON_CreateStringArray ( const char **  strings,
int  count 
)

Creates an array of string items.

Parameters
stringsThe pointer to values for the created cy_p64_cJSON object.
countThe count of the values.
Returns
The pointer to the cy_p64_cJSON item.

◆ cy_p64_cJSON_AddItemToArray()

void cy_p64_cJSON_AddItemToArray ( cy_p64_cJSON array,
cy_p64_cJSON item 
)

Appends an item to the specified array.

Parameters
array: The pointer to the array object.
item: The pointer to the item object.

◆ cy_p64_cJSON_AddItemToObject()

void cy_p64_cJSON_AddItemToObject ( cy_p64_cJSON object,
const char *  string,
cy_p64_cJSON item 
)

Appends an item to the specified object.

Parameters
object: The pointer to the cy_p64_cJSON object.
string: The pointer to the string with a name of the cy_p64_cJSON object.
item: The pointer to the item object.

◆ cy_p64_cJSON_AddItemToObjectCS()

void cy_p64_cJSON_AddItemToObjectCS ( cy_p64_cJSON object,
const char *  string,
cy_p64_cJSON item 
)

Use this function when string is definitely const (i.e.

a literal, or as good as), and will definitely survive the cy_p64_cJSON object.

Note
When using this function, make sure to always check that (item->type & CY_P64_cJSON_StringIsConst) is zero before writing to item->string
Parameters
object: The pointer to cy_p64_cJSON object
string: The pointer to string with a name of cy_p64_cJSON object
item: The pointer to item object

◆ cy_p64_cJSON_AddItemReferenceToArray()

void cy_p64_cJSON_AddItemReferenceToArray ( cy_p64_cJSON array,
cy_p64_cJSON item 
)

Appends reference to an item to the specified array.

Use this to add an existing cy_p64_cJSON to a new cy_p64_cJSON and not corrupt your existing cy_p64_cJSON.

Parameters
array: The pointer to the cy_p64_cJSON object.
item: The pointer to the item object.

◆ cy_p64_cJSON_AddItemReferenceToObject()

void cy_p64_cJSON_AddItemReferenceToObject ( cy_p64_cJSON object,
const char *  string,
cy_p64_cJSON item 
)

This function append reference to item to the specified object.

Use this when you want to add an existing cy_p64_cJSON to a new cy_p64_cJSON, but don't want to corrupt your existing cy_p64_cJSON.

Parameters
object: The pointer to cy_p64_cJSON object
string: The pointer to string with a name of cy_p64_cJSON object
item: The pointer to item object

◆ cy_p64_cJSON_DetachItemFromArray()

cy_p64_cJSON* cy_p64_cJSON_DetachItemFromArray ( cy_p64_cJSON array,
int  which 
)

Detaches items from an array.

Parameters
array: The pointer to the cy_p64_cJSON object.
which: The number of the object to detach.
Returns
The pointer to the cy_p64_cJSON item.

◆ cy_p64_cJSON_DeleteItemFromArray()

void cy_p64_cJSON_DeleteItemFromArray ( cy_p64_cJSON array,
int  which 
)

Removes items from an array.

Parameters
array: The pointer to the cy_p64_cJSON object
which: The number of the object to delete.

◆ cy_p64_cJSON_DetachItemFromObject()

cy_p64_cJSON* cy_p64_cJSON_DetachItemFromObject ( cy_p64_cJSON object,
const char *  string 
)

Detaches items from an object.

Parameters
object: The pointer to the cy_p64_cJSON object.
string: The name of the object to detach.
Returns
The pointer to the cy_p64_cJSON item.

◆ cy_p64_cJSON_DeleteItemFromObject()

void cy_p64_cJSON_DeleteItemFromObject ( cy_p64_cJSON object,
const char *  string 
)

Removes items from an object.

Parameters
object: The pointer to the cy_p64_cJSON object.
string: The name of the object to delete.

◆ cy_p64_cJSON_InsertItemInArray()

void cy_p64_cJSON_InsertItemInArray ( cy_p64_cJSON array,
int  which,
cy_p64_cJSON newitem 
)

Inserts items in an array.

Shifts pre-existing items to the right.

Parameters
array: The pointer to cy_p64_cJSON object
which: The number of the item.
newitem: The pointer to a new object.

◆ cy_p64_cJSON_ReplaceItemInArray()

void cy_p64_cJSON_ReplaceItemInArray ( cy_p64_cJSON array,
int  which,
cy_p64_cJSON newitem 
)

Replaces items in an array.

Parameters
array: The pointer to the cy_p64_cJSON object.
which: The number of an item.
newitem: The pointer to a new object.

◆ cy_p64_cJSON_ReplaceItemInObject()

void cy_p64_cJSON_ReplaceItemInObject ( cy_p64_cJSON object,
const char *  string,
cy_p64_cJSON newitem 
)

Replaces items in an object.

Parameters
object: The pointer to the cy_p64_cJSON object.
string: The name of an item.
newitem: The pointer to a new object.

◆ cy_p64_cJSON_Duplicate()

cy_p64_cJSON* cy_p64_cJSON_Duplicate ( const cy_p64_cJSON item,
int  recurse 
)

Duplicates a cy_p64_cJSON item.

Note
This function creates a new, identical to the one you pass cy_p64_cJSON item , in new memory to be released. With recurse!=0, it will duplicate any children connected to the item. The item->next and item->prev pointers are always zero on return from this function.
Parameters
item: Pointer to cy_p64_cJSON object
recurse: 0-duplicate without children object, other- with children
Returns
The pointer to the duplicated object

◆ cy_p64_cJSON_ParseWithOpts()

cy_p64_cJSON* cy_p64_cJSON_ParseWithOpts ( const char *  value,
const char **  return_parse_end,
int  require_null_terminated 
)

Allows you to require (and check) that the JSON is null- terminated, and to retrieve the pointer to the final byte parsed.

Note
If you supply a ptr in return_parse_end and parsing fails, then return_parse_end will contain a pointer to the error. If not, then cy_p64_cJSON_GetErrorPtr() does the job.
Parameters
value: The pointer to the value for parsing.
return_parse_end: The pointer to an output error or NUL.L
require_null_terminated: "true" to require (and check) that the JSON is null- terminated, "false" otherwise.
Returns
The pointer to the parsed cy_p64_cJSON object.

◆ cy_p64_cJSON_Minify()

void cy_p64_cJSON_Minify ( char *  json)

Removes not required characters from a string like whitespace characters.

Parameters
json: The pointer to a JSON string.