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

Function cJSON_AddItemToObject

cJSON.c:881–889  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

879}
880
881void cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item)
882{
883 if (!item)
884 return;
885 if (item->string)
886 cJSON_free(item->string);
887 item->string = cJSON_strdup(string);
888 cJSON_AddItemToArray(object, item);
889}
890void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item)
891{
892 cJSON_AddItemToArray(array, create_reference(item));

Callers 6

AddEmptySubObjectMethod · 0.85
AddEmptySubArrayMethod · 0.85
AddMethod · 0.85
AddWithMoveMethod · 0.85
AddNullMethod · 0.85

Calls 2

cJSON_strdupFunction · 0.85
cJSON_AddItemToArrayFunction · 0.85

Tested by

no test coverage detected