aboutsummaryrefslogtreecommitdiffstats
path: root/vector.h
diff options
context:
space:
mode:
authorLars Hjemli2010-11-09 19:57:18 +0100
committerLars Hjemli2010-11-10 00:22:41 +0100
commit958a95b37891098133369e835a2ab687e0dfa9dc (patch)
tree31bcd62973d381b072b91da15528c48c6fc14a41 /vector.h
parent52558a6d39d52e2b2968b622534b0ffa4da285cb (diff)
downloadcgit-958a95b37891098133369e835a2ab687e0dfa9dc.tar.gz
cgit-958a95b37891098133369e835a2ab687e0dfa9dc.tar.bz2
cgit-958a95b37891098133369e835a2ab687e0dfa9dc.zip
Add vector utility functions
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'vector.h')
-rw-r--r--vector.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/vector.h b/vector.h
new file mode 100644
index 0000000..c64eb1f
--- /dev/null
+++ b/vector.h
@@ -0,0 +1,17 @@
1#ifndef CGIT_VECTOR_H
2#define CGIT_VECTOR_H
3
4#include <stdlib.h>
5
6struct vector {
7 size_t size;
8 size_t count;
9 size_t alloc;
10 void *data;
11};
12
13#define VECTOR_INIT(type) {sizeof(type), 0, 0, NULL}
14
15int vector_push(struct vector *vec, const void *data, int gently);
16
17#endif /* CGIT_VECTOR_H */