summaryrefslogtreecommitdiffstats
path: root/wv_vec.h
blob: 721856b8bf20a9982fa2ad3189ea6fc2427c5922 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef WV_VEC_H
#define WV_VEC_H

#include <stddef.h>
#include <stdlib.h>

struct wv_vec {
	void	*data;
	size_t	len;
	size_t	cap;
	size_t	unit_size;
};

void wv_vec_init(struct wv_vec *v, size_t unit_size);
void wv_vec_push(struct wv_vec *v, const void *item);
void *wv_vec_pop(struct wv_vec *v);
void *wv_vec_last(struct wv_vec *v);
void wv_vec_free(struct wv_vec *v);

#endif /* WV_VEC_H */