MCPcopy Create free account
hub / github.com/acl-dev/acl / create_reference

Function create_reference

lib_acl/samples/json/json5/cJSON.cpp:668–668  ·  view source on GitHub ↗

Utility for handling references. */

Source from the content-addressed store, hash-verified

666static void suffix_object(cJSON *prev,cJSON *item) {prev->next=item;item->prev=prev;}
667/* Utility for handling references. */
668static cJSON *create_reference(cJSON *item) {cJSON *ref=cJSON_New_Item();if (!ref) return 0;memcpy(ref,item,sizeof(cJSON));ref->string=0;ref->type|=cJSON_IsReference;ref->next=ref->prev=0;return ref;}
669
670/* Add item to array/object. */
671void cJSON_AddItemToArray(cJSON *array, cJSON *item) {cJSON *c=array->child;if (!item) return; if (!c) {array->child=item;} else {while (c && c->next) c=c->next; suffix_object(c,item);}}

Callers 2

Calls 2

cJSON_New_ItemFunction · 0.85
memcpyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…