diff options
author | Preston Pan <ret2pop@gmail.com> | 2024-12-28 16:47:43 -0800 |
---|---|---|
committer | Preston Pan <ret2pop@gmail.com> | 2024-12-28 16:47:43 -0800 |
commit | 1fd608288ee47c2c560817f12f14b21069fed2f6 (patch) | |
tree | e6460b92dba5bb0d089c8c2a4e794e3504098359 /src/include/array.h | |
parent | 63f11aaec8d21844a07fd27003a992c102a3a297 (diff) |
makefile and directory structure change completely to build client and server
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 |