Lines Matching refs:head

48  * A tail queue is headed by a pair of pointers, one to the head of the
52 * after an existing element, at the head of the list, or at the end of
65 #define SM_TAILQ_HEAD_INITIALIZER(head) \
66 { NULL, &(head).tqh_first }
77 #define SM_TAILQ_FIRST(head) ((head)->tqh_first)
78 #define SM_TAILQ_END(head) NULL
80 #define SM_TAILQ_LAST(head, headname) \
81 (*(((struct headname *)((head)->tqh_last))->tqh_last))
85 #define SM_TAILQ_EMPTY(head) \
86 (SM_TAILQ_FIRST(head) == SM_TAILQ_END(head))
88 #define SM_TAILQ_FOREACH(var, head, field) \
89 for((var) = SM_TAILQ_FIRST(head); \
90 (var) != SM_TAILQ_END(head); \
93 #define SM_TAILQ_FOREACH_REVERSE(var, head, headname, field) \
94 for((var) = SM_TAILQ_LAST(head, headname); \
95 (var) != SM_TAILQ_END(head); \
101 #define SM_TAILQ_INIT(head) do { \
102 (head)->tqh_first = NULL; \
103 (head)->tqh_last = &(head)->tqh_first; \
106 #define SM_TAILQ_INSERT_HEAD(head, elm, field) do { \
107 if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
108 (head)->tqh_first->field.tqe_prev = \
111 (head)->tqh_last = &(elm)->field.tqe_next; \
112 (head)->tqh_first = (elm); \
113 (elm)->field.tqe_prev = &(head)->tqh_first; \
116 #define SM_TAILQ_INSERT_TAIL(head, elm, field) do { \
118 (elm)->field.tqe_prev = (head)->tqh_last; \
119 *(head)->tqh_last = (elm); \
120 (head)->tqh_last = &(elm)->field.tqe_next; \
123 #define SM_TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
128 (head)->tqh_last = &(elm)->field.tqe_next; \
140 #define SM_TAILQ_REMOVE(head, elm, field) do { \
145 (head)->tqh_last = (elm)->field.tqe_prev; \
149 #define SM_TAILQ_REPLACE(head, elm, elm2, field) do { \
154 (head)->tqh_last = &(elm2)->field.tqe_next; \