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

Function cJSON_CreateStringReference

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

Source from the content-addressed store, hash-verified

2339}
2340
2341CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string)
2342{
2343 cJSON *item = cJSON_New_Item(&global_hooks);
2344 if (item != NULL)
2345 {
2346 item->type = cJSON_String | cJSON_IsReference;
2347 item->valuestring = (char*)cast_away_const(string);
2348 }
2349
2350 return item;
2351}
2352
2353CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON *child)
2354{

Callers

nothing calls this directly

Calls 2

cJSON_New_ItemFunction · 0.85
cast_away_constFunction · 0.85

Tested by

no test coverage detected