Lines Matching refs:head
56 * or after an existing element or at the head of the list. A list
59 * A tail queue is headed by a pair of pointers, one to the head of the
63 * after an existing element, at the head of the list, or at the end of
66 * A circle queue is headed by a pair of pointers, one to the head of the
70 * an existing element, at the head of the list, or at the end of the list.
91 #define LIST_FIRST(head) ((head)->lh_first)
93 #define LIST_END(head) NULL
98 #define LIST_INIT(head) { \
99 (head)->lh_first = NULL; \
117 #define LIST_INSERT_HEAD(head, elm, field) do { \
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)
148 #define TAILQ_END(head) NULL
153 #define TAILQ_INIT(head) do { \
154 (head)->tqh_first = NULL; \
155 (head)->tqh_last = &(head)->tqh_first; \
158 #define TAILQ_INSERT_HEAD(head, elm, field) do { \
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 { \
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 { \
180 (head)->tqh_last = &(elm)->field.tqe_next; \
192 #define TAILQ_REMOVE(head, elm, field) do { \
197 (head)->tqh_last = (elm)->field.tqe_prev; \
216 #define CIRCLEQ_FIRST(head) ((head)->cqh_first)
217 #define CIRCLEQ_LAST(head) ((head)->cqh_last)
218 #define CIRCLEQ_END(head) ((void *)(head))
225 #define CIRCLEQ_INIT(head) do { \
226 (head)->cqh_first = (void *)(head); \
227 (head)->cqh_last = (void *)(head); \
230 #define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
233 if ((listelm)->field.cqe_next == (void *)(head)) \
234 (head)->cqh_last = (elm); \
240 #define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \
243 if ((listelm)->field.cqe_prev == (void *)(head)) \
244 (head)->cqh_first = (elm); \
250 #define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \
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 { \
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 { \
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; \