Doubly-linked list.
More...
Go to the source code of this file.
|
#define | DL_LIST_HEAD_INIT(l) { &(l), &(l) } |
|
#define | offsetof(type, member) ((long) &((type *) 0)->member) |
|
#define | dl_list_entry(item, type, member) ((type *) ((char *) item - offsetof(type, member))) |
|
#define | dl_list_first(list, type, member) |
|
#define | dl_list_last(list, type, member) |
|
#define | dl_list_for_each(item, list, type, member) |
|
#define | dl_list_for_each_safe(item, n, list, type, member) |
|
#define | dl_list_for_each_reverse(item, list, type, member) |
|
#define | DEFINE_DL_LIST(name) struct dl_list name = { &(name), &(name) } |
|
#define dl_list_first |
( |
|
list, |
|
|
|
type, |
|
|
|
member |
|
) |
| |
Value:(dl_list_empty((list)) ? NULL : \
dl_list_entry((list)->next, type, member))
#define dl_list_for_each |
( |
|
item, |
|
|
|
list, |
|
|
|
type, |
|
|
|
member |
|
) |
| |
Value:for (item = dl_list_entry((list)->next, type, member); \
&item->member != (list); \
item = dl_list_entry(item->member.next, type, member))
#define dl_list_for_each_reverse |
( |
|
item, |
|
|
|
list, |
|
|
|
type, |
|
|
|
member |
|
) |
| |
Value:for (item = dl_list_entry((list)->prev, type, member); \
&item->member != (list); \
item = dl_list_entry(item->member.prev, type, member))
#define dl_list_for_each_safe |
( |
|
item, |
|
|
|
n, |
|
|
|
list, |
|
|
|
type, |
|
|
|
member |
|
) |
| |
Value:for (item = dl_list_entry((list)->next, type, member), \
n = dl_list_entry(item->member.next, type, member); \
&item->member != (list); \
item = n, n = dl_list_entry(n->member.next, type, member))
#define dl_list_last |
( |
|
list, |
|
|
|
type, |
|
|
|
member |
|
) |
| |
Value:(dl_list_empty((list)) ? NULL : \
dl_list_entry((list)->prev, type, member))