Lines Matching refs:field

159 #define	SLIST_FOREACH(var, head, field)					\
162 (var) = SLIST_NEXT((var), field))
164 #define SLIST_FOREACH_SAFE(var, head, field, tvar) \
166 (var) && ((tvar) = SLIST_NEXT((var), field), 1); \
169 #define SLIST_FOREACH_PREVPTR(var, varp, head, field) \
172 (varp) = &SLIST_NEXT((var), field))
178 #define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
179 SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); \
180 SLIST_NEXT((slistelm), field) = (elm); \
183 #define SLIST_INSERT_HEAD(head, elm, field) do { \
184 SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \
188 #define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
190 #define SLIST_REMOVE(head, elm, type, field) do { \
192 SLIST_REMOVE_HEAD((head), field); \
196 while (SLIST_NEXT(curelm, field) != (elm)) \
197 curelm = SLIST_NEXT(curelm, field); \
198 SLIST_NEXT(curelm, field) = \
199 SLIST_NEXT(SLIST_NEXT(curelm, field), field); \
201 TRASHIT((elm)->field.sle_next); \
204 #define SLIST_REMOVE_HEAD(head, field) do { \
205 SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \
240 #define STAILQ_FOREACH(var, head, field) \
243 (var) = STAILQ_NEXT((var), field))
246 #define STAILQ_FOREACH_SAFE(var, head, field, tvar) \
248 (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
256 #define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \
257 if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\
258 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
259 STAILQ_NEXT((tqelm), field) = (elm); \
262 #define STAILQ_INSERT_HEAD(head, elm, field) do { \
263 if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \
264 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
268 #define STAILQ_INSERT_TAIL(head, elm, field) do { \
269 STAILQ_NEXT((elm), field) = NULL; \
271 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
274 #define STAILQ_LAST(head, type, field) \
278 ((char *)((head)->stqh_last) - __offsetof(struct type, field))))
280 #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
282 #define STAILQ_REMOVE(head, elm, type, field) do { \
284 STAILQ_REMOVE_HEAD((head), field); \
288 while (STAILQ_NEXT(curelm, field) != (elm)) \
289 curelm = STAILQ_NEXT(curelm, field); \
290 if ((STAILQ_NEXT(curelm, field) = \
291 STAILQ_NEXT(STAILQ_NEXT(curelm, field), field)) == NULL)\
292 (head)->stqh_last = &STAILQ_NEXT((curelm), field);\
294 TRASHIT((elm)->field.stqe_next); \
297 #define STAILQ_REMOVE_HEAD(head, field) do { \
299 STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \
325 #define QMD_LIST_CHECK_HEAD(head, field) do { \
327 LIST_FIRST((head))->field.le_prev != \
332 #define QMD_LIST_CHECK_NEXT(elm, field) do { \
333 if (LIST_NEXT((elm), field) != NULL && \
334 LIST_NEXT((elm), field)->field.le_prev != \
335 &((elm)->field.le_next)) \
339 #define QMD_LIST_CHECK_PREV(elm, field) do { \
340 if (*(elm)->field.le_prev != (elm)) \
344 #define QMD_LIST_CHECK_HEAD(head, field)
345 #define QMD_LIST_CHECK_NEXT(elm, field)
346 #define QMD_LIST_CHECK_PREV(elm, field)
353 #define LIST_FOREACH(var, head, field) \
356 (var) = LIST_NEXT((var), field))
358 #define LIST_FOREACH_SAFE(var, head, field, tvar) \
360 (var) && ((tvar) = LIST_NEXT((var), field), 1); \
367 #define LIST_INSERT_AFTER(listelm, elm, field) do { \
368 QMD_LIST_CHECK_NEXT(listelm, field); \
369 if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\
370 LIST_NEXT((listelm), field)->field.le_prev = \
371 &LIST_NEXT((elm), field); \
372 LIST_NEXT((listelm), field) = (elm); \
373 (elm)->field.le_prev = &LIST_NEXT((listelm), field); \
376 #define LIST_INSERT_BEFORE(listelm, elm, field) do { \
377 QMD_LIST_CHECK_PREV(listelm, field); \
378 (elm)->field.le_prev = (listelm)->field.le_prev; \
379 LIST_NEXT((elm), field) = (listelm); \
380 *(listelm)->field.le_prev = (elm); \
381 (listelm)->field.le_prev = &LIST_NEXT((elm), field); \
384 #define LIST_INSERT_HEAD(head, elm, field) do { \
385 QMD_LIST_CHECK_HEAD((head), field); \
386 if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \
387 LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\
389 (elm)->field.le_prev = &LIST_FIRST((head)); \
392 #define LIST_NEXT(elm, field) ((elm)->field.le_next)
394 #define LIST_REMOVE(elm, field) do { \
395 QMD_LIST_CHECK_NEXT(elm, field); \
396 QMD_LIST_CHECK_PREV(elm, field); \
397 if (LIST_NEXT((elm), field) != NULL) \
398 LIST_NEXT((elm), field)->field.le_prev = \
399 (elm)->field.le_prev; \
400 *(elm)->field.le_prev = LIST_NEXT((elm), field); \
401 TRASHIT((elm)->field.le_next); \
402 TRASHIT((elm)->field.le_prev); \
429 #define QMD_TAILQ_CHECK_HEAD(head, field) do { \
431 TAILQ_FIRST((head))->field.tqe_prev != \
436 #define QMD_TAILQ_CHECK_TAIL(head, field) do { \
441 #define QMD_TAILQ_CHECK_NEXT(elm, field) do { \
442 if (TAILQ_NEXT((elm), field) != NULL && \
443 TAILQ_NEXT((elm), field)->field.tqe_prev != \
444 &((elm)->field.tqe_next)) \
448 #define QMD_TAILQ_CHECK_PREV(elm, field) do { \
449 if (*(elm)->field.tqe_prev != (elm)) \
453 #define QMD_TAILQ_CHECK_HEAD(head, field)
455 #define QMD_TAILQ_CHECK_NEXT(elm, field)
456 #define QMD_TAILQ_CHECK_PREV(elm, field)
459 #define TAILQ_CONCAT(head1, head2, field) do { \
462 (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \
474 #define TAILQ_FOREACH(var, head, field) \
477 (var) = TAILQ_NEXT((var), field))
479 #define TAILQ_FOREACH_SAFE(var, head, field, tvar) \
481 (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
484 #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
487 (var) = TAILQ_PREV((var), headname, field))
489 #define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \
491 (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \
500 #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
501 QMD_TAILQ_CHECK_NEXT(listelm, field); \
502 if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\
503 TAILQ_NEXT((elm), field)->field.tqe_prev = \
504 &TAILQ_NEXT((elm), field); \
506 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
509 TAILQ_NEXT((listelm), field) = (elm); \
510 (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); \
511 QMD_TRACE_ELEM(&(elm)->field); \
512 QMD_TRACE_ELEM(&listelm->field); \
515 #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
516 QMD_TAILQ_CHECK_PREV(listelm, field); \
517 (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
518 TAILQ_NEXT((elm), field) = (listelm); \
519 *(listelm)->field.tqe_prev = (elm); \
520 (listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \
521 QMD_TRACE_ELEM(&(elm)->field); \
522 QMD_TRACE_ELEM(&listelm->field); \
525 #define TAILQ_INSERT_HEAD(head, elm, field) do { \
526 QMD_TAILQ_CHECK_HEAD(head, field); \
527 if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \
528 TAILQ_FIRST((head))->field.tqe_prev = \
529 &TAILQ_NEXT((elm), field); \
531 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
533 (elm)->field.tqe_prev = &TAILQ_FIRST((head)); \
535 QMD_TRACE_ELEM(&(elm)->field); \
538 #define TAILQ_INSERT_TAIL(head, elm, field) do { \
539 QMD_TAILQ_CHECK_TAIL(head, field); \
540 TAILQ_NEXT((elm), field) = NULL; \
541 (elm)->field.tqe_prev = (head)->tqh_last; \
543 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
545 QMD_TRACE_ELEM(&(elm)->field); \
551 #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
553 #define TAILQ_PREV(elm, headname, field) \
554 (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
556 #define TAILQ_REMOVE(head, elm, field) do { \
557 QMD_TAILQ_CHECK_NEXT(elm, field); \
558 QMD_TAILQ_CHECK_PREV(elm, field); \
559 if ((TAILQ_NEXT((elm), field)) != NULL) \
560 TAILQ_NEXT((elm), field)->field.tqe_prev = \
561 (elm)->field.tqe_prev; \
563 (head)->tqh_last = (elm)->field.tqe_prev; \
566 *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \
567 TRASHIT((elm)->field.tqe_next); \
568 TRASHIT((elm)->field.tqe_prev); \
569 QMD_TRACE_ELEM(&(elm)->field); \