Lines Matching refs:field
105 #define LIST_INSERT_AFTER(listelm, elm, field) do { \ argument
106 if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \
107 (listelm)->field.le_next->field.le_prev = \
108 &(elm)->field.le_next; \
109 (listelm)->field.le_next = (elm); \
110 (elm)->field.le_prev = &(listelm)->field.le_next; \
113 #define LIST_INSERT_BEFORE(listelm, elm, field) do { \ argument
114 (elm)->field.le_prev = (listelm)->field.le_prev; \
115 (elm)->field.le_next = (listelm); \
116 *(listelm)->field.le_prev = (elm); \
117 (listelm)->field.le_prev = &(elm)->field.le_next; \
120 #define LIST_INSERT_HEAD(head, elm, field) do { \ argument
121 if (((elm)->field.le_next = (head)->lh_first) != NULL) \
122 (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
124 (elm)->field.le_prev = &(head)->lh_first; \
127 #define LIST_REMOVE(elm, field) do { \ argument
128 if ((elm)->field.le_next != NULL) \
129 (elm)->field.le_next->field.le_prev = \
130 (elm)->field.le_prev; \
131 *(elm)->field.le_prev = (elm)->field.le_next; \
134 #define LIST_FOREACH(var, head, field) \ argument
137 (var) = ((var)->field.le_next))
144 #define LIST_NEXT(elm, field) ((elm)->field.le_next) argument
170 #define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ argument
171 (elm)->field.sle_next = (slistelm)->field.sle_next; \
172 (slistelm)->field.sle_next = (elm); \
175 #define SLIST_INSERT_HEAD(head, elm, field) do { \ argument
176 (elm)->field.sle_next = (head)->slh_first; \
180 #define SLIST_REMOVE_HEAD(head, field) do { \ argument
181 (head)->slh_first = (head)->slh_first->field.sle_next; \
184 #define SLIST_REMOVE(head, elm, type, field) do { \ argument
186 SLIST_REMOVE_HEAD((head), field); \
190 while(curelm->field.sle_next != (elm)) \
191 curelm = curelm->field.sle_next; \
192 curelm->field.sle_next = \
193 curelm->field.sle_next->field.sle_next; \
197 #define SLIST_FOREACH(var, head, field) \ argument
198 for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
205 #define SLIST_NEXT(elm, field) ((elm)->field.sle_next) argument
233 #define STAILQ_INSERT_HEAD(head, elm, field) do { \ argument
234 if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \
235 (head)->stqh_last = &(elm)->field.stqe_next; \
239 #define STAILQ_INSERT_TAIL(head, elm, field) do { \ argument
240 (elm)->field.stqe_next = NULL; \
242 (head)->stqh_last = &(elm)->field.stqe_next; \
245 #define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
246 if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
247 (head)->stqh_last = &(elm)->field.stqe_next; \
248 (listelm)->field.stqe_next = (elm); \
251 #define STAILQ_REMOVE_HEAD(head, field) do { \ argument
252 if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \
256 #define STAILQ_REMOVE(head, elm, type, field) do { \ argument
258 STAILQ_REMOVE_HEAD((head), field); \
261 while (curelm->field.stqe_next != (elm)) \
262 curelm = curelm->field.stqe_next; \
263 if ((curelm->field.stqe_next = \
264 curelm->field.stqe_next->field.stqe_next) == NULL) \
265 (head)->stqh_last = &(curelm)->field.stqe_next; \
269 #define STAILQ_FOREACH(var, head, field) \ argument
272 (var) = ((var)->field.stqe_next))
287 #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) argument
315 #define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \ argument
316 if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \
317 (head)->sqh_last = &(elm)->field.sqe_next; \
321 #define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \ argument
322 (elm)->field.sqe_next = NULL; \
324 (head)->sqh_last = &(elm)->field.sqe_next; \
327 #define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
328 if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
329 (head)->sqh_last = &(elm)->field.sqe_next; \
330 (listelm)->field.sqe_next = (elm); \
333 #define SIMPLEQ_REMOVE_HEAD(head, field) do { \ argument
334 if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \
338 #define SIMPLEQ_REMOVE(head, elm, type, field) do { \ argument
340 SIMPLEQ_REMOVE_HEAD((head), field); \
343 while (curelm->field.sqe_next != (elm)) \
344 curelm = curelm->field.sqe_next; \
345 if ((curelm->field.sqe_next = \
346 curelm->field.sqe_next->field.sqe_next) == NULL) \
347 (head)->sqh_last = &(curelm)->field.sqe_next; \
351 #define SIMPLEQ_FOREACH(var, head, field) \ argument
354 (var) = ((var)->field.sqe_next))
361 #define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next) argument
392 #define TAILQ_INSERT_HEAD(head, elm, field) do { \ argument
393 if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
394 (head)->tqh_first->field.tqe_prev = \
395 &(elm)->field.tqe_next; \
397 (head)->tqh_last = &(elm)->field.tqe_next; \
399 (elm)->field.tqe_prev = &(head)->tqh_first; \
402 #define TAILQ_INSERT_TAIL(head, elm, field) do { \ argument
403 (elm)->field.tqe_next = NULL; \
404 (elm)->field.tqe_prev = (head)->tqh_last; \
406 (head)->tqh_last = &(elm)->field.tqe_next; \
409 #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
410 if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
411 (elm)->field.tqe_next->field.tqe_prev = \
412 &(elm)->field.tqe_next; \
414 (head)->tqh_last = &(elm)->field.tqe_next; \
415 (listelm)->field.tqe_next = (elm); \
416 (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
419 #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ argument
420 (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
421 (elm)->field.tqe_next = (listelm); \
422 *(listelm)->field.tqe_prev = (elm); \
423 (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
426 #define TAILQ_REMOVE(head, elm, field) do { \ argument
427 if (((elm)->field.tqe_next) != NULL) \
428 (elm)->field.tqe_next->field.tqe_prev = \
429 (elm)->field.tqe_prev; \
431 (head)->tqh_last = (elm)->field.tqe_prev; \
432 *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
435 #define TAILQ_FOREACH(var, head, field) \ argument
438 (var) = ((var)->field.tqe_next))
440 #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ argument
443 (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
445 #define TAILQ_CONCAT(head1, head2, field) do { \ argument
448 (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \
459 #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) argument
463 #define TAILQ_PREV(elm, headname, field) \ argument
464 (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
493 #define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
494 (elm)->field.cqe_next = (listelm)->field.cqe_next; \
495 (elm)->field.cqe_prev = (listelm); \
496 if ((listelm)->field.cqe_next == (void *)(head)) \
499 (listelm)->field.cqe_next->field.cqe_prev = (elm); \
500 (listelm)->field.cqe_next = (elm); \
503 #define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ argument
504 (elm)->field.cqe_next = (listelm); \
505 (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
506 if ((listelm)->field.cqe_prev == (void *)(head)) \
509 (listelm)->field.cqe_prev->field.cqe_next = (elm); \
510 (listelm)->field.cqe_prev = (elm); \
513 #define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \ argument
514 (elm)->field.cqe_next = (head)->cqh_first; \
515 (elm)->field.cqe_prev = (void *)(head); \
519 (head)->cqh_first->field.cqe_prev = (elm); \
523 #define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ argument
524 (elm)->field.cqe_next = (void *)(head); \
525 (elm)->field.cqe_prev = (head)->cqh_last; \
529 (head)->cqh_last->field.cqe_next = (elm); \
533 #define CIRCLEQ_REMOVE(head, elm, field) do { \ argument
534 if ((elm)->field.cqe_next == (void *)(head)) \
535 (head)->cqh_last = (elm)->field.cqe_prev; \
537 (elm)->field.cqe_next->field.cqe_prev = \
538 (elm)->field.cqe_prev; \
539 if ((elm)->field.cqe_prev == (void *)(head)) \
540 (head)->cqh_first = (elm)->field.cqe_next; \
542 (elm)->field.cqe_prev->field.cqe_next = \
543 (elm)->field.cqe_next; \
546 #define CIRCLEQ_FOREACH(var, head, field) \ argument
549 (var) = ((var)->field.cqe_next))
551 #define CIRCLEQ_FOREACH_REVERSE(var, head, field) \ argument
554 (var) = ((var)->field.cqe_prev))
562 #define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next) argument
563 #define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev) argument
565 #define CIRCLEQ_LOOP_NEXT(head, elm, field) \ argument
566 (((elm)->field.cqe_next == (void *)(head)) \
568 : (elm->field.cqe_next))
569 #define CIRCLEQ_LOOP_PREV(head, elm, field) \ argument
570 (((elm)->field.cqe_prev == (void *)(head)) \
572 : (elm->field.cqe_prev))