Lines Matching refs:elm

136 #define	SLIST_INSERT_AFTER(slistelm, elm, field) do {			\  argument
137 SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); \
138 SLIST_NEXT((slistelm), field) = (elm); \
141 #define SLIST_INSERT_HEAD(head, elm, field) do { \ argument
142 SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \
143 SLIST_FIRST((head)) = (elm); \
146 #define SLIST_NEXT(elm, field) ((elm)->field.sle_next) argument
148 #define SLIST_REMOVE(head, elm, type, field) do { \ argument
149 if (SLIST_FIRST((head)) == (elm)) { \
154 while (SLIST_NEXT(curelm, field) != (elm)) \
199 #define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \ argument
200 if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\
201 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
202 STAILQ_NEXT((tqelm), field) = (elm); \
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
212 STAILQ_NEXT((elm), field) = NULL; \
213 STAILQ_LAST((head)) = (elm); \
214 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
219 #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) argument
221 #define STAILQ_REMOVE(head, elm, type, field) do { \ argument
222 if (STAILQ_FIRST((head)) == (elm)) { \
227 while (STAILQ_NEXT(curelm, field) != (elm)) \
241 #define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do { \ argument
242 if ((STAILQ_FIRST((head)) = STAILQ_NEXT((elm), field)) == NULL) \
280 #define LIST_INSERT_AFTER(listelm, elm, field) do { \ argument
281 if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\
283 &LIST_NEXT((elm), field); \
284 LIST_NEXT((listelm), field) = (elm); \
285 (elm)->field.le_prev = &LIST_NEXT((listelm), field); \
288 #define LIST_INSERT_BEFORE(listelm, elm, field) do { \ argument
289 (elm)->field.le_prev = (listelm)->field.le_prev; \
290 LIST_NEXT((elm), field) = (listelm); \
291 *(listelm)->field.le_prev = (elm); \
292 (listelm)->field.le_prev = &LIST_NEXT((elm), field); \
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)); \
302 #define LIST_NEXT(elm, field) ((elm)->field.le_next) argument
304 #define LIST_REMOVE(elm, field) do { \ argument
305 if (LIST_NEXT((elm), field) != NULL) \
306 LIST_NEXT((elm), field)->field.le_prev = \
307 (elm)->field.le_prev; \
308 *(elm)->field.le_prev = LIST_NEXT((elm), field); \
351 #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
352 if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\
353 TAILQ_NEXT((elm), field)->field.tqe_prev = \
354 &TAILQ_NEXT((elm), field); \
356 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
357 TAILQ_NEXT((listelm), field) = (elm); \
358 (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); \
361 #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ argument
362 (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
363 TAILQ_NEXT((elm), field) = (listelm); \
364 *(listelm)->field.tqe_prev = (elm); \
365 (listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \
368 #define TAILQ_INSERT_HEAD(head, elm, field) do { \ argument
369 if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \
371 &TAILQ_NEXT((elm), field); \
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
379 TAILQ_NEXT((elm), field) = NULL; \
380 (elm)->field.tqe_prev = (head)->tqh_last; \
381 *(head)->tqh_last = (elm); \
382 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
388 #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) argument
390 #define TAILQ_PREV(elm, headname, field) \ argument
391 (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
393 #define TAILQ_REMOVE(head, elm, field) do { \ argument
394 if ((TAILQ_NEXT((elm), field)) != NULL) \
395 TAILQ_NEXT((elm), field)->field.tqe_prev = \
396 (elm)->field.tqe_prev; \
398 (head)->tqh_last = (elm)->field.tqe_prev; \
399 *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \
442 #define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
443 CIRCLEQ_NEXT((elm), field) = CIRCLEQ_NEXT((listelm), field); \
444 CIRCLEQ_PREV((elm), field) = (listelm); \
446 CIRCLEQ_LAST((head)) = (elm); \
448 CIRCLEQ_PREV(CIRCLEQ_NEXT((listelm), field), field) = (elm);\
449 CIRCLEQ_NEXT((listelm), field) = (elm); \
452 #define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ argument
453 CIRCLEQ_NEXT((elm), field) = (listelm); \
454 CIRCLEQ_PREV((elm), field) = CIRCLEQ_PREV((listelm), field); \
456 CIRCLEQ_FIRST((head)) = (elm); \
458 CIRCLEQ_NEXT(CIRCLEQ_PREV((listelm), field), field) = (elm);\
459 CIRCLEQ_PREV((listelm), field) = (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); \
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)); \
476 CIRCLEQ_FIRST((head)) = (elm); \
478 CIRCLEQ_NEXT(CIRCLEQ_LAST((head)), field) = (elm); \
479 CIRCLEQ_LAST((head)) = (elm); \
484 #define CIRCLEQ_NEXT(elm,field) ((elm)->field.cqe_next) argument
486 #define CIRCLEQ_PREV(elm,field) ((elm)->field.cqe_prev) 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); \
492 CIRCLEQ_PREV(CIRCLEQ_NEXT((elm), field), field) = \
493 CIRCLEQ_PREV((elm), field); \
494 if (CIRCLEQ_PREV((elm), field) == (void *)(head)) \
495 CIRCLEQ_FIRST((head)) = CIRCLEQ_NEXT((elm), field); \
497 CIRCLEQ_NEXT(CIRCLEQ_PREV((elm), field), field) = \
498 CIRCLEQ_NEXT((elm), field); \