65 for(l = *list; l->next != NULL; l = l->next);
78 ((
struct list *)item)->next = NULL;
95 ((
struct list *)item)->next = *list;
107 if(((
struct list *)*list)->next == NULL) {
113 for(l = *list; l->next->next != NULL; l = l->next);
127 *list = ((
struct list *)*list)->next;
143 for(l = *list; l != NULL; l = l->next) {
165 for(l = *list; l != NULL; l = l->next) {
175 if(previtem == NULL) {
179 ((
struct list *)newitem)->next = ((
struct list *)previtem)->next;
180 ((
struct list *)previtem)->next = newitem;
188 for(l = *list; l != NULL; l = l->next) {
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_t
The linked list type.
void list_push(list_t list, void *item)
Add an item to the start of the 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_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.
Linked list manipulation routines.