From e4c5d83e418f1a045758339779fb49b635db2bdb Mon Sep 17 00:00:00 2001 From: Raghuram Subramani Date: Thu, 19 Jun 2025 16:54:34 +0530 Subject: (list): add lists --- include/list.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 include/list.h (limited to 'include') 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 +#include + +#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 -- cgit v1.2.3