51#define VLC_LIST_INITIALIZER(h) { h, h }
168 return head->
next == head;
183 return node->
prev == head;
198 return node->
next == head;
231 return it->current != it->head;
265#define vlc_list_foreach(pos, head, member) \
266 for (struct vlc_list_it vlc_list_it__##pos = vlc_list_it_start(head); \
267 vlc_list_it_continue(&(vlc_list_it__##pos)) \
268 && ((pos) = container_of((vlc_list_it__##pos).current, \
269 typeof (*(pos)), member), true); \
270 vlc_list_it_next(&(vlc_list_it__##pos)))
287#define vlc_list_reverse_foreach(pos, head, member) \
288 for (struct vlc_list_it vlc_list_it_##pos = vlc_list_it_reverse_start(head); \
289 vlc_list_it_continue(&(vlc_list_it_##pos)) \
290 && ((pos) = container_of((vlc_list_it_##pos).current, \
291 typeof (*(pos)), member), true); \
292 vlc_list_it_prev(&(vlc_list_it_##pos)))
301#define vlc_list_entry(ptr, type, member) container_of(ptr, type, member)
308 return ((
char *)(head->
next)) - offset;
316 return ((
char *)(head->
prev)) - offset;
325 return ((
char *)(node->
prev)) - offset;
334 return ((
char *)(node->
next)) - offset;
344#define vlc_list_first_entry_or_null(head, type, member) \
345 ((type *)vlc_list_first_or_null(head, offsetof (type, member)))
354#define vlc_list_last_entry_or_null(head, type, member) \
355 ((type *)vlc_list_last_or_null(head, offsetof (type, member)))
357#define vlc_list_prev_entry_or_null(head, entry, type, member) \
358 ((type *)vlc_list_prev_or_null(head, &(entry)->member, \
359 offsetof (type, member)))
360#define vlc_list_next_entry_or_null(head, entry, type, member) \
361 ((type *)vlc_list_next_or_null(head, &(entry)->member, \
362 offsetof (type, member)))
static struct vlc_list_it vlc_list_it_start(const struct vlc_list *head)
Definition: vlc_list.h:213
static void vlc_list_it_prev(struct vlc_list_it *restrict it)
Definition: vlc_list.h:243
static void * vlc_list_last_or_null(const struct vlc_list *head, size_t offset)
Definition: vlc_list.h:312
static void vlc_list_append(struct vlc_list *restrict node, struct vlc_list *head)
Appends an element into a list.
Definition: vlc_list.h:110
static void vlc_list_init(struct vlc_list *restrict head)
Initializes an empty list head.
Definition: vlc_list.h:57
static void vlc_list_prepend(struct vlc_list *restrict node, struct vlc_list *head)
Prepends an element into a list.
Definition: vlc_list.h:122
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.
Definition: vlc_list.h:196
static struct vlc_list_it vlc_list_it_reverse_start(const struct vlc_list *head)
Definition: vlc_list.h:222
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.
Definition: vlc_list.h:181
static void * vlc_list_first_or_null(const struct vlc_list *head, size_t offset)
Definition: vlc_list.h:304
static bool vlc_list_is_empty(const struct vlc_list *head)
Checks if a list is empty.
Definition: vlc_list.h:167
static void * vlc_list_next_or_null(const struct vlc_list *head, const struct vlc_list *node, size_t offset)
Definition: vlc_list.h:329
static void vlc_list_add_before(struct vlc_list *restrict node, struct vlc_list *next)
Inserts an element before another.
Definition: vlc_list.h:98
static void * vlc_list_prev_or_null(const struct vlc_list *head, const struct vlc_list *node, size_t offset)
Definition: vlc_list.h:320
static void vlc_list_remove(struct vlc_list *restrict node)
Removes an element from a list.
Definition: vlc_list.h:135
static bool vlc_list_it_continue(const struct vlc_list_it *restrict it)
Definition: vlc_list.h:230
static void vlc_list_add_after(struct vlc_list *restrict node, struct vlc_list *prev)
Inserts an element after another.
Definition: vlc_list.h:86
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.
Definition: vlc_list.h:70
static void vlc_list_it_next(struct vlc_list_it *restrict it)
Definition: vlc_list.h:235
static void vlc_list_replace(const struct vlc_list *original, struct vlc_list *restrict substitute)
Replaces an element with another one.
Definition: vlc_list.h:150
List iterator.
Definition: vlc_list.h:206
const struct vlc_list * head
Definition: vlc_list.h:207
struct vlc_list * next
Definition: vlc_list.h:209
struct vlc_list * current
Definition: vlc_list.h:208
Doubly-linked list node.
Definition: vlc_list.h:44
struct vlc_list * prev
Definition: vlc_list.h:45
struct vlc_list * next
Definition: vlc_list.h:46
This file is a collection of common definitions and types.