Lines Matching refs:field

113 #define	QUEUEDEBUG_LIST_INSERT_HEAD(head, elm, field)			\
115 (head)->lh_first->field.le_prev != &(head)->lh_first) \
118 #define QUEUEDEBUG_LIST_OP(elm, field) \
119 if ((elm)->field.le_next && \
120 (elm)->field.le_next->field.le_prev != \
121 &(elm)->field.le_next) \
124 if (*(elm)->field.le_prev != (elm)) \
127 #define QUEUEDEBUG_LIST_POSTREMOVE(elm, field) \
128 (elm)->field.le_next = (void *)1L; \
129 (elm)->field.le_prev = (void *)1L;
131 #define QUEUEDEBUG_LIST_INSERT_HEAD(head, elm, field)
132 #define QUEUEDEBUG_LIST_OP(elm, field)
133 #define QUEUEDEBUG_LIST_POSTREMOVE(elm, field)
141 #define LIST_INSERT_AFTER(listelm, elm, field) do { \
142 QUEUEDEBUG_LIST_OP((listelm), field) \
143 if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \
144 (listelm)->field.le_next->field.le_prev = \
145 &(elm)->field.le_next; \
146 (listelm)->field.le_next = (elm); \
147 (elm)->field.le_prev = &(listelm)->field.le_next; \
151 #define LIST_INSERT_BEFORE(listelm, elm, field) do { \
152 QUEUEDEBUG_LIST_OP((listelm), field) \
153 (elm)->field.le_prev = (listelm)->field.le_prev; \
154 (elm)->field.le_next = (listelm); \
155 *(listelm)->field.le_prev = (elm); \
156 (listelm)->field.le_prev = &(elm)->field.le_next; \
160 #define LIST_INSERT_HEAD(head, elm, field) do { \
161 QUEUEDEBUG_LIST_INSERT_HEAD((head), (elm), field) \
162 if (((elm)->field.le_next = (head)->lh_first) != NULL) \
163 (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
165 (elm)->field.le_prev = &(head)->lh_first; \
169 #define LIST_REMOVE(elm, field) do { \
170 QUEUEDEBUG_LIST_OP((elm), field) \
171 if ((elm)->field.le_next != NULL) \
172 (elm)->field.le_next->field.le_prev = \
173 (elm)->field.le_prev; \
174 *(elm)->field.le_prev = (elm)->field.le_next; \
175 QUEUEDEBUG_LIST_POSTREMOVE((elm), field) \
179 #define LIST_FOREACH(var, head, field) \
182 (var) = ((var)->field.le_next))
184 #define LIST_FOREACH_SAFE(var, head, field, tvar) \
186 (var) && ((tvar) = LIST_NEXT((var), field), 1); \
194 #define LIST_NEXT(elm, field) ((elm)->field.le_next)
221 #define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
222 (elm)->field.sle_next = (slistelm)->field.sle_next; \
223 (slistelm)->field.sle_next = (elm); \
227 #define SLIST_INSERT_HEAD(head, elm, field) do { \
228 (elm)->field.sle_next = (head)->slh_first; \
233 #define SLIST_REMOVE_HEAD(head, field) do { \
234 (head)->slh_first = (head)->slh_first->field.sle_next; \
238 #define SLIST_REMOVE(head, elm, type, field) do { \
240 SLIST_REMOVE_HEAD((head), field); \
244 while (curelm->field.sle_next != (elm)) \
245 curelm = curelm->field.sle_next; \
246 curelm->field.sle_next = \
247 curelm->field.sle_next->field.sle_next; \
252 #define SLIST_FOREACH(var, head, field) \
253 for ((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
255 #define SLIST_FOREACH_SAFE(var, head, field, tvar) \
257 (var) && ((tvar) = SLIST_NEXT((var), field), 1); \
265 #define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
294 #define STAILQ_INSERT_HEAD(head, elm, field) do { \
295 if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \
296 (head)->stqh_last = &(elm)->field.stqe_next; \
301 #define STAILQ_INSERT_TAIL(head, elm, field) do { \
302 (elm)->field.stqe_next = NULL; \
304 (head)->stqh_last = &(elm)->field.stqe_next; \
308 #define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
309 if (((elm)->field.stqe_next = (listelm)->field.stqe_next) \
311 (head)->stqh_last = &(elm)->field.stqe_next; \
312 (listelm)->field.stqe_next = (elm); \
316 #define STAILQ_REMOVE_HEAD(head, field) do { \
317 if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) \
323 #define STAILQ_REMOVE(head, elm, type, field) do { \
325 STAILQ_REMOVE_HEAD((head), field); \
328 while (curelm->field.stqe_next != (elm)) \
329 curelm = curelm->field.stqe_next; \
330 if ((curelm->field.stqe_next = \
331 curelm->field.stqe_next->field.stqe_next) == NULL) \
332 (head)->stqh_last = &(curelm)->field.stqe_next; \
337 #define STAILQ_FOREACH(var, head, field) \
340 (var) = ((var)->field.stqe_next))
342 #define STAILQ_FOREACH_SAFE(var, head, field, tvar) \
344 (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
352 #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
381 #define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \
382 if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \
383 (head)->sqh_last = &(elm)->field.sqe_next; \
388 #define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \
389 (elm)->field.sqe_next = NULL; \
391 (head)->sqh_last = &(elm)->field.sqe_next; \
395 #define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
396 if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
397 (head)->sqh_last = &(elm)->field.sqe_next; \
398 (listelm)->field.sqe_next = (elm); \
402 #define SIMPLEQ_REMOVE_HEAD(head, field) do { \
403 if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \
408 #define SIMPLEQ_REMOVE(head, elm, type, field) do { \
410 SIMPLEQ_REMOVE_HEAD((head), field); \
413 while (curelm->field.sqe_next != (elm)) \
414 curelm = curelm->field.sqe_next; \
415 if ((curelm->field.sqe_next = \
416 curelm->field.sqe_next->field.sqe_next) == NULL) \
417 (head)->sqh_last = &(curelm)->field.sqe_next; \
422 #define SIMPLEQ_FOREACH(var, head, field) \
425 (var) = ((var)->field.sqe_next))
432 #define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next)
459 #define QUEUEDEBUG_TAILQ_INSERT_HEAD(head, elm, field) \
461 (head)->tqh_first->field.tqe_prev != &(head)->tqh_first) \
464 #define QUEUEDEBUG_TAILQ_INSERT_TAIL(head, elm, field) \
468 #define QUEUEDEBUG_TAILQ_OP(elm, field) \
469 if ((elm)->field.tqe_next && \
470 (elm)->field.tqe_next->field.tqe_prev != \
471 &(elm)->field.tqe_next) \
474 if (*(elm)->field.tqe_prev != (elm)) \
477 #define QUEUEDEBUG_TAILQ_PREREMOVE(head, elm, field) \
478 if ((elm)->field.tqe_next == NULL && \
479 (head)->tqh_last != &(elm)->field.tqe_next) \
482 #define QUEUEDEBUG_TAILQ_POSTREMOVE(elm, field) \
483 (elm)->field.tqe_next = (void *)1L; \
484 (elm)->field.tqe_prev = (void *)1L;
486 #define QUEUEDEBUG_TAILQ_INSERT_HEAD(head, elm, field)
487 #define QUEUEDEBUG_TAILQ_INSERT_TAIL(head, elm, field)
488 #define QUEUEDEBUG_TAILQ_OP(elm, field)
489 #define QUEUEDEBUG_TAILQ_PREREMOVE(head, elm, field)
490 #define QUEUEDEBUG_TAILQ_POSTREMOVE(elm, field)
499 #define TAILQ_INSERT_HEAD(head, elm, field) do { \
500 QUEUEDEBUG_TAILQ_INSERT_HEAD((head), (elm), field) \
501 if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
502 (head)->tqh_first->field.tqe_prev = \
503 &(elm)->field.tqe_next; \
505 (head)->tqh_last = &(elm)->field.tqe_next; \
507 (elm)->field.tqe_prev = &(head)->tqh_first; \
511 #define TAILQ_INSERT_TAIL(head, elm, field) do { \
512 QUEUEDEBUG_TAILQ_INSERT_TAIL((head), (elm), field) \
513 (elm)->field.tqe_next = NULL; \
514 (elm)->field.tqe_prev = (head)->tqh_last; \
516 (head)->tqh_last = &(elm)->field.tqe_next; \
520 #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
521 QUEUEDEBUG_TAILQ_OP((listelm), field) \
522 if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
523 (elm)->field.tqe_next->field.tqe_prev = \
524 &(elm)->field.tqe_next; \
526 (head)->tqh_last = &(elm)->field.tqe_next; \
527 (listelm)->field.tqe_next = (elm); \
528 (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
532 #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
533 QUEUEDEBUG_TAILQ_OP((listelm), field) \
534 (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
535 (elm)->field.tqe_next = (listelm); \
536 *(listelm)->field.tqe_prev = (elm); \
537 (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
541 #define TAILQ_REMOVE(head, elm, field) do { \
542 QUEUEDEBUG_TAILQ_PREREMOVE((head), (elm), field) \
543 QUEUEDEBUG_TAILQ_OP((elm), field) \
544 if (((elm)->field.tqe_next) != NULL) \
545 (elm)->field.tqe_next->field.tqe_prev = \
546 (elm)->field.tqe_prev; \
548 (head)->tqh_last = (elm)->field.tqe_prev; \
549 *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
550 QUEUEDEBUG_TAILQ_POSTREMOVE((elm), field); \
554 #define TAILQ_FOREACH(var, head, field) \
557 (var) = ((var)->field.tqe_next))
559 #define TAILQ_FOREACH_SAFE(var, head, field, tvar) \
561 (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
564 #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
568 (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
570 #define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \
572 (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \
580 #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
584 #define TAILQ_PREV(elm, headname, field) \
585 (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
615 #define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
616 (elm)->field.cqe_next = (listelm)->field.cqe_next; \
617 (elm)->field.cqe_prev = (listelm); \
618 if ((listelm)->field.cqe_next == (void *)(head)) \
621 (listelm)->field.cqe_next->field.cqe_prev = (elm); \
622 (listelm)->field.cqe_next = (elm); \
626 #define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \
627 (elm)->field.cqe_next = (listelm); \
628 (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
629 if ((listelm)->field.cqe_prev == (void *)(head)) \
632 (listelm)->field.cqe_prev->field.cqe_next = (elm); \
633 (listelm)->field.cqe_prev = (elm); \
637 #define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \
638 (elm)->field.cqe_next = (head)->cqh_first; \
639 (elm)->field.cqe_prev = (void *)(head); \
643 (head)->cqh_first->field.cqe_prev = (elm); \
648 #define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \
649 (elm)->field.cqe_next = (void *)(head); \
650 (elm)->field.cqe_prev = (head)->cqh_last; \
654 (head)->cqh_last->field.cqe_next = (elm); \
659 #define CIRCLEQ_REMOVE(head, elm, field) do { \
660 if ((elm)->field.cqe_next == (void *)(head)) \
661 (head)->cqh_last = (elm)->field.cqe_prev; \
663 (elm)->field.cqe_next->field.cqe_prev = \
664 (elm)->field.cqe_prev; \
665 if ((elm)->field.cqe_prev == (void *)(head)) \
666 (head)->cqh_first = (elm)->field.cqe_next; \
668 (elm)->field.cqe_prev->field.cqe_next = \
669 (elm)->field.cqe_next; \
673 #define CIRCLEQ_FOREACH(var, head, field) \
676 (var) = ((var)->field.cqe_next))
678 #define CIRCLEQ_FOREACH_REVERSE(var, head, field) \
681 (var) = ((var)->field.cqe_prev))
689 #define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next)
690 #define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev)
692 #define CIRCLEQ_LOOP_NEXT(head, elm, field) \
693 (((elm)->field.cqe_next == (void *)(head)) \
695 : (elm->field.cqe_next))
696 #define CIRCLEQ_LOOP_PREV(head, elm, field) \
697 (((elm)->field.cqe_prev == (void *)(head)) \
699 : (elm->field.cqe_prev))