MCPcopy Index your code
hub / github.com/armink/struct2json / cJSON_AddItemReferenceToArray

Function cJSON_AddItemReferenceToArray

struct2json/src/cJSON.c:686–686  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

684void cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item) {if (!item) return; if (item->string) cJSON_free(item->string);item->string=cJSON_strdup(string);cJSON_AddItemToArray(object,item);}
685void cJSON_AddItemToObjectCS(cJSON *object,const char *string,cJSON *item) {if (!item) return; if (!(item->type&cJSON_StringIsConst) && item->string) cJSON_free(item->string);item->string=(char*)string;item->type|=cJSON_StringIsConst;cJSON_AddItemToArray(object,item);}
686void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item) {cJSON_AddItemToArray(array,create_reference(item));}
687void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item) {cJSON_AddItemToObject(object,string,create_reference(item));}
688
689cJSON *cJSON_DetachItemFromArray(cJSON *array,int which) {cJSON *c=array->child;while (c && which>0) c=c->next,which--;if (!c) return 0;

Callers

nothing calls this directly

Calls 2

cJSON_AddItemToArrayFunction · 0.85
create_referenceFunction · 0.85

Tested by

no test coverage detected