Lines Matching refs:elm
79 #define SM_TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
83 #define SM_TAILQ_PREV(elm, headname, field) \
84 (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
106 #define SM_TAILQ_INSERT_HEAD(head, elm, field) do { \
107 if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
109 &(elm)->field.tqe_next; \
111 (head)->tqh_last = &(elm)->field.tqe_next; \
112 (head)->tqh_first = (elm); \
113 (elm)->field.tqe_prev = &(head)->tqh_first; \
116 #define SM_TAILQ_INSERT_TAIL(head, elm, field) do { \
117 (elm)->field.tqe_next = NULL; \
118 (elm)->field.tqe_prev = (head)->tqh_last; \
119 *(head)->tqh_last = (elm); \
120 (head)->tqh_last = &(elm)->field.tqe_next; \
123 #define SM_TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
124 if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
125 (elm)->field.tqe_next->field.tqe_prev = \
126 &(elm)->field.tqe_next; \
128 (head)->tqh_last = &(elm)->field.tqe_next; \
129 (listelm)->field.tqe_next = (elm); \
130 (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
133 #define SM_TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
134 (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
135 (elm)->field.tqe_next = (listelm); \
136 *(listelm)->field.tqe_prev = (elm); \
137 (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
140 #define SM_TAILQ_REMOVE(head, elm, field) do { \
141 if (((elm)->field.tqe_next) != NULL) \
142 (elm)->field.tqe_next->field.tqe_prev = \
143 (elm)->field.tqe_prev; \
145 (head)->tqh_last = (elm)->field.tqe_prev; \
146 *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
149 #define SM_TAILQ_REPLACE(head, elm, elm2, field) do { \
150 if (((elm2)->field.tqe_next = (elm)->field.tqe_next) != NULL) \
155 (elm2)->field.tqe_prev = (elm)->field.tqe_prev; \