open62541 1.4.19
Open source implementation of OPC UA
Loading...
Searching...
No Matches
Macros
queue.h File Reference

Go to the source code of this file.

Macros

#define _Q_INVALIDATE(a)
 
#define SLIST_HEAD(name, type)
 
#define SLIST_HEAD_INITIALIZER(head)    { NULL }
 
#define SLIST_ENTRY(type)
 
#define SLIST_FIRST(head)   ((head)->slh_first)
 
#define SLIST_END(head)   NULL
 
#define SLIST_EMPTY(head)   (SLIST_FIRST(head) == SLIST_END(head))
 
#define SLIST_NEXT(elm, field)   ((elm)->field.sle_next)
 
#define SLIST_FOREACH(var, head, field)
 
#define SLIST_FOREACH_SAFE(var, head, field, tvar)
 
#define SLIST_INIT(head)
 
#define SLIST_INSERT_AFTER(slistelm, elm, field)
 
#define SLIST_INSERT_HEAD(head, elm, field)
 
#define SLIST_REMOVE_AFTER(elm, field)
 
#define SLIST_REMOVE_HEAD(head, field)
 
#define SLIST_REMOVE(head, elm, type, field)
 
#define LIST_HEAD(name, type)
 
#define LIST_HEAD_INITIALIZER(head)    { NULL }
 
#define LIST_ENTRY(type)
 
#define LIST_FIRST(head)   ((head)->lh_first)
 
#define LIST_END(head)   NULL
 
#define LIST_EMPTY(head)   (LIST_FIRST(head) == LIST_END(head))
 
#define LIST_NEXT(elm, field)   ((elm)->field.le_next)
 
#define LIST_FOREACH(var, head, field)
 
#define LIST_FOREACH_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_REMOVE(elm, field)
 
#define LIST_REPLACE(elm, elm2, field)
 
#define SIMPLEQ_HEAD(name, type)
 
#define SIMPLEQ_HEAD_INITIALIZER(head)    { NULL, &(head).sqh_first }
 
#define SIMPLEQ_ENTRY(type)
 
#define SIMPLEQ_FIRST(head)   ((head)->sqh_first)
 
#define SIMPLEQ_END(head)   NULL
 
#define SIMPLEQ_EMPTY(head)   (SIMPLEQ_FIRST(head) == SIMPLEQ_END(head))
 
#define SIMPLEQ_NEXT(elm, field)   ((elm)->field.sqe_next)
 
#define SIMPLEQ_FOREACH(var, head, field)
 
#define SIMPLEQ_FOREACH_SAFE(var, head, field, tvar)
 
#define SIMPLEQ_INIT(head)
 
#define SIMPLEQ_INSERT_HEAD(head, elm, field)
 
#define SIMPLEQ_INSERT_TAIL(head, elm, field)
 
#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field)
 
#define SIMPLEQ_REMOVE_HEAD(head, field)
 
#define SIMPLEQ_REMOVE_AFTER(head, elm, field)
 
#define SIMPLEQ_CONCAT(head1, head2)
 
#define XSIMPLEQ_HEAD(name, type)
 
#define XSIMPLEQ_ENTRY(type)
 
#define XSIMPLEQ_XOR(head, ptr)
 
#define XSIMPLEQ_FIRST(head)   XSIMPLEQ_XOR(head, ((head)->sqx_first))
 
#define XSIMPLEQ_END(head)   NULL
 
#define XSIMPLEQ_EMPTY(head)   (XSIMPLEQ_FIRST(head) == XSIMPLEQ_END(head))
 
#define XSIMPLEQ_NEXT(head, elm, field)   XSIMPLEQ_XOR(head, ((elm)->field.sqx_next))
 
#define XSIMPLEQ_FOREACH(var, head, field)
 
#define XSIMPLEQ_FOREACH_SAFE(var, head, field, tvar)
 
#define XSIMPLEQ_INIT(head)
 
#define XSIMPLEQ_INSERT_HEAD(head, elm, field)
 
#define XSIMPLEQ_INSERT_TAIL(head, elm, field)
 
#define XSIMPLEQ_INSERT_AFTER(head, listelm, elm, field)
 
#define XSIMPLEQ_REMOVE_HEAD(head, field)
 
#define XSIMPLEQ_REMOVE_AFTER(head, elm, field)
 
#define TAILQ_HEAD(name, type)
 
#define TAILQ_HEAD_INITIALIZER(head)    { NULL, &(head).tqh_first }
 
#define TAILQ_ENTRY(type)
 
#define TAILQ_FIRST(head)   ((head)->tqh_first)
 
#define TAILQ_END(head)   NULL
 
#define TAILQ_NEXT(elm, field)   ((elm)->field.tqe_next)
 
#define TAILQ_LAST(head, headname)    (*(((struct headname *)((head)->tqh_last))->tqh_last))
 
#define TAILQ_PREV(elm, headname, field)    (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
 
#define TAILQ_EMPTY(head)    (TAILQ_FIRST(head) == TAILQ_END(head))
 
#define TAILQ_FOREACH(var, head, field)
 
#define TAILQ_FOREACH_SAFE(var, head, field, tvar)
 
#define TAILQ_FOREACH_REVERSE(var, head, headname, field)
 
#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar)
 
#define TAILQ_INIT(head)
 
#define TAILQ_INSERT_HEAD(head, elm, field)
 
#define TAILQ_INSERT_TAIL(head, elm, field)
 
#define TAILQ_INSERT_AFTER(head, listelm, elm, field)
 
#define TAILQ_INSERT_BEFORE(listelm, elm, field)
 
#define TAILQ_REMOVE(head, elm, field)
 
#define TAILQ_REPLACE(head, elm, elm2, field)
 
#define TAILQ_CONCAT(head1, head2, field)
 

Macro Definition Documentation

◆ _Q_INVALIDATE

#define _Q_INVALIDATE (   a)

Definition at line 85 of file queue.h.

◆ LIST_EMPTY

#define LIST_EMPTY (   head)    (LIST_FIRST(head) == LIST_END(head))

Definition at line 183 of file queue.h.

◆ LIST_END

#define LIST_END (   head)    NULL

Definition at line 182 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 */ \
}
const UA_DataType * type
Definition types.h:626

Definition at line 172 of file queue.h.

◆ LIST_FIRST

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

Definition at line 181 of file queue.h.

◆ LIST_FOREACH

#define LIST_FOREACH (   var,
  head,
  field 
)
Value:
for((var) = LIST_FIRST(head); \
(var)!= LIST_END(head); \
(var) = LIST_NEXT(var, field))
#define LIST_END(head)
Definition queue.h:182
#define LIST_FIRST(head)
Definition queue.h:181
#define LIST_NEXT(elm, field)
Definition queue.h:184

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

◆ LIST_HEAD

#define LIST_HEAD (   name,
  type 
)
Value:
struct name { \
struct type *lh_first; /* first element */ \
}
qn name
Definition types.h:517

Definition at line 164 of file queue.h.

◆ LIST_HEAD_INITIALIZER

#define LIST_HEAD_INITIALIZER (   head)     { NULL }

Definition at line 169 of file queue.h.

◆ LIST_INIT

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

Definition at line 199 of file queue.h.

◆ LIST_INSERT_AFTER

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

Definition at line 203 of file queue.h.

◆ LIST_INSERT_BEFORE

#define LIST_INSERT_BEFORE (   listelm,
  elm,
  field 
)
Value:
do { \
(elm)->field.le_prev = (listelm)->field.le_prev; \
(elm)->field.le_next = (listelm); \
*(listelm)->field.le_prev = (elm); \
(listelm)->field.le_prev = &(elm)->field.le_next; \
} while (0)

Definition at line 211 of file queue.h.

◆ LIST_INSERT_HEAD

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

Definition at line 218 of file queue.h.

◆ LIST_NEXT

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

Definition at line 184 of file queue.h.

◆ LIST_REMOVE

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

Definition at line 225 of file queue.h.

◆ LIST_REPLACE

#define LIST_REPLACE (   elm,
  elm2,
  field 
)
Value:
do { \
if (((elm2)->field.le_next = (elm)->field.le_next) != NULL) \
(elm2)->field.le_next->field.le_prev = \
&(elm2)->field.le_next; \
(elm2)->field.le_prev = (elm)->field.le_prev; \
*(elm2)->field.le_prev = (elm2); \
_Q_INVALIDATE((elm)->field.le_prev); \
_Q_INVALIDATE((elm)->field.le_next); \
} while (0)

Definition at line 234 of file queue.h.

◆ SIMPLEQ_CONCAT

#define SIMPLEQ_CONCAT (   head1,
  head2 
)
Value:
do { \
if (!SIMPLEQ_EMPTY((head2))) { \
*(head1)->sqh_last = (head2)->sqh_first; \
(head1)->sqh_last = (head2)->sqh_last; \
SIMPLEQ_INIT((head2)); \
} \
} while (0)
#define SIMPLEQ_EMPTY(head)
Definition queue.h:266

Definition at line 316 of file queue.h.

◆ SIMPLEQ_EMPTY

#define SIMPLEQ_EMPTY (   head)    (SIMPLEQ_FIRST(head) == SIMPLEQ_END(head))

Definition at line 266 of file queue.h.

◆ SIMPLEQ_END

#define SIMPLEQ_END (   head)    NULL

Definition at line 265 of file queue.h.

◆ SIMPLEQ_ENTRY

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

Definition at line 256 of file queue.h.

◆ SIMPLEQ_FIRST

#define SIMPLEQ_FIRST (   head)    ((head)->sqh_first)

Definition at line 264 of file queue.h.

◆ SIMPLEQ_FOREACH

#define SIMPLEQ_FOREACH (   var,
  head,
  field 
)
Value:
for((var) = SIMPLEQ_FIRST(head); \
(var) != SIMPLEQ_END(head); \
(var) = SIMPLEQ_NEXT(var, field))
#define SIMPLEQ_NEXT(elm, field)
Definition queue.h:267
#define SIMPLEQ_FIRST(head)
Definition queue.h:264
#define SIMPLEQ_END(head)
Definition queue.h:265

Definition at line 269 of file queue.h.

◆ SIMPLEQ_FOREACH_SAFE

#define SIMPLEQ_FOREACH_SAFE (   var,
  head,
  field,
  tvar 
)
Value:
for ((var) = SIMPLEQ_FIRST(head); \
(var) && ((tvar) = SIMPLEQ_NEXT(var, field), 1); \
(var) = (tvar))

Definition at line 274 of file queue.h.

◆ SIMPLEQ_HEAD

#define SIMPLEQ_HEAD (   name,
  type 
)
Value:
struct name { \
struct type *sqh_first; /* first element */ \
struct type **sqh_last; /* addr of last next element */ \
}

Definition at line 247 of file queue.h.

◆ SIMPLEQ_HEAD_INITIALIZER

#define SIMPLEQ_HEAD_INITIALIZER (   head)     { NULL, &(head).sqh_first }

Definition at line 253 of file queue.h.

◆ SIMPLEQ_INIT

#define SIMPLEQ_INIT (   head)
Value:
do { \
(head)->sqh_first = NULL; \
(head)->sqh_last = &(head)->sqh_first; \
} while (0)

Definition at line 282 of file queue.h.

◆ SIMPLEQ_INSERT_AFTER

#define SIMPLEQ_INSERT_AFTER (   head,
  listelm,
  elm,
  field 
)
Value:
do { \
if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
(head)->sqh_last = &(elm)->field.sqe_next; \
(listelm)->field.sqe_next = (elm); \
} while (0)

Definition at line 299 of file queue.h.

◆ SIMPLEQ_INSERT_HEAD

#define SIMPLEQ_INSERT_HEAD (   head,
  elm,
  field 
)
Value:
do { \
if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \
(head)->sqh_last = &(elm)->field.sqe_next; \
(head)->sqh_first = (elm); \
} while (0)

Definition at line 287 of file queue.h.

◆ SIMPLEQ_INSERT_TAIL

#define SIMPLEQ_INSERT_TAIL (   head,
  elm,
  field 
)
Value:
do { \
(elm)->field.sqe_next = NULL; \
*(head)->sqh_last = (elm); \
(head)->sqh_last = &(elm)->field.sqe_next; \
} while (0)

Definition at line 293 of file queue.h.

◆ SIMPLEQ_NEXT

#define SIMPLEQ_NEXT (   elm,
  field 
)    ((elm)->field.sqe_next)

Definition at line 267 of file queue.h.

◆ SIMPLEQ_REMOVE_AFTER

#define SIMPLEQ_REMOVE_AFTER (   head,
  elm,
  field 
)
Value:
do { \
if (((elm)->field.sqe_next = (elm)->field.sqe_next->field.sqe_next) \
== NULL) \
(head)->sqh_last = &(elm)->field.sqe_next; \
} while (0)

Definition at line 310 of file queue.h.

◆ SIMPLEQ_REMOVE_HEAD

#define SIMPLEQ_REMOVE_HEAD (   head,
  field 
)
Value:
do { \
if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \
(head)->sqh_last = &(head)->sqh_first; \
} while (0)

Definition at line 305 of file queue.h.

◆ SLIST_EMPTY

#define SLIST_EMPTY (   head)    (SLIST_FIRST(head) == SLIST_END(head))

Definition at line 109 of file queue.h.

◆ SLIST_END

#define SLIST_END (   head)    NULL

Definition at line 108 of file queue.h.

◆ SLIST_ENTRY

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

Definition at line 99 of file queue.h.

◆ SLIST_FIRST

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

Definition at line 107 of file queue.h.

◆ SLIST_FOREACH

#define SLIST_FOREACH (   var,
  head,
  field 
)
Value:
for((var) = SLIST_FIRST(head); \
(var) != SLIST_END(head); \
(var) = SLIST_NEXT(var, field))
#define SLIST_END(head)
Definition queue.h:108
#define SLIST_NEXT(elm, field)
Definition queue.h:110
#define SLIST_FIRST(head)
Definition queue.h:107

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

◆ SLIST_HEAD

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

Definition at line 91 of file queue.h.

◆ SLIST_HEAD_INITIALIZER

#define SLIST_HEAD_INITIALIZER (   head)     { NULL }

Definition at line 96 of file queue.h.

◆ SLIST_INIT

#define SLIST_INIT (   head)
Value:
{ \
SLIST_FIRST(head) = SLIST_END(head); \
}

Definition at line 125 of file queue.h.

◆ SLIST_INSERT_AFTER

#define SLIST_INSERT_AFTER (   slistelm,
  elm,
  field 
)
Value:
do { \
(elm)->field.sle_next = (slistelm)->field.sle_next; \
(slistelm)->field.sle_next = (elm); \
} while (0)

Definition at line 129 of file queue.h.

◆ SLIST_INSERT_HEAD

#define SLIST_INSERT_HEAD (   head,
  elm,
  field 
)
Value:
do { \
(elm)->field.sle_next = (head)->slh_first; \
(head)->slh_first = (elm); \
} while (0)

Definition at line 134 of file queue.h.

◆ SLIST_NEXT

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

Definition at line 110 of file queue.h.

◆ SLIST_REMOVE

#define SLIST_REMOVE (   head,
  elm,
  type,
  field 
)
Value:
do { \
if ((head)->slh_first == (elm)) { \
SLIST_REMOVE_HEAD((head), field); \
} else { \
struct type *curelm = (head)->slh_first; \
\
while (curelm->field.sle_next != (elm)) \
curelm = curelm->field.sle_next; \
curelm->field.sle_next = \
curelm->field.sle_next->field.sle_next; \
} \
_Q_INVALIDATE((elm)->field.sle_next); \
} while (0)

Definition at line 147 of file queue.h.

◆ SLIST_REMOVE_AFTER

#define SLIST_REMOVE_AFTER (   elm,
  field 
)
Value:
do { \
(elm)->field.sle_next = (elm)->field.sle_next->field.sle_next; \
} while (0)

Definition at line 139 of file queue.h.

◆ SLIST_REMOVE_HEAD

#define SLIST_REMOVE_HEAD (   head,
  field 
)
Value:
do { \
(head)->slh_first = (head)->slh_first->field.sle_next; \
} while (0)

Definition at line 143 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)); \
} \
} while (0)
#define TAILQ_EMPTY(head)
Definition queue.h:433

Definition at line 524 of file queue.h.

◆ TAILQ_EMPTY

#define TAILQ_EMPTY (   head)     (TAILQ_FIRST(head) == TAILQ_END(head))

Definition at line 433 of file queue.h.

◆ TAILQ_END

#define TAILQ_END (   head)    NULL

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

◆ TAILQ_FIRST

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

Definition at line 425 of file queue.h.

◆ TAILQ_FOREACH

#define TAILQ_FOREACH (   var,
  head,
  field 
)
Value:
for((var) = TAILQ_FIRST(head); \
(var) != TAILQ_END(head); \
(var) = TAILQ_NEXT(var, field))
#define TAILQ_END(head)
Definition queue.h:426
#define TAILQ_FIRST(head)
Definition queue.h:425
#define TAILQ_NEXT(elm, field)
Definition queue.h:427

Definition at line 436 of file queue.h.

◆ TAILQ_FOREACH_REVERSE

#define TAILQ_FOREACH_REVERSE (   var,
  head,
  headname,
  field 
)
Value:
for((var) = TAILQ_LAST(head, headname); \
(var) != TAILQ_END(head); \
(var) = TAILQ_PREV(var, headname, field))
#define TAILQ_PREV(elm, headname, field)
XXX.
Definition queue.h:431
#define TAILQ_LAST(head, headname)
Definition queue.h:428

Definition at line 448 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) != TAILQ_END(head) && \
((tvar) = TAILQ_PREV(var, headname, field), 1); \
(var) = (tvar))

Definition at line 453 of file queue.h.

◆ TAILQ_FOREACH_SAFE

#define TAILQ_FOREACH_SAFE (   var,
  head,
  field,
  tvar 
)
Value:
for ((var) = TAILQ_FIRST(head); \
(var) != TAILQ_END(head) && \
((tvar) = TAILQ_NEXT(var, field), 1); \
(var) = (tvar))

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

Definition at line 407 of file queue.h.

◆ TAILQ_HEAD_INITIALIZER

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

Definition at line 413 of file queue.h.

◆ TAILQ_INIT

#define TAILQ_INIT (   head)
Value:
do { \
(head)->tqh_first = NULL; \
(head)->tqh_last = &(head)->tqh_first; \
} while (0)

Definition at line 462 of file queue.h.

◆ TAILQ_INSERT_AFTER

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

Definition at line 484 of file queue.h.

◆ TAILQ_INSERT_BEFORE

#define TAILQ_INSERT_BEFORE (   listelm,
  elm,
  field 
)
Value:
do { \
(elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
(elm)->field.tqe_next = (listelm); \
*(listelm)->field.tqe_prev = (elm); \
(listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
} while (0)

Definition at line 494 of file queue.h.

◆ TAILQ_INSERT_HEAD

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

Definition at line 467 of file queue.h.

◆ TAILQ_INSERT_TAIL

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

Definition at line 477 of file queue.h.

◆ TAILQ_LAST

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

Definition at line 428 of file queue.h.

◆ TAILQ_NEXT

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

Definition at line 427 of file queue.h.

◆ TAILQ_PREV

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

XXX.

Definition at line 431 of file queue.h.

◆ TAILQ_REMOVE

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

Definition at line 501 of file queue.h.

◆ TAILQ_REPLACE

#define TAILQ_REPLACE (   head,
  elm,
  elm2,
  field 
)
Value:
do { \
if (((elm2)->field.tqe_next = (elm)->field.tqe_next) != NULL) \
(elm2)->field.tqe_next->field.tqe_prev = \
&(elm2)->field.tqe_next; \
else \
(head)->tqh_last = &(elm2)->field.tqe_next; \
(elm2)->field.tqe_prev = (elm)->field.tqe_prev; \
*(elm2)->field.tqe_prev = (elm2); \
_Q_INVALIDATE((elm)->field.tqe_prev); \
_Q_INVALIDATE((elm)->field.tqe_next); \
} while (0)

Definition at line 512 of file queue.h.

◆ XSIMPLEQ_EMPTY

#define XSIMPLEQ_EMPTY (   head)    (XSIMPLEQ_FIRST(head) == XSIMPLEQ_END(head))

Definition at line 346 of file queue.h.

◆ XSIMPLEQ_END

#define XSIMPLEQ_END (   head)    NULL

Definition at line 345 of file queue.h.

◆ XSIMPLEQ_ENTRY

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

Definition at line 334 of file queue.h.

◆ XSIMPLEQ_FIRST

#define XSIMPLEQ_FIRST (   head)    XSIMPLEQ_XOR(head, ((head)->sqx_first))

Definition at line 344 of file queue.h.

◆ XSIMPLEQ_FOREACH

#define XSIMPLEQ_FOREACH (   var,
  head,
  field 
)
Value:
for ((var) = XSIMPLEQ_FIRST(head); \
(var) != XSIMPLEQ_END(head); \
(var) = XSIMPLEQ_NEXT(head, var, field))
#define XSIMPLEQ_END(head)
Definition queue.h:345
#define XSIMPLEQ_NEXT(head, elm, field)
Definition queue.h:347
#define XSIMPLEQ_FIRST(head)
Definition queue.h:344

Definition at line 350 of file queue.h.

◆ XSIMPLEQ_FOREACH_SAFE

#define XSIMPLEQ_FOREACH_SAFE (   var,
  head,
  field,
  tvar 
)
Value:
for ((var) = XSIMPLEQ_FIRST(head); \
(var) && ((tvar) = XSIMPLEQ_NEXT(head, var, field), 1); \
(var) = (tvar))

Definition at line 355 of file queue.h.

◆ XSIMPLEQ_HEAD

#define XSIMPLEQ_HEAD (   name,
  type 
)
Value:
struct name { \
struct type *sqx_first; /* first element */ \
struct type **sqx_last; /* addr of last next element */ \
unsigned long sqx_cookie; \
}

Definition at line 327 of file queue.h.

◆ XSIMPLEQ_INIT

#define XSIMPLEQ_INIT (   head)
Value:
do { \
arc4random_buf(&(head)->sqx_cookie, sizeof((head)->sqx_cookie)); \
(head)->sqx_first = XSIMPLEQ_XOR(head, NULL); \
(head)->sqx_last = XSIMPLEQ_XOR(head, &(head)->sqx_first); \
} while (0)
#define XSIMPLEQ_XOR(head, ptr)
Definition queue.h:342

Definition at line 363 of file queue.h.

◆ XSIMPLEQ_INSERT_AFTER

#define XSIMPLEQ_INSERT_AFTER (   head,
  listelm,
  elm,
  field 
)
Value:
do { \
if (((elm)->field.sqx_next = (listelm)->field.sqx_next) == \
XSIMPLEQ_XOR(head, NULL)) \
(head)->sqx_last = XSIMPLEQ_XOR(head, &(elm)->field.sqx_next); \
(listelm)->field.sqx_next = XSIMPLEQ_XOR(head, (elm)); \
} while (0)

Definition at line 382 of file queue.h.

◆ XSIMPLEQ_INSERT_HEAD

#define XSIMPLEQ_INSERT_HEAD (   head,
  elm,
  field 
)
Value:
do { \
if (((elm)->field.sqx_next = (head)->sqx_first) == \
XSIMPLEQ_XOR(head, NULL)) \
(head)->sqx_last = XSIMPLEQ_XOR(head, &(elm)->field.sqx_next); \
(head)->sqx_first = XSIMPLEQ_XOR(head, (elm)); \
} while (0)

Definition at line 369 of file queue.h.

◆ XSIMPLEQ_INSERT_TAIL

#define XSIMPLEQ_INSERT_TAIL (   head,
  elm,
  field 
)
Value:
do { \
(elm)->field.sqx_next = XSIMPLEQ_XOR(head, NULL); \
*(XSIMPLEQ_XOR(head, (head)->sqx_last)) = XSIMPLEQ_XOR(head, (elm)); \
(head)->sqx_last = XSIMPLEQ_XOR(head, &(elm)->field.sqx_next); \
} while (0)

Definition at line 376 of file queue.h.

◆ XSIMPLEQ_NEXT

#define XSIMPLEQ_NEXT (   head,
  elm,
  field 
)    XSIMPLEQ_XOR(head, ((elm)->field.sqx_next))

Definition at line 347 of file queue.h.

◆ XSIMPLEQ_REMOVE_AFTER

#define XSIMPLEQ_REMOVE_AFTER (   head,
  elm,
  field 
)
Value:
do { \
if (((elm)->field.sqx_next = XSIMPLEQ_XOR(head, \
(elm)->field.sqx_next)->field.sqx_next) \
== XSIMPLEQ_XOR(head, NULL)) \
(head)->sqx_last = \
XSIMPLEQ_XOR(head, &(elm)->field.sqx_next); \
} while (0)

Definition at line 395 of file queue.h.

◆ XSIMPLEQ_REMOVE_HEAD

#define XSIMPLEQ_REMOVE_HEAD (   head,
  field 
)
Value:
do { \
if (((head)->sqx_first = XSIMPLEQ_XOR(head, \
(head)->sqx_first)->field.sqx_next) == XSIMPLEQ_XOR(head, NULL)) \
(head)->sqx_last = XSIMPLEQ_XOR(head, &(head)->sqx_first); \
} while (0)

Definition at line 389 of file queue.h.

◆ XSIMPLEQ_XOR

#define XSIMPLEQ_XOR (   head,
  ptr 
)
Value:
((__typeof(ptr))((head)->sqx_cookie ^ \
(unsigned long)(ptr)))

Definition at line 342 of file queue.h.