MCPcopy Create free account
hub / github.com/alibaba/CicadaPlayer / cJSON_AddStringToObject

Function cJSON_AddStringToObject

framework/utils/cJSON.c:2023–2033  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2021}
2022
2023CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string)
2024{
2025cJSON *string_item = cJSON_CreateString(string);
2026if (add_item_to_object(object, name, string_item, &global_hooks, false))
2027{
2028return string_item;
2029}
2030
2031cJSON_Delete(string_item);
2032return NULL;
2033}
2034
2035CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw)
2036{

Callers 1

addValueMethod · 0.85

Calls 3

cJSON_CreateStringFunction · 0.85
add_item_to_objectFunction · 0.85
cJSON_DeleteFunction · 0.85

Tested by

no test coverage detected