MCPcopy Index your code
hub / github.com/DaveGamble/cJSON / cJSON_CreateString

Function cJSON_CreateString

cJSON.c:2516–2531  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2514}
2515
2516CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string)
2517{
2518 cJSON *item = cJSON_New_Item(&global_hooks);
2519 if(item)
2520 {
2521 item->type = cJSON_String;
2522 item->valuestring = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks);
2523 if(!item->valuestring)
2524 {
2525 cJSON_Delete(item);
2526 return NULL;
2527 }
2528 }
2529
2530 return item;
2531}
2532
2533CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string)
2534{

Calls 3

cJSON_New_ItemFunction · 0.85
cJSON_strdupFunction · 0.85
cJSON_DeleteFunction · 0.85

Used in the wild real call sites across dependent graphs

searching dependent graphs…