72 #define ezc_list_new(self, ...) \ 73 (ezc_list_new__((self), ##__VA_ARGS__, NULL)) 86 #define ezc_list_copy(orig) \ 87 (ezc_list_copy__((orig))) 101 #define ezc_list_swap(a, b) \ 102 (ezc_list_swap__((a), (b))) 117 #define ezc_list_cat(self, ...) \ 118 (ezc_list_cat__((self), ##__VA_ARGS__, NULL)) 132 #define ezc_list_delete(self, ...) \ 133 (ezc_list_delete__((self), ##__VA_ARGS__, NULL), \ 134 SST_MAP(EZC_TO_ZERO, (self), ##__VA_ARGS__)) 136 void ezc_list_delete__(
ezc_list *
self, ...);
146 #define ezc_list_length(self) \ 147 (ezc_list_length__((self))) 149 long ezc_list_length__(
ezc_list const *
self);
165 #define ezc_list_map(self, fn, ...) \ 166 do { ezc_list *iter = (self); while (iter != NULL) { \ 167 (fn)(iter->data, ##__VA_ARGS__); iter = iter->next; \ 182 #define ezc_list_get_index_of(self, head) \ 183 (ezc_list_get_index_of__((self), (head))) 197 #define ezc_list_get_at(self, n) \ 198 (ezc_list_get_at__((self), (n))) 213 #define ezc_list_get_match(self, data) \ 214 (ezc_list_get_match_fn__((self), NULL, (data))) 232 #define ezc_list_get_match_fn(self, neq, data) \ 233 (ezc_list_get_match_fn__((self), (neq), (data))) 236 int (*neq)(
void const *,
void const *),
251 #define ezc_list_push_at(self, n, ...) \ 253 if ((self) == NULL) (self) = ezc_list_new__(__VA_ARGS__, NULL); \ 254 else ezc_list_push_at__((self), (n), ##__VA_ARGS__, NULL); \ 257 void ezc_list_push_at__(
ezc_list *
self,
long n, ...);
268 #define ezc_list_push_front(self, ...) \ 270 if ((self) == NULL) (self) = ezc_list_new__(__VA_ARGS__, NULL); \ 271 else ezc_list_push_at__((self), 0, ##__VA_ARGS__, NULL); \ 284 #define ezc_list_push_back(self, ...) \ 286 if ((self) == NULL) (self) = ezc_list_new__(__VA_ARGS__, NULL); \ 287 else ezc_list_push_at__((self), \ 288 ezc_list_length((self)), \ 306 #define ezc_list_pop_at(self, n) \ 307 (ezc_list_pop_at__(&(self), (n))) 319 #define ezc_list_pop_front(self) \ 320 (ezc_list_pop_at__(&(self), 0)) 330 #define ezc_list_pop_back(self) \ 331 (ezc_list_pop_at__(&(self), ezc_list_length__((self))-1)) 345 #define ezc_list_pop_match(self, data) \ 346 (ezc_list_pop_match_fn__((self), NULL, (data))) 365 #define ezc_list_pop_match_fn(self, neq, data, ...) \ 366 (ezc_list_pop_match_fn__((self), (neq), (data))) 369 int (*neq)(
void const *,
void const *),
380 #define ezc_list_erase_at(self, n) \ 381 (ezc_list_delete__(ezc_list_pop_at__(&(self), (n)), NULL)) 390 #define ezc_list_erase_front(self) \ 391 (ezc_list_delete__(ezc_list_pop_at__(&(self), 0), NULL)) 401 #define ezc_list_erase_back(self) \ 402 (ezc_list_delete__( \ 403 ezc_list_pop_at__(&(self), ezc_list_length__((self))-1), \ 416 #define ezc_list_erase_match(self, data) \ 417 (ezc_list_delete__(ezc_list_pop_match_fn__((self), NULL, (data)), NULL)) 435 #define ezc_list_erase_match_fn(self, neq, data, ...) \ 436 (ezc_list_delete__(ezc_list_pop_match_fn__((self), (neq), (data)), NULL)) Macros for helping you write your own featureful macros.
List item structure.
Definition: ezc_list.h:50
void * data
Definition: ezc_list.h:53
struct ezc_list * next
Definition: ezc_list.h:56
struct ezc_list ezc_list
List item structure.