diff options
author | Tucker Evans <tucker@tuckerevans.com> | 2020-07-04 23:22:28 -0400 |
---|---|---|
committer | Tucker Evans <tucker@tuckerevans.com> | 2020-07-04 23:22:28 -0400 |
commit | 8f17093d39db99acd88405873af90b4bfd428a64 (patch) | |
tree | 0faa11c9d73bf91b877feec97d93d55ad171dd8a /collections/vector/vector.h | |
parent | 0fb0ae61369464e9b2b76039eb074806c50e4474 (diff) | |
parent | f824589fa4b0ba111df624a8927c899bc1e0ca20 (diff) |
Merge branch 'develop'v0.2
Diffstat (limited to 'collections/vector/vector.h')
-rw-r--r-- | collections/vector/vector.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/collections/vector/vector.h b/collections/vector/vector.h new file mode 100644 index 0000000..4d6d04c --- /dev/null +++ b/collections/vector/vector.h @@ -0,0 +1,37 @@ +#ifndef VECTOR_H +#define VECTOR_H + +typedef struct vector vec; + +/*constructors*/ +vec* vec_new(); +vec* vec_with_capacity(int); + +/*management*/ +int vec_size(vec*); +int vec_capacity(vec*); +vec* vec_cp(vec*); +void vec_print(vec*, char* (void*)); + +/*data*/ +void vec_push(vec*, void*); +void* vec_pop(vec*); +void* vec_back(vec*); + +void vec_set(vec*, int, void*); +void* vec_index(vec*, int); + +void vec_insert(vec*, int, void*); +void* vec_remove(vec*, int); + +void vec_swap(vec*, int, int); +void* vec_swap_pop(vec*, int); + + +/*memory*/ +void vec_truncate(vec*, int); +void vec_reserve(vec*, int); + +void vec_clear(vec*); +void vec_free(vec*); +#endif |