ReactOS  0.4.15-dev-1177-g6cb3b62
list.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  list_head
 

Macros

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

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)
 
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)
 

Macro Definition Documentation

◆ INIT_LIST_HEAD

#define INIT_LIST_HEAD (   ptr)
Value:
do { \
(ptr)->next = (ptr); (ptr)->prev = (ptr); \
} while (0)
struct list * prev
Definition: list.h:39
static PVOID ptr
Definition: dispmode.c:27
static unsigned __int64 next
Definition: rand_nt.c:6

Definition at line 29 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 @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 193 of file list.h.

◆ list_for_each

#define list_for_each (   pos,
  head 
)
Value:
for (pos = (head)->next; pos != (head); \
pos = pos->next)
struct outqueuenode * head
Definition: adnsresfilter.c:66
static unsigned __int64 next
Definition: rand_nt.c:6

list_for_each - iterate over a list @pos: the &struct list_head to use as a loop counter. @head: the head for your list.

Definition at line 202 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))
struct outqueuenode * head
Definition: adnsresfilter.c:66
#define typeof(X_)
Definition: msvc.h:2
#define list_entry(ptr, type, member)
Definition: list.h:193
static unsigned __int64 next
Definition: rand_nt.c:6

list_for_each_entry - iterate over list of given type @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 230 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))
struct outqueuenode * head
Definition: adnsresfilter.c:66
GLdouble n
Definition: glext.h:7729
#define typeof(X_)
Definition: msvc.h:2
#define list_entry(ptr, type, member)
Definition: list.h:193
static unsigned __int64 next
Definition: rand_nt.c:6

list_for_each_entry_safe - iterate over list of given type safe against removal of list entry @pos: the type * to use as a loop counter.
: 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 242 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)
struct list * prev
Definition: list.h:39
struct outqueuenode * head
Definition: adnsresfilter.c:66

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

Definition at line 210 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)
struct outqueuenode * head
Definition: adnsresfilter.c:66
GLdouble n
Definition: glext.h:7729
static unsigned __int64 next
Definition: rand_nt.c:6

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.

Definition at line 220 of file list.h.

◆ LIST_HEAD

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

Definition at line 26 of file list.h.

◆ LIST_HEAD_INIT

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

Definition at line 24 of file list.h.

Function Documentation

◆ __list_add()

static void __list_add ( struct list_head New,
struct list_head prev,
struct list_head next 
)
inlinestatic

Definition at line 39 of file list.h.

42 {
43  next->prev = New;
44  New->next = next;
45  New->prev = prev;
46  prev->next = New;
47 }
struct list * prev
Definition: list.h:39
#define New(t)
Definition: rtf.h:1086
static unsigned __int64 next
Definition: rand_nt.c:6
struct define * next
Definition: compiler.c:65

Referenced by list_add(), and list_add_tail().

◆ __list_del()

static void __list_del ( struct list_head prev,
struct list_head next 
)
inlinestatic

Definition at line 82 of file list.h.

83 {
84  next->prev = prev;
85  prev->next = next;
86 }
struct list * prev
Definition: list.h:39
static unsigned __int64 next
Definition: rand_nt.c:6

Referenced by list_del(), list_del_init(), list_move(), and list_move_tail().

◆ __list_splice()

static void __list_splice ( struct list_head list,
struct list_head head 
)
inlinestatic

Definition at line 142 of file list.h.

144 {
145  struct list_head *first = list->next;
146  struct list_head *last = list->prev;
147  struct list_head *at = head->next;
148 
149  first->prev = head;
150  head->next = first;
151 
152  last->next = at;
153  at->prev = last;
154 }
struct list * prev
Definition: list.h:39
struct outqueuenode * head
Definition: adnsresfilter.c:66
POINT last
Definition: font.c:46
const GLint * first
Definition: glext.h:5794
struct list_head * prev
Definition: list.h:16
Definition: list.h:15
struct list * next
Definition: list.h:38
Definition: _list.h:228

Referenced by list_splice(), and list_splice_init().

◆ list_add()

static void list_add ( struct list_head New,
struct list_head head 
)
inlinestatic

list_add - add a new entry @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 57 of file list.h.

58 {
59  __list_add(New, head, head->next);
60 }
struct outqueuenode * head
Definition: adnsresfilter.c:66
static void __list_add(struct list_head *New, struct list_head *prev, struct list_head *next)
Definition: list.h:39
#define New(t)
Definition: rtf.h:1086

Referenced by list_move().

◆ list_add_tail()

static void list_add_tail ( struct list_head New,
struct list_head head 
)
inlinestatic

list_add_tail - add a new entry @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 70 of file list.h.

71 {
72  __list_add(New, head->prev, head);
73 }
struct outqueuenode * head
Definition: adnsresfilter.c:66
static void __list_add(struct list_head *New, struct list_head *prev, struct list_head *next)
Definition: list.h:39
#define New(t)
Definition: rtf.h:1086

◆ list_del()

static void list_del ( struct list_head entry)
inlinestatic

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.

Definition at line 93 of file list.h.

94 {
95  __list_del(entry->prev, entry->next);
96  entry->next = (struct list_head *) 0;
97  entry->prev = (struct list_head *) 0;
98 }
Definition: list.h:15
uint32_t entry
Definition: isohybrid.c:63
static void __list_del(struct list_head *prev, struct list_head *next)
Definition: list.h:82

◆ list_del_init()

static void list_del_init ( struct list_head entry)
inlinestatic

list_del_init - deletes entry from list and reinitialize it. @entry: the element to delete from the list.

Definition at line 104 of file list.h.

105 {
106  __list_del(entry->prev, entry->next);
108 }
#define INIT_LIST_HEAD(ptr)
Definition: list.h:29
uint32_t entry
Definition: isohybrid.c:63
static void __list_del(struct list_head *prev, struct list_head *next)
Definition: list.h:82

◆ list_empty()

static int list_empty ( struct list_head head)
inlinestatic

list_empty - tests whether a list is empty @head: the list to test.

Definition at line 137 of file list.h.

138 {
139  return head->next == head;
140 }
struct outqueuenode * head
Definition: adnsresfilter.c:66

◆ list_move()

static void list_move ( struct list_head list,
struct list_head head 
)
inlinestatic

list_move - delete from one list and add as another's head @list: the entry to move @head: the head that will precede our entry

Definition at line 115 of file list.h.

116 {
118  list_add(list, head);
119 }
struct list * prev
Definition: list.h:39
struct outqueuenode * head
Definition: adnsresfilter.c:66
static void list_add(struct list_head *New, struct list_head *head)
Definition: list.h:57
struct list * next
Definition: list.h:38
Definition: _list.h:228
static void __list_del(struct list_head *prev, struct list_head *next)
Definition: list.h:82

◆ list_move_tail()

static void list_move_tail ( struct list_head list,
struct list_head head 
)
inlinestatic

list_move_tail - delete from one list and add as another's tail @list: the entry to move @head: the head that will follow our entry

Definition at line 126 of file list.h.

128 {
131 }
struct list * prev
Definition: list.h:39
struct outqueuenode * head
Definition: adnsresfilter.c:66
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
struct list * next
Definition: list.h:38
Definition: _list.h:228
static void __list_del(struct list_head *prev, struct list_head *next)
Definition: list.h:82

◆ list_splice()

static void list_splice ( struct list_head list,
struct list_head head 
)
inlinestatic

list_splice - join two lists @list: the new list to add. @head: the place to add it in the first list.

Definition at line 161 of file list.h.

162 {
163  if (!list_empty(list))
165 }
struct outqueuenode * head
Definition: adnsresfilter.c:66
Definition: _list.h:228
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
Definition: list.h:143
static void __list_splice(struct list_head *list, struct list_head *head)
Definition: list.h:142

◆ list_splice_init()

static void list_splice_init ( struct list_head list,
struct list_head head 
)
inlinestatic

list_splice_init - join two lists and reinitialise the emptied list. @list: the new list to add. @head: the place to add it in the first list.

The list at @list is reinitialised

Definition at line 174 of file list.h.

176 {
177  if (!list_empty(list)) {
180  }
181 }
struct outqueuenode * head
Definition: adnsresfilter.c:66
#define INIT_LIST_HEAD(ptr)
Definition: list.h:29
Definition: _list.h:228
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
Definition: list.h:143
static void __list_splice(struct list_head *list, struct list_head *head)
Definition: list.h:142