list.c File Reference

Linked lists implementation. More...

Go to the source code of this file.


int list_push (node_l **_x, void *_data)
 Adds a new node to the list.
void * list_pop (node_l **_x)
 Removes the first node from the list and returns its node data.
int list_move (node_l **_dest, node_l **_src)
 Moves a node from _src to _dest.
int list_reverse (node_l **_x)
 Reverses the order of a list.
node_llist_sub (const node_l *_x, int _pos)
 Returns a sub-list of _x.
int list_insert (node_l **_x, int _pos, void *_data)
 Inserts a new node at the specified position.
void * list_remove (node_l **_x, int _pos)
 Removes element at position _pos+1 from the list, returning its data.
void * list_get (const node_l *_x, int _pos)
 Get data item of a list element.
size_t list_size (const node_l *_x)
 Computes the size of a list.
node_llist_join (node_l *_dest, node_l *_src)
 Appends the list _src to the list _dest.
void list_print (const node_l *_a)
 Prints list elements.
int list_split (node_l **_src, node_l **_front, node_l **_back)
 Splits a list in two equal-sized sublists.
int list_merge (node_l **_dest, node_l **_a, node_l **_b, int _cmp(void *, void *))
 Merges two lists using _cmp to compare nodes.
int list_sort (node_l **_x, int _cmp(void *, void *))
 Sorts a list.
int list_copy (const node_l *_src, node_l **_dest)
 Makes a copy of a list, not including its data items (see list_dup()).
int list_realloc (node_l *_x, size_t _sz)
 Re-allocates storage for a list.
int list_dup (node_l *_src, node_l **_dest, size_t _sz)
 Duplicates a list, including its data items (see list_copy()).
void list_delete (node_l **_x)
 Deletes a list, not including its data items.
void list_destroy (node_l **_x)
 Destroys a list, including its data items.
node_llist_create123 ()
 Auxiliary function for examples.
int cmp (void *_a, void *_b)
 Auxiliary function for examples.
int list_foreach (node_l *_x, int _func(void *))
 Calls a function for each list element.

Detailed Description

Linked lists implementation.

Definition in file list.c.

Generated on Thu Jul 19 13:36:09 2007 for libv by  doxygen 1.5.1-p1. Thank you, Logo