diff options
Diffstat (limited to 'list.h')
-rw-r--r-- | list.h | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -0,0 +1,27 @@ +#pragma once +#include <stdlib.h> + +#define LIST_SIZE_FACTOR 1.5 +struct list { + unsigned int size; + unsigned int allocated_size; + void** list; +}; + +typedef struct list LIST; + +/** +* Add an item to a list +* @list: array list structure. +* @item: item to be added to the list. +*/ +LIST* list_add(LIST* list, void* item); + +/** +* Remove an item from a given list +* @list: array list structure. +* @pos: position of item to be removed. +*/ +LIST* list_remove(LIST* list, unsigned int pos); + +void list_free(LIST* list); |