aboutsummaryrefslogtreecommitdiff
path: root/src/vector.h
blob: 8df3af1832b57564b5596d32dc541d7c8f23ea0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef UNJA_VECTOR_H
#define UNJA_VECTOR_H

#include <sys/types.h>

#ifndef VECTOR_GROW_RATE
#define VECTOR_GROW_RATE 2
#endif

struct vector {
    void **values;
    size_t size;
    size_t cap;
};

struct vector *vector_new(size_t cap);

size_t vector_push(struct vector *vec, void *value);

void vector_free(struct vector *vec);

#endif