/** * xmlListDelete: * @l: a list * * Deletes the list and its associated data */ void xmlListDelete(xmlListPtr l) { if (l == NULL) return; xmlListClear(l); xmlFree(l->sentinel); xmlFree(l); }
void xmlListSort(xmlListPtr l) { xmlListPtr lTemp; if (l == NULL) return; if(xmlListEmpty(l)) return; if (NULL ==(lTemp = xmlListDup(l))) return; xmlListClear(l); xmlListMerge(l, lTemp); xmlListDelete(lTemp); return; }
/** * xmlListSort: * @param l a list * * Sort all the elements in the list */ void xmlListSort(xmlListPtr list) { xmlListPtr lTemp; if(xmlListEmpty(list)) return; /* I think that the real answer is to implement quicksort, the * alternative is to implement some list copying procedure which * would be based on a list copy followed by a clear followed by * an insert. This is slow... */ if (NULL ==(lTemp = xmlListDup(list))) return; xmlListClear(list); xmlListMerge(list, lTemp); xmlListDelete(lTemp); return; }
/** * xmlListMerge: * @l1: the original list * @l2: the new list * * include all the elements of the second list in the first one and * clear the second list */ void xmlListMerge(xmlListPtr l1, xmlListPtr l2) { xmlListCopy(l1, l2); xmlListClear(l2); }
/** * xmlListMerge: * @param l1 the original list * @param l2 the new list * * include all the elements of the second list in the first one and * clear the second list */ XMLPUBFUNEXPORT void xmlListMerge(xmlListPtr list1, xmlListPtr list2) { xmlListCopy(list1, list2); xmlListClear(list2); }
/** * xmlListDelete: * @param l a list * * Deletes the list and its associated data */ XMLPUBFUNEXPORT void xmlListDelete(xmlListPtr list) { xmlListClear(list); xmlFree(list->sentinel); xmlFree(list); }
/** * xmlListDelete: * @l: a list * * Deletes the list and its associated data */ void xmlListDelete(xmlListPtr l) { xmlListClear(l); xmlFree(l->sentinel); xmlFree(l); }