MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / cJSON_CreateString

Function cJSON_CreateString

ThirdParty/cjson/cJSON.c:2330–2345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2328}
2329
2330CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string)
2331{
2332 cJSON *item = cJSON_New_Item(&global_hooks);
2333 if(item)
2334 {
2335 item->type = cJSON_String;
2336 item->valuestring = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks);
2337 if(!item->valuestring)
2338 {
2339 cJSON_Delete(item);
2340 return NULL;
2341 }
2342 }
2343
2344 return item;
2345}
2346
2347CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string)
2348{

Callers 3

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