MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / create_reference

Function create_reference

external/cJSON/cJSON.c:2006–2025  ·  view source on GitHub ↗

Utility for handling references. */

Source from the content-addressed store, hash-verified

2004
2005/* Utility for handling references. */
2006static cJSON *create_reference(const cJSON *item, const internal_hooks * const hooks)
2007{
2008 cJSON *reference = NULL;
2009 if (item == NULL)
2010 {
2011 return NULL;
2012 }
2013
2014 reference = cJSON_New_Item(hooks);
2015 if (reference == NULL)
2016 {
2017 return NULL;
2018 }
2019
2020 memcpy(reference, item, sizeof(cJSON));
2021 reference->string = NULL;
2022 reference->type |= cJSON_IsReference;
2023 reference->next = reference->prev = NULL;
2024 return reference;
2025}
2026
2027static cJSON_bool add_item_to_array(cJSON *array, cJSON *item)
2028{

Callers 2

Calls 1

cJSON_New_ItemFunction · 0.85

Tested by

no test coverage detected