Lines Matching refs:head
87 #define QLIST_HEAD_INITIALIZER(head) \ argument
99 #define QLIST_INIT(head) do { \ argument
100 (head)->lh_first = NULL; \
118 #define QLIST_INSERT_HEAD(head, elm, field) do { \ argument
119 if (((elm)->field.le_next = (head)->lh_first) != NULL) \
120 (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
121 (head)->lh_first = (elm); \
122 (elm)->field.le_prev = &(head)->lh_first; \
132 #define QLIST_FOREACH(var, head, field) \ argument
133 for ((var) = ((head)->lh_first); \
137 #define QLIST_FOREACH_SAFE(var, head, field, next_var) \ argument
138 for ((var) = ((head)->lh_first); \
145 #define QLIST_EMPTY(head) ((head)->lh_first == NULL) argument
146 #define QLIST_FIRST(head) ((head)->lh_first) argument
159 #define QSIMPLEQ_HEAD_INITIALIZER(head) \ argument
160 { NULL, &(head).sqh_first }
170 #define QSIMPLEQ_INIT(head) do { \ argument
171 (head)->sqh_first = NULL; \
172 (head)->sqh_last = &(head)->sqh_first; \
175 #define QSIMPLEQ_INSERT_HEAD(head, elm, field) do { \ argument
176 if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \
177 (head)->sqh_last = &(elm)->field.sqe_next; \
178 (head)->sqh_first = (elm); \
181 #define QSIMPLEQ_INSERT_TAIL(head, elm, field) do { \ argument
183 *(head)->sqh_last = (elm); \
184 (head)->sqh_last = &(elm)->field.sqe_next; \
187 #define QSIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
189 (head)->sqh_last = &(elm)->field.sqe_next; \
193 #define QSIMPLEQ_REMOVE_HEAD(head, field) do { \ argument
194 if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL)\
195 (head)->sqh_last = &(head)->sqh_first; \
198 #define QSIMPLEQ_REMOVE(head, elm, type, field) do { \ argument
199 if ((head)->sqh_first == (elm)) { \
200 QSIMPLEQ_REMOVE_HEAD((head), field); \
202 struct type *curelm = (head)->sqh_first; \
207 (head)->sqh_last = &(curelm)->field.sqe_next; \
211 #define QSIMPLEQ_FOREACH(var, head, field) \ argument
212 for ((var) = ((head)->sqh_first); \
216 #define QSIMPLEQ_FOREACH_SAFE(var, head, field, next) \ argument
217 for ((var) = ((head)->sqh_first); \
229 #define QSIMPLEQ_LAST(head, type, field) \ argument
230 (QSIMPLEQ_EMPTY((head)) ? \
233 ((char *)((head)->sqh_last) - offsetof(struct type, field))))
238 #define QSIMPLEQ_EMPTY(head) ((head)->sqh_first == NULL) argument
239 #define QSIMPLEQ_FIRST(head) ((head)->sqh_first) argument
253 #define QTAILQ_HEAD_INITIALIZER(head) \ argument
254 { NULL, &(head).tqh_first }
266 #define QTAILQ_INIT(head) do { \ argument
267 (head)->tqh_first = NULL; \
268 (head)->tqh_last = &(head)->tqh_first; \
271 #define QTAILQ_INSERT_HEAD(head, elm, field) do { \ argument
272 if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
273 (head)->tqh_first->field.tqe_prev = \
276 (head)->tqh_last = &(elm)->field.tqe_next; \
277 (head)->tqh_first = (elm); \
278 (elm)->field.tqe_prev = &(head)->tqh_first; \
281 #define QTAILQ_INSERT_TAIL(head, elm, field) do { \ argument
283 (elm)->field.tqe_prev = (head)->tqh_last; \
284 *(head)->tqh_last = (elm); \
285 (head)->tqh_last = &(elm)->field.tqe_next; \
288 #define QTAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
293 (head)->tqh_last = &(elm)->field.tqe_next; \
305 #define QTAILQ_REMOVE(head, elm, field) do { \ argument
310 (head)->tqh_last = (elm)->field.tqe_prev; \
314 #define QTAILQ_FOREACH(var, head, field) \ argument
315 for ((var) = ((head)->tqh_first); \
319 #define QTAILQ_FOREACH_SAFE(var, head, field, next_var) \ argument
320 for ((var) = ((head)->tqh_first); \
324 #define QTAILQ_FOREACH_REVERSE(var, head, headname, field) \ argument
325 for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \
332 #define QTAILQ_EMPTY(head) ((head)->tqh_first == NULL) argument
333 #define QTAILQ_FIRST(head) ((head)->tqh_first) argument
336 #define QTAILQ_LAST(head, headname) \ argument
337 (*(((struct headname *)((head)->tqh_last))->tqh_last))
351 #define QCIRCLEQ_HEAD_INITIALIZER(head) \ argument
352 { (void *)&head, (void *)&head }
363 #define QCIRCLEQ_INIT(head) do { \ argument
364 (head)->cqh_first = (void *)(head); \
365 (head)->cqh_last = (void *)(head); \
368 #define QCIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
371 if ((listelm)->field.cqe_next == (void *)(head)) \
372 (head)->cqh_last = (elm); \
378 #define QCIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ argument
381 if ((listelm)->field.cqe_prev == (void *)(head)) \
382 (head)->cqh_first = (elm); \
388 #define QCIRCLEQ_INSERT_HEAD(head, elm, field) do { \ argument
389 (elm)->field.cqe_next = (head)->cqh_first; \
390 (elm)->field.cqe_prev = (void *)(head); \
391 if ((head)->cqh_last == (void *)(head)) \
392 (head)->cqh_last = (elm); \
394 (head)->cqh_first->field.cqe_prev = (elm); \
395 (head)->cqh_first = (elm); \
398 #define QCIRCLEQ_INSERT_TAIL(head, elm, field) do { \ argument
399 (elm)->field.cqe_next = (void *)(head); \
400 (elm)->field.cqe_prev = (head)->cqh_last; \
401 if ((head)->cqh_first == (void *)(head)) \
402 (head)->cqh_first = (elm); \
404 (head)->cqh_last->field.cqe_next = (elm); \
405 (head)->cqh_last = (elm); \
408 #define QCIRCLEQ_REMOVE(head, elm, field) do { \ argument
409 if ((elm)->field.cqe_next == (void *)(head)) \
410 (head)->cqh_last = (elm)->field.cqe_prev; \
414 if ((elm)->field.cqe_prev == (void *)(head)) \
415 (head)->cqh_first = (elm)->field.cqe_next; \
421 #define QCIRCLEQ_FOREACH(var, head, field) \ argument
422 for ((var) = ((head)->cqh_first); \
423 (var) != (const void *)(head); \
426 #define QCIRCLEQ_FOREACH_REVERSE(var, head, field) \ argument
427 for ((var) = ((head)->cqh_last); \
428 (var) != (const void *)(head); \
434 #define QCIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head)) argument
435 #define QCIRCLEQ_FIRST(head) ((head)->cqh_first) argument
436 #define QCIRCLEQ_LAST(head) ((head)->cqh_last) argument
440 #define QCIRCLEQ_LOOP_NEXT(head, elm, field) \ argument
441 (((elm)->field.cqe_next == (void *)(head)) \
442 ? ((head)->cqh_first) \
444 #define QCIRCLEQ_LOOP_PREV(head, elm, field) \ argument
445 (((elm)->field.cqe_prev == (void *)(head)) \
446 ? ((head)->cqh_last) \