MCPcopy Create free account
hub / github.com/acl-dev/acl / cJSON_AddItemReferenceToObject

Function cJSON_AddItemReferenceToObject

lib_acl/samples/json/json5/cJSON.cpp:675–675  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

673void cJSON_AddItemToObjectCS(cJSON *object,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);}
674void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item) {cJSON_AddItemToArray(array,create_reference(item));}
675void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item) {cJSON_AddItemToObject(object,string,create_reference(item));}
676
677cJSON *cJSON_DetachItemFromArray(cJSON *array,int which) {cJSON *c=array->child;while (c && which>0) c=c->next,which--;if (!c) return 0;
678 if (c->prev) c->prev->next=c->next;if (c->next) c->next->prev=c->prev;if (c==array->child) array->child=c->next;c->prev=c->next=0;return c;}

Callers

nothing calls this directly

Calls 2

cJSON_AddItemToObjectFunction · 0.85
create_referenceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…