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

Function cJSON_AddItemToObject

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

Source from the content-addressed store, hash-verified

507/* Add item to array/object. */
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

Callers 13

esl_event_serialize_jsonFunction · 0.70
_init_mi_resultFunction · 0.50
init_mi_error_extraFunction · 0.50
mi_http_run_mi_cmdFunction · 0.50
mi_xmlrpc_get_paramFunction · 0.50
mi_xmlrpc_parse_paramsFunction · 0.50
dm_avps2jsonFunction · 0.50
w_sip_to_jsonFunction · 0.50
mi_script_parse_requestFunction · 0.50
jsonrpc_build_cmdFunction · 0.50

Calls 2

cJSON_strdupFunction · 0.70
cJSON_AddItemToArrayFunction · 0.70

Tested by

no test coverage detected