MCPcopy Create free account
hub / github.com/Tencent/Hardcoder / cJSON_CreateRaw

Function cJSON_CreateRaw

libapp2sys/src/main/cpp/cjson/cJSON.c:2374–2389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2372}
2373
2374CJSON_PUBLIC(cJSON *) cJSON_CreateRaw(const char *raw)
2375{
2376 cJSON *item = cJSON_New_Item(&global_hooks);
2377 if(item)
2378 {
2379 item->type = cJSON_Raw;
2380 item->valuestring = (char*)cJSON_strdup((const unsigned char*)raw, &global_hooks);
2381 if(!item->valuestring)
2382 {
2383 cJSON_Delete(item);
2384 return NULL;
2385 }
2386 }
2387
2388 return item;
2389}
2390
2391CJSON_PUBLIC(cJSON *) cJSON_CreateArray(void)
2392{

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