Go to the source code of this file.
Data Structures | |
| struct | list_node |
| Doubly-linked List Node. More... | |
| struct | list_head |
| Anchor for list_node. More... | |
Macros | |
| #define | LIST_FOREACH(head, iter) |
A preprocessor for iterating over head's list. iter is the current node in the iteration. Methods like list_remove is safe to use on iter. | |
Functions | |
| struct list_head * | list_init_head (struct list_head *head) |
Initializes head as an empty list. | |
| struct list_node * | list_init_node (struct list_node *node) |
Initializes node. | |
| bool | list_is_empty (const struct list_head *head) |
| struct list_node * | list_append (struct list_head *head, struct list_node *node) |
Inserts node at the end of head's list (aka stack push). | |
| struct list_node * | list_insert_before (struct list_node *before, struct list_node *node) |
Inserts node before before in the list of before. | |
| struct list_node * | list_insert_after (struct list_node *after, struct list_node *node) |
Inserts node after after in the list of after. | |
| struct list_head * | list_extend (struct list_head *head1, struct list_head *head2) |
Merges head2 unto head1 at the end of head1 and returns head1. | |
| struct list_node * | list_first (struct list_head *head) |
| struct list_node * | list_last (struct list_head *head) |
| struct list_node * | list_remove (struct list_node *node) |
Removes node from head's list. | |
| struct list_node * | list_pop_last (struct list_head *head) |
Removes the last node of head's list (aka stack pop with respect to list_append). | |
| struct list_node * | list_pop_first (struct list_head *head) |
Removes the first node of head's list (aka deque with respect to list_append). | |
| struct list_node * | list_next (struct list_head *head, struct list_node *node) |
| struct list_node * | list_prev (struct list_head *head, struct list_node *node) |
| size_t | list_length (struct list_head *head) |
| #define LIST_FOREACH | ( | head, | |
| iter | |||
| ) |
A preprocessor for iterating over head's list. iter is the current node in the iteration. Methods like list_remove is safe to use on iter.
Inserts node at the end of head's list (aka stack push).
node Merges head2 unto head1 at the end of head1 and returns head1.
head2, so head2 should be discarded or reinitialized afterwards. head1 head's list, otherwise NULL. Inserts node after after in the list of after.
node Inserts node before before in the list of before.
node true if head's list is empty, otherwise false. head's list, otherwise NULL. node in the head's list, otherwise NULL. Removes the first node of head's list (aka deque with respect to list_append).
head is not empty, otherwise NULL. Removes the last node of head's list (aka stack pop with respect to list_append).
head is not empty, otherwise NULL. node in the head's list, otherwise NULL.