NeoMutt  2024-11-14-34-g5aaf0d
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
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 SLIST_END(head)   NULL
 
#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 STAILQ_END(head)   NULL
 
#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 LIST_END(head)   NULL
 
#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)
 
#define TAILQ_END(head)   NULL
 

Macro Definition Documentation

◆ QMD_TRACE_ELEM

#define QMD_TRACE_ELEM (   elem)

Definition at line 150 of file queue.h.

◆ QMD_TRACE_HEAD

#define QMD_TRACE_HEAD (   head)

Definition at line 151 of file queue.h.

◆ TRACEBUF

#define TRACEBUF

Definition at line 152 of file queue.h.

◆ TRACEBUF_INITIALIZER

#define TRACEBUF_INITIALIZER

Definition at line 153 of file queue.h.

◆ QMD_SAVELINK

#define QMD_SAVELINK (   name,
  link 
)

Definition at line 161 of file queue.h.

◆ TRASHIT

#define TRASHIT (   x)

Definition at line 162 of file queue.h.

◆ QMD_IS_TRASHED

#define QMD_IS_TRASHED (   x)    0

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 */ \
}

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 */ \
}

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))

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))

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))

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))

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))

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)

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)

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)

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)

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)

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)

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)

Definition at line 301 of file queue.h.

◆ SLIST_END

#define SLIST_END (   head)    NULL

Definition at line 307 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 */ \
}

Definition at line 312 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 */ \
}

Definition at line 318 of file queue.h.

◆ STAILQ_HEAD_INITIALIZER

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

Definition at line 324 of file queue.h.

◆ STAILQ_ENTRY

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

Definition at line 327 of file queue.h.

◆ STAILQ_CLASS_ENTRY

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

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

Definition at line 340 of file queue.h.

◆ STAILQ_EMPTY

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

Definition at line 348 of file queue.h.

◆ STAILQ_FIRST

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

Definition at line 350 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_FIRST(head)
Definition: queue.h:350
#define STAILQ_NEXT(elm, field)
Definition: queue.h:400

Definition at line 352 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))

Definition at line 357 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))

Definition at line 362 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))

Definition at line 367 of file queue.h.

◆ STAILQ_INIT

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

Definition at line 372 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)

Definition at line 377 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)

Definition at line 383 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)

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

Definition at line 395 of file queue.h.

◆ STAILQ_NEXT

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

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

Definition at line 402 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)

Definition at line 416 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)

Definition at line 422 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)

Definition at line 428 of file queue.h.

◆ STAILQ_END

#define STAILQ_END (   head)    NULL

Definition at line 441 of file queue.h.

◆ LIST_HEAD

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

Definition at line 447 of file queue.h.

◆ LIST_CLASS_HEAD

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

Definition at line 452 of file queue.h.

◆ LIST_HEAD_INITIALIZER

#define LIST_HEAD_INITIALIZER (   head)     { NULL }

Definition at line 457 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 460 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 466 of file queue.h.

◆ QMD_LIST_CHECK_HEAD

#define QMD_LIST_CHECK_HEAD (   head,
  field 
)

Definition at line 513 of file queue.h.

◆ QMD_LIST_CHECK_NEXT

#define QMD_LIST_CHECK_NEXT (   elm,
  field 
)

Definition at line 514 of file queue.h.

◆ QMD_LIST_CHECK_PREV

#define QMD_LIST_CHECK_PREV (   elm,
  field 
)

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

Definition at line 518 of file queue.h.

◆ LIST_EMPTY

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

Definition at line 535 of file queue.h.

◆ LIST_FIRST

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

Definition at line 537 of file queue.h.

◆ LIST_FOREACH

#define LIST_FOREACH (   var,
  head,
  field 
)
Value:
for ((var) = LIST_FIRST((head)); \
(var); \
(var) = LIST_NEXT((var), field))

Definition at line 539 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))

Definition at line 544 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))

Definition at line 549 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))

Definition at line 554 of file queue.h.

◆ LIST_INIT

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

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

Definition at line 563 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)

Definition at line 572 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)

Definition at line 580 of file queue.h.

◆ LIST_NEXT

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

Definition at line 588 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))

Definition at line 590 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)

Definition at line 595 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)

Definition at line 608 of file queue.h.

◆ LIST_END

#define LIST_END (   head)    NULL

Definition at line 618 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 */ \
}
#define TRACEBUF
Definition: queue.h:152

Definition at line 623 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 */ \
}

Definition at line 630 of file queue.h.

◆ TAILQ_HEAD_INITIALIZER

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

Definition at line 637 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 */ \
}

Definition at line 640 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 */ \
}

Definition at line 647 of file queue.h.

◆ QMD_TAILQ_CHECK_HEAD

#define QMD_TAILQ_CHECK_HEAD (   head,
  field 
)

Definition at line 704 of file queue.h.

◆ QMD_TAILQ_CHECK_TAIL

#define QMD_TAILQ_CHECK_TAIL (   head,
  headname 
)

Definition at line 705 of file queue.h.

◆ QMD_TAILQ_CHECK_NEXT

#define QMD_TAILQ_CHECK_NEXT (   elm,
  field 
)

Definition at line 706 of file queue.h.

◆ QMD_TAILQ_CHECK_PREV

#define QMD_TAILQ_CHECK_PREV (   elm,
  field 
)

Definition at line 707 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:721

Definition at line 710 of file queue.h.

◆ TAILQ_EMPTY

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

Definition at line 721 of file queue.h.

◆ TAILQ_FIRST

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

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

Definition at line 725 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))

Definition at line 730 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))

Definition at line 735 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))

Definition at line 740 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_PREV(elm, headname, field)
Definition: queue.h:834
#define TAILQ_LAST(head, headname)
Definition: queue.h:819

Definition at line 745 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))

Definition at line 750 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))

Definition at line 755 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))

Definition at line 760 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)

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

Definition at line 771 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)

Definition at line 786 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)

Definition at line 796 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)

Definition at line 809 of file queue.h.

◆ TAILQ_LAST

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

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

◆ TAILQ_NEXT

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

Definition at line 832 of file queue.h.

◆ TAILQ_PREV

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

Definition at line 834 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))

Definition at line 837 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:151

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

◆ TAILQ_END

#define TAILQ_END (   head)    NULL

Definition at line 876 of file queue.h.