2018-01-17 19:22:57 +01:00
|
|
|
#ifndef VECTOR_H
|
|
|
|
#define VECTOR_H
|
|
|
|
|
2018-05-06 15:36:53 +02:00
|
|
|
#include "fort_utils.h"
|
2018-01-17 19:22:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
#define INVALID_VEC_INDEX ((size_t) -1)
|
|
|
|
|
2018-09-01 18:42:57 +02:00
|
|
|
FT_INTERNAL
|
2019-08-27 14:04:54 +02:00
|
|
|
f_vector_t *create_vector(size_t item_size, size_t capacity);
|
2018-09-01 18:42:57 +02:00
|
|
|
|
|
|
|
FT_INTERNAL
|
2019-08-27 14:04:54 +02:00
|
|
|
void destroy_vector(f_vector_t *);
|
2018-09-01 18:42:57 +02:00
|
|
|
|
|
|
|
FT_INTERNAL
|
2019-08-27 14:04:54 +02:00
|
|
|
size_t vector_size(const f_vector_t *);
|
2018-09-01 18:42:57 +02:00
|
|
|
|
|
|
|
FT_INTERNAL
|
2019-08-27 14:04:54 +02:00
|
|
|
size_t vector_capacity(const f_vector_t *);
|
2018-01-17 19:22:57 +01:00
|
|
|
|
2018-09-01 18:42:57 +02:00
|
|
|
FT_INTERNAL
|
2019-08-27 14:04:54 +02:00
|
|
|
int vector_push(f_vector_t *, const void *item);
|
2018-01-17 19:22:57 +01:00
|
|
|
|
2018-09-01 18:42:57 +02:00
|
|
|
FT_INTERNAL
|
2019-08-27 14:04:54 +02:00
|
|
|
const void *vector_at_c(const f_vector_t *vector, size_t index);
|
2018-09-01 18:42:57 +02:00
|
|
|
|
|
|
|
FT_INTERNAL
|
2019-08-27 14:04:54 +02:00
|
|
|
void *vector_at(f_vector_t *, size_t index);
|
2018-09-01 18:42:57 +02:00
|
|
|
|
|
|
|
FT_INTERNAL
|
2019-08-27 14:04:54 +02:00
|
|
|
f_status vector_swap(f_vector_t *cur_vec, f_vector_t *mv_vec, size_t pos);
|
2018-01-17 19:22:57 +01:00
|
|
|
|
2018-11-02 22:16:20 +01:00
|
|
|
|
|
|
|
#ifdef FT_TEST_BUILD
|
2019-08-27 14:04:54 +02:00
|
|
|
f_vector_t *copy_vector(f_vector_t *);
|
|
|
|
size_t vector_index_of(const f_vector_t *, const void *item);
|
|
|
|
int vector_erase(f_vector_t *, size_t index);
|
|
|
|
void vector_clear(f_vector_t *);
|
2018-09-01 18:42:57 +02:00
|
|
|
#endif
|
|
|
|
|
2018-03-09 10:44:16 +01:00
|
|
|
#endif /* VECTOR_H */
|