MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / cJSON_AddStringToObject

Function cJSON_AddStringToObject

TheForceEngine/TFE_System/cJSON.c:2144–2154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2142}
2143
2144CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string)
2145{
2146 cJSON *string_item = cJSON_CreateString(string);
2147 if (add_item_to_object(object, name, string_item, &global_hooks, false))
2148 {
2149 return string_item;
2150 }
2151
2152 cJSON_Delete(string_item);
2153 return NULL;
2154}
2155
2156CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw)
2157{

Callers

nothing calls this directly

Calls 3

cJSON_CreateStringFunction · 0.85
add_item_to_objectFunction · 0.85
cJSON_DeleteFunction · 0.85

Tested by

no test coverage detected