Lines Matching refs:head
91 #define LIST_FIRST(head) ((head)->lh_first) argument
93 #define LIST_END(head) NULL argument
98 #define LIST_INIT(head) { \ argument
99 (head)->lh_first = NULL; \
117 #define LIST_INSERT_HEAD(head, elm, field) do { \ argument
118 if (((elm)->field.le_next = (head)->lh_first) != NULL) \
119 (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
120 (head)->lh_first = (elm); \
121 (elm)->field.le_prev = &(head)->lh_first; \
146 #define TAILQ_FIRST(head) ((head)->tqh_first) argument
148 #define TAILQ_END(head) NULL argument
153 #define TAILQ_INIT(head) do { \ argument
154 (head)->tqh_first = NULL; \
155 (head)->tqh_last = &(head)->tqh_first; \
158 #define TAILQ_INSERT_HEAD(head, elm, field) do { \ argument
159 if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
160 (head)->tqh_first->field.tqe_prev = \
163 (head)->tqh_last = &(elm)->field.tqe_next; \
164 (head)->tqh_first = (elm); \
165 (elm)->field.tqe_prev = &(head)->tqh_first; \
168 #define TAILQ_INSERT_TAIL(head, elm, field) do { \ argument
170 (elm)->field.tqe_prev = (head)->tqh_last; \
171 *(head)->tqh_last = (elm); \
172 (head)->tqh_last = &(elm)->field.tqe_next; \
175 #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
180 (head)->tqh_last = &(elm)->field.tqe_next; \
192 #define TAILQ_REMOVE(head, elm, field) do { \ argument
197 (head)->tqh_last = (elm)->field.tqe_prev; \
216 #define CIRCLEQ_FIRST(head) ((head)->cqh_first) argument
217 #define CIRCLEQ_LAST(head) ((head)->cqh_last) argument
218 #define CIRCLEQ_END(head) ((void *)(head)) argument
225 #define CIRCLEQ_INIT(head) do { \ argument
226 (head)->cqh_first = (void *)(head); \
227 (head)->cqh_last = (void *)(head); \
230 #define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
233 if ((listelm)->field.cqe_next == (void *)(head)) \
234 (head)->cqh_last = (elm); \
240 #define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ argument
243 if ((listelm)->field.cqe_prev == (void *)(head)) \
244 (head)->cqh_first = (elm); \
250 #define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \ argument
251 (elm)->field.cqe_next = (head)->cqh_first; \
252 (elm)->field.cqe_prev = (void *)(head); \
253 if ((head)->cqh_last == (void *)(head)) \
254 (head)->cqh_last = (elm); \
256 (head)->cqh_first->field.cqe_prev = (elm); \
257 (head)->cqh_first = (elm); \
260 #define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ argument
261 (elm)->field.cqe_next = (void *)(head); \
262 (elm)->field.cqe_prev = (head)->cqh_last; \
263 if ((head)->cqh_first == (void *)(head)) \
264 (head)->cqh_first = (elm); \
266 (head)->cqh_last->field.cqe_next = (elm); \
267 (head)->cqh_last = (elm); \
270 #define CIRCLEQ_REMOVE(head, elm, field) do { \ argument
271 if ((elm)->field.cqe_next == (void *)(head)) \
272 (head)->cqh_last = (elm)->field.cqe_prev; \
276 if ((elm)->field.cqe_prev == (void *)(head)) \
277 (head)->cqh_first = (elm)->field.cqe_next; \