Lines Matching +full:elm +full:- +full:id

39  * $Id: tailq.h,v 1.3 2012-01-21 00:12:14 ashish Exp $
75 #define SM_TAILQ_FIRST(head) ((head)->tqh_first)
77 #define SM_TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) argument
79 (*(((struct headname *)((head)->tqh_last))->tqh_last))
81 #define SM_TAILQ_PREV(elm, headname, field) \ argument
82 (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
100 (head)->tqh_first = NULL; \
101 (head)->tqh_last = &(head)->tqh_first; \
104 #define SM_TAILQ_INSERT_HEAD(head, elm, field) do { \ argument
105 if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
106 (head)->tqh_first->field.tqe_prev = \
107 &(elm)->field.tqe_next; \
109 (head)->tqh_last = &(elm)->field.tqe_next; \
110 (head)->tqh_first = (elm); \
111 (elm)->field.tqe_prev = &(head)->tqh_first; \
114 #define SM_TAILQ_INSERT_TAIL(head, elm, field) do { \ argument
115 (elm)->field.tqe_next = NULL; \
116 (elm)->field.tqe_prev = (head)->tqh_last; \
117 *(head)->tqh_last = (elm); \
118 (head)->tqh_last = &(elm)->field.tqe_next; \
121 #define SM_TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ argument
122 if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
123 (elm)->field.tqe_next->field.tqe_prev = \
124 &(elm)->field.tqe_next; \
126 (head)->tqh_last = &(elm)->field.tqe_next; \
127 (listelm)->field.tqe_next = (elm); \
128 (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
131 #define SM_TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ argument
132 (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
133 (elm)->field.tqe_next = (listelm); \
134 *(listelm)->field.tqe_prev = (elm); \
135 (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
138 #define SM_TAILQ_REMOVE(head, elm, field) do { \ argument
139 if (((elm)->field.tqe_next) != NULL) \
140 (elm)->field.tqe_next->field.tqe_prev = \
141 (elm)->field.tqe_prev; \
143 (head)->tqh_last = (elm)->field.tqe_prev; \
144 *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
147 #define SM_TAILQ_REPLACE(head, elm, elm2, field) do { \ argument
148 if (((elm2)->field.tqe_next = (elm)->field.tqe_next) != NULL) \
149 (elm2)->field.tqe_next->field.tqe_prev = \
150 &(elm2)->field.tqe_next; \
152 (head)->tqh_last = &(elm2)->field.tqe_next; \
153 (elm2)->field.tqe_prev = (elm)->field.tqe_prev; \
154 *(elm2)->field.tqe_prev = (elm2); \