From 958a95b37891098133369e835a2ab687e0dfa9dc Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Tue, 9 Nov 2010 19:57:18 +0100 Subject: Add vector utility functions Signed-off-by: Lars Hjemli --- vector.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 vector.h (limited to 'vector.h') 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 + +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 */ -- cgit v1.2.3-70-g09d2