MCPcopy Create free account
hub / github.com/Netis/cloud-probe / cJSON_CreateString

Function cJSON_CreateString

cpworker/src/cJSON/cJSON.c:2478–2493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2476}
2477
2478CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string)
2479{
2480 cJSON *item = cJSON_New_Item(&global_hooks);
2481 if(item)
2482 {
2483 item->type = cJSON_String;
2484 item->valuestring = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks);
2485 if(!item->valuestring)
2486 {
2487 cJSON_Delete(item);
2488 return NULL;
2489 }
2490 }
2491
2492 return item;
2493}
2494
2495CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string)
2496{

Callers 5

unix_manager_acceptFunction · 0.85
unix_command_executeFunction · 0.85
compose_patchFunction · 0.85
cJSON_AddStringToObjectFunction · 0.85
cJSON_CreateStringArrayFunction · 0.85

Calls 3

cJSON_New_ItemFunction · 0.85
cJSON_strdupFunction · 0.85
cJSON_DeleteFunction · 0.85

Tested by

no test coverage detected