Lines Matching full:head

50  * added to the list after an existing element or at the head of the list.
51 * Elements being removed from the head of the list should use the explicit
58 * head of the list and the other to the tail of the list. The elements are
61 * to the list after an existing element, at the head of the list, or at the
62 * end of the list. Elements being removed from the head of the tail queue
72 * or after an existing element or at the head of the list. A list
75 * A tail queue is headed by a pair of pointers, one to the head of the
79 * after an existing element, at the head of the list, or at the end of
114 #define SLIST_HEAD_INITIALIZER(head) \ argument
125 #define SLIST_EMPTY(head) ((head)->slh_first == NULL) argument
127 #define SLIST_FIRST(head) ((head)->slh_first) argument
129 #define SLIST_FOREACH(var, head, field) \ argument
130 for ((var) = SLIST_FIRST((head)); \
134 #define SLIST_INIT(head) do { \ argument
135 SLIST_FIRST((head)) = NULL; \
143 #define SLIST_INSERT_HEAD(head, elm, field) do { \ argument
144 SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \
145 SLIST_FIRST((head)) = (elm); \
150 #define SLIST_REMOVE(head, elm, type, field) do { \ argument
151 if (SLIST_FIRST((head)) == (elm)) { \
152 SLIST_REMOVE_HEAD((head), field); \
155 struct type *curelm = SLIST_FIRST((head)); \
163 #define SLIST_REMOVE_HEAD(head, field) do { \ argument
164 SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \
176 #define STAILQ_HEAD_INITIALIZER(head) \ argument
177 { NULL, &(head).stqh_first }
187 #define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) argument
189 #define STAILQ_FIRST(head) ((head)->stqh_first) argument
191 #define STAILQ_FOREACH(var, head, field) \ argument
192 for((var) = STAILQ_FIRST((head)); \
196 #define STAILQ_INIT(head) do { \ argument
197 STAILQ_FIRST((head)) = NULL; \
198 (head)->stqh_last = &STAILQ_FIRST((head)); \
201 #define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \ argument
203 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
207 #define STAILQ_INSERT_HEAD(head, elm, field) do { \ argument
208 if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \
209 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
210 STAILQ_FIRST((head)) = (elm); \
213 #define STAILQ_INSERT_TAIL(head, elm, field) do { \ argument
215 *(head)->stqh_last = (elm); \
216 (head)->stqh_last = &STAILQ_NEXT((elm), field); \
219 #define STAILQ_LAST(head, type, field) \ argument
220 (STAILQ_EMPTY(head) ? \
223 ((char *)((head)->stqh_last) - __offsetof(struct type, field))))
227 #define STAILQ_REMOVE(head, elm, type, field) do { \ argument
228 if (STAILQ_FIRST((head)) == (elm)) { \
229 STAILQ_REMOVE_HEAD(head, field); \
232 struct type *curelm = STAILQ_FIRST((head)); \
237 (head)->stqh_last = &STAILQ_NEXT((curelm), field);\
241 #define STAILQ_REMOVE_HEAD(head, field) do { \ argument
242 if ((STAILQ_FIRST((head)) = \
243 STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \
244 (head)->stqh_last = &STAILQ_FIRST((head)); \
247 #define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do { \ argument
248 if ((STAILQ_FIRST((head)) = STAILQ_NEXT((elm), field)) == NULL) \
249 (head)->stqh_last = &STAILQ_FIRST((head)); \
260 #define LIST_HEAD_INITIALIZER(head) \ argument
273 #define LIST_EMPTY(head) ((head)->lh_first == NULL) argument
275 #define LIST_FIRST(head) ((head)->lh_first) argument
277 #define LIST_FOREACH(var, head, field) \ argument
278 for ((var) = LIST_FIRST((head)); \
282 #define LIST_INIT(head) do { \ argument
283 LIST_FIRST((head)) = NULL; \
301 #define LIST_INSERT_HEAD(head, elm, field) do { \ argument
302 if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \
303 LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\
304 LIST_FIRST((head)) = (elm); \
305 (elm)->field.le_prev = &LIST_FIRST((head)); \
326 #define TAILQ_HEAD_INITIALIZER(head) \ argument
327 { NULL, &(head).tqh_first }
338 #define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) argument
340 #define TAILQ_FIRST(head) ((head)->tqh_first) argument
342 #define TAILQ_FOREACH(var, head, field) \ argument
343 for ((var) = TAILQ_FIRST((head)); \
347 #define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ argument
348 for ((var) = TAILQ_LAST((head), headname); \
352 #define TAILQ_INIT(head) do { \ argument
353 TAILQ_FIRST((head)) = NULL; \
354 (head)->tqh_last = &TAILQ_FIRST((head)); \
357 #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
362 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
374 #define TAILQ_INSERT_HEAD(head, elm, field) do { \ argument
375 if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \
376 TAILQ_FIRST((head))->field.tqe_prev = \
379 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
380 TAILQ_FIRST((head)) = (elm); \
381 (elm)->field.tqe_prev = &TAILQ_FIRST((head)); \
384 #define TAILQ_INSERT_TAIL(head, elm, field) do { \ argument
386 (elm)->field.tqe_prev = (head)->tqh_last; \
387 *(head)->tqh_last = (elm); \
388 (head)->tqh_last = &TAILQ_NEXT((elm), field); \
391 #define TAILQ_LAST(head, headname) \ argument
392 (*(((struct headname *)((head)->tqh_last))->tqh_last))
399 #define TAILQ_REMOVE(head, elm, field) do { \ argument
404 (head)->tqh_last = (elm)->field.tqe_prev; \
427 *head = (struct quehead *)b; in insque() local
429 element->qh_link = head->qh_link; in insque()
430 element->qh_rlink = head; in insque()
431 head->qh_link = element; in insque()