diff options
Diffstat (limited to 'src/util/vec.h')
| -rw-r--r-- | src/util/vec.h | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/util/vec.h b/src/util/vec.h index 5524947..889b649 100644 --- a/src/util/vec.h +++ b/src/util/vec.h @@ -3,6 +3,7 @@ #include <stddef.h> +#include "../error.h" #include "alloc.h" static const size_t LEO_Vec_GROWTH_FACTOR_NUMER = 3; @@ -17,22 +18,12 @@ typedef struct { size_t capacity; } LEO_Vec; -typedef enum { - LEO_Vec_OK = 0, - LEO_Vec_NULL_VEC_POINTER = 1, - LEO_Vec_NULL_ITEM_POINTER = 2, - LEO_Vec_INVALID_ITEM_SIZE = 3, - LEO_Vec_ALLOCATION_FAILURE = 4, - LEO_Vec_TOO_BIG = 5, - LEO_Vec_OUT_OF_BOUNDS = 6, -} LEO_Vec_Error; - -LEO_Vec_Error LEO_Vec_init (LEO_Vec *vec, size_t item_size, +LEO_Error LEO_Vec_init (LEO_Vec *vec, size_t item_size, LEO_Allocator allocator); -void LEO_Vec_free (LEO_Vec *vec); -LEO_Vec_Error LEO_Vec_push (LEO_Vec *vec, const void *item); -LEO_Vec_Error LEO_Vec_pop (LEO_Vec *vec, void *item); -LEO_Vec_Error LEO_Vec_get (LEO_Vec *vec, size_t i, void *item); +void LEO_Vec_free (LEO_Vec *vec); +LEO_Error LEO_Vec_push (LEO_Vec *vec, const void *item); +LEO_Error LEO_Vec_pop (LEO_Vec *vec, void *item); +LEO_Error LEO_Vec_get (LEO_Vec *vec, size_t i, void *item); #endif |
