Home | History | Annotate | Download | only in qemu

Lines Matching full:head

50  * or after an existing element or at the head of the list. A list
53 * A tail queue is headed by a pair of pointers, one to the head of the
57 * after an existing element, at the head of the list, or at the end of
60 * A circle queue is headed by a pair of pointers, one to the head of the
64 * an existing element, at the head of the list, or at the end of the list.
79 #define LIST_HEAD_INITIALIZER(head) \
91 #define LIST_INIT(head) do { \
92 (head)->lh_first = NULL; \
110 #define LIST_INSERT_HEAD(head, elm, field) do { \
111 if (((elm)->field.le_next = (head)->lh_first) != NULL) \
112 (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
113 (head)->lh_first = (elm); \
114 (elm)->field.le_prev = &(head)->lh_first; \
124 #define LIST_FOREACH(var, head, field) \
125 for ((var) = ((head)->lh_first); \
132 #define LIST_EMPTY(head) ((head)->lh_first == NULL)
133 #define LIST_FIRST(head) ((head)->lh_first)
147 #define TAILQ_HEAD_INITIALIZER(head) \
148 { NULL, &(head).tqh_first }
160 #define TAILQ_INIT(head) do { \
161 (head)->tqh_first = NULL; \
162 (head)->tqh_last = &(head)->tqh_first; \
165 #define TAILQ_INSERT_HEAD(head, elm, field) do { \
166 if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
167 (head)->tqh_first->field.tqe_prev = \
170 (head)->tqh_last = &(elm)->field.tqe_next; \
171 (head)->tqh_first = (elm); \
172 (elm)->field.tqe_prev = &(head)->tqh_first; \
175 #define TAILQ_INSERT_TAIL(head, elm, field) do { \
177 (elm)->field.tqe_prev = (head)->tqh_last; \
178 *(head)->tqh_last = (elm); \
179 (head)->tqh_last = &(elm)->field.tqe_next; \
182 #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
187 (head)->tqh_last = &(elm)->field.tqe_next; \
199 #define TAILQ_REMOVE(head, elm, field) do { \
204 (head)->tqh_last = (elm)->field.tqe_prev; \
208 #define TAILQ_FOREACH(var, head, field) \
209 for ((var) = ((head)->tqh_first); \
213 #define TAILQ_FOREACH_SAFE(var, head, field, next_var) \
214 for ((var) = ((head)->tqh_first); \
218 #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
219 for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \
226 #define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
227 #define TAILQ_FIRST(head) ((head)->tqh_first)
230 #define TAILQ_LAST(head, headname) \
231 (*(((struct headname *)((head)->tqh_last))->tqh_last))
245 #define CIRCLEQ_HEAD_INITIALIZER(head) \
246 { (void *)&head, (void *)&head }
257 #define CIRCLEQ_INIT(head) do { \
258 (head)->cqh_first = (void *)(head); \
259 (head)->cqh_last = (void *)(head); \
262 #define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
265 if ((listelm)->field.cqe_next == (void *)(head)) \
266 (head)->cqh_last = (elm); \
272 #define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \
275 if ((listelm)->field.cqe_prev == (void *)(head)) \
276 (head)->cqh_first = (elm); \
282 #define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \
283 (elm)->field.cqe_next = (head)->cqh_first; \
284 (elm)->field.cqe_prev = (void *)(head); \
285 if ((head)->cqh_last == (void *)(head)) \
286 (head)->cqh_last = (elm); \
288 (head)->cqh_first->field.cqe_prev = (elm); \
289 (head)->cqh_first = (elm); \
292 #define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \
293 (elm)->field.cqe_next = (void *)(head); \
294 (elm)->field.cqe_prev = (head)->cqh_last; \
295 if ((head)->cqh_first == (void *)(head)) \
296 (head)->cqh_first = (elm); \
298 (head)->cqh_last->field.cqe_next = (elm); \
299 (head)->cqh_last = (elm); \
302 #define CIRCLEQ_REMOVE(head, elm, field) do { \
303 if ((elm)->field.cqe_next == (void *)(head)) \
304 (head)->cqh_last = (elm)->field.cqe_prev; \
308 if ((elm)->field.cqe_prev == (void *)(head)) \
309 (head)->cqh_first = (elm)->field.cqe_next; \
315 #define CIRCLEQ_FOREACH(var, head, field) \
316 for ((var) = ((head)->cqh_first); \
317 (var) != (const void *)(head); \
320 #define CIRCLEQ_FOREACH_REVERSE(var, head, field) \
321 for ((var) = ((head)->cqh_last); \
322 (var) != (const void *)(head); \
328 #define CIRCLEQ_EMPTY(headhead)->cqh_first == (void *)(head))
329 #define CIRCLEQ_FIRST(head) ((head)->cqh_first)
330 #define CIRCLEQ_LAST(head) ((head)->cqh_last)
334 #define CIRCLEQ_LOOP_NEXT(head, elm, field) \
335 (((elm)->field.cqe_next == (void *)(head)) \
336 ? ((head)->cqh_first) \
338 #define CIRCLEQ_LOOP_PREV(head, elm, field) \
339 (((elm)->field.cqe_prev == (void *)(head)) \
340 ? ((head)->cqh_last) \