MCPcopy Index your code
hub / github.com/antirez/botlib / cJSON_AddNumberToObject

Function cJSON_AddNumberToObject

cJSON.c:2123–2133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2121}
2122
2123CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number)
2124{
2125 cJSON *number_item = cJSON_CreateNumber(number);
2126 if (add_item_to_object(object, name, number_item, &global_hooks, false))
2127 {
2128 return number_item;
2129 }
2130
2131 cJSON_Delete(number_item);
2132 return NULL;
2133}
2134
2135CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string)
2136{

Callers

nothing calls this directly

Calls 3

cJSON_CreateNumberFunction · 0.85
add_item_to_objectFunction · 0.85
cJSON_DeleteFunction · 0.85

Tested by

no test coverage detected