|
cemu
|
类 | |
| struct | list_head |
| struct | hlist_node |
| struct | hlist_head |
宏定义 | |
| #define | NULL 0 |
| #define | LIST_POISON1 ((void *) 0x00100100) |
| #define | LIST_POISON2 ((void *) 0x00200200) |
| #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_first_entry(ptr, type, member) list_entry((ptr)->next, type, member) |
| #define | list_last_entry(ptr, type, member) list_entry((ptr)->prev, type, member) |
| #define | list_first_entry_or_null(ptr, type, member) (!list_empty(ptr) ? list_first_entry(ptr, type, member) : NULL) |
| #define | list_for_each(pos, head) for (pos = (head)->next; pos != (head); pos = pos->next) |
| #define | list_for_each_safe(pos, n, head) |
| #define | list_for_each_prev(pos, head) for (pos = (head)->prev; pos != (head); pos = pos->prev) |
| #define | INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL) |
| #define | INIT_HLIST_NODE(h) |
| #define | hlist_unhashed(h) (!h->pprev) |
| #define | hlist_empty(h) (!h->first) |
| #define | hlist_entry(ptr, type, member) ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member))) |
| #define | hlist_for_each(pos, head) for (pos = (head)->first; pos ; pos = pos->next) |
| #define | hlist_for_each_safe(pos, n, head) for (pos = (head)->first; pos && ({ n = pos->next; 1; }); pos = n) |
函数 | |
| void | __list_add (struct list_head *l_new, struct list_head *prev, struct list_head *next) |
| void | list_add (struct list_head *l_new, struct list_head *head) |
| void | list_add_tail (struct list_head *l_new, struct list_head *head) |
| void | __list_del (struct list_head *prev, struct list_head *next) |
| void | list_del (struct list_head *entry) |
| void | list_del_init (struct list_head *entry) |
| int | list_empty (struct list_head *head) |
| void | list_splice (struct list_head *list, struct list_head *head) |
| void | hlist_del (struct hlist_node *n) |
| void | hlist_del_init (struct hlist_node *n) |
| void | hlist_add_head (struct hlist_node *n, struct hlist_head *h) |
| void | hlist_add_before (struct hlist_node *n, struct hlist_node *next) |
| void | hlist_add_behind (struct hlist_node *n, struct hlist_node *prev) |
| void | hlist_add_fake (struct hlist_node *n) |
| int | hlist_fake (struct hlist_node *h) |
| void | hlist_move_list (struct hlist_head *old, struct hlist_head *l_new) |
| #define INIT_HLIST_NODE | ( | h | ) |
| #define INIT_LIST_HEAD | ( | ptr | ) |
| #define list_entry | ( | ptr, | |
| type, | |||
| member ) ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member))) |
list_entry - get the struct for this entry @ptr: the &struct list_head pointer. @type: the type of the struct this is embedded in. @member: the name of the list_struct within the struct.
| #define list_first_entry | ( | ptr, | |
| type, | |||
| member ) list_entry((ptr)->next, type, member) |
list_first_entry - get the first element from a list @ptr: the list head to take the element from. @type: the type of the struct this is embedded in. @member: the name of the list_head within the struct.
Note, that list is expected to be not empty.
| #define list_first_entry_or_null | ( | ptr, | |
| type, | |||
| member ) (!list_empty(ptr) ? list_first_entry(ptr, type, member) : NULL) |
list_first_entry_or_null - get the first element from a list @ptr: the list head to take the element from. @type: the type of the struct this is embedded in. @member: the name of the list_head within the struct.
Note that if the list is empty, it returns NULL.
| #define list_for_each | ( | pos, | |
| head ) for (pos = (head)->next; pos != (head); pos = pos->next) |
list_for_each - iterate over a list @pos: the &struct list_head to use as a loop counter. @head: the head for your list.
| #define list_for_each_prev | ( | pos, | |
| head ) for (pos = (head)->prev; pos != (head); pos = pos->prev) |
list_for_each_prev - iterate over a list in reverse order @pos: the &struct list_head to use as a loop counter. @head: the head for your list.
| #define list_for_each_safe | ( | pos, | |
| n, | |||
| head ) |
list_for_each_safe - iterate over a list safe against removal of list entry @pos: the &struct list_head to use as a loop counter.
: another &struct list_head to use as temporary storage @head: the head for your list.
| #define list_last_entry | ( | ptr, | |
| type, | |||
| member ) list_entry((ptr)->prev, type, member) |
list_last_entry - get the last element from a list @ptr: the list head to take the element from. @type: the type of the struct this is embedded in. @member: the name of the list_head within the struct.
Note, that list is expected to be not empty.
| #define NULL 0 |
from linux kenrel source
list_add - add a l_new entry @l_new: l_new entry to be added @head: list head to add it after
Insert a l_new entry after the specified head. This is good for implementing stacks.
list_add_tail - add a l_new entry @l_new: l_new entry to be added @head: list head to add it before
Insert a l_new entry before the specified head. This is useful for implementing queues.
| void list_del | ( | struct list_head * | entry | ) |
list_del - deletes entry from list. @entry: the element to delete from the list. Note: list_empty on entry does not return true after this, the entry is in an undefined state.
| void list_del_init | ( | struct list_head * | entry | ) |
list_del_init - deletes entry from list and reinitialize it. @entry: the element to delete from the list.
| int list_empty | ( | struct list_head * | head | ) |
list_empty - tests whether a list is empty @head: the list to test.