diff options
Diffstat (limited to 'src/include/array.h')
-rw-r--r-- | src/include/array.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/include/array.h b/src/include/array.h new file mode 100644 index 0000000..d3004e3 --- /dev/null +++ b/src/include/array.h @@ -0,0 +1,24 @@ +#ifndef ARRAY_H +#define ARRAY_H + +#include <stdlib.h> +#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_del(array_t *a, unsigned int ind); + +void array_free(void *a, void (*freefunc)(void *)); + +array_t *array_reverse(array_t *a); +#endif |