summaryrefslogtreecommitdiffstats
path: root/vec.h
blob: df00da2132f4e811b6596160d88a9ee1023eb680 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef VEC_H
#define VEC_H

#include <stddef.h>

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

void vec_init(struct vec *v, size_t unit_size);
void vec_push(struct vec *v, const void *item);
void *vec_pop(struct vec *v);
void *vec_top(struct vec *v);
void vec_free(struct vec *v);

#endif /* VEC_H */