84#define MPS_LIST_FOREACH(type, local_var, list) \
85 for (type *__mps_local_iterator = (type*)mps_list_first (list), \
86 *local_var = (type*)mps_list_element_value ((mps_list_element*)__mps_local_iterator); \
87 __mps_local_iterator != NULL; \
88 __mps_local_iterator = (type*)mps_list_element_next ((mps_list_element*)__mps_local_iterator), \
89 local_var = (type*)mps_list_element_value ((mps_list_element*)__mps_local_iterator))
void mps_list_free(mps_list *list)
Free a list and all the elements inside it.
Definition: list.c:31
mps_list * mps_list_new(void)
Create a new empty list.
Definition: list.c:17
int mps_list_size(mps_list *list)
Return the number of elements in a list.
Definition: list.c:47
void * value
The value pointed by this list element. Note that holding this pointer in the first field of the stru...
Definition: list.h:31
struct mps_list_element * previous
The previous element in the list.
Definition: list.h:47
struct mps_list_element * next
The next element in the list.
Definition: list.h:39
mps_list_element * first
A pointer to the first element of the list.
Definition: list.h:54
int size
The number of element of the list.
Definition: list.h:64
mps_list_element * last
A pointer to the last element of the list.
Definition: list.h:59