xlist.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Classes

struct  _XList

Typedefs

typedef _XList XList
typedef void *(* XCloneFunc )(void *data)
typedef void *(* XFreeFunc )(void *data)

Functions

XListxlist_new (void)
XListxlist_clone (XList *list)
XListxlist_clone_with (XList *list, XCloneFunc clone)
XListxlist_tail (XList *list)
XListxlist_prepend (XList *list, void *data)
XListxlist_append (XList *list, void *data)
XListxlist_add_before (XList *list, void *data, XList *node)
XListxlist_add_after (XList *list, void *data, XList *node)
XListxlist_find (XList *list, void *data)
XListxlist_remove (XList *list, XList *node)
int xlist_length (XList *list)
int xlist_is_empty (XList *list)
int xlist_is_singleton (XList *list)
XListxlist_free_with (XList *list, XFreeFunc free_func)
XListxlist_free (XList *list)


Typedef Documentation

typedef void*(* XCloneFunc)(void *data)
 

Signature of a cloning function.

Definition at line 55 of file xlist.h.

Referenced by xlist_clone_with().

typedef void*(* XFreeFunc)(void *data)
 

Signature of a freeing function.

Definition at line 60 of file xlist.h.

Referenced by xlist_free_with().

typedef struct _XList XList
 

A doubly linked list

Definition at line 44 of file xlist.h.

Referenced by xlist_add_after(), xlist_add_before(), xlist_append(), xlist_clone(), xlist_clone_with(), xlist_find(), xlist_free(), xlist_free_with(), xlist_is_empty(), xlist_is_singleton(), xlist_length(), xlist_node_new(), xlist_prepend(), xlist_remove(), xlist_tail(), xtag_first_child(), xtag_free(), xtag_get_attribute(), xtag_get_pcdata(), xtag_next_child(), and xtag_snprint().


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

Definition at line 148 of file xlist.c.

References _XList::next, _XList::prev, XList, xlist_node_new(), and xlist_prepend().

Here is the call graph for this function:

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)

Definition at line 128 of file xlist.c.

References _XList::next, _XList::prev, XList, xlist_append(), xlist_node_new(), and xlist_prepend().

Here is the call graph for this function:

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

Definition at line 114 of file xlist.c.

References _XList::next, _XList::prev, XList, xlist_node_new(), and xlist_tail().

Referenced by xlist_add_before(), xlist_clone(), xlist_clone_with(), xtag_new_parse(), and xtag_parse_tag().

Here is the call graph for this function:

XList* xlist_clone XList list  ) 
 

Clone a list using the default clone function

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

Definition at line 57 of file xlist.c.

References _XList::data, _XList::next, XList, xlist_append(), and xlist_new().

Referenced by xlist_clone_with().

Here is the call graph for this function:

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

Definition at line 72 of file xlist.c.

References _XList::data, _XList::next, XCloneFunc, XList, xlist_append(), xlist_clone(), and xlist_new().

Here is the call graph for this function:

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

Definition at line 166 of file xlist.c.

References _XList::data, _XList::next, and XList.

XList* xlist_free XList list  ) 
 

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

Parameters:
list the list
Returns:
NULL on success

Definition at line 240 of file xlist.c.

References _XList::next, and XList.

Referenced by xtag_free().

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

Definition at line 221 of file xlist.c.

References _XList::data, _XList::next, XFreeFunc, and XList.

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

Definition at line 201 of file xlist.c.

References XList.

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

Definition at line 207 of file xlist.c.

References _XList::next, and XList.

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

Definition at line 189 of file xlist.c.

References _XList::next, and XList.

XList* xlist_new void   ) 
 

Create a new list

Returns:
a new list

Definition at line 51 of file xlist.c.

Referenced by xlist_clone(), and xlist_clone_with().

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

Definition at line 101 of file xlist.c.

References _XList::next, _XList::prev, XList, and xlist_node_new().

Referenced by xlist_add_after(), and xlist_add_before().

Here is the call graph for this function:

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)

Definition at line 177 of file xlist.c.

References _XList::next, _XList::prev, and XList.

XList* xlist_tail XList list  ) 
 

Return the tail element of a list

Parameters:
list the list
Returns:
the tail element

Definition at line 92 of file xlist.c.

References _XList::next, and XList.

Referenced by xlist_append().


Generated on Tue Feb 15 14:56:08 2005 for oggdsf by  doxygen 1.3.9