ReactOS 0.4.15-dev-7953-g1f49173
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)-(uintptr_t)(&((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)
 
#define list_for_each_entry_continue(pos, 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)
static PVOID ptr
Definition: dispmode.c:27
static unsigned __int64 next
Definition: rand_nt.c:6

Definition at line 24 of file list.h.

◆ list_entry

#define list_entry (   ptr,
  type,
  member 
)     ((type *)((char *)(ptr)-(uintptr_t)(&((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 185 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

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 193 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))
#define list_entry(ptr, type, member)
Definition: list.h:185
#define typeof(X_)
Definition: msvc.h:2

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

◆ list_for_each_entry_continue

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

list_for_each_entry_continue - iterate over list of given type continuing after existing point @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 246 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))
GLdouble n
Definition: glext.h:7729

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 233 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 @pos: the &struct list_head to use as a loop counter. @head: the head for your list.

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

◆ LIST_HEAD

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

Definition at line 21 of file list.h.

◆ LIST_HEAD_INIT

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

Definition at line 19 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 35 of file list.h.

38 {
39 next->prev = new;
40 new->next = next;
41 new->prev = prev;
42 prev->next = new;
43 }
struct list_head * next
Definition: list.h:16

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

79 {
80 next->prev = prev;
81 prev->next = next;
82 }

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

140 {
141 struct list_head *first = list->next;
142 struct list_head *last = list->prev;
143 struct list_head *at = head->next;
144
145 first->prev = head;
146 head->next = first;
147
148 last->next = at;
149 at->prev = last;
150 }
Definition: list.h:37
struct list * next
Definition: list.h:38
struct list * prev
Definition: list.h:39
const GLint * first
Definition: glext.h:5794
static UINT UINT last
Definition: font.c:45
Definition: list.h:15
struct list_head * prev
Definition: list.h:16

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

54 {
55 __list_add(new, head, head->next);
56 }
static void __list_add(struct list_head *new, struct list_head *prev, struct list_head *next)
Definition: list.h:35

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

67 {
68 __list_add(new, head->prev, head);
69 }

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

90 {
91 __list_del(entry->prev, entry->next);
92 entry->next = (void *) 0;
93 entry->prev = (void *) 0;
94 }
static void __list_del(struct list_head *prev, struct list_head *next)
Definition: list.h:78
uint32_t entry
Definition: isohybrid.c:63

Referenced by __remove_wait_queue(), acpi_bus_receive_event(), acpi_bus_unregister_driver(), acpi_power_off_device(), acpi_power_remove(), chmc_entries_free(), chmc_pmgi_free(), chmc_pmgl_free(), chmc_section_destroy(), chmc_sections_free(), and journal_clear_revoke().

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

101 {
102 __list_del(entry->prev, entry->next);
104 }
#define INIT_LIST_HEAD(ptr)
Definition: list.h:24

Referenced by ext4_xattr_item_remove(), and finish_wait().

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

134 {
135 return head->next == head;
136 }

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

112 {
115 }
static void list_add(struct list_entry *entry, struct list_entry *prev, struct list_entry *next)
Definition: list.h:64

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

124 {
127 }
static void list_add_tail(struct list_head *new, struct list_head *head)
Definition: list.h:66

Referenced by shader_arb_handle_instruction().

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

158 {
159 if (!list_empty(list))
161 }
static int list_empty(struct list_entry *head)
Definition: list.h:58
static void __list_splice(struct list_head *list, struct list_head *head)
Definition: list.h:138

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

172 {
173 if (!list_empty(list)) {
176 }
177 }