libxml2_list.h File Reference

Typedef xmlLink

typedef struct _xmlLinkxmlLink

Typedef xmlLinkPtr

typedef xmlLink *xmlLinkPtr

Typedef xmlList

typedef struct _xmlListxmlList

Typedef xmlListPtr

typedef xmlList *xmlListPtr

Typedef xmlListDeallocator

typedef void(*xmlListDeallocator

xmlListDeallocator: Callback function used to free data from a list.

Typedef xmlListDataCompare

typedef int(*xmlListDataCompare

xmlListDataCompare: Callback function used to compare 2 data.

Returns 0 is equality, -1 or 1 otherwise depending on the ordering.

Typedef xmlListWalker

typedef int(*xmlListWalker

xmlListWalker: Callback function used when walking a list with xmlListWalk().

Returns 0 to stop walking the list, 1 otherwise.

xmlListCreate ( xmlListDeallocator, xmlListDataCompare )

XMLPUBFUN xmlListPtr XMLCALLxmlListCreate(xmlListDeallocatordeallocator,
xmlListDataComparecompare
)

xmlListCreate: Create a new list

Returns the new list or NULL in case of error

Parameters
deallocatoran optional deallocator function
comparean optional comparison function

xmlListDelete ( xmlListPtr )

XMLPUBFUN void XMLCALLxmlListDelete(xmlListPtrl)

xmlListDelete: Deletes the list and its associated data

Parameters
la list

xmlListInsert ( xmlListPtr, void * )

XMLPUBFUN int XMLCALLxmlListInsert(xmlListPtrl,
void *data
)

xmlListInsert: Insert data in the ordered list at the beginning for this value

Returns 0 in case of success, 1 in case of failure

Parameters
la list
datathe data

xmlListAppend ( xmlListPtr, void * )

XMLPUBFUN int XMLCALLxmlListAppend(xmlListPtrl,
void *data
)

xmlListAppend: Insert data in the ordered list at the end for this value

Returns 0 in case of success, 1 in case of failure

Parameters
la list
datathe data

xmlListRemoveFirst ( xmlListPtr, void * )

XMLPUBFUN int XMLCALLxmlListRemoveFirst(xmlListPtrl,
void *data
)

xmlListRemoveFirst: Remove the first instance associated to data in the list

Returns 1 if a deallocation occured, or 0 if not found

Parameters
la list
datalist data

xmlListClear ( xmlListPtr )

XMLPUBFUN void XMLCALLxmlListClear(xmlListPtrl)

xmlListClear: Remove the all data in the list

Parameters
la list

xmlListEmpty ( xmlListPtr )

XMLPUBFUN int XMLCALLxmlListEmpty(xmlListPtrl)

xmlListEmpty: Is the list empty ?

Returns 1 if the list is empty, 0 otherwise

Parameters
la list

xmlListFront ( xmlListPtr )

XMLPUBFUN xmlLinkPtr XMLCALLxmlListFront(xmlListPtrl)

xmlListFront: Get the first element in the list

Returns the first element in the list, or NULL

Parameters
la list

xmlListEnd ( xmlListPtr )

XMLPUBFUN xmlLinkPtr XMLCALLxmlListEnd(xmlListPtrl)

xmlListEnd: Get the last element in the list

Returns the last element in the list, or NULL

Parameters
la list

xmlListReverse ( xmlListPtr )

XMLPUBFUN void XMLCALLxmlListReverse(xmlListPtrl)

xmlListReverse: Reverse the order of the elements in the list

Parameters
la list

xmlListPopBack ( xmlListPtr )

XMLPUBFUN void XMLCALLxmlListPopBack(xmlListPtrl)

xmlListPopBack: Removes the last element in the list

Parameters
la list

xmlListSort ( xmlListPtr )

XMLPUBFUN void XMLCALLxmlListSort(xmlListPtrl)

xmlListSort: Sort all the elements in the list

Parameters
la list

xmlListSearch ( xmlListPtr, void * )

XMLPUBFUN void *XMLCALLxmlListSearch(xmlListPtrl,
void *data
)

xmlListSearch: Search the list for an existing value of data

Returns the value associated to data or NULL in case of error

Parameters
la list
dataa search value

xmlListReverseSearch ( xmlListPtr, void * )

XMLPUBFUN void *XMLCALLxmlListReverseSearch(xmlListPtrl,
void *data
)

xmlListReverseSearch: Search the list in reverse order for an existing value of data

Returns the value associated to data or NULL in case of error

Parameters
la list
dataa search value

xmlListRemoveLast ( xmlListPtr, void * )

XMLPUBFUN int XMLCALLxmlListRemoveLast(xmlListPtrl,
void *data
)

xmlListRemoveLast: Remove the last instance associated to data in the list

Returns 1 if a deallocation occured, or 0 if not found

Parameters
la list
datalist data

xmlListRemoveAll ( xmlListPtr, void * )

XMLPUBFUN int XMLCALLxmlListRemoveAll(xmlListPtrl,
void *data
)

xmlListRemoveAll: Remove the all instance associated to data in the list

Returns the number of deallocation, or 0 if not found

Parameters
la list
datalist data

xmlListPushBack ( xmlListPtr, void * )

XMLPUBFUN int XMLCALLxmlListPushBack(xmlListPtrl,
void *data
)

xmlListPushBack: add the new data at the end of the list

Returns 1 if successful, 0 otherwise

Parameters
la list
datanew data

xmlListReverseWalk ( xmlListPtr, xmlListWalker, const void * )

XMLPUBFUN void XMLCALLxmlListReverseWalk(xmlListPtrl,
xmlListWalkerwalker,
const void *user
)

xmlListReverseWalk: Walk all the element of the list in reverse order and apply the walker function to it

Parameters
la list
walkera processing function
usera user parameter passed to the walker function

xmlListDup ( const xmlListPtr )

XMLPUBFUN xmlListPtr XMLCALLxmlListDup(const xmlListPtrold)

xmlListDup: Duplicate the list

Returns a new copy of the list or NULL in case of error

Parameters
oldthe list

xmlListSize ( xmlListPtr )

XMLPUBFUN int XMLCALLxmlListSize(xmlListPtrl)

xmlListSize: Get the number of elements in the list

Returns the number of elements in the list

Parameters
la list

xmlListPopFront ( xmlListPtr )

XMLPUBFUN void XMLCALLxmlListPopFront(xmlListPtrl)

xmlListPopFront: Removes the first element in the list

Parameters
la list

xmlListPushFront ( xmlListPtr, void * )

XMLPUBFUN int XMLCALLxmlListPushFront(xmlListPtrl,
void *data
)

xmlListPushFront: add the new data at the beginning of the list

Returns 1 if successful, 0 otherwise

Parameters
la list
datanew data

xmlListWalk ( xmlListPtr, xmlListWalker, const void * )

XMLPUBFUN void XMLCALLxmlListWalk(xmlListPtrl,
xmlListWalkerwalker,
const void *user
)

xmlListWalk: Walk all the element of the first from first to last and apply the walker function to it

Parameters
la list
walkera processing function
usera user parameter passed to the walker function

xmlListMerge ( xmlListPtr, xmlListPtr )

XMLPUBFUN void XMLCALLxmlListMerge(xmlListPtrl1,
xmlListPtrl2
)

xmlListMerge: include all the elements of the second list in the first one and clear the second list

Parameters
l1the original list
l2the new list

xmlListCopy ( xmlListPtr, const xmlListPtr )

XMLPUBFUN int XMLCALLxmlListCopy(xmlListPtrcur,
const xmlListPtrold
)

xmlListCopy: Move all the element from the old list in the new list

Returns 0 in case of success 1 in case of error

Parameters
curthe new list
oldthe old list

xmlLinkGetData ( xmlLinkPtr )

XMLPUBFUN void *XMLCALLxmlLinkGetData(xmlLinkPtrlk)

xmlLinkGetData: See Returns.

Returns a pointer to the data referenced from this link

Parameters
lka link