Lines Matching refs:elm

92 #define	LIST_NEXT(elm, field)		((elm)->field.le_next)
102 #define LIST_INSERT_AFTER(listelm, elm, field) do { \
103 if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \
105 &(elm)->field.le_next; \
106 (listelm)->field.le_next = (elm); \
107 (elm)->field.le_prev = &(listelm)->field.le_next; \
110 #define LIST_INSERT_BEFORE(listelm, elm, field) do { \
111 (elm)->field.le_prev = (listelm)->field.le_prev; \
112 (elm)->field.le_next = (listelm); \
113 *(listelm)->field.le_prev = (elm); \
114 (listelm)->field.le_prev = &(elm)->field.le_next; \
117 #define LIST_INSERT_HEAD(head, elm, field) do { \
118 if (((elm)->field.le_next = (head)->lh_first) != NULL) \
119 (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
120 (head)->lh_first = (elm); \
121 (elm)->field.le_prev = &(head)->lh_first; \
124 #define LIST_REMOVE(elm, field) do { \
125 if ((elm)->field.le_next != NULL) \
126 (elm)->field.le_next->field.le_prev = \
127 (elm)->field.le_prev; \
128 *(elm)->field.le_prev = (elm)->field.le_next; \
147 #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
158 #define TAILQ_INSERT_HEAD(head, elm, field) do { \
159 if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
161 &(elm)->field.tqe_next; \
163 (head)->tqh_last = &(elm)->field.tqe_next; \
164 (head)->tqh_first = (elm); \
165 (elm)->field.tqe_prev = &(head)->tqh_first; \
168 #define TAILQ_INSERT_TAIL(head, elm, field) do { \
169 (elm)->field.tqe_next = NULL; \
170 (elm)->field.tqe_prev = (head)->tqh_last; \
171 *(head)->tqh_last = (elm); \
172 (head)->tqh_last = &(elm)->field.tqe_next; \
175 #define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
176 if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
177 (elm)->field.tqe_next->field.tqe_prev = \
178 &(elm)->field.tqe_next; \
180 (head)->tqh_last = &(elm)->field.tqe_next; \
181 (listelm)->field.tqe_next = (elm); \
182 (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
185 #define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
186 (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
187 (elm)->field.tqe_next = (listelm); \
188 *(listelm)->field.tqe_prev = (elm); \
189 (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
192 #define TAILQ_REMOVE(head, elm, field) do { \
193 if (((elm)->field.tqe_next) != NULL) \
194 (elm)->field.tqe_next->field.tqe_prev = \
195 (elm)->field.tqe_prev; \
197 (head)->tqh_last = (elm)->field.tqe_prev; \
198 *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
219 #define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next)
220 #define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev)
230 #define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
231 (elm)->field.cqe_next = (listelm)->field.cqe_next; \
232 (elm)->field.cqe_prev = (listelm); \
234 (head)->cqh_last = (elm); \
236 (listelm)->field.cqe_next->field.cqe_prev = (elm); \
237 (listelm)->field.cqe_next = (elm); \
240 #define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \
241 (elm)->field.cqe_next = (listelm); \
242 (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
244 (head)->cqh_first = (elm); \
246 (listelm)->field.cqe_prev->field.cqe_next = (elm); \
247 (listelm)->field.cqe_prev = (elm); \
250 #define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \
251 (elm)->field.cqe_next = (head)->cqh_first; \
252 (elm)->field.cqe_prev = (void *)(head); \
254 (head)->cqh_last = (elm); \
256 (head)->cqh_first->field.cqe_prev = (elm); \
257 (head)->cqh_first = (elm); \
260 #define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \
261 (elm)->field.cqe_next = (void *)(head); \
262 (elm)->field.cqe_prev = (head)->cqh_last; \
264 (head)->cqh_first = (elm); \
266 (head)->cqh_last->field.cqe_next = (elm); \
267 (head)->cqh_last = (elm); \
270 #define CIRCLEQ_REMOVE(head, elm, field) do { \
271 if ((elm)->field.cqe_next == (void *)(head)) \
272 (head)->cqh_last = (elm)->field.cqe_prev; \
274 (elm)->field.cqe_next->field.cqe_prev = \
275 (elm)->field.cqe_prev; \
276 if ((elm)->field.cqe_prev == (void *)(head)) \
277 (head)->cqh_first = (elm)->field.cqe_next; \
279 (elm)->field.cqe_prev->field.cqe_next = \
280 (elm)->field.cqe_next; \