ReactOS  0.4.12-dev-18-gf469aca
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_entry
 

Macros

#define list_container(entry, type, field)   ((type*)((const char*)(entry) - (const char*)(&((type*)0)->field)))
 
#define list_for_each(entry, head)   for (entry = (head)->next; entry != (head); entry = entry->next)
 
#define list_for_each_tmp(entry, tmp, head)
 
#define list_for_each_reverse(entry, head)   for (entry = (head)->prev; entry != (head); entry = entry->prev)
 
#define list_for_each_reverse_tmp(entry, tmp, head)
 

Typedefs

typedef int(* list_compare_fn) (const struct list_entry *, const void *)
 

Functions

static void list_init (struct list_entry *head)
 
static int list_empty (struct list_entry *head)
 
static void list_add (struct list_entry *entry, struct list_entry *prev, struct list_entry *next)
 
static void list_add_head (struct list_entry *head, struct list_entry *entry)
 
static void list_add_tail (struct list_entry *head, struct list_entry *entry)
 
static void list_remove (struct list_entry *entry)
 
static struct list_entrylist_search (const struct list_entry *head, const void *value, list_compare_fn compare)
 

Macro Definition Documentation

◆ list_container

◆ list_for_each

◆ list_for_each_reverse

#define list_for_each_reverse (   entry,
  head 
)    for (entry = (head)->prev; entry != (head); entry = entry->prev)

Definition at line 43 of file list.h.

◆ list_for_each_reverse_tmp

#define list_for_each_reverse_tmp (   entry,
  tmp,
  head 
)
Value:
for (entry = (head)->next, tmp = entry->next; entry != (head); \
entry = tmp, tmp = entry->next)
struct outqueuenode * head
Definition: adnsresfilter.c:66
uint8_t entry
Definition: isohybrid.c:63
static unsigned __int64 next
Definition: rand_nt.c:6

Definition at line 46 of file list.h.

◆ list_for_each_tmp

Typedef Documentation

◆ list_compare_fn

typedef int(* list_compare_fn) (const struct list_entry *, const void *)

Definition at line 100 of file list.h.

Function Documentation

◆ list_add()

static void list_add ( struct list_entry entry,
struct list_entry prev,
struct list_entry next 
)
static

Definition at line 64 of file list.h.

Referenced by __add_wait_queue(), insert_revoke_hash(), layout_ordered_insert(), list_add_head(), and list_add_tail().

68 {
69  /* assert(prev->next == next && next->prev == prev); */
70  entry->prev = prev;
71  entry->next = next;
72  prev->next = entry;
73  next->prev = entry;
74 }
uint8_t entry
Definition: isohybrid.c:63
struct list_entry * next
Definition: list.h:29
struct list_entry * prev
Definition: list.h:28
static unsigned __int64 next
Definition: rand_nt.c:6

◆ list_add_head()

static void list_add_head ( struct list_entry head,
struct list_entry entry 
)
static

Definition at line 76 of file list.h.

79 {
80  list_add(entry, head, head->next);
81 }
static void list_add(struct list_entry *entry, struct list_entry *prev, struct list_entry *next)
Definition: list.h:64
struct list_entry * next
Definition: list.h:29

◆ list_add_tail()

static void list_add_tail ( struct list_entry head,
struct list_entry entry 
)
static

Definition at line 83 of file list.h.

86 {
87  list_add(entry, head->prev, head);
88 }
static void list_add(struct list_entry *entry, struct list_entry *prev, struct list_entry *next)
Definition: list.h:64
struct list_entry * prev
Definition: list.h:28

◆ list_empty()

static int list_empty ( struct list_entry head)
static

Definition at line 58 of file list.h.

Referenced by list_remove().

60 {
61  return head->next == head;
62 }
struct outqueuenode * head
Definition: adnsresfilter.c:66
struct list_entry * next
Definition: list.h:29

◆ list_init()

static void list_init ( struct list_entry head)
static

Definition at line 51 of file list.h.

Referenced by list_remove().

53 {
54  head->prev = head;
55  head->next = head;
56 }
struct outqueuenode * head
Definition: adnsresfilter.c:66
struct list_entry * next
Definition: list.h:29
struct list_entry * prev
Definition: list.h:28

◆ list_remove()

static void list_remove ( struct list_entry entry)
static

Definition at line 90 of file list.h.

92 {
93  if (!list_empty(entry)) {
94  entry->next->prev = entry->prev;
95  entry->prev->next = entry->next;
96  list_init(entry);
97  }
98 }
static int list_empty(struct list_entry *head)
Definition: list.h:58
struct list_entry * next
Definition: list.h:29
static void list_init(struct list_entry *head)
Definition: list.h:51
struct list_entry * prev
Definition: list.h:28

◆ list_search()

static struct list_entry* list_search ( const struct list_entry head,
const void value,
list_compare_fn  compare 
)
static

Definition at line 102 of file list.h.

Referenced by cache_insert(), cache_lookup(), deleg_open_find(), delegation_find(), file_device_find_or_create(), find_superblock(), is_dst_name_opened(), layout_entry_find(), nfs41_server_find_or_create(), open_unlock_delegate(), open_unlock_remove(), pnfs_file_device_notify(), root_client_find(), root_client_find_addrs(), and server_entry_find().

106 {
107  struct list_entry *entry;
108  list_for_each(entry, head)
109  if (compare(entry, value) == 0)
110  return entry;
111  return NULL;
112 }
uint8_t entry
Definition: isohybrid.c:63
#define list_for_each(entry, head)
Definition: list.h:36
smooth NULL
Definition: ftsmooth.c:416
Definition: list.h:27
#define compare