Lines Matching refs:l
59 xmlLinkDeallocator(xmlListPtr l, xmlLinkPtr lk) in xmlLinkDeallocator() argument
63 if(l->linkDeallocator) in xmlLinkDeallocator()
64 l->linkDeallocator(lk); in xmlLinkDeallocator()
98 xmlListLowerSearch(xmlListPtr l, void *data) in xmlListLowerSearch() argument
102 if (l == NULL) in xmlListLowerSearch()
104 … for(lk = l->sentinel->next;lk != l->sentinel && l->linkCompare(lk->data, data) <0 ;lk = lk->next); in xmlListLowerSearch()
118 xmlListHigherSearch(xmlListPtr l, void *data) in xmlListHigherSearch() argument
122 if (l == NULL) in xmlListHigherSearch()
124 … for(lk = l->sentinel->prev;lk != l->sentinel && l->linkCompare(lk->data, data) >0 ;lk = lk->prev); in xmlListHigherSearch()
138 xmlListLinkSearch(xmlListPtr l, void *data) in xmlListLinkSearch() argument
141 if (l == NULL) in xmlListLinkSearch()
143 lk = xmlListLowerSearch(l, data); in xmlListLinkSearch()
144 if (lk == l->sentinel) in xmlListLinkSearch()
147 if (l->linkCompare(lk->data, data) ==0) in xmlListLinkSearch()
163 xmlListLinkReverseSearch(xmlListPtr l, void *data) in xmlListLinkReverseSearch() argument
166 if (l == NULL) in xmlListLinkReverseSearch()
168 lk = xmlListHigherSearch(l, data); in xmlListLinkReverseSearch()
169 if (lk == l->sentinel) in xmlListLinkReverseSearch()
172 if (l->linkCompare(lk->data, data) ==0) in xmlListLinkReverseSearch()
190 xmlListPtr l; in xmlListCreate() local
191 if (NULL == (l = (xmlListPtr )xmlMalloc( sizeof(xmlList)))) { in xmlListCreate()
197 memset(l, 0, sizeof(xmlList)); in xmlListCreate()
200 if (NULL ==(l->sentinel = (xmlLinkPtr )xmlMalloc(sizeof(xmlLink)))) { in xmlListCreate()
203 xmlFree(l); in xmlListCreate()
206 l->sentinel->next = l->sentinel; in xmlListCreate()
207 l->sentinel->prev = l->sentinel; in xmlListCreate()
208 l->sentinel->data = NULL; in xmlListCreate()
212 l->linkDeallocator = deallocator; in xmlListCreate()
215 l->linkCompare = compare; in xmlListCreate()
217 l->linkCompare = xmlLinkCompare; in xmlListCreate()
218 return l; in xmlListCreate()
231 xmlListSearch(xmlListPtr l, void *data) in xmlListSearch() argument
234 if (l == NULL) in xmlListSearch()
236 lk = xmlListLinkSearch(l, data); in xmlListSearch()
252 xmlListReverseSearch(xmlListPtr l, void *data) in xmlListReverseSearch() argument
255 if (l == NULL) in xmlListReverseSearch()
257 lk = xmlListLinkReverseSearch(l, data); in xmlListReverseSearch()
273 xmlListInsert(xmlListPtr l, void *data) in xmlListInsert() argument
277 if (l == NULL) in xmlListInsert()
279 lkPlace = xmlListLowerSearch(l, data); in xmlListInsert()
305 int xmlListAppend(xmlListPtr l, void *data) in xmlListAppend() argument
309 if (l == NULL) in xmlListAppend()
311 lkPlace = xmlListHigherSearch(l, data); in xmlListAppend()
333 void xmlListDelete(xmlListPtr l) in xmlListDelete() argument
335 if (l == NULL) in xmlListDelete()
338 xmlListClear(l); in xmlListDelete()
339 xmlFree(l->sentinel); in xmlListDelete()
340 xmlFree(l); in xmlListDelete()
353 xmlListRemoveFirst(xmlListPtr l, void *data) in xmlListRemoveFirst() argument
357 if (l == NULL) in xmlListRemoveFirst()
360 lk = xmlListLinkSearch(l, data); in xmlListRemoveFirst()
362 xmlLinkDeallocator(l, lk); in xmlListRemoveFirst()
378 xmlListRemoveLast(xmlListPtr l, void *data) in xmlListRemoveLast() argument
382 if (l == NULL) in xmlListRemoveLast()
385 lk = xmlListLinkReverseSearch(l, data); in xmlListRemoveLast()
387 xmlLinkDeallocator(l, lk); in xmlListRemoveLast()
403 xmlListRemoveAll(xmlListPtr l, void *data) in xmlListRemoveAll() argument
407 if (l == NULL) in xmlListRemoveAll()
410 while(xmlListRemoveFirst(l, data)) in xmlListRemoveAll()
422 xmlListClear(xmlListPtr l) in xmlListClear() argument
426 if (l == NULL) in xmlListClear()
428 lk = l->sentinel->next; in xmlListClear()
429 while(lk != l->sentinel) { in xmlListClear()
432 xmlLinkDeallocator(l, lk); in xmlListClear()
446 xmlListEmpty(xmlListPtr l) in xmlListEmpty() argument
448 if (l == NULL) in xmlListEmpty()
450 return (l->sentinel->next == l->sentinel); in xmlListEmpty()
462 xmlListFront(xmlListPtr l) in xmlListFront() argument
464 if (l == NULL) in xmlListFront()
466 return (l->sentinel->next); in xmlListFront()
478 xmlListEnd(xmlListPtr l) in xmlListEnd() argument
480 if (l == NULL) in xmlListEnd()
482 return (l->sentinel->prev); in xmlListEnd()
494 xmlListSize(xmlListPtr l) in xmlListSize() argument
499 if (l == NULL) in xmlListSize()
502 for(lk = l->sentinel->next; lk != l->sentinel; lk = lk->next, count++); in xmlListSize()
513 xmlListPopFront(xmlListPtr l) in xmlListPopFront() argument
515 if(!xmlListEmpty(l)) in xmlListPopFront()
516 xmlLinkDeallocator(l, l->sentinel->next); in xmlListPopFront()
526 xmlListPopBack(xmlListPtr l) in xmlListPopBack() argument
528 if(!xmlListEmpty(l)) in xmlListPopBack()
529 xmlLinkDeallocator(l, l->sentinel->prev); in xmlListPopBack()
542 xmlListPushFront(xmlListPtr l, void *data) in xmlListPushFront() argument
546 if (l == NULL) in xmlListPushFront()
548 lkPlace = l->sentinel; in xmlListPushFront()
574 xmlListPushBack(xmlListPtr l, void *data) in xmlListPushBack() argument
578 if (l == NULL) in xmlListPushBack()
580 lkPlace = l->sentinel->prev; in xmlListPushBack()
618 xmlListReverse(xmlListPtr l) in xmlListReverse() argument
623 if (l == NULL) in xmlListReverse()
625 lkPrev = l->sentinel; in xmlListReverse()
626 for (lk = l->sentinel->next; lk != l->sentinel; lk = lk->next) { in xmlListReverse()
643 xmlListSort(xmlListPtr l) in xmlListSort() argument
647 if (l == NULL) in xmlListSort()
649 if(xmlListEmpty(l)) in xmlListSort()
658 if (NULL ==(lTemp = xmlListDup(l))) in xmlListSort()
660 xmlListClear(l); in xmlListSort()
661 xmlListMerge(l, lTemp); in xmlListSort()
676 xmlListWalk(xmlListPtr l, xmlListWalker walker, const void *user) { in xmlListWalk() argument
679 if ((l == NULL) || (walker == NULL)) in xmlListWalk()
681 for(lk = l->sentinel->next; lk != l->sentinel; lk = lk->next) { in xmlListWalk()
697 xmlListReverseWalk(xmlListPtr l, xmlListWalker walker, const void *user) { in xmlListReverseWalk() argument
700 if ((l == NULL) || (walker == NULL)) in xmlListReverseWalk()
702 for(lk = l->sentinel->prev; lk != l->sentinel; lk = lk->prev) { in xmlListReverseWalk()