Lines Matching refs:field
204 #define SLIST_NEXT(elm, field) ((elm)->field.sle_next) argument
206 #define SLIST_FOREACH(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); \
223 #define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ argument
224 (elm)->field.sle_next = (slistelm)->field.sle_next; \
225 (slistelm)->field.sle_next = (elm); \
228 #define SLIST_INSERT_HEAD(head, elm, field) do { \ argument
229 (elm)->field.sle_next = (head)->slh_first; \
233 #define SLIST_REMOVE_AFTER(elm, field) do { \ argument
234 (elm)->field.sle_next = (elm)->field.sle_next->field.sle_next; \
237 #define SLIST_REMOVE_HEAD(head, field) do { \ argument
238 (head)->slh_first = (head)->slh_first->field.sle_next; \
241 #define SLIST_REMOVE(head, elm, type, field) do { \ argument
243 SLIST_REMOVE_HEAD((head), field); \
247 while (curelm->field.sle_next != (elm)) \
248 curelm = curelm->field.sle_next; \
249 curelm->field.sle_next = \
250 curelm->field.sle_next->field.sle_next; \
251 _Q_INVALIDATE((elm)->field.sle_next); \
278 #define LIST_NEXT(elm, field) ((elm)->field.le_next) argument
280 #define LIST_FOREACH(var, head, field) \ argument
283 (var) = LIST_NEXT(var, field))
285 #define LIST_FOREACH_SAFE(var, head, field, tvar) \ argument
287 (var) && ((tvar) = LIST_NEXT(var, field), 1); \
297 #define LIST_INSERT_AFTER(listelm, elm, field) do { \ argument
298 if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \
299 (listelm)->field.le_next->field.le_prev = \
300 &(elm)->field.le_next; \
301 (listelm)->field.le_next = (elm); \
302 (elm)->field.le_prev = &(listelm)->field.le_next; \
305 #define LIST_INSERT_BEFORE(listelm, elm, field) do { \ argument
306 (elm)->field.le_prev = (listelm)->field.le_prev; \
307 (elm)->field.le_next = (listelm); \
308 *(listelm)->field.le_prev = (elm); \
309 (listelm)->field.le_prev = &(elm)->field.le_next; \
312 #define LIST_INSERT_HEAD(head, elm, field) do { \ argument
313 if (((elm)->field.le_next = (head)->lh_first) != NULL) \
314 (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
316 (elm)->field.le_prev = &(head)->lh_first; \
319 #define LIST_REMOVE(elm, field) do { \ argument
320 if ((elm)->field.le_next != NULL) \
321 (elm)->field.le_next->field.le_prev = \
322 (elm)->field.le_prev; \
323 *(elm)->field.le_prev = (elm)->field.le_next; \
324 _Q_INVALIDATE((elm)->field.le_prev); \
325 _Q_INVALIDATE((elm)->field.le_next); \
328 #define LIST_REPLACE(elm, elm2, field) do { \ argument
329 if (((elm2)->field.le_next = (elm)->field.le_next) != NULL) \
330 (elm2)->field.le_next->field.le_prev = \
331 &(elm2)->field.le_next; \
332 (elm2)->field.le_prev = (elm)->field.le_prev; \
333 *(elm2)->field.le_prev = (elm2); \
334 _Q_INVALIDATE((elm)->field.le_prev); \
335 _Q_INVALIDATE((elm)->field.le_next); \
361 #define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next) argument
363 #define SIMPLEQ_FOREACH(var, head, field) \ argument
366 (var) = SIMPLEQ_NEXT(var, field))
368 #define SIMPLEQ_FOREACH_SAFE(var, head, field, tvar) \ argument
370 (var) && ((tvar) = SIMPLEQ_NEXT(var, field), 1); \
381 #define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \ argument
382 if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \
383 (head)->sqh_last = &(elm)->field.sqe_next; \
387 #define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \ argument
388 (elm)->field.sqe_next = NULL; \
390 (head)->sqh_last = &(elm)->field.sqe_next; \
393 #define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
394 if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
395 (head)->sqh_last = &(elm)->field.sqe_next; \
396 (listelm)->field.sqe_next = (elm); \
399 #define SIMPLEQ_REMOVE_HEAD(head, field) do { \ argument
400 if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \
404 #define SIMPLEQ_REMOVE_AFTER(head, elm, field) do { \ argument
405 if (((elm)->field.sqe_next = (elm)->field.sqe_next->field.sqe_next) \
407 (head)->sqh_last = &(elm)->field.sqe_next; \
433 #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) argument
437 #define TAILQ_PREV(elm, headname, field) \ argument
438 (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
442 #define TAILQ_FOREACH(var, head, field) \ argument
445 (var) = TAILQ_NEXT(var, field))
447 #define TAILQ_FOREACH_SAFE(var, head, field, tvar) \ argument
450 ((tvar) = TAILQ_NEXT(var, field), 1); \
454 #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ argument
457 (var) = TAILQ_PREV(var, headname, field))
459 #define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \ argument
462 ((tvar) = TAILQ_PREV(var, headname, field), 1); \
473 #define TAILQ_INSERT_HEAD(head, elm, field) do { \ argument
474 if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
475 (head)->tqh_first->field.tqe_prev = \
476 &(elm)->field.tqe_next; \
478 (head)->tqh_last = &(elm)->field.tqe_next; \
480 (elm)->field.tqe_prev = &(head)->tqh_first; \
483 #define TAILQ_INSERT_TAIL(head, elm, field) do { \ argument
484 (elm)->field.tqe_next = NULL; \
485 (elm)->field.tqe_prev = (head)->tqh_last; \
487 (head)->tqh_last = &(elm)->field.tqe_next; \
490 #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
491 if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
492 (elm)->field.tqe_next->field.tqe_prev = \
493 &(elm)->field.tqe_next; \
495 (head)->tqh_last = &(elm)->field.tqe_next; \
496 (listelm)->field.tqe_next = (elm); \
497 (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
500 #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ argument
501 (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
502 (elm)->field.tqe_next = (listelm); \
503 *(listelm)->field.tqe_prev = (elm); \
504 (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
507 #define TAILQ_REMOVE(head, elm, field) do { \ argument
508 if (((elm)->field.tqe_next) != NULL) \
509 (elm)->field.tqe_next->field.tqe_prev = \
510 (elm)->field.tqe_prev; \
512 (head)->tqh_last = (elm)->field.tqe_prev; \
513 *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
514 _Q_INVALIDATE((elm)->field.tqe_prev); \
515 _Q_INVALIDATE((elm)->field.tqe_next); \
518 #define TAILQ_REPLACE(head, elm, elm2, field) do { \ argument
519 if (((elm2)->field.tqe_next = (elm)->field.tqe_next) != NULL) \
520 (elm2)->field.tqe_next->field.tqe_prev = \
521 &(elm2)->field.tqe_next; \
523 (head)->tqh_last = &(elm2)->field.tqe_next; \
524 (elm2)->field.tqe_prev = (elm)->field.tqe_prev; \
525 *(elm2)->field.tqe_prev = (elm2); \
526 _Q_INVALIDATE((elm)->field.tqe_prev); \
527 _Q_INVALIDATE((elm)->field.tqe_next); \
554 #define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next) argument
555 #define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev) argument
559 #define CIRCLEQ_FOREACH(var, head, field) \ argument
562 (var) = CIRCLEQ_NEXT(var, field))
564 #define CIRCLEQ_FOREACH_SAFE(var, head, field, tvar) \ argument
567 ((tvar) = CIRCLEQ_NEXT(var, field), 1); \
570 #define CIRCLEQ_FOREACH_REVERSE(var, head, field) \ argument
573 (var) = CIRCLEQ_PREV(var, field))
575 #define CIRCLEQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \ argument
578 ((tvar) = CIRCLEQ_PREV(var, headname, field), 1); \
589 #define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
590 (elm)->field.cqe_next = (listelm)->field.cqe_next; \
591 (elm)->field.cqe_prev = (listelm); \
592 if ((listelm)->field.cqe_next == CIRCLEQ_END(head)) \
595 (listelm)->field.cqe_next->field.cqe_prev = (elm); \
596 (listelm)->field.cqe_next = (elm); \
599 #define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ argument
600 (elm)->field.cqe_next = (listelm); \
601 (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
602 if ((listelm)->field.cqe_prev == CIRCLEQ_END(head)) \
605 (listelm)->field.cqe_prev->field.cqe_next = (elm); \
606 (listelm)->field.cqe_prev = (elm); \
609 #define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \ argument
610 (elm)->field.cqe_next = (head)->cqh_first; \
611 (elm)->field.cqe_prev = CIRCLEQ_END(head); \
615 (head)->cqh_first->field.cqe_prev = (elm); \
619 #define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ argument
620 (elm)->field.cqe_next = CIRCLEQ_END(head); \
621 (elm)->field.cqe_prev = (head)->cqh_last; \
625 (head)->cqh_last->field.cqe_next = (elm); \
629 #define CIRCLEQ_REMOVE(head, elm, field) do { \ argument
630 if ((elm)->field.cqe_next == CIRCLEQ_END(head)) \
631 (head)->cqh_last = (elm)->field.cqe_prev; \
633 (elm)->field.cqe_next->field.cqe_prev = \
634 (elm)->field.cqe_prev; \
635 if ((elm)->field.cqe_prev == CIRCLEQ_END(head)) \
636 (head)->cqh_first = (elm)->field.cqe_next; \
638 (elm)->field.cqe_prev->field.cqe_next = \
639 (elm)->field.cqe_next; \
640 _Q_INVALIDATE((elm)->field.cqe_prev); \
641 _Q_INVALIDATE((elm)->field.cqe_next); \
644 #define CIRCLEQ_REPLACE(head, elm, elm2, field) do { \ argument
645 if (((elm2)->field.cqe_next = (elm)->field.cqe_next) == \
649 (elm2)->field.cqe_next->field.cqe_prev = (elm2); \
650 if (((elm2)->field.cqe_prev = (elm)->field.cqe_prev) == \
654 (elm2)->field.cqe_prev->field.cqe_next = (elm2); \
655 _Q_INVALIDATE((elm)->field.cqe_prev); \
656 _Q_INVALIDATE((elm)->field.cqe_next); \