NeoMutt  2019-12-07-60-g0cfa53
Teaching an old dog new tricks
DOXYGEN
queue.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define QMD_TRACE_ELEM(elem)
 
#define QMD_TRACE_HEAD(head)
 
#define TRACEBUF
 
#define TRACEBUF_INITIALIZER
 
#define QMD_SAVELINK(name, link)
 
#define TRASHIT(x)
 
#define QMD_IS_TRASHED(x)   0
 
#define QUEUE_TYPEOF(type)   struct type
 
#define SLIST_HEAD(name, type)
 
#define SLIST_CLASS_HEAD(name, type)
 
#define SLIST_HEAD_INITIALIZER(head)   { NULL }
 
#define SLIST_ENTRY(type)
 
#define SLIST_CLASS_ENTRY(type)
 
#define QMD_SLIST_CHECK_PREVPTR(prevp, elm)
 
#define SLIST_CONCAT(head1, head2, type, field)
 
#define SLIST_EMPTY(head)   ((head)->slh_first == NULL)
 
#define SLIST_FIRST(head)   ((head)->slh_first)
 
#define SLIST_FOREACH(var, head, field)
 
#define SLIST_FOREACH_FROM(var, head, field)
 
#define SLIST_FOREACH_SAFE(var, head, field, tvar)
 
#define SLIST_FOREACH_FROM_SAFE(var, head, field, tvar)
 
#define SLIST_FOREACH_PREVPTR(var, varp, head, field)
 
#define SLIST_INIT(head)
 
#define SLIST_INSERT_AFTER(slistelm, elm, field)
 
#define SLIST_INSERT_HEAD(head, elm, field)
 
#define SLIST_NEXT(elm, field)   ((elm)->field.sle_next)
 
#define SLIST_REMOVE(head, elm, type, field)
 
#define SLIST_REMOVE_AFTER(elm, field)
 
#define SLIST_REMOVE_HEAD(head, field)
 
#define SLIST_REMOVE_PREVPTR(prevp, elm, field)
 
#define SLIST_SWAP(head1, head2, type)
 
#define STAILQ_HEAD(name, type)
 
#define STAILQ_CLASS_HEAD(name, type)
 
#define STAILQ_HEAD_INITIALIZER(head)   { NULL, &(head).stqh_first }
 
#define STAILQ_ENTRY(type)
 
#define STAILQ_CLASS_ENTRY(type)
 
#define STAILQ_CONCAT(head1, head2)
 
#define STAILQ_EMPTY(head)   ((head)->stqh_first == NULL)
 
#define STAILQ_FIRST(head)   ((head)->stqh_first)
 
#define STAILQ_FOREACH(var, head, field)
 
#define STAILQ_FOREACH_FROM(var, head, field)
 
#define STAILQ_FOREACH_SAFE(var, head, field, tvar)
 
#define STAILQ_FOREACH_FROM_SAFE(var, head, field, tvar)
 
#define STAILQ_INIT(head)
 
#define STAILQ_INSERT_AFTER(head, tqelm, elm, field)
 
#define STAILQ_INSERT_HEAD(head, elm, field)
 
#define STAILQ_INSERT_TAIL(head, elm, field)
 
#define STAILQ_LAST(head, type, field)
 
#define STAILQ_NEXT(elm, field)   ((elm)->field.stqe_next)
 
#define STAILQ_REMOVE(head, elm, type, field)
 
#define STAILQ_REMOVE_AFTER(head, elm, field)
 
#define STAILQ_REMOVE_HEAD(head, field)
 
#define STAILQ_SWAP(head1, head2, type)
 
#define LIST_HEAD(name, type)
 
#define LIST_CLASS_HEAD(name, type)
 
#define LIST_HEAD_INITIALIZER(head)   { NULL }
 
#define LIST_ENTRY(type)
 
#define LIST_CLASS_ENTRY(type)
 
#define QMD_LIST_CHECK_HEAD(head, field)
 
#define QMD_LIST_CHECK_NEXT(elm, field)
 
#define QMD_LIST_CHECK_PREV(elm, field)
 
#define LIST_CONCAT(head1, head2, type, field)
 
#define LIST_EMPTY(head)   ((head)->lh_first == NULL)
 
#define LIST_FIRST(head)   ((head)->lh_first)
 
#define LIST_FOREACH(var, head, field)
 
#define LIST_FOREACH_FROM(var, head, field)
 
#define LIST_FOREACH_SAFE(var, head, field, tvar)
 
#define LIST_FOREACH_FROM_SAFE(var, head, field, tvar)
 
#define LIST_INIT(head)
 
#define LIST_INSERT_AFTER(listelm, elm, field)
 
#define LIST_INSERT_BEFORE(listelm, elm, field)
 
#define LIST_INSERT_HEAD(head, elm, field)
 
#define LIST_NEXT(elm, field)   ((elm)->field.le_next)
 
#define LIST_PREV(elm, head, type, field)
 
#define LIST_REMOVE(elm, field)
 
#define LIST_SWAP(head1, head2, type, field)
 
#define TAILQ_HEAD(name, type)
 
#define TAILQ_CLASS_HEAD(name, type)
 
#define TAILQ_HEAD_INITIALIZER(head)   { NULL, &(head).tqh_first, TRACEBUF_INITIALIZER }
 
#define TAILQ_ENTRY(type)
 
#define TAILQ_CLASS_ENTRY(type)
 
#define QMD_TAILQ_CHECK_HEAD(head, field)
 
#define QMD_TAILQ_CHECK_TAIL(head, headname)
 
#define QMD_TAILQ_CHECK_NEXT(elm, field)
 
#define QMD_TAILQ_CHECK_PREV(elm, field)
 
#define TAILQ_CONCAT(head1, head2, field)
 
#define TAILQ_EMPTY(head)   ((head)->tqh_first == NULL)
 
#define TAILQ_FIRST(head)   ((head)->tqh_first)
 
#define TAILQ_FOREACH(var, head, field)
 
#define TAILQ_FOREACH_FROM(var, head, field)
 
#define TAILQ_FOREACH_SAFE(var, head, field, tvar)
 
#define TAILQ_FOREACH_FROM_SAFE(var, head, field, tvar)
 
#define TAILQ_FOREACH_REVERSE(var, head, headname, field)
 
#define TAILQ_FOREACH_REVERSE_FROM(var, head, headname, field)
 
#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar)
 
#define TAILQ_FOREACH_REVERSE_FROM_SAFE(var, head, headname, field, tvar)
 
#define TAILQ_INIT(head)
 
#define TAILQ_INSERT_AFTER(head, listelm, elm, field)
 
#define TAILQ_INSERT_BEFORE(listelm, elm, field)
 
#define TAILQ_INSERT_HEAD(head, elm, field)
 
#define TAILQ_INSERT_TAIL(head, elm, field)
 
#define TAILQ_LAST(head, headname)   (*(((struct headname *)((head)->tqh_last))->tqh_last))
 
#define TAILQ_LAST_FAST(head, type, field)   (TAILQ_EMPTY(head) ? NULL : __containerof((head)->tqh_last, QUEUE_TYPEOF(type), field.tqe_next))
 
#define TAILQ_NEXT(elm, field)   ((elm)->field.tqe_next)
 
#define TAILQ_PREV(elm, headname, field)   (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
 
#define TAILQ_PREV_FAST(elm, head, type, field)
 
#define TAILQ_REMOVE(head, elm, field)
 
#define TAILQ_SWAP(head1, head2, type, field)
 

Macro Definition Documentation

◆ QMD_TRACE_ELEM

#define QMD_TRACE_ELEM (   elem)

Definition at line 149 of file queue.h.

◆ QMD_TRACE_HEAD

#define QMD_TRACE_HEAD (   head)

Definition at line 150 of file queue.h.

◆ TRACEBUF

#define TRACEBUF

Definition at line 151 of file queue.h.

◆ TRACEBUF_INITIALIZER

#define TRACEBUF_INITIALIZER

Definition at line 152 of file queue.h.

◆ QMD_SAVELINK

#define QMD_SAVELINK (   name,
  link 
)

Definition at line 160 of file queue.h.

◆ TRASHIT

#define TRASHIT (   x)

Definition at line 161 of file queue.h.

◆ QMD_IS_TRASHED

#define QMD_IS_TRASHED (   x)    0

Definition at line 162 of file queue.h.

◆ QUEUE_TYPEOF

#define QUEUE_TYPEOF (   type)    struct type

Definition at line 171 of file queue.h.

◆ SLIST_HEAD

#define SLIST_HEAD (   name,
  type 
)
Value:
struct name { \
struct type *slh_first; /* first element */ \
}
const char * name
Definition: pgpmicalg.c:46

Definition at line 177 of file queue.h.

◆ SLIST_CLASS_HEAD

#define SLIST_CLASS_HEAD (   name,
  type 
)
Value:
struct name { \
class type *slh_first; /* first element */ \
}
const char * name
Definition: pgpmicalg.c:46

Definition at line 182 of file queue.h.

◆ SLIST_HEAD_INITIALIZER

#define SLIST_HEAD_INITIALIZER (   head)    { NULL }

Definition at line 187 of file queue.h.

◆ SLIST_ENTRY

#define SLIST_ENTRY (   type)
Value:
struct { \
struct type *sle_next; /* next element */ \
}

Definition at line 190 of file queue.h.

◆ SLIST_CLASS_ENTRY

#define SLIST_CLASS_ENTRY (   type)
Value:
struct { \
class type *sle_next; /* next element */ \
}

Definition at line 195 of file queue.h.

◆ QMD_SLIST_CHECK_PREVPTR

#define QMD_SLIST_CHECK_PREVPTR (   prevp,
  elm 
)

Definition at line 210 of file queue.h.

◆ SLIST_CONCAT

#define SLIST_CONCAT (   head1,
  head2,
  type,
  field 
)
Value:
do { \
QUEUE_TYPEOF(type) *curelm = SLIST_FIRST(head1); \
if (curelm == NULL) { \
if ((SLIST_FIRST(head1) = SLIST_FIRST(head2)) != NULL) \
SLIST_INIT(head2); \
} else if (SLIST_FIRST(head2) != NULL) { \
while (SLIST_NEXT(curelm, field) != NULL) \
curelm = SLIST_NEXT(curelm, field); \
SLIST_NEXT(curelm, field) = SLIST_FIRST(head2); \
SLIST_INIT(head2); \
} \
} while (0)
#define SLIST_NEXT(elm, field)
Definition: queue.h:269
#define SLIST_FIRST(head)
Definition: queue.h:228

Definition at line 213 of file queue.h.

◆ SLIST_EMPTY

#define SLIST_EMPTY (   head)    ((head)->slh_first == NULL)

Definition at line 226 of file queue.h.

◆ SLIST_FIRST

#define SLIST_FIRST (   head)    ((head)->slh_first)

Definition at line 228 of file queue.h.

◆ SLIST_FOREACH

#define SLIST_FOREACH (   var,
  head,
  field 
)
Value:
for ((var) = SLIST_FIRST((head)); \
(var); \
(var) = SLIST_NEXT((var), field))
#define SLIST_NEXT(elm, field)
Definition: queue.h:269
#define SLIST_FIRST(head)
Definition: queue.h:228

Definition at line 230 of file queue.h.

◆ SLIST_FOREACH_FROM

#define SLIST_FOREACH_FROM (   var,
  head,
  field 
)
Value:
for ((var) = ((var) ? (var) : SLIST_FIRST((head))); \
(var); \
(var) = SLIST_NEXT((var), field))
#define SLIST_NEXT(elm, field)
Definition: queue.h:269
#define SLIST_FIRST(head)
Definition: queue.h:228

Definition at line 235 of file queue.h.

◆ SLIST_FOREACH_SAFE

#define SLIST_FOREACH_SAFE (   var,
  head,
  field,
  tvar 
)
Value:
for ((var) = SLIST_FIRST((head)); \
(var) && ((tvar) = SLIST_NEXT((var), field), 1); \
(var) = (tvar))
#define SLIST_NEXT(elm, field)
Definition: queue.h:269
#define SLIST_FIRST(head)
Definition: queue.h:228

Definition at line 240 of file queue.h.

◆ SLIST_FOREACH_FROM_SAFE

#define SLIST_FOREACH_FROM_SAFE (   var,
  head,
  field,
  tvar 
)
Value:
for ((var) = ((var) ? (var) : SLIST_FIRST((head))); \
(var) && ((tvar) = SLIST_NEXT((var), field), 1); \
(var) = (tvar))
#define SLIST_NEXT(elm, field)
Definition: queue.h:269
#define SLIST_FIRST(head)
Definition: queue.h:228

Definition at line 245 of file queue.h.

◆ SLIST_FOREACH_PREVPTR

#define SLIST_FOREACH_PREVPTR (   var,
  varp,
  head,
  field 
)
Value:
for ((varp) = &SLIST_FIRST((head)); \
((var) = *(varp)) != NULL; \
(varp) = &SLIST_NEXT((var), field))
#define SLIST_NEXT(elm, field)
Definition: queue.h:269
#define SLIST_FIRST(head)
Definition: queue.h:228

Definition at line 250 of file queue.h.

◆ SLIST_INIT

#define SLIST_INIT (   head)
Value:
do { \
SLIST_FIRST((head)) = NULL; \
} while (0)

Definition at line 255 of file queue.h.

◆ SLIST_INSERT_AFTER

#define SLIST_INSERT_AFTER (   slistelm,
  elm,
  field 
)
Value:
do { \
SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); \
SLIST_NEXT((slistelm), field) = (elm); \
} while (0)
#define SLIST_NEXT(elm, field)
Definition: queue.h:269

Definition at line 259 of file queue.h.

◆ SLIST_INSERT_HEAD

#define SLIST_INSERT_HEAD (   head,
  elm,
  field 
)
Value:
do { \
SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \
SLIST_FIRST((head)) = (elm); \
} while (0)
#define SLIST_FIRST(head)
Definition: queue.h:228

Definition at line 264 of file queue.h.

◆ SLIST_NEXT

#define SLIST_NEXT (   elm,
  field 
)    ((elm)->field.sle_next)

Definition at line 269 of file queue.h.

◆ SLIST_REMOVE

#define SLIST_REMOVE (   head,
  elm,
  type,
  field 
)
Value:
do { \
QMD_SAVELINK(oldnext, (elm)->field.sle_next); \
if (SLIST_FIRST((head)) == (elm)) { \
SLIST_REMOVE_HEAD((head), field); \
} \
else { \
QUEUE_TYPEOF(type) *curelm = SLIST_FIRST(head); \
while (SLIST_NEXT(curelm, field) != (elm)) \
curelm = SLIST_NEXT(curelm, field); \
SLIST_REMOVE_AFTER(curelm, field); \
} \
TRASHIT(*oldnext); \
} while (0)
#define SLIST_NEXT(elm, field)
Definition: queue.h:269
#define SLIST_FIRST(head)
Definition: queue.h:228

Definition at line 271 of file queue.h.

◆ SLIST_REMOVE_AFTER

#define SLIST_REMOVE_AFTER (   elm,
  field 
)
Value:
do { \
SLIST_NEXT(elm, field) = \
SLIST_NEXT(SLIST_NEXT(elm, field), field); \
} while (0)
#define SLIST_NEXT(elm, field)
Definition: queue.h:269

Definition at line 285 of file queue.h.

◆ SLIST_REMOVE_HEAD

#define SLIST_REMOVE_HEAD (   head,
  field 
)
Value:
do { \
SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \
} while (0)
#define SLIST_NEXT(elm, field)
Definition: queue.h:269
#define SLIST_FIRST(head)
Definition: queue.h:228

Definition at line 290 of file queue.h.

◆ SLIST_REMOVE_PREVPTR

#define SLIST_REMOVE_PREVPTR (   prevp,
  elm,
  field 
)
Value:
do { \
QMD_SLIST_CHECK_PREVPTR(prevp, elm); \
*(prevp) = SLIST_NEXT(elm, field); \
TRASHIT((elm)->field.sle_next); \
} while (0)
#define SLIST_NEXT(elm, field)
Definition: queue.h:269

Definition at line 294 of file queue.h.

◆ SLIST_SWAP

#define SLIST_SWAP (   head1,
  head2,
  type 
)
Value:
do { \
QUEUE_TYPEOF(type) *swap_first = SLIST_FIRST(head1); \
SLIST_FIRST(head1) = SLIST_FIRST(head2); \
SLIST_FIRST(head2) = swap_first; \
} while (0)
#define SLIST_FIRST(head)
Definition: queue.h:228

Definition at line 300 of file queue.h.

◆ STAILQ_HEAD

#define STAILQ_HEAD (   name,
  type 
)
Value:
struct name { \
struct type *stqh_first;/* first element */ \
struct type **stqh_last;/* addr of last next element */ \
}
const char * name
Definition: pgpmicalg.c:46

Definition at line 309 of file queue.h.

◆ STAILQ_CLASS_HEAD

#define STAILQ_CLASS_HEAD (   name,
  type 
)
Value:
struct name { \
class type *stqh_first; /* first element */ \
class type **stqh_last; /* addr of last next element */ \
}
const char * name
Definition: pgpmicalg.c:46

Definition at line 315 of file queue.h.

◆ STAILQ_HEAD_INITIALIZER

#define STAILQ_HEAD_INITIALIZER (   head)    { NULL, &(head).stqh_first }

Definition at line 321 of file queue.h.

◆ STAILQ_ENTRY

#define STAILQ_ENTRY (   type)
Value:
struct { \
struct type *stqe_next; /* next element */ \
}

Definition at line 324 of file queue.h.

◆ STAILQ_CLASS_ENTRY

#define STAILQ_CLASS_ENTRY (   type)
Value:
struct { \
class type *stqe_next; /* next element */ \
}

Definition at line 329 of file queue.h.

◆ STAILQ_CONCAT

#define STAILQ_CONCAT (   head1,
  head2 
)
Value:
do { \
if (!STAILQ_EMPTY((head2))) { \
*(head1)->stqh_last = (head2)->stqh_first; \
(head1)->stqh_last = (head2)->stqh_last; \
STAILQ_INIT((head2)); \
} \
} while (0)
#define STAILQ_EMPTY(head)
Definition: queue.h:345

Definition at line 337 of file queue.h.

◆ STAILQ_EMPTY

#define STAILQ_EMPTY (   head)    ((head)->stqh_first == NULL)

Definition at line 345 of file queue.h.

◆ STAILQ_FIRST

#define STAILQ_FIRST (   head)    ((head)->stqh_first)

Definition at line 347 of file queue.h.

◆ STAILQ_FOREACH

#define STAILQ_FOREACH (   var,
  head,
  field 
)
Value:
for((var) = STAILQ_FIRST((head)); \
(var); \
(var) = STAILQ_NEXT((var), field))
#define STAILQ_NEXT(elm, field)
Definition: queue.h:397
#define STAILQ_FIRST(head)
Definition: queue.h:347

Definition at line 349 of file queue.h.

◆ STAILQ_FOREACH_FROM

#define STAILQ_FOREACH_FROM (   var,
  head,
  field 
)
Value:
for ((var) = ((var) ? (var) : STAILQ_FIRST((head))); \
(var); \
(var) = STAILQ_NEXT((var), field))
#define STAILQ_NEXT(elm, field)
Definition: queue.h:397
#define STAILQ_FIRST(head)
Definition: queue.h:347

Definition at line 354 of file queue.h.

◆ STAILQ_FOREACH_SAFE

#define STAILQ_FOREACH_SAFE (   var,
  head,
  field,
  tvar 
)
Value:
for ((var) = STAILQ_FIRST((head)); \
(var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
(var) = (tvar))
#define STAILQ_NEXT(elm, field)
Definition: queue.h:397
#define STAILQ_FIRST(head)
Definition: queue.h:347

Definition at line 359 of file queue.h.

◆ STAILQ_FOREACH_FROM_SAFE

#define STAILQ_FOREACH_FROM_SAFE (   var,
  head,
  field,
  tvar 
)
Value:
for ((var) = ((var) ? (var) : STAILQ_FIRST((head))); \
(var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
(var) = (tvar))
#define STAILQ_NEXT(elm, field)
Definition: queue.h:397
#define STAILQ_FIRST(head)
Definition: queue.h:347

Definition at line 364 of file queue.h.

◆ STAILQ_INIT

#define STAILQ_INIT (   head)
Value:
do { \
STAILQ_FIRST((head)) = NULL; \
(head)->stqh_last = &STAILQ_FIRST((head)); \
} while (0)
#define STAILQ_FIRST(head)
Definition: queue.h:347

Definition at line 369 of file queue.h.

◆ STAILQ_INSERT_AFTER

#define STAILQ_INSERT_AFTER (   head,
  tqelm,
  elm,
  field 
)
Value:
do { \
if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\
(head)->stqh_last = &STAILQ_NEXT((elm), field); \
STAILQ_NEXT((tqelm), field) = (elm); \
} while (0)
#define STAILQ_NEXT(elm, field)
Definition: queue.h:397

Definition at line 374 of file queue.h.

◆ STAILQ_INSERT_HEAD

#define STAILQ_INSERT_HEAD (   head,
  elm,
  field 
)
Value:
do { \
if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \
(head)->stqh_last = &STAILQ_NEXT((elm), field); \
STAILQ_FIRST((head)) = (elm); \
} while (0)
#define STAILQ_NEXT(elm, field)
Definition: queue.h:397
#define STAILQ_FIRST(head)
Definition: queue.h:347

Definition at line 380 of file queue.h.

◆ STAILQ_INSERT_TAIL

#define STAILQ_INSERT_TAIL (   head,
  elm,
  field 
)
Value:
do { \
STAILQ_NEXT((elm), field) = NULL; \
*(head)->stqh_last = (elm); \
(head)->stqh_last = &STAILQ_NEXT((elm), field); \
} while (0)
#define STAILQ_NEXT(elm, field)
Definition: queue.h:397

Definition at line 386 of file queue.h.

◆ STAILQ_LAST

#define STAILQ_LAST (   head,
  type,
  field 
)
Value:
(STAILQ_EMPTY((head)) ? NULL : \
__containerof((head)->stqh_last, \
QUEUE_TYPEOF(type), field.stqe_next))
#define STAILQ_EMPTY(head)
Definition: queue.h:345
#define QUEUE_TYPEOF(type)
Definition: queue.h:171

Definition at line 392 of file queue.h.

◆ STAILQ_NEXT

#define STAILQ_NEXT (   elm,
  field 
)    ((elm)->field.stqe_next)

Definition at line 397 of file queue.h.

◆ STAILQ_REMOVE

#define STAILQ_REMOVE (   head,
  elm,
  type,
  field 
)
Value:
do { \
QMD_SAVELINK(oldnext, (elm)->field.stqe_next); \
if (STAILQ_FIRST((head)) == (elm)) { \
STAILQ_REMOVE_HEAD((head), field); \
} \
else { \
QUEUE_TYPEOF(type) *curelm = STAILQ_FIRST(head); \
while (STAILQ_NEXT(curelm, field) != (elm)) \
curelm = STAILQ_NEXT(curelm, field); \
STAILQ_REMOVE_AFTER(head, curelm, field); \
} \
TRASHIT(*oldnext); \
} while (0)
#define STAILQ_NEXT(elm, field)
Definition: queue.h:397
#define STAILQ_FIRST(head)
Definition: queue.h:347

Definition at line 399 of file queue.h.

◆ STAILQ_REMOVE_AFTER

#define STAILQ_REMOVE_AFTER (   head,
  elm,
  field 
)
Value:
do { \
if ((STAILQ_NEXT(elm, field) = \
STAILQ_NEXT(STAILQ_NEXT(elm, field), field)) == NULL) \
(head)->stqh_last = &STAILQ_NEXT((elm), field); \
} while (0)
#define STAILQ_NEXT(elm, field)
Definition: queue.h:397

Definition at line 413 of file queue.h.

◆ STAILQ_REMOVE_HEAD

#define STAILQ_REMOVE_HEAD (   head,
  field 
)
Value:
do { \
if ((STAILQ_FIRST((head)) = \
STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \
(head)->stqh_last = &STAILQ_FIRST((head)); \
} while (0)
#define STAILQ_NEXT(elm, field)
Definition: queue.h:397
#define STAILQ_FIRST(head)
Definition: queue.h:347

Definition at line 419 of file queue.h.

◆ STAILQ_SWAP

#define STAILQ_SWAP (   head1,
  head2,
  type 
)
Value:
do { \
QUEUE_TYPEOF(type) *swap_first = STAILQ_FIRST(head1); \
QUEUE_TYPEOF(type) **swap_last = (head1)->stqh_last; \
STAILQ_FIRST(head1) = STAILQ_FIRST(head2); \
(head1)->stqh_last = (head2)->stqh_last; \
STAILQ_FIRST(head2) = swap_first; \
(head2)->stqh_last = swap_last; \
if (STAILQ_EMPTY(head1)) \
(head1)->stqh_last = &STAILQ_FIRST(head1); \
if (STAILQ_EMPTY(head2)) \
(head2)->stqh_last = &STAILQ_FIRST(head2); \
} while (0)
#define STAILQ_EMPTY(head)
Definition: queue.h:345
#define STAILQ_FIRST(head)
Definition: queue.h:347

Definition at line 425 of file queue.h.

◆ LIST_HEAD

#define LIST_HEAD (   name,
  type 
)
Value:
struct name { \
struct type *lh_first; /* first element */ \
}
const char * name
Definition: pgpmicalg.c:46

Definition at line 442 of file queue.h.

◆ LIST_CLASS_HEAD

#define LIST_CLASS_HEAD (   name,
  type 
)
Value:
struct name { \
class type *lh_first; /* first element */ \
}
const char * name
Definition: pgpmicalg.c:46

Definition at line 447 of file queue.h.

◆ LIST_HEAD_INITIALIZER

#define LIST_HEAD_INITIALIZER (   head)    { NULL }

Definition at line 452 of file queue.h.

◆ LIST_ENTRY

#define LIST_ENTRY (   type)
Value:
struct { \
struct type *le_next; /* next element */ \
struct type **le_prev; /* address of previous next element */ \
}

Definition at line 455 of file queue.h.

◆ LIST_CLASS_ENTRY

#define LIST_CLASS_ENTRY (   type)
Value:
struct { \
class type *le_next; /* next element */ \
class type **le_prev; /* address of previous next element */ \
}

Definition at line 461 of file queue.h.

◆ QMD_LIST_CHECK_HEAD

#define QMD_LIST_CHECK_HEAD (   head,
  field 
)

Definition at line 508 of file queue.h.

◆ QMD_LIST_CHECK_NEXT

#define QMD_LIST_CHECK_NEXT (   elm,
  field 
)

Definition at line 509 of file queue.h.

◆ QMD_LIST_CHECK_PREV

#define QMD_LIST_CHECK_PREV (   elm,
  field 
)

Definition at line 510 of file queue.h.

◆ LIST_CONCAT

#define LIST_CONCAT (   head1,
  head2,
  type,
  field 
)
Value:
do { \
QUEUE_TYPEOF(type) *curelm = LIST_FIRST(head1); \
if (curelm == NULL) { \
if ((LIST_FIRST(head1) = LIST_FIRST(head2)) != NULL) { \
LIST_FIRST(head2)->field.le_prev = \
&LIST_FIRST((head1)); \
LIST_INIT(head2); \
} \
} else if (LIST_FIRST(head2) != NULL) { \
while (LIST_NEXT(curelm, field) != NULL) \
curelm = LIST_NEXT(curelm, field); \
LIST_NEXT(curelm, field) = LIST_FIRST(head2); \
LIST_FIRST(head2)->field.le_prev = &LIST_NEXT(curelm, field); \
LIST_INIT(head2); \
} \
} while (0)
#define LIST_FIRST(head)
Definition: queue.h:532
#define LIST_NEXT(elm, field)
Definition: queue.h:583

Definition at line 513 of file queue.h.

◆ LIST_EMPTY

#define LIST_EMPTY (   head)    ((head)->lh_first == NULL)

Definition at line 530 of file queue.h.

◆ LIST_FIRST

#define LIST_FIRST (   head)    ((head)->lh_first)

Definition at line 532 of file queue.h.

◆ LIST_FOREACH

#define LIST_FOREACH (   var,
  head,
  field 
)
Value:
for ((var) = LIST_FIRST((head)); \
(var); \
(var) = LIST_NEXT((var), field))
#define LIST_FIRST(head)
Definition: queue.h:532
#define LIST_NEXT(elm, field)
Definition: queue.h:583

Definition at line 534 of file queue.h.

◆ LIST_FOREACH_FROM

#define LIST_FOREACH_FROM (   var,
  head,
  field 
)
Value:
for ((var) = ((var) ? (var) : LIST_FIRST((head))); \
(var); \
(var) = LIST_NEXT((var), field))
#define LIST_FIRST(head)
Definition: queue.h:532
#define LIST_NEXT(elm, field)
Definition: queue.h:583

Definition at line 539 of file queue.h.

◆ LIST_FOREACH_SAFE

#define LIST_FOREACH_SAFE (   var,
  head,
  field,
  tvar 
)
Value:
for ((var) = LIST_FIRST((head)); \
(var) && ((tvar) = LIST_NEXT((var), field), 1); \
(var) = (tvar))
#define LIST_FIRST(head)
Definition: queue.h:532
#define LIST_NEXT(elm, field)
Definition: queue.h:583

Definition at line 544 of file queue.h.

◆ LIST_FOREACH_FROM_SAFE

#define LIST_FOREACH_FROM_SAFE (   var,
  head,
  field,
  tvar 
)
Value:
for ((var) = ((var) ? (var) : LIST_FIRST((head))); \
(var) && ((tvar) = LIST_NEXT((var), field), 1); \
(var) = (tvar))
#define LIST_FIRST(head)
Definition: queue.h:532
#define LIST_NEXT(elm, field)
Definition: queue.h:583

Definition at line 549 of file queue.h.

◆ LIST_INIT

#define LIST_INIT (   head)
Value:
do { \
LIST_FIRST((head)) = NULL; \
} while (0)

Definition at line 554 of file queue.h.

◆ LIST_INSERT_AFTER

#define LIST_INSERT_AFTER (   listelm,
  elm,
  field 
)
Value:
do { \
QMD_LIST_CHECK_NEXT(listelm, field); \
if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\
LIST_NEXT((listelm), field)->field.le_prev = \
&LIST_NEXT((elm), field); \
LIST_NEXT((listelm), field) = (elm); \
(elm)->field.le_prev = &LIST_NEXT((listelm), field); \
} while (0)
#define LIST_NEXT(elm, field)
Definition: queue.h:583

Definition at line 558 of file queue.h.

◆ LIST_INSERT_BEFORE

#define LIST_INSERT_BEFORE (   listelm,
  elm,
  field 
)
Value:
do { \
QMD_LIST_CHECK_PREV(listelm, field); \
(elm)->field.le_prev = (listelm)->field.le_prev; \
LIST_NEXT((elm), field) = (listelm); \
*(listelm)->field.le_prev = (elm); \
(listelm)->field.le_prev = &LIST_NEXT((elm), field); \
} while (0)
#define LIST_NEXT(elm, field)
Definition: queue.h:583

Definition at line 567 of file queue.h.

◆ LIST_INSERT_HEAD

#define LIST_INSERT_HEAD (   head,
  elm,
  field 
)
Value:
do { \
QMD_LIST_CHECK_HEAD((head), field); \
if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \
LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\
LIST_FIRST((head)) = (elm); \
(elm)->field.le_prev = &LIST_FIRST((head)); \
} while (0)
#define LIST_FIRST(head)
Definition: queue.h:532
#define LIST_NEXT(elm, field)
Definition: queue.h:583

Definition at line 575 of file queue.h.

◆ LIST_NEXT

#define LIST_NEXT (   elm,
  field 
)    ((elm)->field.le_next)

Definition at line 583 of file queue.h.

◆ LIST_PREV

#define LIST_PREV (   elm,
  head,
  type,
  field 
)
Value:
((elm)->field.le_prev == &LIST_FIRST((head)) ? NULL : \
__containerof((elm)->field.le_prev, \
QUEUE_TYPEOF(type), field.le_next))
#define LIST_FIRST(head)
Definition: queue.h:532

Definition at line 585 of file queue.h.

◆ LIST_REMOVE

#define LIST_REMOVE (   elm,
  field 
)
Value:
do { \
QMD_SAVELINK(oldnext, (elm)->field.le_next); \
QMD_SAVELINK(oldprev, (elm)->field.le_prev); \
QMD_LIST_CHECK_NEXT(elm, field); \
QMD_LIST_CHECK_PREV(elm, field); \
if (LIST_NEXT((elm), field) != NULL) \
LIST_NEXT((elm), field)->field.le_prev = \
(elm)->field.le_prev; \
*(elm)->field.le_prev = LIST_NEXT((elm), field); \
TRASHIT(*oldnext); \
TRASHIT(*oldprev); \
} while (0)
#define LIST_NEXT(elm, field)
Definition: queue.h:583

Definition at line 590 of file queue.h.

◆ LIST_SWAP

#define LIST_SWAP (   head1,
  head2,
  type,
  field 
)
Value:
do { \
QUEUE_TYPEOF(type) *swap_tmp = LIST_FIRST(head1); \
LIST_FIRST((head1)) = LIST_FIRST((head2)); \
LIST_FIRST((head2)) = swap_tmp; \
if ((swap_tmp = LIST_FIRST((head1))) != NULL) \
swap_tmp->field.le_prev = &LIST_FIRST((head1)); \
if ((swap_tmp = LIST_FIRST((head2))) != NULL) \
swap_tmp->field.le_prev = &LIST_FIRST((head2)); \
} while (0)
#define LIST_FIRST(head)
Definition: queue.h:532

Definition at line 603 of file queue.h.

◆ TAILQ_HEAD

#define TAILQ_HEAD (   name,
  type 
)
Value:
struct name { \
struct type *tqh_first; /* first element */ \
struct type **tqh_last; /* addr of last next element */ \
TRACEBUF \
}
const char * name
Definition: pgpmicalg.c:46

Definition at line 616 of file queue.h.

◆ TAILQ_CLASS_HEAD

#define TAILQ_CLASS_HEAD (   name,
  type 
)
Value:
struct name { \
class type *tqh_first; /* first element */ \
class type **tqh_last; /* addr of last next element */ \
TRACEBUF \
}
const char * name
Definition: pgpmicalg.c:46

Definition at line 623 of file queue.h.

◆ TAILQ_HEAD_INITIALIZER

#define TAILQ_HEAD_INITIALIZER (   head)    { NULL, &(head).tqh_first, TRACEBUF_INITIALIZER }

Definition at line 630 of file queue.h.

◆ TAILQ_ENTRY

#define TAILQ_ENTRY (   type)
Value:
struct { \
struct type *tqe_next; /* next element */ \
struct type **tqe_prev; /* address of previous next element */ \
TRACEBUF \
}

Definition at line 633 of file queue.h.

◆ TAILQ_CLASS_ENTRY

#define TAILQ_CLASS_ENTRY (   type)
Value:
struct { \
class type *tqe_next; /* next element */ \
class type **tqe_prev; /* address of previous next element */ \
TRACEBUF \
}

Definition at line 640 of file queue.h.

◆ QMD_TAILQ_CHECK_HEAD

#define QMD_TAILQ_CHECK_HEAD (   head,
  field 
)

Definition at line 697 of file queue.h.

◆ QMD_TAILQ_CHECK_TAIL

#define QMD_TAILQ_CHECK_TAIL (   head,
  headname 
)

Definition at line 698 of file queue.h.

◆ QMD_TAILQ_CHECK_NEXT

#define QMD_TAILQ_CHECK_NEXT (   elm,
  field 
)

Definition at line 699 of file queue.h.

◆ QMD_TAILQ_CHECK_PREV

#define QMD_TAILQ_CHECK_PREV (   elm,
  field 
)

Definition at line 700 of file queue.h.

◆ TAILQ_CONCAT

#define TAILQ_CONCAT (   head1,
  head2,
  field 
)
Value:
do { \
if (!TAILQ_EMPTY(head2)) { \
*(head1)->tqh_last = (head2)->tqh_first; \
(head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \
(head1)->tqh_last = (head2)->tqh_last; \
TAILQ_INIT((head2)); \
QMD_TRACE_HEAD(head1); \
QMD_TRACE_HEAD(head2); \
} \
} while (0)
#define TAILQ_EMPTY(head)
Definition: queue.h:714

Definition at line 703 of file queue.h.

◆ TAILQ_EMPTY

#define TAILQ_EMPTY (   head)    ((head)->tqh_first == NULL)

Definition at line 714 of file queue.h.

◆ TAILQ_FIRST

#define TAILQ_FIRST (   head)    ((head)->tqh_first)

Definition at line 716 of file queue.h.

◆ TAILQ_FOREACH

#define TAILQ_FOREACH (   var,
  head,
  field 
)
Value:
for ((var) = TAILQ_FIRST((head)); \
(var); \
(var) = TAILQ_NEXT((var), field))
#define TAILQ_FIRST(head)
Definition: queue.h:716
#define TAILQ_NEXT(elm, field)
Definition: queue.h:825

Definition at line 718 of file queue.h.

◆ TAILQ_FOREACH_FROM

#define TAILQ_FOREACH_FROM (   var,
  head,
  field 
)
Value:
for ((var) = ((var) ? (var) : TAILQ_FIRST((head))); \
(var); \
(var) = TAILQ_NEXT((var), field))
#define TAILQ_FIRST(head)
Definition: queue.h:716
#define TAILQ_NEXT(elm, field)
Definition: queue.h:825

Definition at line 723 of file queue.h.

◆ TAILQ_FOREACH_SAFE

#define TAILQ_FOREACH_SAFE (   var,
  head,
  field,
  tvar 
)
Value:
for ((var) = TAILQ_FIRST((head)); \
(var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
(var) = (tvar))
#define TAILQ_FIRST(head)
Definition: queue.h:716
#define TAILQ_NEXT(elm, field)
Definition: queue.h:825

Definition at line 728 of file queue.h.

◆ TAILQ_FOREACH_FROM_SAFE

#define TAILQ_FOREACH_FROM_SAFE (   var,
  head,
  field,
  tvar 
)
Value:
for ((var) = ((var) ? (var) : TAILQ_FIRST((head))); \
(var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
(var) = (tvar))
#define TAILQ_FIRST(head)
Definition: queue.h:716
#define TAILQ_NEXT(elm, field)
Definition: queue.h:825

Definition at line 733 of file queue.h.

◆ TAILQ_FOREACH_REVERSE

#define TAILQ_FOREACH_REVERSE (   var,
  head,
  headname,
  field 
)
Value:
for ((var) = TAILQ_LAST((head), headname); \
(var); \
(var) = TAILQ_PREV((var), headname, field))
#define TAILQ_LAST(head, headname)
Definition: queue.h:812
#define TAILQ_PREV(elm, headname, field)
Definition: queue.h:827

Definition at line 738 of file queue.h.

◆ TAILQ_FOREACH_REVERSE_FROM

#define TAILQ_FOREACH_REVERSE_FROM (   var,
  head,
  headname,
  field 
)
Value:
for ((var) = ((var) ? (var) : TAILQ_LAST((head), headname)); \
(var); \
(var) = TAILQ_PREV((var), headname, field))
#define TAILQ_LAST(head, headname)
Definition: queue.h:812
#define TAILQ_PREV(elm, headname, field)
Definition: queue.h:827

Definition at line 743 of file queue.h.

◆ TAILQ_FOREACH_REVERSE_SAFE

#define TAILQ_FOREACH_REVERSE_SAFE (   var,
  head,
  headname,
  field,
  tvar 
)
Value:
for ((var) = TAILQ_LAST((head), headname); \
(var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \
(var) = (tvar))
#define TAILQ_LAST(head, headname)
Definition: queue.h:812
#define TAILQ_PREV(elm, headname, field)
Definition: queue.h:827

Definition at line 748 of file queue.h.

◆ TAILQ_FOREACH_REVERSE_FROM_SAFE

#define TAILQ_FOREACH_REVERSE_FROM_SAFE (   var,
  head,
  headname,
  field,
  tvar 
)
Value:
for ((var) = ((var) ? (var) : TAILQ_LAST((head), headname)); \
(var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \
(var) = (tvar))
#define TAILQ_LAST(head, headname)
Definition: queue.h:812
#define TAILQ_PREV(elm, headname, field)
Definition: queue.h:827

Definition at line 753 of file queue.h.

◆ TAILQ_INIT

#define TAILQ_INIT (   head)
Value:
do { \
TAILQ_FIRST((head)) = NULL; \
(head)->tqh_last = &TAILQ_FIRST((head)); \
QMD_TRACE_HEAD(head); \
} while (0)
#define TAILQ_FIRST(head)
Definition: queue.h:716

Definition at line 758 of file queue.h.

◆ TAILQ_INSERT_AFTER

#define TAILQ_INSERT_AFTER (   head,
  listelm,
  elm,
  field 
)
Value:
do { \
QMD_TAILQ_CHECK_NEXT(listelm, field); \
if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\
TAILQ_NEXT((elm), field)->field.tqe_prev = \
&TAILQ_NEXT((elm), field); \
else { \
(head)->tqh_last = &TAILQ_NEXT((elm), field); \
QMD_TRACE_HEAD(head); \
} \
TAILQ_NEXT((listelm), field) = (elm); \
(elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); \
QMD_TRACE_ELEM(&(elm)->field); \
QMD_TRACE_ELEM(&(listelm)->field); \
} while (0)
#define TAILQ_NEXT(elm, field)
Definition: queue.h:825

Definition at line 764 of file queue.h.

◆ TAILQ_INSERT_BEFORE

#define TAILQ_INSERT_BEFORE (   listelm,
  elm,
  field 
)
Value:
do { \
QMD_TAILQ_CHECK_PREV(listelm, field); \
(elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
TAILQ_NEXT((elm), field) = (listelm); \
*(listelm)->field.tqe_prev = (elm); \
(listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \
QMD_TRACE_ELEM(&(elm)->field); \
QMD_TRACE_ELEM(&(listelm)->field); \
} while (0)
#define TAILQ_NEXT(elm, field)
Definition: queue.h:825

Definition at line 779 of file queue.h.

◆ TAILQ_INSERT_HEAD

#define TAILQ_INSERT_HEAD (   head,
  elm,
  field 
)
Value:
do { \
QMD_TAILQ_CHECK_HEAD(head, field); \
if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \
TAILQ_FIRST((head))->field.tqe_prev = \
&TAILQ_NEXT((elm), field); \
else \
(head)->tqh_last = &TAILQ_NEXT((elm), field); \
TAILQ_FIRST((head)) = (elm); \
(elm)->field.tqe_prev = &TAILQ_FIRST((head)); \
QMD_TRACE_HEAD(head); \
QMD_TRACE_ELEM(&(elm)->field); \
} while (0)
#define TAILQ_FIRST(head)
Definition: queue.h:716
#define TAILQ_NEXT(elm, field)
Definition: queue.h:825

Definition at line 789 of file queue.h.

◆ TAILQ_INSERT_TAIL

#define TAILQ_INSERT_TAIL (   head,
  elm,
  field 
)
Value:
do { \
QMD_TAILQ_CHECK_TAIL(head, field); \
TAILQ_NEXT((elm), field) = NULL; \
(elm)->field.tqe_prev = (head)->tqh_last; \
*(head)->tqh_last = (elm); \
(head)->tqh_last = &TAILQ_NEXT((elm), field); \
QMD_TRACE_HEAD(head); \
QMD_TRACE_ELEM(&(elm)->field); \
} while (0)
#define TAILQ_NEXT(elm, field)
Definition: queue.h:825

Definition at line 802 of file queue.h.

◆ TAILQ_LAST

#define TAILQ_LAST (   head,
  headname 
)    (*(((struct headname *)((head)->tqh_last))->tqh_last))

Definition at line 812 of file queue.h.

◆ TAILQ_LAST_FAST

#define TAILQ_LAST_FAST (   head,
  type,
  field 
)    (TAILQ_EMPTY(head) ? NULL : __containerof((head)->tqh_last, QUEUE_TYPEOF(type), field.tqe_next))

Definition at line 822 of file queue.h.

◆ TAILQ_NEXT

#define TAILQ_NEXT (   elm,
  field 
)    ((elm)->field.tqe_next)

Definition at line 825 of file queue.h.

◆ TAILQ_PREV

#define TAILQ_PREV (   elm,
  headname,
  field 
)    (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))

Definition at line 827 of file queue.h.

◆ TAILQ_PREV_FAST

#define TAILQ_PREV_FAST (   elm,
  head,
  type,
  field 
)
Value:
((elm)->field.tqe_prev == &(head)->tqh_first ? NULL : \
__containerof((elm)->field.tqe_prev, QUEUE_TYPEOF(type), field.tqe_next))
#define QUEUE_TYPEOF(type)
Definition: queue.h:171

Definition at line 830 of file queue.h.

◆ TAILQ_REMOVE

#define TAILQ_REMOVE (   head,
  elm,
  field 
)
Value:
do { \
QMD_SAVELINK(oldnext, (elm)->field.tqe_next); \
QMD_SAVELINK(oldprev, (elm)->field.tqe_prev); \
QMD_TAILQ_CHECK_NEXT(elm, field); \
QMD_TAILQ_CHECK_PREV(elm, field); \
if ((TAILQ_NEXT((elm), field)) != NULL) \
TAILQ_NEXT((elm), field)->field.tqe_prev = \
(elm)->field.tqe_prev; \
else { \
(head)->tqh_last = (elm)->field.tqe_prev; \
QMD_TRACE_HEAD(head); \
} \
*(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \
TRASHIT(*oldnext); \
TRASHIT(*oldprev); \
QMD_TRACE_ELEM(&(elm)->field); \
} while (0)
#define QMD_TRACE_HEAD(head)
Definition: queue.h:150
#define TAILQ_NEXT(elm, field)
Definition: queue.h:825

Definition at line 834 of file queue.h.

◆ TAILQ_SWAP

#define TAILQ_SWAP (   head1,
  head2,
  type,
  field 
)
Value:
do { \
QUEUE_TYPEOF(type) *swap_first = (head1)->tqh_first; \
QUEUE_TYPEOF(type) **swap_last = (head1)->tqh_last; \
(head1)->tqh_first = (head2)->tqh_first; \
(head1)->tqh_last = (head2)->tqh_last; \
(head2)->tqh_first = swap_first; \
(head2)->tqh_last = swap_last; \
if ((swap_first = (head1)->tqh_first) != NULL) \
swap_first->field.tqe_prev = &(head1)->tqh_first; \
else \
(head1)->tqh_last = &(head1)->tqh_first; \
if ((swap_first = (head2)->tqh_first) != NULL) \
swap_first->field.tqe_prev = &(head2)->tqh_first; \
else \
(head2)->tqh_last = &(head2)->tqh_first; \
} while (0)

Definition at line 852 of file queue.h.