/** * xmlListClear: * @param l a list * * Remove the all data in the list */ XMLPUBFUNEXPORT void xmlListClear(xmlListPtr list) { xmlLinkPtr lk = list->sentinel->next; while(lk != list->sentinel) { xmlLinkPtr next = lk->next; xmlLinkDeallocator(list, lk); lk = next; } }
/** * xmlListClear: * @l: a list * * Remove the all data in the list */ void xmlListClear(xmlListPtr l) { xmlLinkPtr lk = l->sentinel->next; while(lk != l->sentinel) { xmlLinkPtr next = lk->next; xmlLinkDeallocator(l, lk); lk = next; } }
/** * xmlListRemoveLast: * @param l a list * @param data list data * * Remove the last instance associated to data in the list * * Returns 1 if a deallocation occured, or 0 if not found */ int xmlListRemoveLast(xmlListPtr list, void *data) { xmlLinkPtr lk; /*Find the last instance of this data */ lk = xmlListLinkReverseSearch(list, data); if (lk != NULL) { xmlLinkDeallocator(list, lk); return 1; } return 0; }
/** * xmlListRemoveFirst: * @param l a list * @param data list data * * Remove the first instance associated to data in the list * * Returns 1 if a deallocation occured, or 0 if not found */ XMLPUBFUNEXPORT int xmlListRemoveFirst(xmlListPtr list, void *data) { xmlLinkPtr lk; /*Find the first instance of this data */ lk = xmlListLinkSearch(list, data); if (lk != NULL) { xmlLinkDeallocator(list, lk); return 1; } return 0; }
/** * xmlListRemoveFirst: * @l: a list * @data: list data * * Remove the first instance associated to data in the list * * Returns 1 if a deallocation occured, or 0 if not found */ int xmlListRemoveFirst(xmlListPtr l, void *data) { xmlLinkPtr lk; if (l == NULL) return(0); /*Find the first instance of this data */ lk = xmlListLinkSearch(l, data); if (lk != NULL) { xmlLinkDeallocator(l, lk); return 1; } return 0; }
int xmlListRemoveLast(xmlListPtr l, void *data) { xmlLinkPtr lk; if (l == NULL) return(0); lk = xmlListLinkReverseSearch(l, data); if (lk != NULL) { xmlLinkDeallocator(l, lk); return 1; } return 0; }
/** * xmlListPopBack: * @l: a list * * Removes the last element in the list */ void xmlListPopBack(xmlListPtr l) { if (!xmlListEmpty(l)) xmlLinkDeallocator(l, l->sentinel->prev); }
/** * xmlListPopFront: * @l: a list * * Removes the first element in the list */ void xmlListPopFront(xmlListPtr l) { if (!xmlListEmpty(l)) xmlLinkDeallocator(l, l->sentinel->next); }
/** * xmlListPopFront: * @param l a list * * Removes the first element in the list */ XMLPUBFUNEXPORT void xmlListPopFront(xmlListPtr list) { if(!xmlListEmpty(list)) xmlLinkDeallocator(list, list->sentinel->next); }
/** * xmlListPopBack: * @param l a list * * Removes the last element in the list */ void xmlListPopBack(xmlListPtr list) { if(!xmlListEmpty(list)) xmlLinkDeallocator(list, list->sentinel->prev); }