| 2130 | } |
| 2131 | |
| 2132 | CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number) |
| 2133 | { |
| 2134 | cJSON *number_item = cJSON_CreateNumber(number); |
| 2135 | if (add_item_to_object(object, name, number_item, &global_hooks, false)) |
| 2136 | { |
| 2137 | return number_item; |
| 2138 | } |
| 2139 | |
| 2140 | cJSON_Delete(number_item); |
| 2141 | return NULL; |
| 2142 | } |
| 2143 | |
| 2144 | CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string) |
| 2145 | { |
nothing calls this directly
no test coverage detected