feature: Added structure for ArrayListSlices

This commit is contained in:
2026-04-19 12:32:11 -06:00
parent 1ca3defacc
commit 4b2389ad62
2 changed files with 10 additions and 9 deletions

View File

@@ -7,15 +7,7 @@
typedef struct ArrayList ArrayList;
// FUCK, i forgot one of the main reasons i wanted to
// implement arrays myself was because i needed
// array slices or something like this and i completely
// forgot, fuck, guess i will implement it once i get
// the tests done.
typedef struct {
ArrayList *array;
size_t offset;
} ArrayListSlice;
typedef struct ArrayListSlice ArrayListSlice;
typedef enum {
ARRLIST_OK = 0,
@@ -26,6 +18,7 @@ typedef enum {
ARRLIST_NULL_ARG,
ARRLIST_INVALID_ELEM_SIZE,
ARRLIST_INVALID_CAPACITY,
ARRLIST_IS_BORROWED,
} ArrayListErr;
ArrayList *arraylist_init(size_t capacity, size_t elem_size);