MCPcopy Create free account
hub / github.com/alibaba/CicadaPlayer / cJSON_CreateRaw

Function cJSON_CreateRaw

framework/utils/cJSON.c:2366–2381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2364}
2365
2366CJSON_PUBLIC(cJSON *) cJSON_CreateRaw(const char *raw)
2367{
2368 cJSON *item = cJSON_New_Item(&global_hooks);
2369 if(item)
2370 {
2371 item->type = cJSON_Raw;
2372 item->valuestring = (char*)cJSON_strdup((const unsigned char*)raw, &global_hooks);
2373 if(!item->valuestring)
2374 {
2375 cJSON_Delete(item);
2376 return NULL;
2377 }
2378 }
2379
2380 return item;
2381}
2382
2383CJSON_PUBLIC(cJSON *) cJSON_CreateArray(void)
2384{

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