Go to the source code of this file.
Data Structures | |
struct | List |
struct | ListNode |
Defines | |
#define | list_begin(list) ((list) -> sentinel.next) |
#define | list_end(list) (& (list) -> sentinel) |
#define | list_next(iterator) ((iterator) -> next) |
#define | list_previous(iterator) ((iterator) -> previous) |
#define | list_front(list) ((void *) list_begin (list)) |
#define | list_back(list) ((void *) list_previous (list_end (list))) |
#define | list_empty(list) (list_begin (list) == list_end (list)) |
#define | list_insert_front(list, value) (list_insert (list_begin (list), (value))) |
#define | list_insert_back(list, value) (list_insert (list_end (list), (value))) |
#define | list_remove_front(list) (list_remove (list_begin (list))) |
#define | list_remove_back(list) (list_remove (list_previous (list_end (list)))) |
#define | LIST_ELEMENT(node, type, field) ((type *) ((char *) (node) - (unsigned int) & ((type *) 0) -> field)) |
Typedefs | |
typedef ListNode | ListNode |
typedef ListNode * | ListIterator |
Functions | |
void | list_clear (List *list) |
Clear the list. | |
ListIterator | list_insert (ListIterator position, void *value) |
Insert into a list. | |
void * | list_remove (ListIterator position) |
Remove from a list. | |
unsigned int | list_size (List *list) |
Count list elements. |
Provides an interface for inline lists that store the nodes directly in data. Lists maintain a sentinel node and are doubly linked.
|
Clear the list. Clears the list to be empty.
|
|
Insert into a list. Inserts a new value before the specified position in a list.
|
|
Remove from a list. Remove the specified position from a list.
|
|
Count list elements. Return the number of elements in a list.
|