MCPcopy Create free account
hub / github.com/esnet/iperf / create_reference

Function create_reference

src/cjson.c:1946–1965  ·  view source on GitHub ↗

Utility for handling references. */

Source from the content-addressed store, hash-verified

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

Callers 2

Calls 1

cJSON_New_ItemFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…