MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / cJSON_CreateString

Function cJSON_CreateString

external/cJSON/cJSON.c:2531–2546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2529}
2530
2531CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string)
2532{
2533 cJSON *item = cJSON_New_Item(&global_hooks);
2534 if(item)
2535 {
2536 item->type = cJSON_String;
2537 item->valuestring = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks);
2538 if(!item->valuestring)
2539 {
2540 cJSON_Delete(item);
2541 return NULL;
2542 }
2543 }
2544
2545 return item;
2546}
2547
2548CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string)
2549{

Callers 3

make_cjsonFunction · 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