NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
list.h File Reference
#include <stddef.h>
#include <stdbool.h>
#include "utils.h"
Include dependency graph for list.h:

Go to the source code of this file.

Data Structures

struct  list_head
 

Macros

#define prefetch(x)
 
#define LIST_HEAD_INIT(name)   { &(name), &(name) }
 
#define LIST_HEAD(name)   struct list_head name = LIST_HEAD_INIT(name)
 
#define list_entry(ptr, type, field)   container_of(ptr, type, field)
 
#define list_first_entry(ptr, type, field)   list_entry((ptr)->next, type, field)
 
#define list_last_entry(ptr, type, field)   list_entry((ptr)->prev, type, field)
 
#define list_for_each(p, head)   for (p = (head)->next; p != (head); p = p->next)
 
#define list_for_each_safe(p, n, head)   for (p = (head)->next, n = p->next; p != (head); p = n, n = p->next)
 
#define list_for_each_entry(p, h, field)
 
#define list_for_each_entry_safe(p, n, h, field)
 
#define list_for_each_entry_reverse(p, h, field)
 
#define list_for_each_prev(p, h)   for (p = (h)->prev; p != (h); p = p->prev)
 
#define list_for_each_prev_safe(p, n, h)   for (p = (h)->prev, n = p->prev; p != (h); p = n, n = p->prev)
 

Macro Definition Documentation

#define list_entry (   ptr,
  type,
  field 
)    container_of(ptr, type, field)
#define list_first_entry (   ptr,
  type,
  field 
)    list_entry((ptr)->next, type, field)
#define list_for_each (   p,
  head 
)    for (p = (head)->next; p != (head); p = p->next)
#define list_for_each_entry (   p,
  h,
  field 
)
Value:
for (p = list_first_entry(h, typeof(*p), field); &p->field != (h); \
p = list_entry(p->field.next, typeof(*p), field))
#define list_entry(ptr, type, field)
Definition: list.h:106
#define list_first_entry(ptr, type, field)
Definition: list.h:107
#define list_for_each_entry_reverse (   p,
  h,
  field 
)
Value:
for (p = list_last_entry(h, typeof(*p), field); &p->field != (h); \
p = list_entry(p->field.prev, typeof(*p), field))
#define list_last_entry(ptr, type, field)
Definition: list.h:108
#define list_entry(ptr, type, field)
Definition: list.h:106
#define list_for_each_entry_safe (   p,
  n,
  h,
  field 
)
Value:
for (p = list_first_entry(h, typeof(*p), field), \
n = list_entry(p->field.next, typeof(*p), field); &p->field != (h);\
p = n, n = list_entry(n->field.next, typeof(*n), field))
#define list_entry(ptr, type, field)
Definition: list.h:106
#define list_first_entry(ptr, type, field)
Definition: list.h:107
#define list_for_each_prev (   p,
 
)    for (p = (h)->prev; p != (h); p = p->prev)
#define list_for_each_prev_safe (   p,
  n,
 
)    for (p = (h)->prev, n = p->prev; p != (h); p = n, n = p->prev)
#define list_for_each_safe (   p,
  n,
  head 
)    for (p = (head)->next, n = p->next; p != (head); p = n, n = p->next)
#define LIST_HEAD (   name)    struct list_head name = LIST_HEAD_INIT(name)
#define LIST_HEAD_INIT (   name)    { &(name), &(name) }
#define list_last_entry (   ptr,
  type,
  field 
)    list_entry((ptr)->prev, type, field)
#define prefetch (   x)