Lines Matching refs:head

91 #define	LIST_HEAD_INITIALIZER(head)					\  argument
103 #define LIST_INIT(head) do { \ argument
104 (head)->lh_first = NULL; \
122 #define LIST_INSERT_HEAD(head, elm, field) do { \ argument
123 if (((elm)->field.le_next = (head)->lh_first) != NULL) \
124 (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
125 (head)->lh_first = (elm); \
126 (elm)->field.le_prev = &(head)->lh_first; \
136 #define LIST_FOREACH(var, head, field) \ argument
137 for ((var) = ((head)->lh_first); \
144 #define LIST_EMPTY(head) ((head)->lh_first == NULL) argument
145 #define LIST_FIRST(head) ((head)->lh_first) argument
157 #define SLIST_HEAD_INITIALIZER(head) \ argument
168 #define SLIST_INIT(head) do { \ argument
169 (head)->slh_first = NULL; \
177 #define SLIST_INSERT_HEAD(head, elm, field) do { \ argument
178 (elm)->field.sle_next = (head)->slh_first; \
179 (head)->slh_first = (elm); \
182 #define SLIST_REMOVE_HEAD(head, field) do { \ argument
183 (head)->slh_first = (head)->slh_first->field.sle_next; \
186 #define SLIST_REMOVE(head, elm, type, field) do { \ argument
187 if ((head)->slh_first == (elm)) { \
188 SLIST_REMOVE_HEAD((head), field); \
191 struct type *curelm = (head)->slh_first; \
199 #define SLIST_FOREACH(var, head, field) \ argument
200 for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
205 #define SLIST_EMPTY(head) ((head)->slh_first == NULL) argument
206 #define SLIST_FIRST(head) ((head)->slh_first) argument
219 #define STAILQ_HEAD_INITIALIZER(head) \ argument
220 { NULL, &(head).stqh_first }
230 #define STAILQ_INIT(head) do { \ argument
231 (head)->stqh_first = NULL; \
232 (head)->stqh_last = &(head)->stqh_first; \
235 #define STAILQ_INSERT_HEAD(head, elm, field) do { \ argument
236 if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \
237 (head)->stqh_last = &(elm)->field.stqe_next; \
238 (head)->stqh_first = (elm); \
241 #define STAILQ_INSERT_TAIL(head, elm, field) do { \ argument
243 *(head)->stqh_last = (elm); \
244 (head)->stqh_last = &(elm)->field.stqe_next; \
247 #define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
249 (head)->stqh_last = &(elm)->field.stqe_next; \
253 #define STAILQ_REMOVE_HEAD(head, field) do { \ argument
254 if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \
255 (head)->stqh_last = &(head)->stqh_first; \
258 #define STAILQ_REMOVE(head, elm, type, field) do { \ argument
259 if ((head)->stqh_first == (elm)) { \
260 STAILQ_REMOVE_HEAD((head), field); \
262 struct type *curelm = (head)->stqh_first; \
267 (head)->stqh_last = &(curelm)->field.stqe_next; \
271 #define STAILQ_FOREACH(var, head, field) \ argument
272 for ((var) = ((head)->stqh_first); \
279 #define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) argument
280 #define STAILQ_FIRST(head) ((head)->stqh_first) argument
293 #define SIMPLEQ_HEAD_INITIALIZER(head) \ argument
294 { NULL, &(head).sqh_first }
304 #define SIMPLEQ_INIT(head) do { \ argument
305 (head)->sqh_first = NULL; \
306 (head)->sqh_last = &(head)->sqh_first; \
309 #define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \ argument
310 if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \
311 (head)->sqh_last = &(elm)->field.sqe_next; \
312 (head)->sqh_first = (elm); \
315 #define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \ argument
317 *(head)->sqh_last = (elm); \
318 (head)->sqh_last = &(elm)->field.sqe_next; \
321 #define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
323 (head)->sqh_last = &(elm)->field.sqe_next; \
327 #define SIMPLEQ_REMOVE_HEAD(head, field) do { \ argument
328 if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \
329 (head)->sqh_last = &(head)->sqh_first; \
332 #define SIMPLEQ_REMOVE(head, elm, type, field) do { \ argument
333 if ((head)->sqh_first == (elm)) { \
334 SIMPLEQ_REMOVE_HEAD((head), field); \
336 struct type *curelm = (head)->sqh_first; \
341 (head)->sqh_last = &(curelm)->field.sqe_next; \
345 #define SIMPLEQ_FOREACH(var, head, field) \ argument
346 for ((var) = ((head)->sqh_first); \
353 #define SIMPLEQ_EMPTY(head) ((head)->sqh_first == NULL) argument
354 #define SIMPLEQ_FIRST(head) ((head)->sqh_first) argument
368 #define TAILQ_HEAD_INITIALIZER(head) \ argument
369 { NULL, &(head).tqh_first }
381 #define TAILQ_INIT(head) do { \ argument
382 (head)->tqh_first = NULL; \
383 (head)->tqh_last = &(head)->tqh_first; \
386 #define TAILQ_INSERT_HEAD(head, elm, field) do { \ argument
387 if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
388 (head)->tqh_first->field.tqe_prev = \
391 (head)->tqh_last = &(elm)->field.tqe_next; \
392 (head)->tqh_first = (elm); \
393 (elm)->field.tqe_prev = &(head)->tqh_first; \
396 #define TAILQ_INSERT_TAIL(head, elm, field) do { \ argument
398 (elm)->field.tqe_prev = (head)->tqh_last; \
399 *(head)->tqh_last = (elm); \
400 (head)->tqh_last = &(elm)->field.tqe_next; \
403 #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
408 (head)->tqh_last = &(elm)->field.tqe_next; \
420 #define TAILQ_REMOVE(head, elm, field) do { \ argument
425 (head)->tqh_last = (elm)->field.tqe_prev; \
429 #define TAILQ_FOREACH(var, head, field) \ argument
430 for ((var) = ((head)->tqh_first); \
434 #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ argument
435 for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \
442 #define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) argument
443 #define TAILQ_FIRST(head) ((head)->tqh_first) argument
446 #define TAILQ_LAST(head, headname) \ argument
447 (*(((struct headname *)((head)->tqh_last))->tqh_last))
461 #define CIRCLEQ_HEAD_INITIALIZER(head) \ argument
462 { (void *)&head, (void *)&head }
473 #define CIRCLEQ_INIT(head) do { \ argument
474 (head)->cqh_first = (void *)(head); \
475 (head)->cqh_last = (void *)(head); \
478 #define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
481 if ((listelm)->field.cqe_next == (void *)(head)) \
482 (head)->cqh_last = (elm); \
488 #define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ argument
491 if ((listelm)->field.cqe_prev == (void *)(head)) \
492 (head)->cqh_first = (elm); \
498 #define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \ argument
499 (elm)->field.cqe_next = (head)->cqh_first; \
500 (elm)->field.cqe_prev = (void *)(head); \
501 if ((head)->cqh_last == (void *)(head)) \
502 (head)->cqh_last = (elm); \
504 (head)->cqh_first->field.cqe_prev = (elm); \
505 (head)->cqh_first = (elm); \
508 #define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ argument
509 (elm)->field.cqe_next = (void *)(head); \
510 (elm)->field.cqe_prev = (head)->cqh_last; \
511 if ((head)->cqh_first == (void *)(head)) \
512 (head)->cqh_first = (elm); \
514 (head)->cqh_last->field.cqe_next = (elm); \
515 (head)->cqh_last = (elm); \
518 #define CIRCLEQ_REMOVE(head, elm, field) do { \ argument
519 if ((elm)->field.cqe_next == (void *)(head)) \
520 (head)->cqh_last = (elm)->field.cqe_prev; \
524 if ((elm)->field.cqe_prev == (void *)(head)) \
525 (head)->cqh_first = (elm)->field.cqe_next; \
531 #define CIRCLEQ_FOREACH(var, head, field) \ argument
532 for ((var) = ((head)->cqh_first); \
533 (var) != (const void *)(head); \
536 #define CIRCLEQ_FOREACH_REVERSE(var, head, field) \ argument
537 for ((var) = ((head)->cqh_last); \
538 (var) != (const void *)(head); \
544 #define CIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head)) argument
545 #define CIRCLEQ_FIRST(head) ((head)->cqh_first) argument
546 #define CIRCLEQ_LAST(head) ((head)->cqh_last) argument
550 #define CIRCLEQ_LOOP_NEXT(head, elm, field) \ argument
551 (((elm)->field.cqe_next == (void *)(head)) \
552 ? ((head)->cqh_first) \
554 #define CIRCLEQ_LOOP_PREV(head, elm, field) \ argument
555 (((elm)->field.cqe_prev == (void *)(head)) \
556 ? ((head)->cqh_last) \