Lines Matching refs:head
190 #define SLIST_HEAD_INITIALIZER(head) \ argument
201 #define SLIST_FIRST(head) ((head)->slh_first) argument
202 #define SLIST_END(head) NULL argument
203 #define SLIST_EMPTY(head) (SLIST_FIRST(head) == SLIST_END(head)) argument
206 #define SLIST_FOREACH(var, head, field) \ argument
207 for((var) = SLIST_FIRST(head); \
208 (var) != SLIST_END(head); \
211 #define SLIST_FOREACH_SAFE(var, head, field, tvar) \ argument
212 for ((var) = SLIST_FIRST(head); \
219 #define SLIST_INIT(head) { \ argument
220 SLIST_FIRST(head) = SLIST_END(head); \
228 #define SLIST_INSERT_HEAD(head, elm, field) do { \ argument
229 (elm)->field.sle_next = (head)->slh_first; \
230 (head)->slh_first = (elm); \
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
242 if ((head)->slh_first == (elm)) { \
243 SLIST_REMOVE_HEAD((head), field); \
245 struct type *curelm = (head)->slh_first; \
263 #define LIST_HEAD_INITIALIZER(head) \ argument
275 #define LIST_FIRST(head) ((head)->lh_first) argument
276 #define LIST_END(head) NULL argument
277 #define LIST_EMPTY(head) (LIST_FIRST(head) == LIST_END(head)) argument
280 #define LIST_FOREACH(var, head, field) \ argument
281 for((var) = LIST_FIRST(head); \
282 (var)!= LIST_END(head); \
285 #define LIST_FOREACH_SAFE(var, head, field, tvar) \ argument
286 for ((var) = LIST_FIRST(head); \
293 #define LIST_INIT(head) do { \ argument
294 LIST_FIRST(head) = LIST_END(head); \
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;\
315 (head)->lh_first = (elm); \
316 (elm)->field.le_prev = &(head)->lh_first; \
347 #define SIMPLEQ_HEAD_INITIALIZER(head) \ argument
348 { NULL, &(head).sqh_first }
358 #define SIMPLEQ_FIRST(head) ((head)->sqh_first) argument
359 #define SIMPLEQ_END(head) NULL argument
360 #define SIMPLEQ_EMPTY(head) (SIMPLEQ_FIRST(head) == SIMPLEQ_END(head)) argument
363 #define SIMPLEQ_FOREACH(var, head, field) \ argument
364 for((var) = SIMPLEQ_FIRST(head); \
365 (var) != SIMPLEQ_END(head); \
368 #define SIMPLEQ_FOREACH_SAFE(var, head, field, tvar) \ argument
369 for ((var) = SIMPLEQ_FIRST(head); \
376 #define SIMPLEQ_INIT(head) do { \ argument
377 (head)->sqh_first = NULL; \
378 (head)->sqh_last = &(head)->sqh_first; \
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; \
384 (head)->sqh_first = (elm); \
387 #define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \ argument
389 *(head)->sqh_last = (elm); \
390 (head)->sqh_last = &(elm)->field.sqe_next; \
393 #define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
395 (head)->sqh_last = &(elm)->field.sqe_next; \
399 #define SIMPLEQ_REMOVE_HEAD(head, field) do { \ argument
400 if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \
401 (head)->sqh_last = &(head)->sqh_first; \
404 #define SIMPLEQ_REMOVE_AFTER(head, elm, field) do { \ argument
407 (head)->sqh_last = &(elm)->field.sqe_next; \
419 #define TAILQ_HEAD_INITIALIZER(head) \ argument
420 { NULL, &(head).tqh_first }
431 #define TAILQ_FIRST(head) ((head)->tqh_first) argument
432 #define TAILQ_END(head) NULL argument
434 #define TAILQ_LAST(head, headname) \ argument
435 (*(((struct headname *)((head)->tqh_last))->tqh_last))
439 #define TAILQ_EMPTY(head) \ argument
440 (TAILQ_FIRST(head) == TAILQ_END(head))
442 #define TAILQ_FOREACH(var, head, field) \ argument
443 for((var) = TAILQ_FIRST(head); \
444 (var) != TAILQ_END(head); \
447 #define TAILQ_FOREACH_SAFE(var, head, field, tvar) \ argument
448 for ((var) = TAILQ_FIRST(head); \
449 (var) != TAILQ_END(head) && \
454 #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ argument
455 for((var) = TAILQ_LAST(head, headname); \
456 (var) != TAILQ_END(head); \
459 #define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \ argument
460 for ((var) = TAILQ_LAST(head, headname); \
461 (var) != TAILQ_END(head) && \
468 #define TAILQ_INIT(head) do { \ argument
469 (head)->tqh_first = NULL; \
470 (head)->tqh_last = &(head)->tqh_first; \
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 = \
478 (head)->tqh_last = &(elm)->field.tqe_next; \
479 (head)->tqh_first = (elm); \
480 (elm)->field.tqe_prev = &(head)->tqh_first; \
483 #define TAILQ_INSERT_TAIL(head, elm, field) do { \ argument
485 (elm)->field.tqe_prev = (head)->tqh_last; \
486 *(head)->tqh_last = (elm); \
487 (head)->tqh_last = &(elm)->field.tqe_next; \
490 #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
495 (head)->tqh_last = &(elm)->field.tqe_next; \
507 #define TAILQ_REMOVE(head, elm, field) do { \ argument
512 (head)->tqh_last = (elm)->field.tqe_prev; \
518 #define TAILQ_REPLACE(head, elm, elm2, field) do { \ argument
523 (head)->tqh_last = &(elm2)->field.tqe_next; \
539 #define CIRCLEQ_HEAD_INITIALIZER(head) \ argument
540 { CIRCLEQ_END(&head), CIRCLEQ_END(&head) }
551 #define CIRCLEQ_FIRST(head) ((head)->cqh_first) argument
552 #define CIRCLEQ_LAST(head) ((head)->cqh_last) argument
553 #define CIRCLEQ_END(head) ((void *)(head)) argument
556 #define CIRCLEQ_EMPTY(head) \ argument
557 (CIRCLEQ_FIRST(head) == CIRCLEQ_END(head))
559 #define CIRCLEQ_FOREACH(var, head, field) \ argument
560 for((var) = CIRCLEQ_FIRST(head); \
561 (var) != CIRCLEQ_END(head); \
564 #define CIRCLEQ_FOREACH_SAFE(var, head, field, tvar) \ argument
565 for ((var) = CIRCLEQ_FIRST(head); \
566 (var) != CIRCLEQ_END(head) && \
570 #define CIRCLEQ_FOREACH_REVERSE(var, head, field) \ argument
571 for((var) = CIRCLEQ_LAST(head); \
572 (var) != CIRCLEQ_END(head); \
575 #define CIRCLEQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \ argument
576 for ((var) = CIRCLEQ_LAST(head, headname); \
577 (var) != CIRCLEQ_END(head) && \
584 #define CIRCLEQ_INIT(head) do { \ argument
585 (head)->cqh_first = CIRCLEQ_END(head); \
586 (head)->cqh_last = CIRCLEQ_END(head); \
589 #define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
592 if ((listelm)->field.cqe_next == CIRCLEQ_END(head)) \
593 (head)->cqh_last = (elm); \
599 #define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ argument
602 if ((listelm)->field.cqe_prev == CIRCLEQ_END(head)) \
603 (head)->cqh_first = (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); \
612 if ((head)->cqh_last == CIRCLEQ_END(head)) \
613 (head)->cqh_last = (elm); \
615 (head)->cqh_first->field.cqe_prev = (elm); \
616 (head)->cqh_first = (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; \
622 if ((head)->cqh_first == CIRCLEQ_END(head)) \
623 (head)->cqh_first = (elm); \
625 (head)->cqh_last->field.cqe_next = (elm); \
626 (head)->cqh_last = (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; \
635 if ((elm)->field.cqe_prev == CIRCLEQ_END(head)) \
636 (head)->cqh_first = (elm)->field.cqe_next; \
644 #define CIRCLEQ_REPLACE(head, elm, elm2, field) do { \ argument
646 CIRCLEQ_END(head)) \
647 (head).cqh_last = (elm2); \
651 CIRCLEQ_END(head)) \
652 (head).cqh_first = (elm2); \