72#define LIST_CONCAT2(s1, s2) s1##s2
73#define LIST_CONCAT(s1, s2) LIST_CONCAT2(s1, s2)
90 static void *LIST_CONCAT(name,_list) = NULL; \
91 static list_t name = (list_t)&LIST_CONCAT(name,_list)
111#define LIST_STRUCT(name) \
112 void *LIST_CONCAT(name,_list); \
125#define LIST_STRUCT_INIT(struct_ptr, name) \
127 (struct_ptr)->name = &((struct_ptr)->LIST_CONCAT(name,_list)); \
128 (struct_ptr)->LIST_CONCAT(name,_list) = NULL; \
129 list_init((struct_ptr)->name); \
void list_init(list_t list)
Initialize a list.
void * list_chop(list_t list)
Remove the last object on the list.
int list_length(const_list_t list)
Get the length of a list.
void list_add(list_t list, void *item)
Add an item at the end of a list.
void list_remove(list_t list, const void *item)
Remove a specific element from a list.
void * list_pop(list_t list)
Remove the first object on a list.
void * list_item_next(const void *item)
Get the next item following this item.
void ** list_t
The linked list type.
void list_push(list_t list, void *item)
Add an item to the start of the list.
void * list_head(const_list_t list)
Get a pointer to the first element of a list.
bool list_contains(const_list_t list, const void *item)
Check if the list contains an item.
void *const * const_list_t
The non-modifiable linked list type.
void list_copy(list_t dest, const_list_t src)
Duplicate a list.
void * list_tail(const_list_t list)
Get the tail of a list.
void list_insert(list_t list, void *previtem, void *newitem)
Insert an item after a specified item on the list.