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

Function cJSON_CreateStringReference

contrib/cJSON/cJSON.cpp:2384–2394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2382}
2383
2384CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string)
2385{
2386 cJSON *item = cJSON_New_Item(&global_hooks);
2387 if (item != NULL)
2388 {
2389 item->type = cJSON_String | cJSON_IsReference;
2390 item->valuestring = (char*)cast_away_const(string);
2391 }
2392
2393 return item;
2394}
2395
2396CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON *child)
2397{

Callers

nothing calls this directly

Calls 2

cJSON_New_ItemFunction · 0.85
cast_away_constFunction · 0.85

Tested by

no test coverage detected