aboutsummaryrefslogtreecommitdiff
path: root/vector.h
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-02-08 21:13:08 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2019-02-08 21:23:31 +0100
commit8e2d4025fc02e07866869a33ccc686f87389cb36 (patch)
tree2af14e4713d88024597add14106d565055317cb4 /vector.h
parentMade root of graphviz output gray. (diff)
downloadcalp-8e2d4025fc02e07866869a33ccc686f87389cb36.tar.gz
calp-8e2d4025fc02e07866869a33ccc686f87389cb36.tar.xz
V{calendar,event} merged into vcomponent, making it symmetic.
Diffstat (limited to 'vector.h')
-rw-r--r--vector.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/vector.h b/vector.h
new file mode 100644
index 00000000..f6acd66a
--- /dev/null
+++ b/vector.h
@@ -0,0 +1,27 @@
+#ifndef VECTOR_H
+#define VECTOR_H
+
+#include <stdlib.h>
+#include "macro.h"
+
+#define VECT(T) TEMPL(vect, T)
+
+#endif /* VECTOR_H */
+
+#ifdef TYPE
+
+typedef struct {
+ unsigned int length;
+ unsigned int alloc;
+ TYPE** items;
+} VECT(TYPE);
+
+INIT_F(VECT(TYPE));
+FREE_F(VECT(TYPE));
+
+int PUSH(VECT(TYPE))(VECT(TYPE)*, TYPE*);
+TYPE* GET(VECT(TYPE))(VECT(TYPE)*, unsigned int idx);
+int EMPTY(VECT(TYPE))(VECT(TYPE)*);
+unsigned int SIZE(VECT(TYPE))(VECT(TYPE)*);
+
+#endif /* TYPE */