• Home
  • Raw
  • Download

Lines Matching full:head

46  * added to the list after an existing element or at the head of the list.
47 * Elements being removed from the head of the list should use the explicit
57 * or after an existing element or at the head of the list. A list
60 * A simple queue is headed by a pair of pointers, one the head of the
63 * head of the list. New elements can be added to the list before or after
64 * an existing element, at the head of the list, or at the end of the
67 * A tail queue is headed by a pair of pointers, one to the head of the
71 * after an existing element, at the head of the list, or at the end of
74 * A circle queue is headed by a pair of pointers, one to the head of the
78 * an existing element, at the head of the list, or at the end of the list.
99 #define SLIST_HEAD_INITIALIZER(head) \ argument
110 #define SLIST_FIRST(head) ((head)->slh_first) argument
111 #define SLIST_END(head) NULL argument
112 #define SLIST_EMPTY(head) (SLIST_FIRST(head) == SLIST_END(head)) argument
115 #define SLIST_FOREACH(var, head, field) \ argument
116 for((var) = SLIST_FIRST(head); \
117 (var) != SLIST_END(head); \
120 #define SLIST_FOREACH_PREVPTR(var, varp, head, field) \ argument
121 for ((varp) = &SLIST_FIRST((head)); \
122 ((var) = *(varp)) != SLIST_END(head); \
128 #define SLIST_INIT(head) { \ argument
129 SLIST_FIRST(head) = SLIST_END(head); \
137 #define SLIST_INSERT_HEAD(head, elm, field) do { \ argument
138 (elm)->field.sle_next = (head)->slh_first; \
139 (head)->slh_first = (elm); \
142 #define SLIST_REMOVE_NEXT(head, elm, field) do { \ argument
146 #define SLIST_REMOVE_HEAD(head, field) do { \ argument
147 (head)->slh_first = (head)->slh_first->field.sle_next; \
150 #define SLIST_REMOVE(head, elm, type, field) do { \ argument
151 if ((head)->slh_first == (elm)) { \
152 SLIST_REMOVE_HEAD((head), field); \
154 struct type *curelm = (head)->slh_first; \
172 #define LIST_HEAD_INITIALIZER(head) \ argument
184 #define LIST_FIRST(head) ((head)->lh_first) argument
185 #define LIST_END(head) NULL argument
186 #define LIST_EMPTY(head) (LIST_FIRST(head) == LIST_END(head)) argument
189 #define LIST_FOREACH(var, head, field) \ argument
190 for((var) = LIST_FIRST(head); \
191 (var)!= LIST_END(head); \
197 #define LIST_INIT(head) do { \ argument
198 LIST_FIRST(head) = LIST_END(head); \
216 #define LIST_INSERT_HEAD(head, elm, field) do { \ argument
217 if (((elm)->field.le_next = (head)->lh_first) != NULL) \
218 (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
219 (head)->lh_first = (elm); \
220 (elm)->field.le_prev = &(head)->lh_first; \
251 #define SIMPLEQ_HEAD_INITIALIZER(head) \ argument
252 { NULL, &(head).sqh_first }
262 #define SIMPLEQ_FIRST(head) ((head)->sqh_first) argument
263 #define SIMPLEQ_END(head) NULL argument
264 #define SIMPLEQ_EMPTY(head) (SIMPLEQ_FIRST(head) == SIMPLEQ_END(head)) argument
267 #define SIMPLEQ_FOREACH(var, head, field) \ argument
268 for((var) = SIMPLEQ_FIRST(head); \
269 (var) != SIMPLEQ_END(head); \
275 #define SIMPLEQ_INIT(head) do { \ argument
276 (head)->sqh_first = NULL; \
277 (head)->sqh_last = &(head)->sqh_first; \
280 #define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \ argument
281 if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \
282 (head)->sqh_last = &(elm)->field.sqe_next; \
283 (head)->sqh_first = (elm); \
286 #define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \ argument
288 *(head)->sqh_last = (elm); \
289 (head)->sqh_last = &(elm)->field.sqe_next; \
292 #define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
294 (head)->sqh_last = &(elm)->field.sqe_next; \
298 #define SIMPLEQ_REMOVE_HEAD(head, field) do { \ argument
299 if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \
300 (head)->sqh_last = &(head)->sqh_first; \
312 #define TAILQ_HEAD_INITIALIZER(head) \ argument
313 { NULL, &(head).tqh_first }
324 #define TAILQ_FIRST(head) ((head)->tqh_first) argument
325 #define TAILQ_END(head) NULL argument
327 #define TAILQ_LAST(head, headname) \ argument
328 (*(((struct headname *)((head)->tqh_last))->tqh_last))
332 #define TAILQ_EMPTY(head) \ argument
333 (TAILQ_FIRST(head) == TAILQ_END(head))
335 #define TAILQ_FOREACH(var, head, field) \ argument
336 for((var) = TAILQ_FIRST(head); \
337 (var) != TAILQ_END(head); \
340 #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ argument
341 for((var) = TAILQ_LAST(head, headname); \
342 (var) != TAILQ_END(head); \
348 #define TAILQ_INIT(head) do { \ argument
349 (head)->tqh_first = NULL; \
350 (head)->tqh_last = &(head)->tqh_first; \
353 #define TAILQ_INSERT_HEAD(head, elm, field) do { \ argument
354 if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
355 (head)->tqh_first->field.tqe_prev = \
358 (head)->tqh_last = &(elm)->field.tqe_next; \
359 (head)->tqh_first = (elm); \
360 (elm)->field.tqe_prev = &(head)->tqh_first; \
363 #define TAILQ_INSERT_TAIL(head, elm, field) do { \ argument
365 (elm)->field.tqe_prev = (head)->tqh_last; \
366 *(head)->tqh_last = (elm); \
367 (head)->tqh_last = &(elm)->field.tqe_next; \
370 #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
375 (head)->tqh_last = &(elm)->field.tqe_next; \
387 #define TAILQ_REMOVE(head, elm, field) do { \ argument
392 (head)->tqh_last = (elm)->field.tqe_prev; \
398 #define TAILQ_REPLACE(head, elm, elm2, field) do { \ argument
403 (head)->tqh_last = &(elm2)->field.tqe_next; \
419 #define CIRCLEQ_HEAD_INITIALIZER(head) \ argument
420 { CIRCLEQ_END(&head), CIRCLEQ_END(&head) }
431 #define CIRCLEQ_FIRST(head) ((head)->cqh_first) argument
432 #define CIRCLEQ_LAST(head) ((head)->cqh_last) argument
433 #define CIRCLEQ_END(head) ((void *)(head)) argument
436 #define CIRCLEQ_EMPTY(head) \ argument
437 (CIRCLEQ_FIRST(head) == CIRCLEQ_END(head))
439 #define CIRCLEQ_FOREACH(var, head, field) \ argument
440 for((var) = CIRCLEQ_FIRST(head); \
441 (var) != CIRCLEQ_END(head); \
444 #define CIRCLEQ_FOREACH_REVERSE(var, head, field) \ argument
445 for((var) = CIRCLEQ_LAST(head); \
446 (var) != CIRCLEQ_END(head); \
452 #define CIRCLEQ_INIT(head) do { \ argument
453 (head)->cqh_first = CIRCLEQ_END(head); \
454 (head)->cqh_last = CIRCLEQ_END(head); \
457 #define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
460 if ((listelm)->field.cqe_next == CIRCLEQ_END(head)) \
461 (head)->cqh_last = (elm); \
467 #define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ argument
470 if ((listelm)->field.cqe_prev == CIRCLEQ_END(head)) \
471 (head)->cqh_first = (elm); \
477 #define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \ argument
478 (elm)->field.cqe_next = (head)->cqh_first; \
479 (elm)->field.cqe_prev = CIRCLEQ_END(head); \
480 if ((head)->cqh_last == CIRCLEQ_END(head)) \
481 (head)->cqh_last = (elm); \
483 (head)->cqh_first->field.cqe_prev = (elm); \
484 (head)->cqh_first = (elm); \
487 #define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ argument
488 (elm)->field.cqe_next = CIRCLEQ_END(head); \
489 (elm)->field.cqe_prev = (head)->cqh_last; \
490 if ((head)->cqh_first == CIRCLEQ_END(head)) \
491 (head)->cqh_first = (elm); \
493 (head)->cqh_last->field.cqe_next = (elm); \
494 (head)->cqh_last = (elm); \
497 #define CIRCLEQ_REMOVE(head, elm, field) do { \ argument
498 if ((elm)->field.cqe_next == CIRCLEQ_END(head)) \
499 (head)->cqh_last = (elm)->field.cqe_prev; \
503 if ((elm)->field.cqe_prev == CIRCLEQ_END(head)) \
504 (head)->cqh_first = (elm)->field.cqe_next; \
512 #define CIRCLEQ_REPLACE(head, elm, elm2, field) do { \ argument
514 CIRCLEQ_END(head)) \
515 (head).cqh_last = (elm2); \
519 CIRCLEQ_END(head)) \
520 (head).cqh_first = (elm2); \