MCPcopy Create free account
hub / github.com/antirez/botlib / create_reference

Function create_reference

cJSON.c:1931–1950  ·  view source on GitHub ↗

Utility for handling references. */

Source from the content-addressed store, hash-verified

1929
1930/* Utility for handling references. */
1931static cJSON *create_reference(const cJSON *item, const internal_hooks * const hooks)
1932{
1933 cJSON *reference = NULL;
1934 if (item == NULL)
1935 {
1936 return NULL;
1937 }
1938
1939 reference = cJSON_New_Item(hooks);
1940 if (reference == NULL)
1941 {
1942 return NULL;
1943 }
1944
1945 memcpy(reference, item, sizeof(cJSON));
1946 reference->string = NULL;
1947 reference->type |= cJSON_IsReference;
1948 reference->next = reference->prev = NULL;
1949 return reference;
1950}
1951
1952static cJSON_bool add_item_to_array(cJSON *array, cJSON *item)
1953{

Callers 2

Calls 1

cJSON_New_ItemFunction · 0.85

Tested by

no test coverage detected