Lines Matching refs:head
143 #define LDAP_SLIST_HEAD_INITIALIZER(head) \ argument
157 #define LDAP_SLIST_EMPTY(head) ((head)->slh_first == NULL) argument
159 #define LDAP_SLIST_FIRST(head) ((head)->slh_first) argument
161 #define LDAP_SLIST_FOREACH(var, head, field) \ argument
162 for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
164 #define LDAP_SLIST_INIT(head) { \ argument
165 (head)->slh_first = NULL; \
177 #define LDAP_SLIST_INSERT_HEAD(head, elm, field) do { \ argument
178 (elm)->field.sle_next = (head)->slh_first; \
179 (head)->slh_first = (elm); \
184 #define LDAP_SLIST_REMOVE_HEAD(head, field) do { \ argument
185 (head)->slh_first = (head)->slh_first->field.sle_next; \
188 #define LDAP_SLIST_REMOVE(head, elm, type, field) do { \ argument
189 if ((head)->slh_first == (elm)) { \
190 LDAP_SLIST_REMOVE_HEAD((head), field); \
193 struct type *curelm = (head)->slh_first; \
210 #define LDAP_STAILQ_HEAD_INITIALIZER(head) \ argument
211 { NULL, &(head).stqh_first }
224 #define LDAP_STAILQ_EMPTY(head) ((head)->stqh_first == NULL) argument
226 #define LDAP_STAILQ_INIT(head) do { \ argument
227 (head)->stqh_first = NULL; \
228 (head)->stqh_last = &(head)->stqh_first; \
235 #define LDAP_STAILQ_FIRST(head) ((head)->stqh_first) argument
237 #define LDAP_STAILQ_LAST(head, type, field) \ argument
238 (LDAP_STAILQ_EMPTY(head) ? \
241 ((char *)((head)->stqh_last) - offsetof(struct type, field))))
243 #define LDAP_STAILQ_FOREACH(var, head, field) \ argument
244 for((var) = (head)->stqh_first; (var); (var) = (var)->field.stqe_next)
246 #define LDAP_STAILQ_INSERT_HEAD(head, elm, field) do { \ argument
247 if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \
248 (head)->stqh_last = &(elm)->field.stqe_next; \
249 (head)->stqh_first = (elm); \
252 #define LDAP_STAILQ_INSERT_TAIL(head, elm, field) do { \ argument
254 *(head)->stqh_last = (elm); \
255 (head)->stqh_last = &(elm)->field.stqe_next; \
258 #define LDAP_STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \ argument
260 (head)->stqh_last = &(elm)->field.stqe_next; \
266 #define LDAP_STAILQ_REMOVE_HEAD(head, field) do { \ argument
267 if (((head)->stqh_first = \
268 (head)->stqh_first->field.stqe_next) == NULL) \
269 (head)->stqh_last = &(head)->stqh_first; \
272 #define LDAP_STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do { \ argument
273 if (((head)->stqh_first = (elm)->field.stqe_next) == NULL) \
274 (head)->stqh_last = &(head)->stqh_first; \
277 #define LDAP_STAILQ_REMOVE(head, elm, type, field) do { \ argument
278 if ((head)->stqh_first == (elm)) { \
279 LDAP_STAILQ_REMOVE_HEAD(head, field); \
282 struct type *curelm = (head)->stqh_first; \
287 (head)->stqh_last = &(curelm)->field.stqe_next; \
299 #define LDAP_LIST_HEAD_INITIALIZER(head) \ argument
315 #define LDAP_LIST_EMPTY(head) ((head)->lh_first == NULL) argument
317 #define LDAP_LIST_FIRST(head) ((head)->lh_first) argument
319 #define LDAP_LIST_FOREACH(var, head, field) \ argument
320 for((var) = (head)->lh_first; (var); (var) = (var)->field.le_next)
322 #define LDAP_LIST_INIT(head) do { \ argument
323 (head)->lh_first = NULL; \
346 #define LDAP_LIST_INSERT_HEAD(head, elm, field) do { \ argument
347 if (((elm)->field.le_next = (head)->lh_first) != NULL) \
348 (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
349 (head)->lh_first = (elm); \
350 (elm)->field.le_prev = &(head)->lh_first; \
371 #define LDAP_TAILQ_HEAD_INITIALIZER(head) \ argument
372 { NULL, &(head).tqh_first }
386 #define LDAP_TAILQ_EMPTY(head) ((head)->tqh_first == NULL) argument
388 #define LDAP_TAILQ_FOREACH(var, head, field) \ argument
389 for (var = LDAP_TAILQ_FIRST(head); var; var = LDAP_TAILQ_NEXT(var, field))
391 #define LDAP_TAILQ_FOREACH_REVERSE(var, head, headname, field) \ argument
392 for ((var) = LDAP_TAILQ_LAST((head), headname); \
396 #define LDAP_TAILQ_FIRST(head) ((head)->tqh_first) argument
398 #define LDAP_TAILQ_LAST(head, headname) \ argument
399 (*(((struct headname *)((head)->tqh_last))->tqh_last))
406 #define LDAP_TAILQ_INIT(head) do { \ argument
407 (head)->tqh_first = NULL; \
408 (head)->tqh_last = &(head)->tqh_first; \
416 #define LDAP_TAILQ_INSERT_HEAD(head, elm, field) do { \ argument
417 if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
418 (head)->tqh_first->field.tqe_prev = \
421 (head)->tqh_last = &(elm)->field.tqe_next; \
422 (head)->tqh_first = (elm); \
423 (elm)->field.tqe_prev = &(head)->tqh_first; \
426 #define LDAP_TAILQ_INSERT_TAIL(head, elm, field) do { \ argument
428 (elm)->field.tqe_prev = (head)->tqh_last; \
429 *(head)->tqh_last = (elm); \
430 (head)->tqh_last = &(elm)->field.tqe_next; \
433 #define LDAP_TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
438 (head)->tqh_last = &(elm)->field.tqe_next; \
450 #define LDAP_TAILQ_REMOVE(head, elm, field) do { \ argument
455 (head)->tqh_last = (elm)->field.tqe_prev; \
468 #define LDAP_CIRCLEQ_HEAD_INITIALIZER(head) \ argument
469 { (void *)&(head), (void *)&(head) }
480 #define LDAP_CIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head)) argument
482 #define LDAP_CIRCLEQ_FIRST(head) ((head)->cqh_first) argument
484 #define LDAP_CIRCLEQ_FOREACH(var, head, field) \ argument
485 for((var) = (head)->cqh_first; \
486 (var) != (void *)(head); \
489 #define LDAP_CIRCLEQ_FOREACH_REVERSE(var, head, field) \ argument
490 for((var) = (head)->cqh_last; \
491 (var) != (void *)(head); \
494 #define LDAP_CIRCLEQ_INIT(head) do { \ argument
495 (head)->cqh_first = (void *)(head); \
496 (head)->cqh_last = (void *)(head); \
504 #define LDAP_CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
507 if ((listelm)->field.cqe_next == (void *)(head)) \
508 (head)->cqh_last = (elm); \
514 #define LDAP_CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ argument
517 if ((listelm)->field.cqe_prev == (void *)(head)) \
518 (head)->cqh_first = (elm); \
524 #define LDAP_CIRCLEQ_INSERT_HEAD(head, elm, field) do { \ argument
525 (elm)->field.cqe_next = (head)->cqh_first; \
526 (elm)->field.cqe_prev = (void *)(head); \
527 if ((head)->cqh_last == (void *)(head)) \
528 (head)->cqh_last = (elm); \
530 (head)->cqh_first->field.cqe_prev = (elm); \
531 (head)->cqh_first = (elm); \
534 #define LDAP_CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ argument
535 (elm)->field.cqe_next = (void *)(head); \
536 (elm)->field.cqe_prev = (head)->cqh_last; \
537 if ((head)->cqh_first == (void *)(head)) \
538 (head)->cqh_first = (elm); \
540 (head)->cqh_last->field.cqe_next = (elm); \
541 (head)->cqh_last = (elm); \
544 #define LDAP_CIRCLEQ_LAST(head) ((head)->cqh_last) argument
550 #define LDAP_CIRCLEQ_REMOVE(head, elm, field) do { \ argument
551 if ((elm)->field.cqe_next == (void *)(head)) \
552 (head)->cqh_last = (elm)->field.cqe_prev; \
556 if ((elm)->field.cqe_prev == (void *)(head)) \
557 (head)->cqh_first = (elm)->field.cqe_next; \
563 #define LDAP_CIRCLEQ_LOOP_NEXT(head, elm, field) \ argument
564 (((elm)->field.cqe_next == (void *)(head)) \
565 ? ((head)->cqh_first) \
568 #define LDAP_CIRCLEQ_LOOP_PREV(head, elm, field) \ argument
569 (((elm)->field.cqe_prev == (void *)(head)) \
570 ? ((head)->cqh_last) \
573 #define LDAP_CIRCLEQ_MAKE_HEAD(head, elm, field) do { \ argument
574 if ((elm)->field.cqe_prev != (void *)(head)) { \
575 (head)->cqh_first->field.cqe_prev = (head)->cqh_last; \
576 (head)->cqh_last->field.cqe_next = (head)->cqh_first; \
577 (head)->cqh_first = elm; \
578 (head)->cqh_last = (elm)->field.cqe_prev; \
579 (elm)->field.cqe_prev->field.cqe_next = (void *)(head); \
580 (elm)->field.cqe_prev = (void *)(head); \
584 #define LDAP_CIRCLEQ_MAKE_TAIL(head, elm, field) do { \ argument
585 if ((elm)->field.cqe_next != (void *)(head)) { \
586 (head)->cqh_first->field.cqe_prev = (head)->cqh_last; \
587 (head)->cqh_last->field.cqe_next = (head)->cqh_first; \
588 (head)->cqh_first = (elm)->field.cqe_next; \
589 (head)->cqh_last = elm; \
590 (elm)->field.cqe_next->field.cqe_prev = (void *)(head); \
591 (elm)->field.cqe_next = (void *)(head); \