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

Function cJSON_CreateObject

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

Source from the content-addressed store, hash-verified

535ESL_DECLARE(cJSON *)cJSON_CreateString(const char *string) {cJSON *item=cJSON_New_Item();if(item){item->type=cJSON_String;item->valuestring=cJSON_strdup(string);}return item;}
536ESL_DECLARE(cJSON *)cJSON_CreateArray(void) {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_Array;return item;}
537ESL_DECLARE(cJSON *)cJSON_CreateObject(void) {cJSON *item=cJSON_New_Item();if(item)item->type=cJSON_Object;return item;}
538
539/* Create Arrays: */
540ESL_DECLARE(cJSON *)cJSON_CreateIntArray(int *numbers,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a!=0 && i<count;i++){n=cJSON_CreateNumber(numbers[i]);if(!n)return 0;if(!i)a->child=n;else suffix_object(p,n);p=n;}return a;}

Callers 15

esl_event_serialize_jsonFunction · 0.70
_init_mi_resultFunction · 0.50
init_mi_error_extraFunction · 0.50
_add_mi_itemFunction · 0.50
mi_http_run_mi_cmdFunction · 0.50
mi_xmlrpc_parse_paramsFunction · 0.50
mi_xmlrpc_run_mi_cmdFunction · 0.50
dm_avps2jsonFunction · 0.50
w_sip_to_jsonFunction · 0.50
mi_script_parse_requestFunction · 0.50
store_serializeFunction · 0.50
create_http2_stream_dataFunction · 0.50

Calls 1

cJSON_New_ItemFunction · 0.70

Tested by

no test coverage detected