MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / cJSON_AddItemReferenceToArray

Function cJSON_AddItemReferenceToArray

modules/freeswitch/esl/src/esl_json.c:510–510  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

508ESL_DECLARE(void) cJSON_AddItemToArray(cJSON *array, cJSON *item) {cJSON *c=array->child;if (!item) return; if (!c) {array->child=item;} else {while (c && c->next) c=c->next; suffix_object(c,item);}}
509ESL_DECLARE(void) 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);}
510ESL_DECLARE(void) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item) {cJSON_AddItemToArray(array,create_reference(item));}
511ESL_DECLARE(void) cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item) {cJSON_AddItemToObject(object,string,create_reference(item));}
512
513ESL_DECLARE(cJSON *)cJSON_DetachItemFromArray(cJSON *array,int which) {cJSON *c=array->child;while (c && which>0) c=c->next,which--;if (!c) return 0;

Callers 1

esl_json.hFile · 0.50

Calls 2

cJSON_AddItemToArrayFunction · 0.70
create_referenceFunction · 0.70

Tested by

no test coverage detected