list.h File Reference

Go to the source code of this file.

Data Structures

struct  Linkable
 element used to link structures each others More...
struct  LIST
 definition of a list of linked structures More...
struct  LinkablePtr

Defines

#define listEmptyListInitializer()   {{NULL,NULL},{NULL,NULL}}
 this is a zero-ed LIST data
#define listForEach(type, i, list)
 usefull macro to parse all elements of a list.
#define listRewind(list)   &((list)->head)
 return the very first LINKABLE object of the list (before the first element linked)
#define listEnd(list)   &((list)->tail)
 return the very last LINKABLE object of the list (after the last element linked)
#define listNext(iter)   ((!((LINKABLE*)iter)->next->next) ? NULL : (((LINKABLE*)iter)->next))
 return the next element on list.
#define listPrev(iter)   ((!((LINKABLE*)iter)->prev->prev) ? NULL : (((LINKABLE*)iter)->prev))
 return the previous element on list.
#define listIsEmpty(list)   ( ((list)->head.next) == (&(list)->tail))
 return if the list is empty or not
#define listFirst(list)   ( ((list)->head.next) == (&(list)->tail) ? NULL : ((list)->head.next))
 return the first linked element of the list (the LINKABLE object right after listRewind), or NULL if the list is empty
#define listLast(list)   ( ((list)->tail.prev) == (&(list)->head) ? NULL : ((list)->tail.prev))

Typedefs

typedef Linkable LINKABLE
 element used to link structures each others
typedef LinkablePtr LINKABLEPTR

Functions

LISTcreateList (void)
 create an empty list
LISTlistSplice (LIST *list, LINKABLE *first, LINKABLE *pastLast)
 splice a list (extract a part of a list)


Generated on Thu Jun 22 11:45:27 2006 for WinDom by  doxygen 1.4.6