diff options
| author | Raghuram Subramani <raghus2247@gmail.com> | 2025-06-19 16:54:34 +0530 |
|---|---|---|
| committer | Raghuram Subramani <raghus2247@gmail.com> | 2025-06-19 16:54:34 +0530 |
| commit | e4c5d83e418f1a045758339779fb49b635db2bdb (patch) | |
| tree | 8fdf2fda83f88a12ab971968eee81a7edf8b48d5 /include | |
| parent | 2ab610ffa95df79dcb3bcea2328b49234c65e372 (diff) | |
(list): add lists
Diffstat (limited to 'include')
| -rw-r--r-- | include/list.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/list.h b/include/list.h new file mode 100644 index 0000000..e8df51c --- /dev/null +++ b/include/list.h @@ -0,0 +1,22 @@ +#ifndef __LIST_H +#define __LIST_H + +#include <stddef.h> +#include <stdint.h> + +#define START_SIZE 100 +#define INCREMENT_BY 25 + +typedef struct { + size_t element_size; + size_t max; + size_t size; + uint8_t *elements; +} list_t; + +list_t *list_create(size_t element_size); +void list_add(list_t *list, void *element); +void *list_get(list_t *list, size_t i); +void list_delete(list_t *list); + +#endif |
