Lines Matching refs:head
116 #define QMD_TRACE_HEAD(head) do { \ argument
117 (head)->trace.prevline = (head)->trace.lastline; \
118 (head)->trace.prevfile = (head)->trace.lastfile; \
119 (head)->trace.lastline = __LINE__; \
120 (head)->trace.lastfile = __FILE__; \
132 #define QMD_TRACE_HEAD(head) argument
151 #define SLIST_HEAD_INITIALIZER(head) \ argument
162 #define SLIST_EMPTY(head) ((head)->slh_first == NULL) argument
164 #define SLIST_FIRST(head) ((head)->slh_first) argument
166 #define SLIST_FOREACH(var, head, field) \ argument
167 for ((var) = SLIST_FIRST((head)); \
171 #define SLIST_FOREACH_SAFE(var, head, field, tvar) \ argument
172 for ((var) = SLIST_FIRST((head)); \
176 #define SLIST_FOREACH_PREVPTR(var, varp, head, field) \ argument
177 for ((varp) = &SLIST_FIRST((head)); \
181 #define SLIST_INIT(head) do { \ argument
182 SLIST_FIRST((head)) = NULL; \
190 #define SLIST_INSERT_HEAD(head, elm, field) do { \ argument
191 SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \
192 SLIST_FIRST((head)) = (elm); \
197 #define SLIST_REMOVE(head, elm, type, field) do { \ argument
198 if (SLIST_FIRST((head)) == (elm)) { \
199 SLIST_REMOVE_HEAD((head), field); \
202 struct type *curelm = SLIST_FIRST((head)); \
210 #define SLIST_REMOVE_HEAD(head, field) do { \ argument
211 SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), \
224 #define STAILQ_HEAD_INITIALIZER(head) \ argument
225 { NULL, &(head).stqh_first }
243 #define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) argument
245 #define STAILQ_FIRST(head) ((head)->stqh_first) argument
247 #define STAILQ_FOREACH(var, head, field) \ argument
248 for ((var) = STAILQ_FIRST((head)); \
252 #define STAILQ_FOREACH_SAFE(var, head, field, tvar) \ argument
253 for ((var) = STAILQ_FIRST((head)); \
257 #define STAILQ_INIT(head) do { \ argument
258 STAILQ_FIRST((head)) = NULL; \
259 (head)->stqh_last = &STAILQ_FIRST((head)); \
262 #define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \ argument
265 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
269 #define STAILQ_INSERT_HEAD(head, elm, field) do { \ argument
270 if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == \
272 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
273 STAILQ_FIRST((head)) = (elm); \
276 #define STAILQ_INSERT_TAIL(head, elm, field) do { \ argument
278 *(head)->stqh_last = (elm); \
279 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
282 #define STAILQ_LAST(head, type, field) \ argument
283 (STAILQ_EMPTY((head)) ? \
286 ((char *)((head)->stqh_last) - __offsetof(struct type, field))))
290 #define STAILQ_REMOVE(head, elm, type, field) do { \ argument
291 if (STAILQ_FIRST((head)) == (elm)) { \
292 STAILQ_REMOVE_HEAD((head), field); \
295 struct type *curelm = STAILQ_FIRST((head)); \
301 (head)->stqh_last = &STAILQ_NEXT((curelm),\
306 #define STAILQ_REMOVE_AFTER(head, elm, field) do { \ argument
311 (head)->stqh_last = \
316 #define STAILQ_REMOVE_HEAD(head, field) do { \ argument
317 if ((STAILQ_FIRST((head)) = \
318 STAILQ_NEXT(STAILQ_FIRST((head)), field)) == \
320 (head)->stqh_last = &STAILQ_FIRST((head)); \
323 #define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do { \ argument
324 if ((STAILQ_FIRST((head)) = \
326 (head)->stqh_last = &STAILQ_FIRST((head)); \
341 #define LIST_HEAD_INITIALIZER(head) \ argument
354 #define LIST_EMPTY(head) ((head)->lh_first == NULL) argument
356 #define LIST_FIRST(head) ((head)->lh_first) argument
358 #define LIST_FOREACH(var, head, field) \ argument
359 for ((var) = LIST_FIRST((head)); \
363 #define LIST_FOREACH_SAFE(var, head, field, tvar) \ argument
364 for ((var) = LIST_FIRST((head)); \
368 #define LIST_INIT(head) do { \ argument
369 LIST_FIRST((head)) = NULL; \
388 #define LIST_INSERT_HEAD(head, elm, field) do { \ argument
389 if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \
390 LIST_FIRST((head))->field.le_prev = \
392 LIST_FIRST((head)) = (elm); \
393 (elm)->field.le_prev = &LIST_FIRST((head)); \
414 #define COPY_HEADNAME(head) OS_MEMCPY((head)->headname, #head, sizeof(#head)) argument
417 #define COPY_HEADNAME(head) argument
428 #define TAILQ_HEAD_INITIALIZER(head) \ argument
429 { NULL, &(head).tqh_first }
442 #define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) argument
444 #define TAILQ_FIRST(head) ((head)->tqh_first) argument
446 #define TAILQ_FOREACH(var, head, field) \ argument
447 for ((var) = TAILQ_FIRST((head)); \
451 #define TAILQ_FOREACH_SAFE(var, head, field, tvar) \ argument
452 for ((var) = TAILQ_FIRST((head)); \
456 #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ argument
457 for ((var) = TAILQ_LAST((head), headname); \
461 #define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \ argument
462 for ((var) = TAILQ_LAST((head), headname); \
466 #define TAILQ_INIT(head) do { \ argument
467 TAILQ_FIRST((head)) = NULL; \
468 (head)->tqh_last = &TAILQ_FIRST((head)); \
469 COPY_HEADNAME(head); \
470 QMD_TRACE_HEAD(head); \
473 #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
479 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
480 QMD_TRACE_HEAD(head); \
497 #define TAILQ_INSERT_HEAD(head, elm, field) do { \ argument
498 if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL)\
499 TAILQ_FIRST((head))->field.tqe_prev = \
502 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
503 TAILQ_FIRST((head)) = (elm); \
504 (elm)->field.tqe_prev = &TAILQ_FIRST((head)); \
505 QMD_TRACE_HEAD(head); \
509 #define TAILQ_INSERT_TAIL(head, elm, field) do { \ argument
511 (elm)->field.tqe_prev = (head)->tqh_last; \
512 *(head)->tqh_last = (elm); \
513 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
514 QMD_TRACE_HEAD(head); \
518 #define TAILQ_LAST(head, headname) \ argument
519 (*(((struct headname *)((head)->tqh_last))->tqh_last))
526 #define TAILQ_REMOVE(head, elm, field) do { \ argument
531 (head)->tqh_last = (elm)->field.tqe_prev; \
532 QMD_TRACE_HEAD(head); \
566 *head = (struct quehead *)b; in insque() local
568 element->qh_link = head->qh_link; in insque()
569 element->qh_rlink = head; in insque()
570 head->qh_link = element; in insque()