MCPcopy Index your code
hub / github.com/armink/struct2json / cJSON_DetachItemFromObject

Function cJSON_DetachItemFromObject

struct2json/src/cJSON.c:692–692  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

690 if (c->prev) c->prev->next=c->next;if (c->next) c->next->prev=c->prev;if (c==array->child) array->child=c->next;c->prev=c->next=0;return c;}
691void cJSON_DeleteItemFromArray(cJSON *array,int which) {cJSON_Delete(cJSON_DetachItemFromArray(array,which));}
692cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string) {int i=0;cJSON *c=object->child;while (c && cJSON_strcasecmp(c->string,string)) i++,c=c->next;if (c) return cJSON_DetachItemFromArray(object,i);return 0;}
693void cJSON_DeleteItemFromObject(cJSON *object,const char *string) {cJSON_Delete(cJSON_DetachItemFromObject(object,string));}
694
695/* Replace array/object items with new ones. */

Callers 1

Calls 2

cJSON_strcasecmpFunction · 0.85

Tested by

no test coverage detected