Lines Matching refs:head
114 #define QMD_TRACE_HEAD(head) do { \ argument
115 (head)->trace.prevline = (head)->trace.lastline; \
116 (head)->trace.prevfile = (head)->trace.lastfile; \
117 (head)->trace.lastline = __LINE__; \
118 (head)->trace.lastfile = __FILE__; \
130 #define QMD_TRACE_HEAD(head) argument
144 #define SLIST_HEAD_INITIALIZER(head) \ argument
161 #define SLIST_EMPTY(head) ((head)->slh_first == NULL) argument
163 #define SLIST_FIRST(head) ((head)->slh_first) argument
165 #define SLIST_FOREACH(var, head, field) \ argument
166 for ((var) = SLIST_FIRST((head)); \
170 #define SLIST_FOREACH_SAFE(var, head, field, tvar) \ argument
171 for ((var) = SLIST_FIRST((head)); \
175 #define SLIST_FOREACH_PREVPTR(var, varp, head, field) \ argument
176 for ((varp) = &SLIST_FIRST((head)); \
180 #define SLIST_INIT(head) do { \ argument
181 SLIST_FIRST((head)) = NULL; \
189 #define SLIST_INSERT_HEAD(head, elm, field) do { \ argument
190 SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \
191 SLIST_FIRST((head)) = (elm); \
196 #define SLIST_REMOVE(head, elm, type, field) do { \ argument
198 if (SLIST_FIRST((head)) == (elm)) { \
199 SLIST_REMOVE_HEAD((head), field); \
202 struct type *curelm = SLIST_FIRST((head)); \
215 #define SLIST_REMOVE_HEAD(head, field) do { \ argument
216 SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \
234 #define STAILQ_HEAD_INITIALIZER(head) \ argument
235 { NULL, &(head).stqh_first }
253 #define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) argument
255 #define STAILQ_FIRST(head) ((head)->stqh_first) argument
257 #define STAILQ_FOREACH(var, head, field) \ argument
258 for((var) = STAILQ_FIRST((head)); \
263 #define STAILQ_FOREACH_SAFE(var, head, field, tvar) \ argument
264 for ((var) = STAILQ_FIRST((head)); \
268 #define STAILQ_INIT(head) do { \ argument
269 STAILQ_FIRST((head)) = NULL; \
270 (head)->stqh_last = &STAILQ_FIRST((head)); \
273 #define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \ argument
275 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
279 #define STAILQ_INSERT_HEAD(head, elm, field) do { \ argument
280 if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \
281 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
282 STAILQ_FIRST((head)) = (elm); \
285 #define STAILQ_INSERT_TAIL(head, elm, field) do { \ argument
287 *(head)->stqh_last = (elm); \
288 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
291 #define STAILQ_LAST(head, type, field) \ argument
292 (STAILQ_EMPTY((head)) ? \
295 ((char *)((head)->stqh_last) - __offsetof(struct type, field))))
299 #define STAILQ_REMOVE(head, elm, type, field) do { \ argument
301 if (STAILQ_FIRST((head)) == (elm)) { \
302 STAILQ_REMOVE_HEAD((head), field); \
305 struct type *curelm = STAILQ_FIRST((head)); \
308 STAILQ_REMOVE_AFTER(head, curelm, field); \
313 #define STAILQ_REMOVE_AFTER(head, elm, field) do { \ argument
316 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
319 #define STAILQ_REMOVE_HEAD(head, field) do { \ argument
320 if ((STAILQ_FIRST((head)) = \
321 STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \
322 (head)->stqh_last = &STAILQ_FIRST((head)); \
347 #define LIST_HEAD_INITIALIZER(head) \ argument
361 #define QMD_LIST_CHECK_HEAD(head, field) do { \ argument
362 if (LIST_FIRST((head)) != NULL && \
363 LIST_FIRST((head))->field.le_prev != \
364 &LIST_FIRST((head))) \
365 panic("Bad list head %p first->prev != head", (void *)(head)); \
380 #define QMD_LIST_CHECK_HEAD(head, field) argument
385 #define LIST_EMPTY(head) ((head)->lh_first == NULL) argument
387 #define LIST_FIRST(head) ((head)->lh_first) argument
389 #define LIST_FOREACH(var, head, field) \ argument
390 for ((var) = LIST_FIRST((head)); \
394 #define LIST_FOREACH_SAFE(var, head, field, tvar) \ argument
395 for ((var) = LIST_FIRST((head)); \
399 #define LIST_INIT(head) do { \ argument
400 LIST_FIRST((head)) = NULL; \
420 #define LIST_INSERT_HEAD(head, elm, field) do { \ argument
421 QMD_LIST_CHECK_HEAD((head), field); \
422 if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \
423 LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\
424 LIST_FIRST((head)) = (elm); \
425 (elm)->field.le_prev = &LIST_FIRST((head)); \
463 #define TAILQ_HEAD_INITIALIZER(head) \ argument
464 { NULL, &(head).tqh_first }
477 #define QMD_TAILQ_CHECK_HEAD(head, field) do { \ argument
478 if (!TAILQ_EMPTY(head) && \
479 TAILQ_FIRST((head))->field.tqe_prev != \
480 &TAILQ_FIRST((head))) \
481 panic("Bad tailq head %p first->prev != head", (void *)(head)); \
484 #define QMD_TAILQ_CHECK_TAIL(head, field) do { \ argument
485 if (*(head)->tqh_last != NULL) \
486 panic("Bad tailq NEXT(%p->tqh_last) != NULL", (void *)(head)); \
501 #define QMD_TAILQ_CHECK_HEAD(head, field) argument
502 #define QMD_TAILQ_CHECK_TAIL(head, headname) argument
518 #define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) argument
520 #define TAILQ_FIRST(head) ((head)->tqh_first) argument
522 #define TAILQ_FOREACH(var, head, field) \ argument
523 for ((var) = TAILQ_FIRST((head)); \
527 #define TAILQ_FOREACH_SAFE(var, head, field, tvar) \ argument
528 for ((var) = TAILQ_FIRST((head)); \
532 #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ argument
533 for ((var) = TAILQ_LAST((head), headname); \
537 #define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \ argument
538 for ((var) = TAILQ_LAST((head), headname); \
542 #define TAILQ_INIT(head) do { \ argument
543 TAILQ_FIRST((head)) = NULL; \
544 (head)->tqh_last = &TAILQ_FIRST((head)); \
545 QMD_TRACE_HEAD(head); \
548 #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
554 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
555 QMD_TRACE_HEAD(head); \
573 #define TAILQ_INSERT_HEAD(head, elm, field) do { \ argument
574 QMD_TAILQ_CHECK_HEAD(head, field); \
575 if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \
576 TAILQ_FIRST((head))->field.tqe_prev = \
579 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
580 TAILQ_FIRST((head)) = (elm); \
581 (elm)->field.tqe_prev = &TAILQ_FIRST((head)); \
582 QMD_TRACE_HEAD(head); \
586 #define TAILQ_INSERT_TAIL(head, elm, field) do { \ argument
587 QMD_TAILQ_CHECK_TAIL(head, field); \
589 (elm)->field.tqe_prev = (head)->tqh_last; \
590 *(head)->tqh_last = (elm); \
591 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
592 QMD_TRACE_HEAD(head); \
596 #define TAILQ_LAST(head, headname) \ argument
597 (*(((struct headname *)((head)->tqh_last))->tqh_last))
604 #define TAILQ_REMOVE(head, elm, field) do { \ argument
613 (head)->tqh_last = (elm)->field.tqe_prev; \
614 QMD_TRACE_HEAD(head); \