Lines Matching refs:head

53 #define SH_LIST_FIRSTP(head, type)					\  argument
54 ((struct type *)(((u_int8_t *)(head)) + (head)->slh_first))
56 #define SH_LIST_FIRST(head, type) \ argument
57 ((head)->slh_first == -1 ? NULL : \
58 ((struct type *)(((u_int8_t *)(head)) + (head)->slh_first)))
73 #define SH_LIST_END(head) NULL argument
83 #define SH_LIST_INIT(head) (head)->slh_first = -1 argument
97 #define SH_LIST_INSERT_HEAD(head, elm, field, type) do { \ argument
98 if ((head)->slh_first != -1) { \
100 (head)->slh_first - SH_PTR_TO_OFF(head, elm); \
101 SH_LIST_FIRSTP(head, type)->field.sle_prev = \
105 (head)->slh_first = SH_PTR_TO_OFF(head, elm); \
106 (elm)->field.sle_prev = SH_PTR_TO_OFF(elm, &(head)->slh_first); \
136 #define SH_TAILQ_FIRSTP(head, type) \ argument
137 ((struct type *)((u_int8_t *)(head) + (head)->stqh_first))
139 #define SH_TAILQ_FIRST(head, type) \ argument
140 ((head)->stqh_first == -1 ? NULL : SH_TAILQ_FIRSTP(head, type))
151 #define SH_TAILQ_LAST(head) \ argument
152 ((ssize_t *)(((u_int8_t *)(head)) + (head)->stqh_last))
157 #define SH_TAILQ_END(head) NULL argument
159 #define SH_TAILQ_INIT(head) { \ argument
160 (head)->stqh_first = -1; \
161 (head)->stqh_last = SH_PTR_TO_OFF(head, &(head)->stqh_first); \
164 #define SH_TAILQ_INSERT_HEAD(head, elm, field, type) do { \ argument
165 if ((head)->stqh_first != -1) { \
167 (head)->stqh_first - SH_PTR_TO_OFF(head, elm); \
168 SH_TAILQ_FIRSTP(head, type)->field.stqe_prev = \
172 (head)->stqh_last = \
173 SH_PTR_TO_OFF(head, &(elm)->field.stqe_next); \
175 (head)->stqh_first = SH_PTR_TO_OFF(head, elm); \
177 SH_PTR_TO_OFF(elm, &(head)->stqh_first); \
180 #define SH_TAILQ_INSERT_TAIL(head, elm, field) do { \ argument
183 -SH_PTR_TO_OFF(head, elm) + (head)->stqh_last; \
184 if ((head)->stqh_last == \
185 SH_PTR_TO_OFF((head), &(head)->stqh_first)) \
186 (head)->stqh_first = SH_PTR_TO_OFF(head, elm); \
188 *SH_TAILQ_LAST(head) = -(head)->stqh_last + \
190 SH_PTR_TO_OFF(head, elm); \
191 (head)->stqh_last = \
192 SH_PTR_TO_OFF(head, &((elm)->field.stqe_next)); \
195 #define SH_TAILQ_INSERT_AFTER(head, listelm, elm, field, type) do { \ argument
203 (head)->stqh_last = \
204 SH_PTR_TO_OFF(head, &elm->field.stqe_next); \
210 #define SH_TAILQ_REMOVE(head, elm, field, type) do { \ argument
218 (head)->stqh_last = (elm)->field.stqe_prev + \
219 SH_PTR_TO_OFF(head, elm); \
242 #define SH_CIRCLEQ_FIRSTP(head, type) \ argument
243 ((struct type *)(((u_int8_t *)(head)) + (head)->scqh_first))
245 #define SH_CIRCLEQ_FIRST(head, type) \ argument
246 ((head)->scqh_first == -1 ? \
247 (void *)head : SH_CIRCLEQ_FIRSTP(head, type))
249 #define SH_CIRCLEQ_LASTP(head, type) \ argument
250 ((struct type *)(((u_int8_t *)(head)) + (head)->scqh_last))
252 #define SH_CIRCLEQ_LAST(head, type) \ argument
253 ((head)->scqh_last == -1 ? (void *)head : SH_CIRCLEQ_LASTP(head, type))
258 #define SH_CIRCLEQ_NEXT(head, elm, field, type) \ argument
259 ((elm)->field.scqe_next == SH_PTR_TO_OFF(elm, head) ? \
260 (void *)head : SH_CIRCLEQ_NEXTP(elm, field, type))
265 #define SH_CIRCLEQ_PREV(head, elm, field, type) \ argument
266 ((elm)->field.scqe_prev == SH_PTR_TO_OFF(elm, head) ? \
267 (void *)head : SH_CIRCLEQ_PREVP(elm, field, type))
269 #define SH_CIRCLEQ_END(head) ((void *)(head)) argument
271 #define SH_CIRCLEQ_INIT(head) { \ argument
272 (head)->scqh_first = 0; \
273 (head)->scqh_last = 0; \
276 #define SH_CIRCLEQ_INSERT_AFTER(head, listelm, elm, field, type) do { \ argument
280 if (SH_CIRCLEQ_NEXTP(listelm, field, type) == (void *)head) \
281 (head)->scqh_last = SH_PTR_TO_OFF(head, elm); \
290 #define SH_CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field, type) do { \ argument
294 if (SH_CIRCLEQ_PREVP(listelm, field, type) == (void *)(head)) \
295 (head)->scqh_first = SH_PTR_TO_OFF(head, elm); \
304 #define SH_CIRCLEQ_INSERT_HEAD(head, elm, field, type) do { \ argument
305 (elm)->field.scqe_prev = SH_PTR_TO_OFF(elm, head); \
306 (elm)->field.scqe_next = (head)->scqh_first + \
308 if ((head)->scqh_last == 0) \
309 (head)->scqh_last = -(elm)->field.scqe_prev; \
311 SH_CIRCLEQ_FIRSTP(head, type)->field.scqe_prev = \
312 SH_PTR_TO_OFF(SH_CIRCLEQ_FIRSTP(head, type), elm); \
313 (head)->scqh_first = -(elm)->field.scqe_prev; \
316 #define SH_CIRCLEQ_INSERT_TAIL(head, elm, field, type) do { \ argument
317 (elm)->field.scqe_next = SH_PTR_TO_OFF(elm, head); \
318 (elm)->field.scqe_prev = (head)->scqh_last + \
320 if ((head)->scqh_first == 0) \
321 (head)->scqh_first = -(elm)->field.scqe_next; \
323 SH_CIRCLEQ_LASTP(head, type)->field.scqe_next = \
324 SH_PTR_TO_OFF(SH_CIRCLEQ_LASTP(head, type), elm); \
325 (head)->scqh_last = -(elm)->field.scqe_next; \
328 #define SH_CIRCLEQ_REMOVE(head, elm, field, type) do { \ argument
329 if (SH_CIRCLEQ_NEXTP(elm, field, type) == (void *)(head)) \
330 (head)->scqh_last += (elm)->field.scqe_prev; \
334 if (SH_CIRCLEQ_PREVP(elm, field, type) == (void *)(head)) \
335 (head)->scqh_first += (elm)->field.scqe_next; \