| 3548 | #endif |
| 3549 | |
| 3550 | static int |
| 3551 | xmlSchemaItemListRemove(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: |
no outgoing calls
no test coverage detected