aboutsummaryrefslogtreecommitdiffstats
path: root/vector.h
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2010-11-09 19:57:18 +0100
committerLars Hjemli <hjemli@gmail.com>2010-11-10 00:22:41 +0100
commit958a95b37891098133369e835a2ab687e0dfa9dc (patch)
tree31bcd62973d381b072b91da15528c48c6fc14a41 /vector.h
parent52558a6d39d52e2b2968b622534b0ffa4da285cb (diff)
Add vector utility functions
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to '')
-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 @@
+#ifndef CGIT_VECTOR_H
+#define CGIT_VECTOR_H
+
+#include <stdlib.h>
+
+struct vector {
+ size_t size;
+ size_t count;
+ size_t alloc;
+ void *data;
+};
+
+#define VECTOR_INIT(type) {sizeof(type), 0, 0, NULL}
+
+int vector_push(struct vector *vec, const void *data, int gently);
+
+#endif /* CGIT_VECTOR_H */