Lines Matching full:field
184 #define SLIST_CONCAT(head1, head2, type, field) do { \ argument
190 while (SLIST_NEXT(curelm, field) != NULL) \
191 curelm = SLIST_NEXT(curelm, field); \
192 SLIST_NEXT(curelm, field) = SLIST_FIRST(head2); \
201 #define SLIST_FOREACH(var, head, field) \ argument
204 (var) = SLIST_NEXT((var), field))
206 #define SLIST_FOREACH_FROM(var, head, field) \ argument
209 (var) = SLIST_NEXT((var), field))
211 #define SLIST_FOREACH_SAFE(var, head, field, tvar) \ argument
213 (var) && ((tvar) = SLIST_NEXT((var), field), 1); \
216 #define SLIST_FOREACH_FROM_SAFE(var, head, field, tvar) \ argument
218 (var) && ((tvar) = SLIST_NEXT((var), field), 1); \
221 #define SLIST_FOREACH_PREVPTR(var, varp, head, field) \ argument
224 (varp) = &SLIST_NEXT((var), field))
230 #define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ argument
231 SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); \
232 SLIST_NEXT((slistelm), field) = (elm); \
235 #define SLIST_INSERT_HEAD(head, elm, field) do { \ argument
236 SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \
240 #define SLIST_NEXT(elm, field) ((elm)->field.sle_next) argument
242 #define SLIST_REMOVE(head, elm, type, field) do { \ argument
243 QMD_SAVELINK(oldnext, (elm)->field.sle_next); \
245 SLIST_REMOVE_HEAD((head), field); \
249 while (SLIST_NEXT(curelm, field) != (elm)) \
250 curelm = SLIST_NEXT(curelm, field); \
251 SLIST_REMOVE_AFTER(curelm, field); \
256 #define SLIST_REMOVE_AFTER(elm, field) do { \ argument
257 SLIST_NEXT(elm, field) = \
258 SLIST_NEXT(SLIST_NEXT(elm, field), field); \
261 #define SLIST_REMOVE_HEAD(head, field) do { \ argument
262 SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \
265 #define SLIST_REMOVE_PREVPTR(prevp, elm, field) do { \ argument
267 *(prevp) = SLIST_NEXT(elm, field); \
268 TRASHIT((elm)->field.sle_next); \
320 #define STAILQ_FOREACH(var, head, field) \ argument
323 (var) = STAILQ_NEXT((var), field))
325 #define STAILQ_FOREACH_FROM(var, head, field) \ argument
328 (var) = STAILQ_NEXT((var), field))
330 #define STAILQ_FOREACH_SAFE(var, head, field, tvar) \ argument
332 (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
335 #define STAILQ_FOREACH_FROM_SAFE(var, head, field, tvar) \ argument
337 (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
345 #define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \ argument
346 if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\
347 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
348 STAILQ_NEXT((tqelm), field) = (elm); \
351 #define STAILQ_INSERT_HEAD(head, elm, field) do { \ argument
352 if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \
353 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
357 #define STAILQ_INSERT_TAIL(head, elm, field) do { \ argument
358 STAILQ_NEXT((elm), field) = NULL; \
360 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
363 #define STAILQ_LAST(head, type, field) \ argument
366 QUEUE_TYPEOF(type), field.stqe_next))
368 #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) argument
370 #define STAILQ_REMOVE(head, elm, type, field) do { \ argument
371 QMD_SAVELINK(oldnext, (elm)->field.stqe_next); \
373 STAILQ_REMOVE_HEAD((head), field); \
377 while (STAILQ_NEXT(curelm, field) != (elm)) \
378 curelm = STAILQ_NEXT(curelm, field); \
379 STAILQ_REMOVE_AFTER(head, curelm, field); \
384 #define STAILQ_REMOVE_AFTER(head, elm, field) do { \ argument
385 if ((STAILQ_NEXT(elm, field) = \
386 STAILQ_NEXT(STAILQ_NEXT(elm, field), field)) == NULL) \
387 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
390 #define STAILQ_REMOVE_HEAD(head, field) do { \ argument
392 STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \
449 #define QMD_LIST_CHECK_HEAD(head, field) do { \ argument
451 LIST_FIRST((head))->field.le_prev != \
462 #define QMD_LIST_CHECK_NEXT(elm, field) do { \ argument
463 if (LIST_NEXT((elm), field) != NULL && \
464 LIST_NEXT((elm), field)->field.le_prev != \
465 &((elm)->field.le_next)) \
474 #define QMD_LIST_CHECK_PREV(elm, field) do { \ argument
475 if (*(elm)->field.le_prev != (elm)) \
479 #define QMD_LIST_CHECK_HEAD(head, field) argument
480 #define QMD_LIST_CHECK_NEXT(elm, field) argument
481 #define QMD_LIST_CHECK_PREV(elm, field) argument
484 #define LIST_CONCAT(head1, head2, type, field) do { \ argument
488 LIST_FIRST(head2)->field.le_prev = \
493 while (LIST_NEXT(curelm, field) != NULL) \
494 curelm = LIST_NEXT(curelm, field); \
495 LIST_NEXT(curelm, field) = LIST_FIRST(head2); \
496 LIST_FIRST(head2)->field.le_prev = &LIST_NEXT(curelm, field); \
505 #define LIST_FOREACH(var, head, field) \ argument
508 (var) = LIST_NEXT((var), field))
510 #define LIST_FOREACH_FROM(var, head, field) \ argument
513 (var) = LIST_NEXT((var), field))
515 #define LIST_FOREACH_SAFE(var, head, field, tvar) \ argument
517 (var) && ((tvar) = LIST_NEXT((var), field), 1); \
520 #define LIST_FOREACH_FROM_SAFE(var, head, field, tvar) \ argument
522 (var) && ((tvar) = LIST_NEXT((var), field), 1); \
529 #define LIST_INSERT_AFTER(listelm, elm, field) do { \ argument
530 QMD_LIST_CHECK_NEXT(listelm, field); \
531 if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\
532 LIST_NEXT((listelm), field)->field.le_prev = \
533 &LIST_NEXT((elm), field); \
534 LIST_NEXT((listelm), field) = (elm); \
535 (elm)->field.le_prev = &LIST_NEXT((listelm), field); \
538 #define LIST_INSERT_BEFORE(listelm, elm, field) do { \ argument
539 QMD_LIST_CHECK_PREV(listelm, field); \
540 (elm)->field.le_prev = (listelm)->field.le_prev; \
541 LIST_NEXT((elm), field) = (listelm); \
542 *(listelm)->field.le_prev = (elm); \
543 (listelm)->field.le_prev = &LIST_NEXT((elm), field); \
546 #define LIST_INSERT_HEAD(head, elm, field) do { \ argument
547 QMD_LIST_CHECK_HEAD((head), field); \
548 if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \
549 LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\
551 (elm)->field.le_prev = &LIST_FIRST((head)); \
554 #define LIST_NEXT(elm, field) ((elm)->field.le_next) argument
556 #define LIST_PREV(elm, head, type, field) \ argument
557 ((elm)->field.le_prev == &LIST_FIRST((head)) ? NULL : \
558 __containerof((elm)->field.le_prev, \
559 QUEUE_TYPEOF(type), field.le_next))
561 #define LIST_REMOVE(elm, field) do { \ argument
562 QMD_SAVELINK(oldnext, (elm)->field.le_next); \
563 QMD_SAVELINK(oldprev, (elm)->field.le_prev); \
564 QMD_LIST_CHECK_NEXT(elm, field); \
565 QMD_LIST_CHECK_PREV(elm, field); \
566 if (LIST_NEXT((elm), field) != NULL) \
567 LIST_NEXT((elm), field)->field.le_prev = \
568 (elm)->field.le_prev; \
569 *(elm)->field.le_prev = LIST_NEXT((elm), field); \
574 #define LIST_SWAP(head1, head2, type, field) do { \ argument
579 swap_tmp->field.le_prev = &LIST_FIRST((head1)); \
581 swap_tmp->field.le_prev = &LIST_FIRST((head2)); \
628 #define QMD_TAILQ_CHECK_HEAD(head, field) do { \ argument
630 TAILQ_FIRST((head))->field.tqe_prev != \
640 #define QMD_TAILQ_CHECK_TAIL(head, field) do { \ argument
651 #define QMD_TAILQ_CHECK_NEXT(elm, field) do { \ argument
652 if (TAILQ_NEXT((elm), field) != NULL && \
653 TAILQ_NEXT((elm), field)->field.tqe_prev != \
654 &((elm)->field.tqe_next)) \
663 #define QMD_TAILQ_CHECK_PREV(elm, field) do { \ argument
664 if (*(elm)->field.tqe_prev != (elm)) \
668 #define QMD_TAILQ_CHECK_HEAD(head, field) argument
670 #define QMD_TAILQ_CHECK_NEXT(elm, field) argument
671 #define QMD_TAILQ_CHECK_PREV(elm, field) argument
674 #define TAILQ_CONCAT(head1, head2, field) do { \ argument
677 (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \
689 #define TAILQ_FOREACH(var, head, field) \ argument
692 (var) = TAILQ_NEXT((var), field))
694 #define TAILQ_FOREACH_FROM(var, head, field) \ argument
697 (var) = TAILQ_NEXT((var), field))
699 #define TAILQ_FOREACH_SAFE(var, head, field, tvar) \ argument
701 (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
704 #define TAILQ_FOREACH_FROM_SAFE(var, head, field, tvar) \ argument
706 (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
709 #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ argument
712 (var) = TAILQ_PREV((var), headname, field))
714 #define TAILQ_FOREACH_REVERSE_FROM(var, head, headname, field) \ argument
717 (var) = TAILQ_PREV((var), headname, field))
719 #define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \ argument
721 (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \
724 #define TAILQ_FOREACH_REVERSE_FROM_SAFE(var, head, headname, field, tvar) \ argument
726 (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \
735 #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
736 QMD_TAILQ_CHECK_NEXT(listelm, field); \
737 if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\
738 TAILQ_NEXT((elm), field)->field.tqe_prev = \
739 &TAILQ_NEXT((elm), field); \
741 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
744 TAILQ_NEXT((listelm), field) = (elm); \
745 (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); \
746 QMD_TRACE_ELEM(&(elm)->field); \
747 QMD_TRACE_ELEM(&(listelm)->field); \
750 #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ argument
751 QMD_TAILQ_CHECK_PREV(listelm, field); \
752 (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
753 TAILQ_NEXT((elm), field) = (listelm); \
754 *(listelm)->field.tqe_prev = (elm); \
755 (listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \
756 QMD_TRACE_ELEM(&(elm)->field); \
757 QMD_TRACE_ELEM(&(listelm)->field); \
760 #define TAILQ_INSERT_HEAD(head, elm, field) do { \ argument
761 QMD_TAILQ_CHECK_HEAD(head, field); \
762 if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \
763 TAILQ_FIRST((head))->field.tqe_prev = \
764 &TAILQ_NEXT((elm), field); \
766 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
768 (elm)->field.tqe_prev = &TAILQ_FIRST((head)); \
770 QMD_TRACE_ELEM(&(elm)->field); \
773 #define TAILQ_INSERT_TAIL(head, elm, field) do { \ argument
774 QMD_TAILQ_CHECK_TAIL(head, field); \
775 TAILQ_NEXT((elm), field) = NULL; \
776 (elm)->field.tqe_prev = (head)->tqh_last; \
778 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
780 QMD_TRACE_ELEM(&(elm)->field); \
793 #define TAILQ_LAST_FAST(head, type, field) \ argument
794 (TAILQ_EMPTY(head) ? NULL : __containerof((head)->tqh_last, QUEUE_TYPEOF(type), field.tqe_next))
796 #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) argument
798 #define TAILQ_PREV(elm, headname, field) \ argument
799 (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
801 #define TAILQ_PREV_FAST(elm, head, type, field) \ argument
802 ((elm)->field.tqe_prev == &(head)->tqh_first ? NULL : \
803 __containerof((elm)->field.tqe_prev, QUEUE_TYPEOF(type), field.tqe_next))
805 #define TAILQ_REMOVE(head, elm, field) do { \ argument
806 QMD_SAVELINK(oldnext, (elm)->field.tqe_next); \
807 QMD_SAVELINK(oldprev, (elm)->field.tqe_prev); \
808 QMD_TAILQ_CHECK_NEXT(elm, field); \
809 QMD_TAILQ_CHECK_PREV(elm, field); \
810 if ((TAILQ_NEXT((elm), field)) != NULL) \
811 TAILQ_NEXT((elm), field)->field.tqe_prev = \
812 (elm)->field.tqe_prev; \
814 (head)->tqh_last = (elm)->field.tqe_prev; \
817 *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \
820 QMD_TRACE_ELEM(&(elm)->field); \
823 #define TAILQ_SWAP(head1, head2, type, field) do { \ argument
831 swap_first->field.tqe_prev = &(head1)->tqh_first; \
835 swap_first->field.tqe_prev = &(head2)->tqh_first; \