12 #ifndef INCLUDE_LIST_H_ 13 #define INCLUDE_LIST_H_ struct list list_t
Dynamically growing list, elems is always NULL terminated, call list_ensure_size() to alloc elems...
void list_remove(list_t *list, size_t idx, list_elem_free_fn elem_free)
Remove element from the list, frees element with fn.
Definition: list.c:41
void list_ensure_size(list_t *list, size_t min_size)
Alloc elems if needed and ensure the list has room for at least min_size elements.
Definition: list.c:15
void list_clear(list_t *list, list_elem_free_fn elem_free)
Clear the list, frees each element with fn, does not free backing or list itself. ...
Definition: list.c:55
void ** elems
Definition: list.h:19
void(* list_elem_free_fn)(void *)
Definition: list.h:24
void list_free_elems(list_t *list, list_elem_free_fn elem_free)
Clear the list, free backing, does not free list itself.
Definition: list.c:68
void list_push(list_t *list, void *p)
Add to the end of elems, allocs or grows the list if needed and ensures the list has a terminating NU...
Definition: list.c:25
Dynamically growing list, elems is always NULL terminated, call list_ensure_size() to alloc elems...
Definition: list.h:18
size_t len
Definition: list.h:21
void list_push_all(list_t *list, void **p)
Adds all elements of a NULL terminated list to the end of elems, allocs or grows the list if needed a...
Definition: list.c:35
size_t size
Definition: list.h:20