MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlSchemaItemListRemove

Function xmlSchemaItemListRemove

ThirdParty/libxml2/vtklibxml2/xmlschemas.c:3550–3571  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3548#endif
3549
3550static int
3551xmlSchemaItemListRemove(xmlSchemaItemListPtr list, int idx)
3552{
3553 int i;
3554 if ((list->items == NULL) || (idx >= list->nbItems))
3555 return(-1);
3556
3557 if (list->nbItems == 1) {
3558 /* TODO: Really free the list? */
3559 xmlFree(list->items);
3560 list->items = NULL;
3561 list->nbItems = 0;
3562 list->sizeItems = 0;
3563 } else if (list->nbItems -1 == idx) {
3564 list->nbItems--;
3565 } else {
3566 for (i = idx; i < list->nbItems -1; i++)
3567 list->items[i] = list->items[i+1];
3568 list->nbItems--;
3569 }
3570 return(0);
3571}
3572
3573/**
3574 * xmlSchemaItemListFree:

Calls

no outgoing calls

Tested by

no test coverage detected