NeoMutt  2018-07-16 +2481-68dcde
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 TRASHIT(x)
 
#define QMD_IS_TRASHED(x)   0
 
#define QMD_SAVELINK(name, link)
 
#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_NEXT(elm, field)   ((elm)->field.tqe_next)
 
#define TAILQ_PREV(elm, headname, field)   (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
 
#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 146 of file queue.h.

◆ QMD_TRACE_HEAD

#define QMD_TRACE_HEAD (   head)

Definition at line 147 of file queue.h.

◆ TRACEBUF

#define TRACEBUF

Definition at line 148 of file queue.h.

◆ TRACEBUF_INITIALIZER

#define TRACEBUF_INITIALIZER

Definition at line 149 of file queue.h.

◆ TRASHIT

#define TRASHIT (   x)

Definition at line 156 of file queue.h.

◆ QMD_IS_TRASHED

#define QMD_IS_TRASHED (   x)    0

Definition at line 157 of file queue.h.

◆ QMD_SAVELINK

#define QMD_SAVELINK (   name,
  link 
)

Definition at line 163 of file queue.h.

◆ QUEUE_TYPEOF

#define QUEUE_TYPEOF (   type)    struct type

Definition at line 172 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:45

Definition at line 178 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:45

Definition at line 183 of file queue.h.

◆ SLIST_HEAD_INITIALIZER

#define SLIST_HEAD_INITIALIZER (   head)    { NULL }

Definition at line 188 of file queue.h.

◆ SLIST_ENTRY

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

Definition at line 191 of file queue.h.

◆ SLIST_CLASS_ENTRY

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

Definition at line 196 of file queue.h.

◆ QMD_SLIST_CHECK_PREVPTR

#define QMD_SLIST_CHECK_PREVPTR (   prevp,
  elm 
)

Definition at line 211 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:270
#define SLIST_FIRST(head)
Definition: queue.h:229

Definition at line 214 of file queue.h.

◆ SLIST_EMPTY

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

Definition at line 227 of file queue.h.

◆ SLIST_FIRST

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

Definition at line 229 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:270
#define SLIST_FIRST(head)
Definition: queue.h:229

Definition at line 231 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:270
#define SLIST_FIRST(head)
Definition: queue.h:229

Definition at line 236 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:270
#define SLIST_FIRST(head)
Definition: queue.h:229

Definition at line 241 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:270
#define SLIST_FIRST(head)
Definition: queue.h:229

Definition at line 246 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:270
#define SLIST_FIRST(head)
Definition: queue.h:229

Definition at line 251 of file queue.h.

◆ SLIST_INIT

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

Definition at line 256 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:270

Definition at line 260 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:229

Definition at line 265 of file queue.h.

◆ SLIST_NEXT

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

Definition at line 270 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:270
#define SLIST_FIRST(head)
Definition: queue.h:229

Definition at line 272 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:270

Definition at line 286 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:270
#define SLIST_FIRST(head)
Definition: queue.h:229

Definition at line 291 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:270

Definition at line 295 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:229

Definition at line 301 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:45

Definition at line 310 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:45

Definition at line 316 of file queue.h.

◆ STAILQ_HEAD_INITIALIZER

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

Definition at line 322 of file queue.h.

◆ STAILQ_ENTRY

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

Definition at line 325 of file queue.h.

◆ STAILQ_CLASS_ENTRY

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

Definition at line 330 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:346

Definition at line 338 of file queue.h.

◆ STAILQ_EMPTY

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

Definition at line 346 of file queue.h.

◆ STAILQ_FIRST

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

Definition at line 348 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:398
#define STAILQ_FIRST(head)
Definition: queue.h:348

Definition at line 350 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:398
#define STAILQ_FIRST(head)
Definition: queue.h:348

Definition at line 355 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:398
#define STAILQ_FIRST(head)
Definition: queue.h:348

Definition at line 360 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:398
#define STAILQ_FIRST(head)
Definition: queue.h:348

Definition at line 365 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:348

Definition at line 370 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:398

Definition at line 375 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:398
#define STAILQ_FIRST(head)
Definition: queue.h:348

Definition at line 381 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:398

Definition at line 387 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:346
#define QUEUE_TYPEOF(type)
Definition: queue.h:172

Definition at line 393 of file queue.h.

◆ STAILQ_NEXT

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

Definition at line 398 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:398
#define STAILQ_FIRST(head)
Definition: queue.h:348

Definition at line 400 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:398

Definition at line 414 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:398
#define STAILQ_FIRST(head)
Definition: queue.h:348

Definition at line 420 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:346
#define STAILQ_FIRST(head)
Definition: queue.h:348

Definition at line 426 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:45

Definition at line 443 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:45

Definition at line 448 of file queue.h.

◆ LIST_HEAD_INITIALIZER

#define LIST_HEAD_INITIALIZER (   head)    { NULL }

Definition at line 453 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 456 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 462 of file queue.h.

◆ QMD_LIST_CHECK_HEAD

#define QMD_LIST_CHECK_HEAD (   head,
  field 
)

Definition at line 509 of file queue.h.

◆ QMD_LIST_CHECK_NEXT

#define QMD_LIST_CHECK_NEXT (   elm,
  field 
)

Definition at line 510 of file queue.h.

◆ QMD_LIST_CHECK_PREV

#define QMD_LIST_CHECK_PREV (   elm,
  field 
)

Definition at line 511 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:533
#define LIST_NEXT(elm, field)
Definition: queue.h:584

Definition at line 514 of file queue.h.

◆ LIST_EMPTY

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

Definition at line 531 of file queue.h.

◆ LIST_FIRST

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

Definition at line 533 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:533
#define LIST_NEXT(elm, field)
Definition: queue.h:584

Definition at line 535 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:533
#define LIST_NEXT(elm, field)
Definition: queue.h:584

Definition at line 540 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:533
#define LIST_NEXT(elm, field)
Definition: queue.h:584

Definition at line 545 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:533
#define LIST_NEXT(elm, field)
Definition: queue.h:584

Definition at line 550 of file queue.h.

◆ LIST_INIT

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

Definition at line 555 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:584

Definition at line 559 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:584

Definition at line 568 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:533
#define LIST_NEXT(elm, field)
Definition: queue.h:584

Definition at line 576 of file queue.h.

◆ LIST_NEXT

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

Definition at line 584 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:533

Definition at line 586 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:584

Definition at line 591 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:533

Definition at line 604 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:45

Definition at line 617 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:45

Definition at line 624 of file queue.h.

◆ TAILQ_HEAD_INITIALIZER

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

Definition at line 631 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 634 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 641 of file queue.h.

◆ QMD_TAILQ_CHECK_HEAD

#define QMD_TAILQ_CHECK_HEAD (   head,
  field 
)

Definition at line 698 of file queue.h.

◆ QMD_TAILQ_CHECK_TAIL

#define QMD_TAILQ_CHECK_TAIL (   head,
  headname 
)

Definition at line 699 of file queue.h.

◆ QMD_TAILQ_CHECK_NEXT

#define QMD_TAILQ_CHECK_NEXT (   elm,
  field 
)

Definition at line 700 of file queue.h.

◆ QMD_TAILQ_CHECK_PREV

#define QMD_TAILQ_CHECK_PREV (   elm,
  field 
)

Definition at line 701 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:715

Definition at line 704 of file queue.h.

◆ TAILQ_EMPTY

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

Definition at line 715 of file queue.h.

◆ TAILQ_FIRST

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

Definition at line 717 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:717
#define TAILQ_NEXT(elm, field)
Definition: queue.h:816

Definition at line 719 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:717
#define TAILQ_NEXT(elm, field)
Definition: queue.h:816

Definition at line 724 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:717
#define TAILQ_NEXT(elm, field)
Definition: queue.h:816

Definition at line 729 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:717
#define TAILQ_NEXT(elm, field)
Definition: queue.h:816

Definition at line 734 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:813
#define TAILQ_PREV(elm, headname, field)
Definition: queue.h:818

Definition at line 739 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:813
#define TAILQ_PREV(elm, headname, field)
Definition: queue.h:818

Definition at line 744 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:813
#define TAILQ_PREV(elm, headname, field)
Definition: queue.h:818

Definition at line 749 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:813
#define TAILQ_PREV(elm, headname, field)
Definition: queue.h:818

Definition at line 754 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:717

Definition at line 759 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:816

Definition at line 765 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:816

Definition at line 780 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:717
#define TAILQ_NEXT(elm, field)
Definition: queue.h:816

Definition at line 790 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:816

Definition at line 803 of file queue.h.

◆ TAILQ_LAST

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

Definition at line 813 of file queue.h.

◆ TAILQ_NEXT

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

Definition at line 816 of file queue.h.

◆ TAILQ_PREV

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

Definition at line 818 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:147
#define TAILQ_NEXT(elm, field)
Definition: queue.h:816

Definition at line 821 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 839 of file queue.h.