VLC 4.0.0-dev
|
This provides convenience helpers for linked lists. More...
Go to the source code of this file.
Data Structures | |
struct | vlc_list |
Doubly-linked list node. More... | |
struct | vlc_list_it |
List iterator. More... | |
Macros | |
#define | VLC_LIST_INITIALIZER(h) { h, h } |
Static initializer for a list head. | |
#define | vlc_list_foreach(pos, head, member) |
List iteration macro. | |
#define | vlc_list_foreach_const(pos, head, member) |
#define | vlc_list_reverse_foreach(pos, head, member) |
List iteration macro. | |
#define | vlc_list_entry(ptr, type, member) container_of(ptr, type, member) |
Converts a list node pointer to an element pointer. | |
#define | vlc_list_first_entry_or_null(head, type, member) ((type *)vlc_list_first_or_null(head, offsetof (type, member))) |
Gets the first element. | |
#define | vlc_list_last_entry_or_null(head, type, member) ((type *)vlc_list_last_or_null(head, offsetof (type, member))) |
Gets the last element. | |
#define | vlc_list_prev_entry_or_null(head, entry, type, member) |
#define | vlc_list_next_entry_or_null(head, entry, type, member) |
Functions | |
static void | vlc_list_init (struct vlc_list *restrict head) |
Initializes an empty list head. | |
static void | vlc_list_add_between (struct vlc_list *restrict node, struct vlc_list *prev, struct vlc_list *next) |
Inserts an element in a list. | |
static void | vlc_list_add_after (struct vlc_list *restrict node, struct vlc_list *prev) |
Inserts an element after another. | |
static void | vlc_list_add_before (struct vlc_list *restrict node, struct vlc_list *next) |
Inserts an element before another. | |
static void | vlc_list_append (struct vlc_list *restrict node, struct vlc_list *head) |
Appends an element into a list. | |
static void | vlc_list_prepend (struct vlc_list *restrict node, struct vlc_list *head) |
Prepends an element into a list. | |
static void | vlc_list_remove (struct vlc_list *restrict node) |
Removes an element from a list. | |
static void | vlc_list_replace (const struct vlc_list *original, struct vlc_list *restrict substitute) |
Replaces an element with another one. | |
static bool | vlc_list_is_empty (const struct vlc_list *head) |
Checks if a list is empty. | |
static bool | vlc_list_is_first (const struct vlc_list *node, const struct vlc_list *head) |
Checks if an element is first in a list. | |
static bool | vlc_list_is_last (const struct vlc_list *node, const struct vlc_list *head) |
Checks if an element is last in a list. | |
static struct vlc_list_it | vlc_list_it_start (struct vlc_list *head) |
static struct vlc_list_it | vlc_list_it_start_const (const struct vlc_list *head) |
static struct vlc_list_it | vlc_list_it_reverse_start (struct vlc_list *head) |
static struct vlc_list_it | vlc_list_it_reverse_start_const (const struct vlc_list *head) |
static bool | vlc_list_it_continue (const struct vlc_list_it *restrict it) |
static void | vlc_list_it_next (struct vlc_list_it *restrict it) |
static void | vlc_list_it_prev (struct vlc_list_it *restrict it) |
static void * | vlc_list_first_or_null (const struct vlc_list *head, size_t offset) |
static void * | vlc_list_last_or_null (const struct vlc_list *head, size_t offset) |
static void * | vlc_list_prev_or_null (const struct vlc_list *head, const struct vlc_list *node, size_t offset) |
static void * | vlc_list_next_or_null (const struct vlc_list *head, const struct vlc_list *node, size_t offset) |
This provides convenience helpers for linked lists.