Lines Matching refs:name

23 # define OSSL_LIST_FOREACH_FROM(p, name, init)                              \  argument
26 (p) = ossl_list_##name##_next(p))
27 # define OSSL_LIST_FOREACH(p, name, l) \ argument
28 OSSL_LIST_FOREACH_FROM(p, name, ossl_list_##name##_head(l))
30 # define OSSL_LIST_FOREACH_REV_FROM(p, name, init) \ argument
33 (p) = ossl_list_##name##_prev(p))
34 # define OSSL_LIST_FOREACH_REV(p, name, l) \ argument
35 OSSL_LIST_FOREACH_FROM(p, name, ossl_list_##name##_tail(l))
37 # define OSSL_LIST_FOREACH_DELSAFE_FROM(p, pn, name, init) \ argument
39 (p) != NULL && (((pn) = ossl_list_##name##_next(p)), 1); \
41 #define OSSL_LIST_FOREACH_DELSAFE(p, pn, name, l) \ argument
42 OSSL_LIST_FOREACH_DELSAFE_FROM(p, pn, name, ossl_list_##name##_head(l))
44 # define OSSL_LIST_FOREACH_REV_DELSAFE_FROM(p, pn, name, init) \ argument
46 (p) != NULL && (((pn) = ossl_list_##name##_prev(p)), 1); \
48 # define OSSL_LIST_FOREACH_REV_DELSAFE(p, pn, name, l) \ argument
49 OSSL_LIST_FOREACH_REV_DELSAFE_FROM(p, pn, name, ossl_list_##name##_tail(l))
52 # define OSSL_LIST(name) OSSL_LIST_ ## name argument
55 # define OSSL_LIST_MEMBER(name, type) \ argument
58 OSSL_LIST_DBG(struct ossl_list_st_ ## name *list) \
59 } ossl_list_ ## name
61 # define DECLARE_LIST_OF(name, type) \ argument
62 typedef struct ossl_list_st_ ## name OSSL_LIST(name); \
63 struct ossl_list_st_ ## name { \
68 # define DEFINE_LIST_OF_IMPL(name, type) \ argument
70 ossl_list_##name##_init(OSSL_LIST(name) *list) \
75 ossl_list_##name##_init_elem(type *elem) \
77 memset(&elem->ossl_list_ ## name, 0, \
78 sizeof(elem->ossl_list_ ## name)); \
81 ossl_list_##name##_is_empty(const OSSL_LIST(name) *list) \
86 ossl_list_##name##_num(const OSSL_LIST(name) *list) \
91 ossl_list_##name##_head(const OSSL_LIST(name) *list) \
94 || list->alpha->ossl_list_ ## name.list == list); \
98 ossl_list_##name##_tail(const OSSL_LIST(name) *list) \
101 || list->omega->ossl_list_ ## name.list == list); \
105 ossl_list_##name##_next(const type *elem) \
107 assert(elem->ossl_list_ ## name.next == NULL \
108 || elem->ossl_list_ ## name.next \
109 ->ossl_list_ ## name.prev == elem); \
110 return elem->ossl_list_ ## name.next; \
113 ossl_list_##name##_prev(const type *elem) \
115 assert(elem->ossl_list_ ## name.prev == NULL \
116 || elem->ossl_list_ ## name.prev \
117 ->ossl_list_ ## name.next == elem); \
118 return elem->ossl_list_ ## name.prev; \
121 ossl_list_##name##_remove(OSSL_LIST(name) *list, type *elem) \
123 assert(elem->ossl_list_ ## name.list == list); \
124 OSSL_LIST_DBG(elem->ossl_list_ ## name.list = NULL) \
126 list->alpha = elem->ossl_list_ ## name.next; \
128 list->omega = elem->ossl_list_ ## name.prev; \
129 if (elem->ossl_list_ ## name.prev != NULL) \
130 elem->ossl_list_ ## name.prev->ossl_list_ ## name.next = \
131 elem->ossl_list_ ## name.next; \
132 if (elem->ossl_list_ ## name.next != NULL) \
133 elem->ossl_list_ ## name.next->ossl_list_ ## name.prev = \
134 elem->ossl_list_ ## name.prev; \
136 memset(&elem->ossl_list_ ## name, 0, \
137 sizeof(elem->ossl_list_ ## name)); \
140 ossl_list_##name##_insert_head(OSSL_LIST(name) *list, type *elem) \
142 assert(elem->ossl_list_ ## name.list == NULL); \
143 OSSL_LIST_DBG(elem->ossl_list_ ## name.list = list) \
145 list->alpha->ossl_list_ ## name.prev = elem; \
146 elem->ossl_list_ ## name.next = list->alpha; \
147 elem->ossl_list_ ## name.prev = NULL; \
154 ossl_list_##name##_insert_tail(OSSL_LIST(name) *list, type *elem) \
156 assert(elem->ossl_list_ ## name.list == NULL); \
157 OSSL_LIST_DBG(elem->ossl_list_ ## name.list = list) \
159 list->omega->ossl_list_ ## name.next = elem; \
160 elem->ossl_list_ ## name.prev = list->omega; \
161 elem->ossl_list_ ## name.next = NULL; \
168 ossl_list_##name##_insert_before(OSSL_LIST(name) *list, type *e, \
171 assert(elem->ossl_list_ ## name.list == NULL); \
172 OSSL_LIST_DBG(elem->ossl_list_ ## name.list = list) \
173 elem->ossl_list_ ## name.next = e; \
174 elem->ossl_list_ ## name.prev = e->ossl_list_ ## name.prev; \
175 if (e->ossl_list_ ## name.prev != NULL) \
176 e->ossl_list_ ## name.prev->ossl_list_ ## name.next = elem; \
177 e->ossl_list_ ## name.prev = elem; \
183 ossl_list_##name##_insert_after(OSSL_LIST(name) *list, type *e, \
186 assert(elem->ossl_list_ ## name.list == NULL); \
187 OSSL_LIST_DBG(elem->ossl_list_ ## name.list = list) \
188 elem->ossl_list_ ## name.prev = e; \
189 elem->ossl_list_ ## name.next = e->ossl_list_ ## name.next; \
190 if (e->ossl_list_ ## name.next != NULL) \
191 e->ossl_list_ ## name.next->ossl_list_ ## name.prev = elem; \
192 e->ossl_list_ ## name.next = elem; \
197 struct ossl_list_st_ ## name
199 # define DEFINE_LIST_OF(name, type) \ argument
200 DECLARE_LIST_OF(name, type); \
201 DEFINE_LIST_OF_IMPL(name, type)