Back to index

lightning-sunbird  0.9+nobinonly
Defines
queue.h File Reference

Go to the source code of this file.

Defines

#define LIST_HEAD(name, type)
#define LIST_ENTRY(type)
#define LIST_INIT(head)
#define LIST_INSERT_AFTER(listelm, elm, field)
#define LIST_INSERT_HEAD(head, elm, field)
#define LIST_REMOVE(elm, field)
#define TAILQ_HEAD(name, type)
#define TAILQ_ENTRY(type)
#define TAILQ_INIT(head)
#define TAILQ_INSERT_HEAD(head, elm, field)
#define TAILQ_INSERT_TAIL(head, elm, field)
#define TAILQ_INSERT_AFTER(head, listelm, elm, field)
#define TAILQ_REMOVE(head, elm, field)
#define CIRCLEQ_HEAD(name, type)
#define CIRCLEQ_ENTRY(type)
#define CIRCLEQ_INIT(head)
#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field)
#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field)
#define CIRCLEQ_INSERT_HEAD(head, elm, field)
#define CIRCLEQ_INSERT_TAIL(head, elm, field)
#define CIRCLEQ_REMOVE(head, elm, field)

Define Documentation

Value:
struct {                                                       \
       struct type *cqe_next;             /* next element */          \
       struct type *cqe_prev;             /* previous element */             \
}

Definition at line 177 of file queue.h.

#define CIRCLEQ_HEAD (   name,
  type 
)
Value:
struct name {                                                  \
       struct type *cqh_first;            /* first element */         \
       struct type *cqh_last;             /* last element */          \
}

Definition at line 171 of file queue.h.

Value:
{                                         \
       (head)->cqh_first = (void *)(head);                            \
       (head)->cqh_last = (void *)(head);                      \
}

Definition at line 186 of file queue.h.

#define CIRCLEQ_INSERT_AFTER (   head,
  listelm,
  elm,
  field 
)
Value:
{             \
       (elm)->field.cqe_next = (listelm)->field.cqe_next;             \
       (elm)->field.cqe_prev = (listelm);                      \
       if ((listelm)->field.cqe_next == (void *)(head))        \
              (head)->cqh_last = (elm);                        \
       else                                                    \
              (listelm)->field.cqe_next->field.cqe_prev = (elm);      \
       (listelm)->field.cqe_next = (elm);                      \
}

Definition at line 191 of file queue.h.

#define CIRCLEQ_INSERT_BEFORE (   head,
  listelm,
  elm,
  field 
)
Value:
{             \
       (elm)->field.cqe_next = (listelm);                      \
       (elm)->field.cqe_prev = (listelm)->field.cqe_prev;             \
       if ((listelm)->field.cqe_prev == (void *)(head))        \
              (head)->cqh_first = (elm);                       \
       else                                                    \
              (listelm)->field.cqe_prev->field.cqe_next = (elm);      \
       (listelm)->field.cqe_prev = (elm);                      \
}

Definition at line 201 of file queue.h.

#define CIRCLEQ_INSERT_HEAD (   head,
  elm,
  field 
)
Value:
{                           \
       (elm)->field.cqe_next = (head)->cqh_first;                     \
       (elm)->field.cqe_prev = (void *)(head);                        \
       if ((head)->cqh_last == (void *)(head))                        \
              (head)->cqh_last = (elm);                        \
       else                                                    \
              (head)->cqh_first->field.cqe_prev = (elm);              \
       (head)->cqh_first = (elm);                              \
}

Definition at line 211 of file queue.h.

#define CIRCLEQ_INSERT_TAIL (   head,
  elm,
  field 
)
Value:
{                           \
       (elm)->field.cqe_next = (void *)(head);                        \
       (elm)->field.cqe_prev = (head)->cqh_last;               \
       if ((head)->cqh_first == (void *)(head))                \
              (head)->cqh_first = (elm);                       \
       else                                                    \
              (head)->cqh_last->field.cqe_next = (elm);        \
       (head)->cqh_last = (elm);                               \
}

Definition at line 221 of file queue.h.

#define CIRCLEQ_REMOVE (   head,
  elm,
  field 
)
Value:
{                           \
       if ((elm)->field.cqe_next == (void *)(head))                   \
              (head)->cqh_last = (elm)->field.cqe_prev;        \
       else                                                    \
              (elm)->field.cqe_next->field.cqe_prev =                 \
                  (elm)->field.cqe_prev;                       \
       if ((elm)->field.cqe_prev == (void *)(head))                   \
              (head)->cqh_first = (elm)->field.cqe_next;              \
       else                                                    \
              (elm)->field.cqe_prev->field.cqe_next =                 \
                  (elm)->field.cqe_next;                       \
}

Definition at line 231 of file queue.h.

Value:
struct {                                                       \
       struct type *le_next;       /* next element */                 \
       struct type **le_prev;      /* address of previous next element */    \
}

Definition at line 74 of file queue.h.

#define LIST_HEAD (   name,
  type 
)
Value:
struct name {                                                  \
       struct type *lh_first;      /* first element */                \
}

Definition at line 69 of file queue.h.

Value:
{                                         \
       (head)->lh_first = NULL;                                \
}

Definition at line 83 of file queue.h.

#define LIST_INSERT_AFTER (   listelm,
  elm,
  field 
)
Value:
{                    \
       if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \
              (listelm)->field.le_next->field.le_prev =        \
                  &(elm)->field.le_next;                       \
       (listelm)->field.le_next = (elm);                       \
       (elm)->field.le_prev = &(listelm)->field.le_next;              \
}

Definition at line 87 of file queue.h.

#define LIST_INSERT_HEAD (   head,
  elm,
  field 
)
Value:
{                           \
       if (((elm)->field.le_next = (head)->lh_first) != NULL)         \
              (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
       (head)->lh_first = (elm);                               \
       (elm)->field.le_prev = &(head)->lh_first;               \
}

Definition at line 95 of file queue.h.

#define LIST_REMOVE (   elm,
  field 
)
Value:
{                                  \
       if ((elm)->field.le_next != NULL)                       \
              (elm)->field.le_next->field.le_prev =                   \
                  (elm)->field.le_prev;                        \
       *(elm)->field.le_prev = (elm)->field.le_next;                  \
}

Definition at line 102 of file queue.h.

Value:
struct {                                                       \
       struct type *tqe_next;      /* next element */                 \
       struct type **tqe_prev;     /* address of previous next element */    \
}

Definition at line 118 of file queue.h.

#define TAILQ_HEAD (   name,
  type 
)
Value:
struct name {                                                  \
       struct type *tqh_first;     /* first element */                \
       struct type **tqh_last;     /* addr of last next element */           \
}

Definition at line 112 of file queue.h.

Value:
{                                         \
       (head)->tqh_first = NULL;                               \
       (head)->tqh_last = &(head)->tqh_first;                         \
}

Definition at line 127 of file queue.h.

#define TAILQ_INSERT_AFTER (   head,
  listelm,
  elm,
  field 
)
Value:
{                    \
       if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
              (elm)->field.tqe_next->field.tqe_prev =          \
                  &(elm)->field.tqe_next;                      \
       else                                                    \
              (head)->tqh_last = &(elm)->field.tqe_next;              \
       (listelm)->field.tqe_next = (elm);                      \
       (elm)->field.tqe_prev = &(listelm)->field.tqe_next;            \
}

Definition at line 149 of file queue.h.

#define TAILQ_INSERT_HEAD (   head,
  elm,
  field 
)
Value:
{                           \
       if (((elm)->field.tqe_next = (head)->tqh_first) != NULL)       \
              (elm)->field.tqe_next->field.tqe_prev =                 \
                  &(elm)->field.tqe_next;                      \
       else                                                    \
              (head)->tqh_last = &(elm)->field.tqe_next;              \
       (head)->tqh_first = (elm);                              \
       (elm)->field.tqe_prev = &(head)->tqh_first;                    \
}

Definition at line 132 of file queue.h.

#define TAILQ_INSERT_TAIL (   head,
  elm,
  field 
)
Value:
{                           \
       (elm)->field.tqe_next = NULL;                                  \
       (elm)->field.tqe_prev = (head)->tqh_last;               \
       *(head)->tqh_last = (elm);                              \
       (head)->tqh_last = &(elm)->field.tqe_next;                     \
}

Definition at line 142 of file queue.h.

#define TAILQ_REMOVE (   head,
  elm,
  field 
)
Value:
{                           \
       if (((elm)->field.tqe_next) != NULL)                           \
              (elm)->field.tqe_next->field.tqe_prev =          \
                  (elm)->field.tqe_prev;                       \
       else                                                    \
              (head)->tqh_last = (elm)->field.tqe_prev;        \
       *(elm)->field.tqe_prev = (elm)->field.tqe_next;                \
}

Definition at line 159 of file queue.h.