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

Function cJSON_CreateStr

lib/cJSON.c:2199–2214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2197}
2198
2199cJSON *cJSON_CreateStr(const char *string, size_t len)
2200{
2201 cJSON *item = cJSON_New_Item();
2202 if(item)
2203 {
2204 item->type = cJSON_String;
2205 item->valuestring = (char*)cJSON_strndup((const unsigned char*)string, len);
2206 if(!item->valuestring)
2207 {
2208 cJSON_Delete(item);
2209 return NULL;
2210 }
2211 }
2212
2213 return item;
2214}
2215
2216extern cJSON *cJSON_CreateRaw(const char *raw)
2217{

Callers 15

_init_mi_resultFunction · 0.85
init_mi_error_extraFunction · 0.85
_add_mi_itemFunction · 0.85
mi_xmlrpc_get_paramFunction · 0.85
dm_avps2jsonFunction · 0.85
dict_avp_dec_hexFunction · 0.85
w_sip_to_jsonFunction · 0.85
mi_script_parse_requestFunction · 0.85
push_kv_to_jsonFunction · 0.85
on_header_callbackFunction · 0.85
aka_av_diameter_fetchFunction · 0.85
jsonrpc_build_cmdFunction · 0.85

Calls 3

cJSON_strndupFunction · 0.85
cJSON_New_ItemFunction · 0.70
cJSON_DeleteFunction · 0.70

Tested by

no test coverage detected