The List Class
[The Classes]

A List to store objects in Order. More...


Modules

 The List Interface

Typedefs

typedef Cmaid_Container Cmaid_List
 Type definition of the List Class.

Functions

CMAID_INLINE void * cmaid_list_append (Cmaid_List *t, void *data)
 Appends a new data node.
CMAID_INLINE void * cmaid_list_prepend (Cmaid_List *t, void *data)
 Prepends a new data node.
CMAID_INLINE void cmaid_list_first_remove (Cmaid_List *t)
 Remove the first node of the list.
CMAID_INLINE void cmaid_list_last_remove (Cmaid_List *t)
 Remove the last node of the list.
CMAID_INLINE void * cmaid_list_first (Cmaid_List *t)
 Retrieve the value of the first node.
CMAID_INLINE void * cmaid_list_last (Cmaid_List *t)
 Retrieve the value of the last node.
CMAID_INLINE void * cmaid_list_insert_before (Cmaid_List *t, Cmaid_Iter *iter, void *data)
 Insert a new data node.
CMAID_INLINE void * cmaid_list_insert_after (Cmaid_List *t, Cmaid_Iter *iter, void *data)
 Insert a new data node.
CMAID_INLINE void cmaid_list_sort (Cmaid_List *t)
 Sorts the list.
CMAID_INLINE void cmaid_list_reverse (Cmaid_List *t)
 Reverse the list.


Detailed Description

A List to store objects in Order.

The list provides an interface for a container to manage objects in an ordered collection. Duplications are possible and the order is preserved in the same way they were added to the container.

It provides functions to append and prepend objects, to sort and reverse the order. It is also possible to insert object, with an iterator defining the position.


Function Documentation

CMAID_INLINE void* cmaid_list_append ( Cmaid_List t,
void *  data 
)

Appends a new data node.

Parameters:
t the list to append the new data
data the data to append
Returns:
Returns a pointer pointing to the newly appended data This functions appends a new data node to the list. Depending on the value type the list will allocated space to hold the data and thus may return another pointer then the data pointer passed to the functions. The data parameter must not be NULL.

CMAID_INLINE void* cmaid_list_first ( Cmaid_List t  ) 

Retrieve the value of the first node.

Parameters:
t the list to work with
Returns:
Returns the value of the first node Returns the value of the first node. If the list is empty NULL will be returned.

CMAID_INLINE void cmaid_list_first_remove ( Cmaid_List t  ) 

Remove the first node of the list.

Parameters:
t the list to work with
Returns:
Returns no value Remove the first node of the list. If a free function is defined the value will be freed.

CMAID_INLINE void* cmaid_list_insert_after ( Cmaid_List t,
Cmaid_Iter iter,
void *  data 
)

Insert a new data node.

Parameters:
t the list to insert the new data
data the data to insert
iter the iterator which defines the position
Returns:
Returns a pointer pointing to the new data This functions inserts a new data node to the list. Depending on the value type the list will allocated space to hold the data and thus may return another pointer then the data pointer passed to the functions. The data parameter must not be NULL.

CMAID_INLINE void* cmaid_list_insert_before ( Cmaid_List t,
Cmaid_Iter iter,
void *  data 
)

Insert a new data node.

Parameters:
t the list to insert the new data
data the data to insert
iter the iterator which defines the position
Returns:
Returns a pointer pointing to the new data This functions inserts a new data node to the list. Depending on the value type the list will allocated space to hold the data and thus may return another pointer then the data pointer passed to the functions. The data parameter must not be NULL.

CMAID_INLINE void* cmaid_list_last ( Cmaid_List t  ) 

Retrieve the value of the last node.

Parameters:
t the list to work with
Returns:
Returns the value of the last node Returns the value of the last node. If the list is empty NULL will be returned.

CMAID_INLINE void cmaid_list_last_remove ( Cmaid_List t  ) 

Remove the last node of the list.

Parameters:
t the list to work with
Returns:
Returns no value Remove the last node of the list. If a free function is defined the value will be freed.

CMAID_INLINE void* cmaid_list_prepend ( Cmaid_List t,
void *  data 
)

Prepends a new data node.

Parameters:
t the list to prepend the new data
data the data to prepend
Returns:
Returns a pointer pointing to the newly prepended data This functions prepends a new data node to the list. Depending on the value type the list will allocated space to hold the data and thus may return another pointer then the data pointer passed to the functions. The data parameter must not be NULL.

CMAID_INLINE void cmaid_list_reverse ( Cmaid_List t  ) 

Reverse the list.

Parameters:
t the list to reverse
Returns:
Returns no value

CMAID_INLINE void cmaid_list_sort ( Cmaid_List t  ) 

Sorts the list.

Parameters:
t the list to sort
Returns:
Returns no value


Generated on Wed Aug 5 00:20:50 2009 for Cmaid by  doxygen 1.5.8