Lines Matching +full:elm +full:- +full:id
2 /* $Id$ */
59 #define QUEUEDEBUG_ASN1_TAILQ_INSERT_HEAD(head, elm, field) \ argument
60 if ((head)->tqh_first && \
61 (head)->tqh_first->field.tqe_prev != &(head)->tqh_first) \
63 #define QUEUEDEBUG_ASN1_TAILQ_INSERT_TAIL(head, elm, field) \ argument
64 if (*(head)->tqh_last != NULL) \
66 #define QUEUEDEBUG_ASN1_TAILQ_OP(elm, field) \ argument
67 if ((elm)->field.tqe_next && \
68 (elm)->field.tqe_next->field.tqe_prev != \
69 &(elm)->field.tqe_next) \
70 panic("ASN1_TAILQ_* forw %p %s:%d", (elm), __FILE__, __LINE__);\
71 if (*(elm)->field.tqe_prev != (elm)) \
72 panic("ASN1_TAILQ_* back %p %s:%d", (elm), __FILE__, __LINE__);
73 #define QUEUEDEBUG_ASN1_TAILQ_PREREMOVE(head, elm, field) \ argument
74 if ((elm)->field.tqe_next == NULL && \
75 (head)->tqh_last != &(elm)->field.tqe_next) \
76 panic("ASN1_TAILQ_PREREMOVE head %p elm %p %s:%d", \
77 (head), (elm), __FILE__, __LINE__);
78 #define QUEUEDEBUG_ASN1_TAILQ_POSTREMOVE(elm, field) \ argument
79 (elm)->field.tqe_next = (void *)1L; \
80 (elm)->field.tqe_prev = (void *)1L;
82 #define QUEUEDEBUG_ASN1_TAILQ_INSERT_HEAD(head, elm, field) argument
83 #define QUEUEDEBUG_ASN1_TAILQ_INSERT_TAIL(head, elm, field) argument
84 #define QUEUEDEBUG_ASN1_TAILQ_OP(elm, field) argument
85 #define QUEUEDEBUG_ASN1_TAILQ_PREREMOVE(head, elm, field) argument
86 #define QUEUEDEBUG_ASN1_TAILQ_POSTREMOVE(elm, field) argument
90 (head)->tqh_first = NULL; \
91 (head)->tqh_last = &(head)->tqh_first; \
94 #define ASN1_TAILQ_INSERT_HEAD(head, elm, field) do { \ argument
95 QUEUEDEBUG_ASN1_TAILQ_INSERT_HEAD((head), (elm), field) \
96 if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
97 (head)->tqh_first->field.tqe_prev = \
98 &(elm)->field.tqe_next; \
100 (head)->tqh_last = &(elm)->field.tqe_next; \
101 (head)->tqh_first = (elm); \
102 (elm)->field.tqe_prev = &(head)->tqh_first; \
105 #define ASN1_TAILQ_INSERT_TAIL(head, elm, field) do { \ argument
106 QUEUEDEBUG_ASN1_TAILQ_INSERT_TAIL((head), (elm), field) \
107 (elm)->field.tqe_next = NULL; \
108 (elm)->field.tqe_prev = (head)->tqh_last; \
109 *(head)->tqh_last = (elm); \
110 (head)->tqh_last = &(elm)->field.tqe_next; \
113 #define ASN1_TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
115 if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
116 (elm)->field.tqe_next->field.tqe_prev = \
117 &(elm)->field.tqe_next; \
119 (head)->tqh_last = &(elm)->field.tqe_next; \
120 (listelm)->field.tqe_next = (elm); \
121 (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
124 #define ASN1_TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ argument
126 (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
127 (elm)->field.tqe_next = (listelm); \
128 *(listelm)->field.tqe_prev = (elm); \
129 (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
132 #define ASN1_TAILQ_REMOVE(head, elm, field) do { \ argument
133 QUEUEDEBUG_ASN1_TAILQ_PREREMOVE((head), (elm), field) \
134 QUEUEDEBUG_ASN1_TAILQ_OP((elm), field) \
135 if (((elm)->field.tqe_next) != NULL) \
136 (elm)->field.tqe_next->field.tqe_prev = \
137 (elm)->field.tqe_prev; \
139 (head)->tqh_last = (elm)->field.tqe_prev; \
140 *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
141 QUEUEDEBUG_ASN1_TAILQ_POSTREMOVE((elm), field); \
145 for ((var) = ((head)->tqh_first); \
147 (var) = ((var)->field.tqe_next))
150 for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \
152 (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
157 #define ASN1_TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
158 #define ASN1_TAILQ_FIRST(head) ((head)->tqh_first)
159 #define ASN1_TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) argument
162 (*(((struct headname *)((head)->tqh_last))->tqh_last))
163 #define ASN1_TAILQ_PREV(elm, headname, field) \ argument
164 (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))