Go to the source code of this file.
Data Structures | |
struct | list_head |
struct | hlist_head |
struct | hlist_node |
Defines | |
#define | offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) |
#define | container_of(ptr, type, member) |
container_of - cast a member of a structure out to the containing structure | |
#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) container_of(ptr, type, member) |
list_entry - get the struct for this entry : the &struct list_head pointer. | |
#define | list_for_each(pos, head) for (pos = (head)->next; pos != (head); pos = pos->next) |
list_for_each - iterate over a list : the &struct list_head to use as a loop counter. | |
#define | list_for_each_prev(pos, head) |
list_for_each_prev - iterate over a list backwards : the &struct list_head to use as a loop counter. | |
#define | list_for_each_safe(pos, n, head) |
list_for_each_safe - iterate over a list safe against removal of list entry : the &struct list_head to use as a loop counter. | |
#define | list_for_each_entry(pos, head, member) |
list_for_each_entry - iterate over list of given type : the type * to use as a loop counter. | |
#define | list_for_each_entry_reverse(pos, head, member) |
list_for_each_entry_reverse - iterate backwards over list of given type. | |
#define | list_for_each_entry_continue(pos, head, member) |
list_for_each_entry_continue - iterate over list of given type continuing after existing point : the type * to use as a loop counter. | |
#define | list_for_each_entry_safe(pos, n, head, 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. | |
#define | HLIST_HEAD_INIT { .first = NULL } |
#define | HLIST_HEAD(name) struct hlist_head name = { .first = NULL } |
#define | INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL) |
#define | INIT_HLIST_NODE(ptr) ((ptr)->next = NULL, (ptr)->pprev = NULL) |
#define | hlist_entry(ptr, type, member) container_of(ptr,type,member) |
#define | hlist_for_each(pos, head) |
#define | hlist_for_each_safe(pos, n, head) |
#define | hlist_for_each_entry(pos, head, member) |
hlist_for_each_entry - iterate over list of given type : the &struct hlist_node to use as a loop counter. | |
#define | hlist_for_each_entry_continue(tpos, pos, member) |
hlist_for_each_entry_continue - iterate over a hlist continuing after existing point : the type * to use as a loop counter. | |
#define | hlist_for_each_entry_from(tpos, pos, member) |
hlist_for_each_entry_from - iterate over a hlist continuing from existing point : the type * to use as a loop counter. | |
#define | hlist_for_each_entry_safe(tpos, pos, n, head, member) |
hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry : the type * to use as a loop counter. | |
Functions | |
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) |
list_add - add a new entry : new entry to be added : list head to add it after | |
static void | list_add_tail (struct list_head *new, struct list_head *head) |
list_add_tail - add a new entry : new entry to be added : list head to add it before | |
static void | list_del_internal (struct list_head *prev, struct list_head *next) |
static void | list_del (struct list_head *entry) |
list_del - deletes entry from list. | |
static void | list_move (struct list_head *list, struct list_head *head) |
list_move - delete from one list and add as another's head : the entry to move : the head that will precede our entry | |
static void | list_move_tail (struct list_head *list, struct list_head *head) |
list_move_tail - delete from one list and add as another's tail : the entry to move : the head that will follow our entry | |
static int | list_empty (const struct list_head *head) |
list_empty - tests whether a list is empty : the list to test. | |
static void | list_splice (struct list_head *list, struct list_head *head) |
list_splice - join two lists : the new list to add. | |
static __inline__ int | hlist_unhashed (const struct hlist_node *h) |
static __inline__ int | hlist_empty (const struct hlist_head *h) |
static __inline__ void | hlist_del (struct hlist_node *n) |
static __inline__ void | hlist_add_head (struct hlist_node *n, struct hlist_head *h) |
static __inline__ void | hlist_add_before (struct hlist_node *n, struct hlist_node *next) |
static __inline__ void | hlist_add_after (struct hlist_node *n, struct hlist_node *next) |
#define container_of | ( | ptr, | |||
type, | |||||
member | ) |
({ \ const typeof( ((type *)0)->member ) *_mptr = (ptr); \ (type *)( (char *)_mptr - offsetof(type,member) );})
container_of - cast a member of a structure out to the containing structure
: the pointer to the member. : the type of the container struct this is embedded in. : the name of the member within the struct.
#define hlist_entry | ( | ptr, | |||
type, | |||||
member | ) | container_of(ptr,type,member) |
#define hlist_for_each | ( | pos, | |||
head | ) |
#define hlist_for_each_entry | ( | pos, | |||
head, | |||||
member | ) |
for (pos = hlist_entry((head)->first, typeof(*pos), member); \ &pos->member != NULL; \ pos = hlist_entry(pos->member.next, typeof(*pos), member))
hlist_for_each_entry - iterate over list of given type : the &struct hlist_node to use as a loop counter.
: the head for your list. : the name of the hlist_node within the struct.
#define hlist_for_each_entry_continue | ( | tpos, | |||
pos, | |||||
member | ) |
for (pos = (pos)->next; \ pos && \ ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ pos = pos->next)
hlist_for_each_entry_continue - iterate over a hlist continuing after existing point : the type * to use as a loop counter.
: the &struct hlist_node to use as a loop counter. : the name of the hlist_node within the struct.
#define hlist_for_each_entry_from | ( | tpos, | |||
pos, | |||||
member | ) |
for (; pos && \ ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ pos = pos->next)
hlist_for_each_entry_from - iterate over a hlist continuing from existing point : the type * to use as a loop counter.
: the &struct hlist_node to use as a loop counter. : the name of the hlist_node within the struct.
#define hlist_for_each_entry_safe | ( | tpos, | |||
pos, | |||||
n, | |||||
head, | |||||
member | ) |
for (pos = (head)->first; \ pos && ({ n = pos->next; 1; }) && \ ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ pos = n)
hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry : the type * to use as a loop counter.
: the &struct hlist_node to use as a loop counter.
: another &struct hlist_node to use as temporary storage : the head for your list. : the name of the hlist_node within the struct.
#define hlist_for_each_safe | ( | pos, | |||
n, | |||||
head | ) |
#define HLIST_HEAD | ( | name | ) | struct hlist_head name = { .first = NULL } |
#define INIT_HLIST_NODE | ( | ptr | ) | ((ptr)->next = NULL, (ptr)->pprev = NULL) |
Definition at line 269 of file list.h.
Referenced by hlist_del().
#define INIT_LIST_HEAD | ( | ptr | ) |
do { \ (ptr)->next = (ptr); (ptr)->prev = (ptr); \ } while (0)
Definition at line 38 of file list.h.
Referenced by emv_init(), list_del(), and list_splice().
#define list_entry | ( | ptr, | |||
type, | |||||
member | ) | container_of(ptr, type, 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.
Definition at line 169 of file list.h.
Referenced by emv_appsel_pse_first(), and emv_appsel_pse_next().
#define list_for_each | ( | pos, | |||
head | ) | for (pos = (head)->next; pos != (head); pos = pos->next) |
list_for_each - iterate over a list : the &struct list_head to use as a loop counter.
: the head for your list.
This variant differs from list_for_each() in that it's the simplest possible list iteration code, no prefetching is done. Use this for code that knows the list to be very short (empty or 1 entry) most of the time.
#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_continue | ( | pos, | |||
head, | |||||
member | ) |
for (pos = list_entry(pos->member.next, typeof(*pos), member); \ &pos->member != (head); \ pos = list_entry(pos->member.next, typeof(*pos), member)) \
list_for_each_entry_continue - iterate over list of given type continuing after existing point : 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_reverse | ( | pos, | |||
head, | |||||
member | ) |
for (pos = list_entry((head)->prev, typeof(*pos), member); \ &pos->member != (head); \ pos = list_entry(pos->member.prev, typeof(*pos), member))
list_for_each_entry_reverse - iterate backwards 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.
Definition at line 245 of file list.h.
Referenced by _emv_free_applist(), and emv_appsel_pse().
#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 offsetof | ( | TYPE, | |||
MEMBER | ) | ((size_t) &((TYPE *)0)->MEMBER) |
static void _list_add | ( | struct list_head * | new, | |
struct list_head * | prev, | |||
struct list_head * | next | |||
) | [inline, static] |
Definition at line 48 of file list.h.
References list_head::next, and list_head::prev.
Referenced by list_add(), and list_add_tail().
static __inline__ void hlist_add_after | ( | struct hlist_node * | n, | |
struct hlist_node * | next | |||
) | [static] |
Definition at line 310 of file list.h.
References hlist_node::next, and hlist_node::pprev.
static __inline__ void hlist_add_before | ( | struct hlist_node * | n, | |
struct hlist_node * | next | |||
) | [static] |
Definition at line 302 of file list.h.
References hlist_node::next, and hlist_node::pprev.
static __inline__ void hlist_add_head | ( | struct hlist_node * | n, | |
struct hlist_head * | h | |||
) | [static] |
Definition at line 291 of file list.h.
References hlist_head::first, hlist_node::next, and hlist_node::pprev.
static __inline__ void hlist_del | ( | struct hlist_node * | n | ) | [static] |
Definition at line 281 of file list.h.
References INIT_HLIST_NODE, hlist_node::next, and hlist_node::pprev.
static __inline__ int hlist_empty | ( | const struct hlist_head * | h | ) | [static] |
Definition at line 276 of file list.h.
References hlist_head::first.
static __inline__ int hlist_unhashed | ( | const struct hlist_node * | h | ) | [static] |
Definition at line 271 of file list.h.
References hlist_node::pprev.
list_add - add a new entry : new entry to be added : list head to add it after
Insert a new entry after the specified head. This is good for implementing stacks.
Definition at line 66 of file list.h.
References _list_add(), and list_head::next.
Referenced by list_move().
list_add_tail - add a new entry : new entry to be added : list head to add it before
Insert a new entry before the specified head. This is useful for implementing queues.
Definition at line 79 of file list.h.
References _list_add(), and list_head::prev.
Referenced by bop_dtemp(), and list_move_tail().
static void list_del | ( | struct list_head * | entry | ) | [inline, static] |
list_del - deletes entry from list.
: 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 103 of file list.h.
References INIT_LIST_HEAD, list_del_internal(), list_head::next, and list_head::prev.
Referenced by _emv_free_applist(), emv_app_delete(), and emv_appsel_pse().
Definition at line 91 of file list.h.
References list_head::next, and list_head::prev.
Referenced by list_del(), list_move(), and list_move_tail().
static int list_empty | ( | const struct list_head * | head | ) | [inline, static] |
list_empty - tests whether a list is empty : the list to test.
Definition at line 136 of file list.h.
References list_head::next.
Referenced by list_splice().
list_move - delete from one list and add as another's head : the entry to move : the head that will precede our entry
Definition at line 114 of file list.h.
References list_add(), list_del_internal(), list_head::next, and list_head::prev.
list_move_tail - delete from one list and add as another's tail : the entry to move : the head that will follow our entry
Definition at line 125 of file list.h.
References list_add_tail(), list_del_internal(), list_head::next, and list_head::prev.
list_splice - join two lists : the new list to add.
: the place to add it in the first list.
Definition at line 146 of file list.h.
References INIT_LIST_HEAD, list_empty(), list_head::next, and list_head::prev.