Lines Matching refs:head
112 #define SLIST_HEAD_INITIALIZER(head) \ argument
123 #define SLIST_EMPTY(head) ((head)->slh_first == NULL) argument
125 #define SLIST_FIRST(head) ((head)->slh_first) argument
127 #define SLIST_FOREACH(var, head, field) \ argument
128 for ((var) = SLIST_FIRST((head)); \
132 #define SLIST_INIT(head) do { \ argument
133 SLIST_FIRST((head)) = NULL; \
141 #define SLIST_INSERT_HEAD(head, elm, field) do { \ argument
142 SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \
143 SLIST_FIRST((head)) = (elm); \
148 #define SLIST_REMOVE(head, elm, type, field) do { \ argument
149 if (SLIST_FIRST((head)) == (elm)) { \
150 SLIST_REMOVE_HEAD((head), field); \
153 struct type *curelm = SLIST_FIRST((head)); \
161 #define SLIST_REMOVE_HEAD(head, field) do { \ argument
162 SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \
174 #define STAILQ_HEAD_INITIALIZER(head) \ argument
175 { NULL, &(head).stqh_first }
185 #define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) argument
187 #define STAILQ_FIRST(head) ((head)->stqh_first) argument
189 #define STAILQ_FOREACH(var, head, field) \ argument
190 for((var) = STAILQ_FIRST((head)); \
194 #define STAILQ_INIT(head) do { \ argument
195 STAILQ_FIRST((head)) = NULL; \
196 (head)->stqh_last = &STAILQ_FIRST((head)); \
199 #define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \ argument
201 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
205 #define STAILQ_INSERT_HEAD(head, elm, field) do { \ argument
206 if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \
207 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
208 STAILQ_FIRST((head)) = (elm); \
211 #define STAILQ_INSERT_TAIL(head, elm, field) do { \ argument
213 STAILQ_LAST((head)) = (elm); \
214 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
217 #define STAILQ_LAST(head) (*(head)->stqh_last) argument
221 #define STAILQ_REMOVE(head, elm, type, field) do { \ argument
222 if (STAILQ_FIRST((head)) == (elm)) { \
223 STAILQ_REMOVE_HEAD(head, field); \
226 struct type *curelm = STAILQ_FIRST((head)); \
231 (head)->stqh_last = &STAILQ_NEXT((curelm), field);\
235 #define STAILQ_REMOVE_HEAD(head, field) do { \ argument
236 if ((STAILQ_FIRST((head)) = \
237 STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \
238 (head)->stqh_last = &STAILQ_FIRST((head)); \
241 #define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do { \ argument
242 if ((STAILQ_FIRST((head)) = STAILQ_NEXT((elm), field)) == NULL) \
243 (head)->stqh_last = &STAILQ_FIRST((head)); \
254 #define LIST_HEAD_INITIALIZER(head) \ argument
267 #define LIST_EMPTY(head) ((head)->lh_first == NULL) argument
269 #define LIST_FIRST(head) ((head)->lh_first) argument
271 #define LIST_FOREACH(var, head, field) \ argument
272 for ((var) = LIST_FIRST((head)); \
276 #define LIST_INIT(head) do { \ argument
277 LIST_FIRST((head)) = NULL; \
295 #define LIST_INSERT_HEAD(head, elm, field) do { \ argument
296 if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \
297 LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\
298 LIST_FIRST((head)) = (elm); \
299 (elm)->field.le_prev = &LIST_FIRST((head)); \
320 #define TAILQ_HEAD_INITIALIZER(head) \ argument
321 { NULL, &(head).tqh_first }
332 #define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) argument
334 #define TAILQ_FIRST(head) ((head)->tqh_first) argument
336 #define TAILQ_FOREACH(var, head, field) \ argument
337 for ((var) = TAILQ_FIRST((head)); \
341 #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ argument
342 for ((var) = TAILQ_LAST((head), headname); \
346 #define TAILQ_INIT(head) do { \ argument
347 TAILQ_FIRST((head)) = NULL; \
348 (head)->tqh_last = &TAILQ_FIRST((head)); \
351 #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
356 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
368 #define TAILQ_INSERT_HEAD(head, elm, field) do { \ argument
369 if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \
370 TAILQ_FIRST((head))->field.tqe_prev = \
373 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
374 TAILQ_FIRST((head)) = (elm); \
375 (elm)->field.tqe_prev = &TAILQ_FIRST((head)); \
378 #define TAILQ_INSERT_TAIL(head, elm, field) do { \ argument
380 (elm)->field.tqe_prev = (head)->tqh_last; \
381 *(head)->tqh_last = (elm); \
382 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
385 #define TAILQ_LAST(head, headname) \ argument
386 (*(((struct headname *)((head)->tqh_last))->tqh_last))
393 #define TAILQ_REMOVE(head, elm, field) do { \ argument
398 (head)->tqh_last = (elm)->field.tqe_prev; \
411 #define CIRCLEQ_HEAD_INITIALIZER(head) \ argument
412 { (void *)&(head), (void *)&(head) }
423 #define CIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head)) argument
425 #define CIRCLEQ_FIRST(head) ((head)->cqh_first) argument
427 #define CIRCLEQ_FOREACH(var, head, field) \ argument
428 for ((var) = CIRCLEQ_FIRST((head)); \
429 (var) != (void *)(head); \
432 #define CIRCLEQ_FOREACH_REVERSE(var, head, field) \ argument
433 for ((var) = CIRCLEQ_LAST((head)); \
434 (var) != (void *)(head); \
437 #define CIRCLEQ_INIT(head) do { \ argument
438 CIRCLEQ_FIRST((head)) = (void *)(head); \
439 CIRCLEQ_LAST((head)) = (void *)(head); \
442 #define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
445 if (CIRCLEQ_NEXT((listelm), field) == (void *)(head)) \
446 CIRCLEQ_LAST((head)) = (elm); \
452 #define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ argument
455 if (CIRCLEQ_PREV((listelm), field) == (void *)(head)) \
456 CIRCLEQ_FIRST((head)) = (elm); \
462 #define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \ argument
463 CIRCLEQ_NEXT((elm), field) = CIRCLEQ_FIRST((head)); \
464 CIRCLEQ_PREV((elm), field) = (void *)(head); \
465 if (CIRCLEQ_LAST((head)) == (void *)(head)) \
466 CIRCLEQ_LAST((head)) = (elm); \
468 CIRCLEQ_PREV(CIRCLEQ_FIRST((head)), field) = (elm); \
469 CIRCLEQ_FIRST((head)) = (elm); \
472 #define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ argument
473 CIRCLEQ_NEXT((elm), field) = (void *)(head); \
474 CIRCLEQ_PREV((elm), field) = CIRCLEQ_LAST((head)); \
475 if (CIRCLEQ_FIRST((head)) == (void *)(head)) \
476 CIRCLEQ_FIRST((head)) = (elm); \
478 CIRCLEQ_NEXT(CIRCLEQ_LAST((head)), field) = (elm); \
479 CIRCLEQ_LAST((head)) = (elm); \
482 #define CIRCLEQ_LAST(head) ((head)->cqh_last) argument
488 #define CIRCLEQ_REMOVE(head, elm, field) do { \ argument
489 if (CIRCLEQ_NEXT((elm), field) == (void *)(head)) \
490 CIRCLEQ_LAST((head)) = CIRCLEQ_PREV((elm), field); \
494 if (CIRCLEQ_PREV((elm), field) == (void *)(head)) \
495 CIRCLEQ_FIRST((head)) = CIRCLEQ_NEXT((elm), field); \