MCPcopy Create free account
hub / github.com/ByConity/ByConity / cJSON_CreateRaw

Function cJSON_CreateRaw

contrib/cJSON/cJSON.cpp:2417–2432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2415}
2416
2417CJSON_PUBLIC(cJSON *) cJSON_CreateRaw(const char *raw)
2418{
2419 cJSON *item = cJSON_New_Item(&global_hooks);
2420 if(item)
2421 {
2422 item->type = cJSON_Raw;
2423 item->valuestring = (char*)cJSON_strdup((const unsigned char*)raw, &global_hooks);
2424 if(!item->valuestring)
2425 {
2426 cJSON_Delete(item);
2427 return NULL;
2428 }
2429 }
2430
2431 return item;
2432}
2433
2434CJSON_PUBLIC(cJSON *) cJSON_CreateArray(void)
2435{

Callers 1

cJSON_AddRawToObjectFunction · 0.85

Calls 3

cJSON_New_ItemFunction · 0.85
cJSON_strdupFunction · 0.85
cJSON_DeleteFunction · 0.85

Tested by

no test coverage detected