|
Packit |
423ecb |
|
|
Packit |
423ecb |
<html>
|
|
Packit |
423ecb |
<head>
|
|
Packit |
423ecb |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
|
Packit |
423ecb |
<title>list: lists interfaces</title>
|
|
Packit |
423ecb |
<meta name="generator" content="Libxml2 devhelp stylesheet"/>
|
|
Packit |
423ecb |
<link rel="start" href="index.html" title="libxml2 Reference Manual"/>
|
|
Packit |
423ecb |
<link rel="up" href="general.html" title="API"/>
|
|
Packit |
423ecb |
<link rel="stylesheet" href="style.css" type="text/css"/>
|
|
Packit |
423ecb |
<link rel="chapter" href="general.html" title="API"/>
|
|
Packit |
423ecb |
</head>
|
|
Packit |
423ecb |
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
libxml2 Reference Manual
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
list
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
list - lists interfaces
|
|
Packit |
423ecb |
this module implement the list support used in various place in the library.
|
|
Packit |
423ecb |
Author(s): Gary Pennington <Gary.Pennington@uk.sun.com>
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Synopsis
|
|
Packit |
423ecb |
typedef struct _xmlLink xmlLink;
|
|
Packit |
423ecb |
typedef xmlLink * xmlLinkPtr;
|
|
Packit |
423ecb |
typedef struct _xmlList xmlList;
|
|
Packit |
423ecb |
typedef xmlList * xmlListPtr;
|
|
Packit |
423ecb |
int xmlListInsert (xmlListPtr l, void * data);
|
|
Packit |
423ecb |
int xmlListEmpty (xmlListPtr l);
|
|
Packit |
423ecb |
void xmlListSort (xmlListPtr l);
|
|
Packit |
423ecb |
typedef void xmlListDeallocator (xmlLinkPtr lk);
|
|
Packit |
423ecb |
void xmlListMerge (xmlListPtr l1, xmlListPtr l2);
|
|
Packit |
423ecb |
xmlListPtr xmlListCreate (xmlListDeallocator deallocator, xmlListDataCompare compare);
|
|
Packit |
423ecb |
xmlListPtr xmlListDup (const xmlListPtr old);
|
|
Packit |
423ecb |
int xmlListRemoveLast (xmlListPtr l, void * data);
|
|
Packit |
423ecb |
void xmlListWalk (xmlListPtr l, xmlListWalker walker, const void * user);
|
|
Packit |
423ecb |
int xmlListRemoveAll (xmlListPtr l, void * data);
|
|
Packit |
423ecb |
int xmlListCopy (xmlListPtr cur, const xmlListPtr old);
|
|
Packit |
423ecb |
void xmlListPopFront (xmlListPtr l);
|
|
Packit |
423ecb |
void * xmlListSearch (xmlListPtr l, void * data);
|
|
Packit |
423ecb |
typedef int xmlListWalker (const void * data, const void * user);
|
|
Packit |
423ecb |
int xmlListRemoveFirst (xmlListPtr l, void * data);
|
|
Packit |
423ecb |
void xmlListReverseWalk (xmlListPtr l, xmlListWalker walker, const void * user);
|
|
Packit |
423ecb |
void * xmlLinkGetData (xmlLinkPtr lk);
|
|
Packit |
423ecb |
void xmlListClear (xmlListPtr l);
|
|
Packit |
423ecb |
int xmlListAppend (xmlListPtr l, void * data);
|
|
Packit |
423ecb |
void xmlListReverse (xmlListPtr l);
|
|
Packit |
423ecb |
typedef int xmlListDataCompare (const void * data0, const void * data1);
|
|
Packit |
423ecb |
int xmlListSize (xmlListPtr l);
|
|
Packit |
423ecb |
int xmlListPushFront (xmlListPtr l, void * data);
|
|
Packit |
423ecb |
xmlLinkPtr xmlListEnd (xmlListPtr l);
|
|
Packit |
423ecb |
void xmlListPopBack (xmlListPtr l);
|
|
Packit |
423ecb |
void * xmlListReverseSearch (xmlListPtr l, void * data);
|
|
Packit |
423ecb |
int xmlListPushBack (xmlListPtr l, void * data);
|
|
Packit |
423ecb |
xmlLinkPtr xmlListFront (xmlListPtr l);
|
|
Packit |
423ecb |
void xmlListDelete (xmlListPtr l);
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Description
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Details
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
The content of this structure is not made public by the API.
|
|
Packit |
423ecb |
} xmlLink;
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
The content of this structure is not made public by the API.
|
|
Packit |
423ecb |
} xmlList;
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Callback function used to compare 2 data.
|
|
Packit |
423ecb |
<tt>data0</tt>: | the first data | <tt>data1</tt>: | the second data | <tt>Returns</tt>: | 0 is equality, -1 or 1 otherwise depending on the ordering. |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Callback function used to free data from a list.
|
|
Packit |
423ecb |
<tt>lk</tt>: | the data to deallocate |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Callback function used when walking a list with xmlListWalk().
|
|
Packit |
423ecb |
<tt>data</tt>: | the data found in the list | <tt>user</tt>: | extra user provided data to the walker | <tt>Returns</tt>: | 0 to stop walking the list, 1 otherwise. |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
See Returns.
|
|
Packit |
423ecb |
<tt>lk</tt>: | a link | <tt>Returns</tt>: | a pointer to the data referenced from this link |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Insert data in the ordered list at the end for this value
|
|
Packit |
423ecb |
<tt>l</tt>: | a list | <tt>data</tt>: | the data | <tt>Returns</tt>: | 0 in case of success, 1 in case of failure |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Remove the all data in the list
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Move all the element from the old list in the new list
|
|
Packit |
423ecb |
<tt>cur</tt>: | the new list | <tt>old</tt>: | the old list | <tt>Returns</tt>: | 0 in case of success 1 in case of error |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Create a new list
|
|
Packit |
423ecb |
<tt>deallocator</tt>: | an optional deallocator function | <tt>compare</tt>: | an optional comparison function | <tt>Returns</tt>: | the new list or NULL in case of error |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Deletes the list and its associated data
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Duplicate the list
|
|
Packit |
423ecb |
<tt>old</tt>: | the list | <tt>Returns</tt>: | a new copy of the list or NULL in case of error |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Is the list empty ?
|
|
Packit |
423ecb |
<tt>l</tt>: | a list | <tt>Returns</tt>: | 1 if the list is empty, 0 if not empty and -1 in case of error |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Get the last element in the list
|
|
Packit |
423ecb |
<tt>l</tt>: | a list | <tt>Returns</tt>: | the last element in the list, or NULL |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Get the first element in the list
|
|
Packit |
423ecb |
<tt>l</tt>: | a list | <tt>Returns</tt>: | the first element in the list, or NULL |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Insert data in the ordered list at the beginning for this value
|
|
Packit |
423ecb |
<tt>l</tt>: | a list | <tt>data</tt>: | the data | <tt>Returns</tt>: | 0 in case of success, 1 in case of failure |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
include all the elements of the second list in the first one and clear the second list
|
|
Packit |
423ecb |
<tt>l1</tt>: | the original list | <tt>l2</tt>: | the new list |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Removes the last element in the list
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Removes the first element in the list
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
add the new data at the end of the list
|
|
Packit |
423ecb |
<tt>l</tt>: | a list | <tt>data</tt>: | new data | <tt>Returns</tt>: | 1 if successful, 0 otherwise |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
add the new data at the beginning of the list
|
|
Packit |
423ecb |
<tt>l</tt>: | a list | <tt>data</tt>: | new data | <tt>Returns</tt>: | 1 if successful, 0 otherwise |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Remove the all instance associated to data in the list
|
|
Packit |
423ecb |
<tt>l</tt>: | a list | <tt>data</tt>: | list data | <tt>Returns</tt>: | the number of deallocation, or 0 if not found |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Remove the first instance associated to data in the list
|
|
Packit |
423ecb |
<tt>l</tt>: | a list | <tt>data</tt>: | list data | <tt>Returns</tt>: | 1 if a deallocation occurred, or 0 if not found |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Remove the last instance associated to data in the list
|
|
Packit |
423ecb |
<tt>l</tt>: | a list | <tt>data</tt>: | list data | <tt>Returns</tt>: | 1 if a deallocation occurred, or 0 if not found |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Reverse the order of the elements in the list
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Search the list in reverse order for an existing value of @data
|
|
Packit |
423ecb |
<tt>l</tt>: | a list | <tt>data</tt>: | a search value | <tt>Returns</tt>: | the value associated to @data or NULL in case of error |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Walk all the element of the list in reverse order and apply the walker function to it
|
|
Packit |
423ecb |
<tt>l</tt>: | a list | <tt>walker</tt>: | a processing function | <tt>user</tt>: | a user parameter passed to the walker function |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Search the list for an existing value of @data
|
|
Packit |
423ecb |
<tt>l</tt>: | a list | <tt>data</tt>: | a search value | <tt>Returns</tt>: | the value associated to @data or NULL in case of error |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Get the number of elements in the list
|
|
Packit |
423ecb |
<tt>l</tt>: | a list | <tt>Returns</tt>: | the number of elements in the list or -1 in case of error |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Sort all the elements in the list
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
Walk all the element of the first from first to last and apply the walker function to it
|
|
Packit |
423ecb |
<tt>l</tt>: | a list | <tt>walker</tt>: | a processing function | <tt>user</tt>: | a user parameter passed to the walker function |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
|
|
Packit |
423ecb |
</body>
|
|
Packit |
423ecb |
</html>
|