Lines Matching refs:field

160 #define	SLIST_FOREACH(var, head, field)					\  argument
163 (var) = SLIST_NEXT((var), field))
165 #define SLIST_FOREACH_SAFE(var, head, field, tvar) \ argument
167 (var) && ((tvar) = SLIST_NEXT((var), field), 1); \
170 #define SLIST_FOREACH_PREVPTR(var, varp, head, field) \ argument
173 (varp) = &SLIST_NEXT((var), field))
179 #define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ argument
180 SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); \
181 SLIST_NEXT((slistelm), field) = (elm); \
184 #define SLIST_INSERT_HEAD(head, elm, field) do { \ argument
185 SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \
189 #define SLIST_NEXT(elm, field) ((elm)->field.sle_next) argument
191 #define SLIST_REMOVE(head, elm, type, field) do { \ argument
193 SLIST_REMOVE_HEAD((head), field); \
197 while (SLIST_NEXT(curelm, field) != (elm)) \
198 curelm = SLIST_NEXT(curelm, field); \
199 SLIST_NEXT(curelm, field) = \
200 SLIST_NEXT(SLIST_NEXT(curelm, field), field); \
202 TRASHIT((elm)->field.sle_next); \
205 #define SLIST_REMOVE_HEAD(head, field) do { \ argument
206 SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \
241 #define STAILQ_FOREACH(var, head, field) \ argument
244 (var) = STAILQ_NEXT((var), field))
247 #define STAILQ_FOREACH_SAFE(var, head, field, tvar) \ argument
249 (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
257 #define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \ argument
258 if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\
259 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
260 STAILQ_NEXT((tqelm), field) = (elm); \
263 #define STAILQ_INSERT_HEAD(head, elm, field) do { \ argument
264 if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \
265 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
269 #define STAILQ_INSERT_TAIL(head, elm, field) do { \ argument
270 STAILQ_NEXT((elm), field) = NULL; \
272 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
275 #define STAILQ_LAST(head, type, field) \ argument
279 ((char *)((head)->stqh_last) - __offsetof(struct type, field))))
281 #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) argument
283 #define STAILQ_REMOVE(head, elm, type, field) do { \ argument
285 STAILQ_REMOVE_HEAD((head), field); \
289 while (STAILQ_NEXT(curelm, field) != (elm)) \
290 curelm = STAILQ_NEXT(curelm, field); \
291 if ((STAILQ_NEXT(curelm, field) = \
292 STAILQ_NEXT(STAILQ_NEXT(curelm, field), field)) == NULL)\
293 (head)->stqh_last = &STAILQ_NEXT((curelm), field);\
295 TRASHIT((elm)->field.stqe_next); \
298 #define STAILQ_REMOVE_HEAD(head, field) do { \ argument
300 STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \
304 #define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do { \ argument
305 if ((STAILQ_FIRST((head)) = STAILQ_NEXT((elm), field)) == NULL) \
331 #define QMD_LIST_CHECK_HEAD(head, field) do { \ argument
333 LIST_FIRST((head))->field.le_prev != \
338 #define QMD_LIST_CHECK_NEXT(elm, field) do { \ argument
339 if (LIST_NEXT((elm), field) != NULL && \
340 LIST_NEXT((elm), field)->field.le_prev != \
341 &((elm)->field.le_next)) \
345 #define QMD_LIST_CHECK_PREV(elm, field) do { \ argument
346 if (*(elm)->field.le_prev != (elm)) \
350 #define QMD_LIST_CHECK_HEAD(head, field) argument
351 #define QMD_LIST_CHECK_NEXT(elm, field) argument
352 #define QMD_LIST_CHECK_PREV(elm, field) argument
359 #define LIST_FOREACH(var, head, field) \ argument
362 (var) = LIST_NEXT((var), field))
364 #define LIST_FOREACH_SAFE(var, head, field, tvar) \ argument
366 (var) && ((tvar) = LIST_NEXT((var), field), 1); \
373 #define LIST_INSERT_AFTER(listelm, elm, field) do { \ argument
374 QMD_LIST_CHECK_NEXT(listelm, field); \
375 if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\
376 LIST_NEXT((listelm), field)->field.le_prev = \
377 &LIST_NEXT((elm), field); \
378 LIST_NEXT((listelm), field) = (elm); \
379 (elm)->field.le_prev = &LIST_NEXT((listelm), field); \
382 #define LIST_INSERT_BEFORE(listelm, elm, field) do { \ argument
383 QMD_LIST_CHECK_PREV(listelm, field); \
384 (elm)->field.le_prev = (listelm)->field.le_prev; \
385 LIST_NEXT((elm), field) = (listelm); \
386 *(listelm)->field.le_prev = (elm); \
387 (listelm)->field.le_prev = &LIST_NEXT((elm), field); \
390 #define LIST_INSERT_HEAD(head, elm, field) do { \ argument
391 QMD_LIST_CHECK_HEAD((head), field); \
392 if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \
393 LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\
395 (elm)->field.le_prev = &LIST_FIRST((head)); \
398 #define LIST_NEXT(elm, field) ((elm)->field.le_next) argument
400 #define LIST_REMOVE(elm, field) do { \ argument
401 QMD_LIST_CHECK_NEXT(elm, field); \
402 QMD_LIST_CHECK_PREV(elm, field); \
403 if (LIST_NEXT((elm), field) != NULL) \
404 LIST_NEXT((elm), field)->field.le_prev = \
405 (elm)->field.le_prev; \
406 *(elm)->field.le_prev = LIST_NEXT((elm), field); \
407 TRASHIT((elm)->field.le_next); \
408 TRASHIT((elm)->field.le_prev); \
434 #define TAILQ_CONCAT(head1, head2, field) do { \ argument
437 (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \
449 #define TAILQ_FOREACH(var, head, field) \ argument
452 (var) = TAILQ_NEXT((var), field))
454 #define TAILQ_FOREACH_SAFE(var, head, field, tvar) \ argument
456 (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
459 #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ argument
462 (var) = TAILQ_PREV((var), headname, field))
464 #define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \ argument
466 (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \
475 #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
476 if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\
477 TAILQ_NEXT((elm), field)->field.tqe_prev = \
478 &TAILQ_NEXT((elm), field); \
480 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
483 TAILQ_NEXT((listelm), field) = (elm); \
484 (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); \
485 QMD_TRACE_ELEM(&(elm)->field); \
486 QMD_TRACE_ELEM(&listelm->field); \
489 #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ argument
490 (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
491 TAILQ_NEXT((elm), field) = (listelm); \
492 *(listelm)->field.tqe_prev = (elm); \
493 (listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \
494 QMD_TRACE_ELEM(&(elm)->field); \
495 QMD_TRACE_ELEM(&listelm->field); \
498 #define TAILQ_INSERT_HEAD(head, elm, field) do { \ argument
499 if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \
500 TAILQ_FIRST((head))->field.tqe_prev = \
501 &TAILQ_NEXT((elm), field); \
503 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
505 (elm)->field.tqe_prev = &TAILQ_FIRST((head)); \
507 QMD_TRACE_ELEM(&(elm)->field); \
510 #define TAILQ_INSERT_TAIL(head, elm, field) do { \ argument
511 TAILQ_NEXT((elm), field) = NULL; \
512 (elm)->field.tqe_prev = (head)->tqh_last; \
514 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
516 QMD_TRACE_ELEM(&(elm)->field); \
522 #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) argument
524 #define TAILQ_PREV(elm, headname, field) \ argument
525 (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
527 #define TAILQ_REMOVE(head, elm, field) do { \ argument
528 if ((TAILQ_NEXT((elm), field)) != NULL) \
529 TAILQ_NEXT((elm), field)->field.tqe_prev = \
530 (elm)->field.tqe_prev; \
532 (head)->tqh_last = (elm)->field.tqe_prev; \
535 *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \
536 TRASHIT((elm)->field.tqe_next); \
537 TRASHIT((elm)->field.tqe_prev); \
538 QMD_TRACE_ELEM(&(elm)->field); \