51#define VLC_LIST_INITIALIZER(h) { h, h }
168 return head->
next == head;
183 return node->
prev == head;
198 return node->
next == head;
249 return it->
current != it->head;
283#define vlc_list_foreach(pos, head, member) \
284 for (struct vlc_list_it vlc_list_it__##pos = vlc_list_it_start(head); \
285 vlc_list_it_continue(&(vlc_list_it__##pos)) \
286 && ((pos) = container_of((vlc_list_it__##pos).current, \
287 typeof (*(pos)), member), true); \
288 vlc_list_it_next(&(vlc_list_it__##pos)))
289#define vlc_list_foreach_const(pos, head, member) \
290 for (struct vlc_list_it vlc_list_it__##pos = vlc_list_it_start_const(head); \
291 vlc_list_it_continue(&(vlc_list_it__##pos)) \
292 && ((pos) = container_of((vlc_list_it__##pos).current, \
293 const typeof (*(pos)), member), true); \
294 vlc_list_it_next(&(vlc_list_it__##pos)))
311#define vlc_list_reverse_foreach(pos, head, member) \
312 for (struct vlc_list_it vlc_list_it_##pos = vlc_list_it_reverse_start(head); \
313 vlc_list_it_continue(&(vlc_list_it_##pos)) \
314 && ((pos) = container_of((vlc_list_it_##pos).current, \
315 typeof (*(pos)), member), true); \
316 vlc_list_it_prev(&(vlc_list_it_##pos)))
325#define vlc_list_entry(ptr, type, member) container_of(ptr, type, member)
332 return ((
char *)(head->
next)) - offset;
340 return ((
char *)(head->
prev)) - offset;
349 return ((
char *)(node->
prev)) - offset;
358 return ((
char *)(node->
next)) - offset;
368#define vlc_list_first_entry_or_null(head, type, member) \
369 ((type *)vlc_list_first_or_null(head, offsetof (type, member)))
378#define vlc_list_last_entry_or_null(head, type, member) \
379 ((type *)vlc_list_last_or_null(head, offsetof (type, member)))
381#define vlc_list_prev_entry_or_null(head, entry, type, member) \
382 ((type *)vlc_list_prev_or_null(head, &(entry)->member, \
383 offsetof (type, member)))
384#define vlc_list_next_entry_or_null(head, entry, type, member) \
385 ((type *)vlc_list_next_or_null(head, &(entry)->member, \
386 offsetof (type, member)))
static void vlc_list_it_prev(struct vlc_list_it *restrict it)
Definition vlc_list.h:261
static void * vlc_list_last_or_null(const struct vlc_list *head, size_t offset)
Definition vlc_list.h:336
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(struct vlc_list *head)
Definition vlc_list.h:231
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:328
static struct vlc_list_it vlc_list_it_start(struct vlc_list *head)
Definition vlc_list.h:213
static struct vlc_list_it vlc_list_it_start_const(const struct vlc_list *head)
Definition vlc_list.h:222
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:353
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 struct vlc_list_it vlc_list_it_reverse_start_const(const struct vlc_list *head)
Definition vlc_list.h:240
static void * vlc_list_prev_or_null(const struct vlc_list *head, const struct vlc_list *node, size_t offset)
Definition vlc_list.h:344
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:248
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:253
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.