From 4b2ec7c721eae2b95e57ee09ba5234abdb9755dc Mon Sep 17 00:00:00 2001 From: realtradam Date: Mon, 1 Aug 2022 12:10:25 -0400 Subject: init --- arraylist.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 arraylist.h (limited to 'arraylist.h') diff --git a/arraylist.h b/arraylist.h new file mode 100644 index 0000000..7a1f08e --- /dev/null +++ b/arraylist.h @@ -0,0 +1,20 @@ +#ifndef ARRAYLIST_H +#define ARRAYLIST_H + +#include + +typedef struct array_list_type Arraylist; + +Arraylist* al_create(int type_size); +void al_free(Arraylist* al); +void* al_access(Arraylist* al, int position); +bool al_push(Arraylist* al, void* item); +void al_delete_last(Arraylist* al); +bool al_delete_at(Arraylist *al, int position); +bool al_allocate_at_least(Arraylist* al, int size); +int al_len(Arraylist* al); + +// give 2 indexes, moves source to overwrite the target +bool al_overwrite_and_delete(Arraylist* al, int source, int target); + +#endif -- cgit v1.2.3