Go to the source code of this file.
|
| #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) |
| |
|
| static void | __list_add (struct list_head *new, struct list_head *prev, struct list_head *next) |
| |
| static void | list_add (struct list_head *new, struct list_head *head) |
| |
| static void | list_add_tail (struct list_head *new, struct list_head *head) |
| |
| static void | __list_del (struct list_head *prev, struct list_head *next) |
| |
| static void | list_del (struct list_head *entry) |
| |
| static void | list_del_init (struct list_head *entry) |
| |
| static void | list_move (struct list_head *list, struct list_head *head) |
| |
| static void | list_move_tail (struct list_head *list, struct list_head *head) |
| |
| static int | list_empty (struct list_head *head) |
| |
| static void | __list_splice (struct list_head *list, struct list_head *head) |
| |
| static void | list_splice (struct list_head *list, struct list_head *head) |
| |
| static void | list_splice_init (struct list_head *list, struct list_head *head) |
| |
◆ INIT_LIST_HEAD
| #define INIT_LIST_HEAD |
( |
|
ptr | ) |
|
Value: do { \
(ptr)->next = (ptr); (ptr)->prev = (ptr); \
} while (0)
Definition at line 30 of file list.h.
◆ list_entry
| #define list_entry |
( |
|
ptr, |
|
|
|
type, |
|
|
|
member |
|
) |
| ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member))) |
list_entry - get the struct for this entry
- Parameters
-
| 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. |
Definition at line 190 of file list.h.
◆ list_for_each
| #define list_for_each |
( |
|
pos, |
|
|
|
head |
|
) |
| |
Value: for (pos = (head)->next; pos != (head); \
pos = pos->next)
list_for_each - iterate over a list
- Parameters
-
| pos | the &struct list_head to use as a loop counter. |
| head | the head for your list. |
Definition at line 198 of file list.h.
◆ list_for_each_entry
| #define list_for_each_entry |
( |
|
pos, |
|
|
|
head, |
|
|
|
member |
|
) |
| |
Value: 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
- Parameters
-
| pos | the type * to use as a loop counter. |
| head | the head for your list. |
| member | the name of the list_struct within the struct. |
Definition at line 226 of file list.h.
◆ list_for_each_entry_safe
| #define list_for_each_entry_safe |
( |
|
pos, |
|
|
|
n, |
|
|
|
head, |
|
|
|
member |
|
) |
| |
Value: 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
- Parameters
-
| pos | the type * to use as a loop counter. |
| n | another type * to use as temporary storage |
| head | the head for your list. |
| member | the name of the list_struct within the struct. |
Definition at line 238 of file list.h.
◆ list_for_each_prev
| #define list_for_each_prev |
( |
|
pos, |
|
|
|
head |
|
) |
| |
Value: for (pos = (head)->prev; pos != (head); \
pos = pos->prev)
list_for_each_prev - iterate over a list backwards
- Parameters
-
| pos | the &struct list_head to use as a loop counter. |
| head | the head for your list. |
Definition at line 206 of file list.h.
◆ list_for_each_safe
| #define list_for_each_safe |
( |
|
pos, |
|
|
|
n, |
|
|
|
head |
|
) |
| |
Value: for (pos = (head)->next, n = pos->next; pos != (head); \
pos = n, n = pos->next)
list_for_each_safe - iterate over a list safe against removal of list entry
- Parameters
-
| pos | the &struct list_head to use as a loop counter. |
| n | another &struct list_head to use as temporary storage |
| head | the head for your list. |
Definition at line 216 of file list.h.
◆ LIST_HEAD
◆ LIST_HEAD_INIT
| #define LIST_HEAD_INIT |
( |
|
name | ) |
{ &(name), &(name) } |
◆ __list_add()
◆ __list_del()
◆ __list_splice()
◆ list_add()
list_add - add a new entry
- Parameters
-
| new | new entry to be added |
| head | list head to add it after |
Insert a new entry after the specified head. This is good for implementing stacks.
Definition at line 58 of file list.h.
◆ list_add_tail()
list_add_tail - add a new entry
- Parameters
-
| new | new entry to be added |
| head | list head to add it before |
Insert a new entry before the specified head. This is useful for implementing queues.
Definition at line 71 of file list.h.
◆ list_del()
| static void list_del |
( |
struct list_head * |
entry | ) |
|
|
inlinestatic |
list_del - deletes entry from list.
- Parameters
-
| 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.
Definition at line 94 of file list.h.
◆ list_del_init()
| static void list_del_init |
( |
struct list_head * |
entry | ) |
|
|
inlinestatic |
list_del_init - deletes entry from list and reinitialize it.
- Parameters
-
| entry | the element to delete from the list. |
Definition at line 105 of file list.h.
◆ list_empty()
| static int list_empty |
( |
struct list_head * |
head | ) |
|
|
inlinestatic |
list_empty - tests whether a list is empty
- Parameters
-
Definition at line 138 of file list.h.
◆ list_move()
list_move - delete from one list and add as another's head
- Parameters
-
| list | the entry to move |
| head | the head that will precede our entry |
Definition at line 116 of file list.h.
◆ list_move_tail()
list_move_tail - delete from one list and add as another's tail
- Parameters
-
| list | the entry to move |
| head | the head that will follow our entry |
Definition at line 127 of file list.h.
◆ list_splice()
list_splice - join two lists
- Parameters
-
| list | the new list to add. |
| head | the place to add it in the first list. |
Definition at line 162 of file list.h.
◆ list_splice_init()
list_splice_init - join two lists and reinitialise the emptied list.
- Parameters
-
| list | the new list to add. |
| head | the place to add it in the first list. |
The list at the list parameter is reinitialised
Definition at line 175 of file list.h.