From e75d6f6b8f4512a5bbfecbfa8c17f0bb687e3d55 Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Tue, 24 Dec 2024 21:11:06 -0800 Subject: first commit --- include/array.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 include/array.h (limited to 'include/array.h') diff --git a/include/array.h b/include/array.h new file mode 100644 index 0000000..48d82db --- /dev/null +++ b/include/array.h @@ -0,0 +1,18 @@ +#ifndef ARRAY_H +#define ARRAY_H +#include +#define DEFAULT_ARR_LEN 10 +typedef struct { + void **items; + size_t size; + size_t capacity; +} array_t; + +array_t *init_array(); + +void array_push(array_t *a, void *item); + +void *array_pop(array_t *a); + +void array_free(void *a, void (*freefunc)(void *)); +#endif -- cgit