MCPcopy Create free account
hub / github.com/Netis/cloud-probe / create_reference

Function create_reference

cpworker/src/cJSON/cJSON.c:1953–1972  ·  view source on GitHub ↗

Utility for handling references. */

Source from the content-addressed store, hash-verified

1951
1952/* Utility for handling references. */
1953static cJSON *create_reference(const cJSON *item, const internal_hooks * const hooks)
1954{
1955 cJSON *reference = NULL;
1956 if (item == NULL)
1957 {
1958 return NULL;
1959 }
1960
1961 reference = cJSON_New_Item(hooks);
1962 if (reference == NULL)
1963 {
1964 return NULL;
1965 }
1966
1967 memcpy(reference, item, sizeof(cJSON));
1968 reference->string = NULL;
1969 reference->type |= cJSON_IsReference;
1970 reference->next = reference->prev = NULL;
1971 return reference;
1972}
1973
1974static cJSON_bool add_item_to_array(cJSON *array, cJSON *item)
1975{

Callers 2

Calls 1

cJSON_New_ItemFunction · 0.85

Tested by

no test coverage detected