Stackdb
Stackdb is a stackable, multi-target and -level source debugger and memory forensics library.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros
list.h File Reference
#include <stddef.h>
Include dependency graph for list.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  list_head
 
struct  hlist_head
 
struct  hlist_node
 

Macros

#define LIST_POISON1   ((void *) 0x00100100)
 
#define LIST_POISON2   ((void *) 0x00200200)
 
#define container_of(ptr, type, member)
 
#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_top(head, type, member)
 
#define list_entry(ptr, type, member)   container_of(ptr, type, member)
 
#define list_for_each(pos, head)   for (pos = (head)->next; pos != (head); pos = pos->next)
 
#define list_for_each_prev(pos, head)   for (pos = (head)->prev; pos != (head); pos = pos->prev)
 
#define list_for_each_safe(pos, n, head)
 
#define list_for_each_entry(pos, head, member)
 
#define list_for_each_entry_dual(pos, pos2, head, head2, member, member2)
 
#define list_for_each_entry_reverse(pos, head, member)
 
#define list_for_each_entry_continue(pos, head, member)
 
#define list_for_each_entry_safe(pos, n, head, member)
 
#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_del_rcu_init   hlist_del_init
 
#define hlist_entry(ptr, type, member)   container_of(ptr,type,member)
 
#define hlist_for_each(pos, head)   for (pos = (head)->first; pos; pos = pos->next)
 
#define hlist_for_each_safe(pos, n, head)
 
#define hlist_for_each_entry(tpos, pos, head, member)
 
#define hlist_for_each_entry_continue(tpos, pos, member)
 
#define hlist_for_each_entry_from(tpos, pos, member)
 
#define hlist_for_each_entry_safe(tpos, pos, n, head, member)
 

Macro Definition Documentation

#define container_of (   ptr,
  type,
  member 
)
Value:
({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})

Definition at line 37 of file list.h.

#define hlist_del_rcu_init   hlist_del_init

Definition at line 465 of file list.h.

#define hlist_entry (   ptr,
  type,
  member 
)    container_of(ptr,type,member)

Definition at line 504 of file list.h.

#define hlist_for_each (   pos,
  head 
)    for (pos = (head)->first; pos; pos = pos->next)

Definition at line 507 of file list.h.

#define hlist_for_each_entry (   tpos,
  pos,
  head,
  member 
)
Value:
for (pos = (head)->first; \
pos && ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
pos = pos->next)
#define hlist_entry(ptr, type, member)
Definition: list.h:504

hlist_for_each_entry - iterate over list of given type : the type * to use as a loop counter. : the &struct hlist_node to use as a loop counter. : the head for your list. : the name of the hlist_node within the struct.

Definition at line 521 of file list.h.

#define hlist_for_each_entry_continue (   tpos,
  pos,
  member 
)
Value:
for (pos = (pos)->next; \
pos && ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
pos = pos->next)
#define hlist_entry(ptr, type, member)
Definition: list.h:504

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.

Definition at line 532 of file list.h.

#define hlist_for_each_entry_from (   tpos,
  pos,
  member 
)
Value:
for (; pos && ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
pos = pos->next)
#define hlist_entry(ptr, type, member)
Definition: list.h:504

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.

Definition at line 543 of file list.h.

#define hlist_for_each_entry_safe (   tpos,
  pos,
  n,
  head,
  member 
)
Value:
for (pos = (head)->first; \
pos && ({ n = pos->next; 1; }) && \
({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
pos = n)
#define hlist_entry(ptr, type, member)
Definition: list.h:504

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.

Definition at line 555 of file list.h.

#define hlist_for_each_safe (   pos,
  n,
  head 
)
Value:
for (pos = (head)->first; n = pos ? pos->next : 0, pos; \
pos = n)

Definition at line 510 of file list.h.

#define HLIST_HEAD (   name)    struct hlist_head name = { .first = NULL }

Definition at line 410 of file list.h.

#define HLIST_HEAD_INIT   { .first = NULL }

Definition at line 409 of file list.h.

#define INIT_HLIST_HEAD (   ptr)    ((ptr)->first = NULL)

Definition at line 411 of file list.h.

#define INIT_HLIST_NODE (   ptr)    ((ptr)->next = NULL, (ptr)->pprev = NULL)

Definition at line 412 of file list.h.

#define INIT_LIST_HEAD (   ptr)
Value:
do { \
(ptr)->next = (ptr); (ptr)->prev = (ptr); \
} while (0)

Definition at line 60 of file list.h.

#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 300 of file list.h.

#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.

Definition at line 308 of file list.h.

#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))
#define list_entry(ptr, type, member)
Definition: list.h:300

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.

Definition at line 335 of file list.h.

#define list_for_each_entry_continue (   pos,
  head,
  member 
)
Value:
for (pos = list_entry(pos->member.next, typeof(*pos), member); \
&pos->member != (head); \
pos = list_entry(pos->member.next, typeof(*pos), member))
#define list_entry(ptr, type, member)
Definition: list.h:300

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.

Definition at line 375 of file list.h.

#define list_for_each_entry_dual (   pos,
  pos2,
  head,
  head2,
  member,
  member2 
)
Value:
for (pos = list_entry((head)->next, typeof(*pos), member), \
pos2 = list_entry((head2)->next, typeof(*pos2), member2); \
&pos->member != (head) && &pos2->member2 != (head2); \
pos = list_entry(pos->member.next, typeof(*pos), member), \
pos2 = list_entry(pos2->member2.next, typeof(*pos2), member2))
#define list_entry(ptr, type, member)
Definition: list.h:300

list_for_each_entry_dual - iterate over two lists of given type : the type * to use as a loop counter. : the type * to use as a loop counter. : the head for your list. : the head for your list. : the name of the list_struct within the struct. :the name of the list_struct within the struct.

Definition at line 349 of file list.h.

#define list_for_each_entry_reverse (   pos,
  head,
  member 
)
Value:
for (pos = list_entry((head)->prev, typeof(*pos), member); \
&pos->member != (head); \
pos = list_entry(pos->member.prev, typeof(*pos), member))
#define list_entry(ptr, type, member)
Definition: list.h:300

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.

Definition at line 362 of file list.h.

#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))
#define list_entry(ptr, type, member)
Definition: list.h:300

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 387 of file list.h.

#define list_for_each_prev (   pos,
  head 
)    for (pos = (head)->prev; pos != (head); pos = pos->prev)

list_for_each_prev - iterate over a list backwards : the &struct list_head to use as a loop counter. : the head for your list.

Definition at line 316 of file list.h.

#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 : the &struct list_head to use as a loop counter.
: another &struct list_head to use as temporary storage : the head for your list.

Definition at line 325 of file list.h.

#define LIST_HEAD (   name)    struct list_head name = LIST_HEAD_INIT(name)

Definition at line 57 of file list.h.

#define LIST_HEAD_INIT (   name)    { &(name), &(name) }

Definition at line 55 of file list.h.

#define LIST_POISON1   ((void *) 0x00100100)

Definition at line 34 of file list.h.

#define LIST_POISON2   ((void *) 0x00200200)

Definition at line 35 of file list.h.

#define list_top (   head,
  type,
  member 
)
Value:
({ \
struct list_head *_head = (head); \
list_empty(_head) ? NULL : list_entry(_head->next, type, member); \
})
Definition: list.h:51
#define list_entry(ptr, type, member)
Definition: list.h:300

Definition at line 64 of file list.h.