MCPcopy Create free account
hub / github.com/binbyu/Reader / cJSON_AddNumberToObject

Function cJSON_AddNumberToObject

opensrc/cjson/cJSON.c:2013–2023  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2011}
2012
2013CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number)
2014{
2015 cJSON *number_item = cJSON_CreateNumber(number);
2016 if (add_item_to_object(object, name, number_item, &global_hooks, false))
2017 {
2018 return number_item;
2019 }
2020
2021 cJSON_Delete(number_item);
2022 return NULL;
2023}
2024
2025CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string)
2026{

Callers 12

cJSON_AddULongToObjectFunction · 0.85
json_pointMethod · 0.85
json_rect_tMethod · 0.85
json_font_tMethod · 0.85
json_bg_image_tMethod · 0.85
json_proxy_tMethod · 0.85
json_keyset_tMethod · 0.85
json_chapter_rule_tMethod · 0.85
json_tagitem_tMethod · 0.85
json_book_source_tMethod · 0.85
json_header_tMethod · 0.85
json_item_tMethod · 0.85

Calls 3

cJSON_CreateNumberFunction · 0.85
add_item_to_objectFunction · 0.85
cJSON_DeleteFunction · 0.85

Tested by

no test coverage detected