MCPcopy Index your code
hub / github.com/esnet/iperf / cJSON_CreateString

Function cJSON_CreateString

src/cjson.c:2466–2481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2464}
2465
2466CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string)
2467{
2468 cJSON *item = cJSON_New_Item(&global_hooks);
2469 if(item)
2470 {
2471 item->type = cJSON_String;
2472 item->valuestring = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks);
2473 if(!item->valuestring)
2474 {
2475 cJSON_Delete(item);
2476 return NULL;
2477 }
2478 }
2479
2480 return item;
2481}
2482
2483CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string)
2484{

Callers 6

iperf_json_printfFunction · 0.85
cJSON_AddStringToObjectFunction · 0.85
cJSON_CreateStringArrayFunction · 0.85
iperf_json_finishFunction · 0.85
iperf_run_clientFunction · 0.85
iperf_run_serverFunction · 0.85

Calls 3

cJSON_New_ItemFunction · 0.85
cJSON_strdupFunction · 0.85
cJSON_DeleteFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…