MCPcopy Create free account
hub / github.com/Bwar/CJsonObject / cJSON_AddItemToArray

Function cJSON_AddItemToArray

cJSON.c:846–861  ·  view source on GitHub ↗

Add item to array/object. */

Source from the content-addressed store, hash-verified

844
845/* Add item to array/object. */
846void cJSON_AddItemToArray(cJSON *array, cJSON *item)
847{
848 cJSON *c = array->child;
849 if (!item)
850 return;
851 if (!c)
852 {
853 array->child = item;
854 }
855 else
856 {
857 while (c && c->next)
858 c = c->next;
859 suffix_object(c, item);
860 }
861}
862
863void cJSON_AddItemToArrayHead(cJSON *array, cJSON *item)
864{

Callers 5

AddMethod · 0.85
AddWithMoveMethod · 0.85
AddNullMethod · 0.85
cJSON_AddItemToObjectFunction · 0.85

Calls 1

suffix_objectFunction · 0.85

Tested by

no test coverage detected