Go to the source code of this file.
Classes | |
| struct | listlink |
Defines | |
| #define | list_next(n) ((n) ? (n)->next : NULL) |
| #define | list_prev(n) ((n) ? (n)->prev : NULL) |
| #define | LIST_FOREACH(func) ((ListForeachFunc)func) |
Typedefs | |
| typedef int(* | CompareFunc )(void *a, void *b) |
| typedef listlink | List |
Functions | |
| LIBGIFT_EXPORT List * | list_append (List *head, void *udata) |
| LIBGIFT_EXPORT List * | list_prepend (List *head, void *udata) |
| LIBGIFT_EXPORT List * | list_insert (List *head, int nth, void *udata) |
| LIBGIFT_EXPORT List * | list_insert_sorted (List *head, CompareFunc func, void *udata) |
| LIBGIFT_EXPORT List * | list_remove (List *head, void *udata) |
| LIBGIFT_EXPORT List * | list_remove_link (List *head, List *link) |
| LIBGIFT_EXPORT List * | list_free (List *head) |
| LIBGIFT_EXPORT List * | list_find (List *head, void *udata) |
| LIBGIFT_EXPORT List * | list_find_custom (List *head, void *udata, CompareFunc func) |
| LIBGIFT_EXPORT void | list_foreach (List *head, ListForeachFunc func, void *udata) |
| LIBGIFT_EXPORT List * | list_foreach_remove (List *head, ListForeachFunc func, void *udata) |
| LIBGIFT_EXPORT List * | list_nth (List *head, int nth) |
| LIBGIFT_EXPORT void * | list_nth_data (List *head, int nth) |
| LIBGIFT_EXPORT List * | list_last (List *head) |
| LIBGIFT_EXPORT int | list_length (List *head) |
| LIBGIFT_EXPORT List * | list_sort (List *head, CompareFunc func) |
| LIBGIFT_EXPORT List * | list_copy (List *head) |
Variables | |
| EXTERN_C_BEGIN typedef int(* | ListForeachFunc )(void *data, void *udata) |
Implements a standard doubly linked list.
|
|
Node comparison.
|
|
|
Linked list structure. This represents all chains in the list. |
|
||||||||||||
|
Add a new link to the end of the linked list pointed to by `head'. |
|
|
Allocate a copy of each individual node in the list decsribed by `head'. This will not affect the data added by the user. |
|
||||||||||||
|
Search for the first list link found with the user data element matching `udata'. |
|
||||||||||||||||
|
Similar to list_find, except that comparison of your search data against the data in the list will be subject to the comparison function `func', instead of the default pointer comparison. |
|
||||||||||||||||
|
Iterate through each node in the list described by `head' calling the iterator function `func' for each link chain encountered. |
|
||||||||||||||||
|
Combination of list_foreach and list_free, allowing the user the chance to manage the memory of each individual link chain and the associated user data. See ListForeachFunc for more information on the various options you have. |
|
|
Walk through the list pointed to by `head' freeing each individual link pointer. This will not affect the data added by the user, which you will need to manage yourself. Consider list_foreach_remove for an alternate interface. |
|
||||||||||||||||
|
Insert a new link immediately preceding the link that currently exists at the `nth' position. |
|
||||||||||||||||
|
Similar to list_insert, but determines `nth' based on the result of the comparison function `func'. |
|
|
Iterate through the list described by `head' until the tail is reached, in which case it will be returned to the caller. |
|
|
Determine the length of the list described by `head' through iteration. |
|
||||||||||||
|
Access the link chain at the nth position in the list described by `head'. |
|
||||||||||||
|
Similar to list_nth, except that the link chains user data element is returned instead of the link chain itself. |
|
||||||||||||
|
Similar to list_append, but uses the prepend operation. |
|
||||||||||||
|
Search for and remove the element inserted with the data described by `udata'. |
|
||||||||||||
|
Similar to list_remove, but will not search for the links position. The memory pointed to by `link' will be freed by this call. |
|
||||||||||||
|
Sort the list described by `head' according to the comparison function `func'. If NULL is used for the comparison function, the default string comparison will be used via strcmp. |
|
|
Foreach iteration function. Return value depends on the usage.
|
1.3.7