-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvec.h
33 lines (19 loc) · 738 Bytes
/
vec.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef COLLECTIONS_VEC_H
#define COLLECTIONS_VEC_H
#include <stdlib.h>
struct vec_t {
size_t capacity;
size_t length;
size_t size;
void **items;
};
void vec_init(struct vec_t *const vec, size_t size);
void vec_push(struct vec_t *const vec, void const *const item);
void vec_insert(struct vec_t *const vec, void const *const restrict item, size_t index);
void vec_remove(struct vec_t *const vec, size_t index);
void *vec_get(struct vec_t const *const vec, size_t index);
void vec_concat(struct vec_t *const dest, struct vec_t const *const src);
void vec_copy(struct vec_t *dest, struct vec_t const *const src);
void vec_clear(struct vec_t *const vec);
void vec_drop(struct vec_t *const vec);
#endif // COLLECTIONS_VEC_H