MCPcopy Create free account
hub / github.com/Wassimulator/CactusViewer / cJSON_AddStringToObject

Function cJSON_AddStringToObject

src/cJSON.c:2139–2149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2137}
2138
2139CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string)
2140{
2141 cJSON *string_item = cJSON_CreateString(string);
2142 if (add_item_to_object(object, name, string_item, &global_hooks, false))
2143 {
2144 return string_item;
2145 }
2146
2147 cJSON_Delete(string_item);
2148 return NULL;
2149}
2150
2151CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw)
2152{

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