MCPcopy Index your code
hub / github.com/DaveGamble/cJSON / cJSON_AddStringToObject

Function cJSON_AddStringToObject

cJSON.c:2195–2205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2193}
2194
2195CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string)
2196{
2197 cJSON *string_item = cJSON_CreateString(string);
2198 if (add_item_to_object(object, name, string_item, &global_hooks, false))
2199 {
2200 return string_item;
2201 }
2202
2203 cJSON_Delete(string_item);
2204 return NULL;
2205}
2206
2207CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw)
2208{

Calls 3

cJSON_CreateStringFunction · 0.85
add_item_to_objectFunction · 0.85
cJSON_DeleteFunction · 0.85

Tested by 1

create_objectsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…