MCPcopy Create free account
hub / github.com/Bwar/CJsonObject / cJSON_DetachItemFromArray

Function cJSON_DetachItemFromArray

cJSON.c:900–915  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

898}
899
900cJSON *cJSON_DetachItemFromArray(cJSON *array, int which)
901{
902 cJSON *c = array->child;
903 while (c && which > 0)
904 c = c->next, which--;
905 if (!c)
906 return 0;
907 if (c->prev)
908 c->prev->next = c->next;
909 if (c->next)
910 c->next->prev = c->prev;
911 if (c == array->child)
912 array->child = c->next;
913 c->prev = c->next = 0;
914 return c;
915}
916void cJSON_DeleteItemFromArray(cJSON *array, int which)
917{
918 cJSON_Delete(cJSON_DetachItemFromArray(array, which));

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected