Data Structures | |
struct | list_head |
Defines | |
#define | LIST_HEAD_INIT(name) { &(name), &(name) } |
#define | LIST_HEAD(name) struct list_head name = LIST_HEAD_INIT(name) |
#define | INIT_LIST_HEAD(ptr) |
#define | list_entry(ptr, type, member) ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member))) |
#define | list_for_each(pos, head) |
#define | list_for_each_prev(pos, head) |
#define | list_for_each_safe(pos, n, head) |
#define | list_for_each_entry(pos, head, member) |
#define | list_for_each_entry_safe(pos, n, head, member) |
#define list_entry | ( | ptr, | |||
type, | |||||
member | ) | ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member))) |
list_entry - get the struct for this entry : the &struct list_head pointer. : the type of the struct this is embedded in. : the name of the list_struct within the struct.
#define list_for_each | ( | pos, | |||
head | ) |
#define list_for_each_entry | ( | pos, | |||
head, | |||||
member | ) |
for (pos = list_entry((head)->next, typeof(*pos), member); \ &pos->member != (head); \ pos = list_entry(pos->member.next, typeof(*pos), member))
list_for_each_entry - iterate over list of given type : the type * to use as a loop counter. : the head for your list. : the name of the list_struct within the struct.
#define list_for_each_entry_safe | ( | pos, | |||
n, | |||||
head, | |||||
member | ) |
for (pos = list_entry((head)->next, typeof(*pos), member), \ n = list_entry(pos->member.next, typeof(*pos), member); \ &pos->member != (head); \ pos = n, n = list_entry(n->member.next, typeof(*n), member))
list_for_each_entry_safe - iterate over list of given type safe against removal of list entry : the type * to use as a loop counter.
: another type * to use as temporary storage : the head for your list. : the name of the list_struct within the struct.
#define list_for_each_prev | ( | pos, | |||
head | ) |
#define list_for_each_safe | ( | pos, | |||
n, | |||||
head | ) |
#define LIST_HEAD | ( | name | ) | struct list_head name = LIST_HEAD_INIT(name) |
#define LIST_HEAD_INIT | ( | name | ) | { &(name), &(name) } |