MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / create_reference

Function create_reference

TheForceEngine/TFE_System/cJSON.c:1940–1959  ·  view source on GitHub ↗

Utility for handling references. */

Source from the content-addressed store, hash-verified

1938
1939/* Utility for handling references. */
1940static cJSON *create_reference(const cJSON *item, const internal_hooks * const hooks)
1941{
1942 cJSON *reference = NULL;
1943 if (item == NULL)
1944 {
1945 return NULL;
1946 }
1947
1948 reference = cJSON_New_Item(hooks);
1949 if (reference == NULL)
1950 {
1951 return NULL;
1952 }
1953
1954 memcpy(reference, item, sizeof(cJSON));
1955 reference->string = NULL;
1956 reference->type |= cJSON_IsReference;
1957 reference->next = reference->prev = NULL;
1958 return reference;
1959}
1960
1961static cJSON_bool add_item_to_array(cJSON *array, cJSON *item)
1962{

Callers 2

Calls 1

cJSON_New_ItemFunction · 0.85

Tested by

no test coverage detected