xlist.c File Reference

Include dependency graph for xlist.c:


Functions

static XListxlist_node_new (void *data)
XListxlist_new (void)
 Create a new list.
XListxlist_clone (XList *list)
 Clone a list using the default clone function.
XListxlist_clone_with (XList *list, XCloneFunc clone)
 Clone a list using a custom clone function.
XListxlist_tail (XList *list)
 Return the tail element of a list.
XListxlist_prepend (XList *list, void *data)
 Prepend a new node to a list containing given data.
XListxlist_append (XList *list, void *data)
 Append a new node to a list containing given data.
XListxlist_add_before (XList *list, void *data, XList *node)
 Add a new node containing given data before a given node.
XListxlist_add_after (XList *list, void *data, XList *node)
 Add a new node containing given data after a given node.
XListxlist_find (XList *list, void *data)
 Find the first node containing given data in a list.
XListxlist_remove (XList *list, XList *node)
 Remove a node from a list.
int xlist_length (XList *list)
 Query the number of items in a list.
int xlist_is_empty (XList *list)
 Query if a list is empty, ie.
int xlist_is_singleton (XList *list)
 Query if the list is singleton, ie.
XListxlist_free_with (XList *list, XFreeFunc free_func)
 Free a list, using a given function to free each data element.
XListxlist_free (XList *list)
 Free a list, using anx_free() to free each data element.

Function Documentation

XList* xlist_add_after ( XList list,
void *  data,
XList node 
)

Add a new node containing given data after a given node.

Parameters:
list the list
data the data element of the newly created node
node the node after which to add the newly created node
Returns:
the head of the list

XList* xlist_add_before ( XList list,
void *  data,
XList node 
)

Add a new node containing given data before a given node.

Parameters:
list the list
data the data element of the newly created node
node the node before which to add the newly created node
Returns:
the head of the list (which may have changed)

XList* xlist_append ( XList list,
void *  data 
)

Append a new node to a list containing given data.

Parameters:
list the list
data the data element of the newly created node
Returns:
the head of the list

XList* xlist_clone ( XList list  ) 

Clone a list using the default clone function.

Parameters:
list the list to clone
Returns:
a newly cloned list

XList* xlist_clone_with ( XList list,
XCloneFunc  clone 
)

Clone a list using a custom clone function.

Parameters:
list the list to clone
clone the function to use to clone a list item
Returns:
a newly cloned list

XList* xlist_find ( XList list,
void *  data 
)

Find the first node containing given data in a list.

Parameters:
list the list
data the data element to find
Returns:
the first node containing given data, or NULL if it is not found

XList* xlist_free ( XList list  ) 

Free a list, using anx_free() to free each data element.

Parameters:
list the list
Returns:
NULL on success

XList* xlist_free_with ( XList list,
XFreeFunc  free_func 
)

Free a list, using a given function to free each data element.

Parameters:
list the list
free_func a function to free each data element
Returns:
NULL on success

int xlist_is_empty ( XList list  ) 

Query if a list is empty, ie.

contains no items

Parameters:
list the list
Returns:
1 if the list is empty, 0 otherwise

int xlist_is_singleton ( XList list  ) 

Query if the list is singleton, ie.

contains exactly one item

Parameters:
list the list
Returns:
1 if the list is singleton, 0 otherwise

int xlist_length ( XList list  ) 

Query the number of items in a list.

Parameters:
list the list
Returns:
the number of nodes in the list

XList* xlist_new ( void   ) 

Create a new list.

Returns:
a new list

static XList* xlist_node_new ( void *  data  )  [static]

XList* xlist_prepend ( XList list,
void *  data 
)

Prepend a new node to a list containing given data.

Parameters:
list the list
data the data element of the newly created node
Returns:
the new list head

XList* xlist_remove ( XList list,
XList node 
)

Remove a node from a list.

Parameters:
list the list
node the node to remove
Returns:
the head of the list (which may have changed)

XList* xlist_tail ( XList list  ) 

Return the tail element of a list.

Parameters:
list the list
Returns:
the tail element


Generated on Wed Aug 13 08:03:12 2008 for VLC by  doxygen 1.5.1