aboutsummaryrefslogtreecommitdiff
path: root/vcal.h
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-01-22 11:42:58 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2019-01-22 11:42:58 +0100
commitebe5c7e428b57dca758b1b3a1d8b7d4b423b19a9 (patch)
treebf97a4ba3a05c24ae1ec176f42656ce1608ee8d1 /vcal.h
parentAdd very simple err header. (diff)
downloadcalp-ebe5c7e428b57dca758b1b3a1d8b7d4b423b19a9.tar.gz
calp-ebe5c7e428b57dca758b1b3a1d8b7d4b423b19a9.tar.xz
Start using trie's instead of hash-maps.
Diffstat (limited to 'vcal.h')
-rw-r--r--vcal.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/vcal.h b/vcal.h
index 285d2d0b..0876e0a9 100644
--- a/vcal.h
+++ b/vcal.h
@@ -24,21 +24,20 @@ typedef struct {
} content_line;
#define TYPE content_line
-#include "hash.h"
+// #include "hash.h"
+#include "trie.h"
#undef TYPE
-struct s_vevent {
+typedef struct s_vevent {
/*
strbuf dtstart;
strbuf dtend;
strbuf summary;
strbuf description;
*/
- TABLE(content_line) clines;
-};
-
-struct s_vevent;
-typedef struct s_vevent vevent;
+ // TABLE(content_line) clines;
+ TRIE(content_line) clines;
+} vevent;
int CONSTRUCTOR_DECL(vevent, int init_size);
@@ -69,12 +68,15 @@ int free_vevent(vevent* ev);
typedef struct {
size_t n_events;
size_t alloc;
- vevent* events;
+ vevent** events;
} vcalendar;
int CONSTRUCTOR_DECL(vcalendar);
int free_vcalendar (vcalendar* cal);
+/*
+ * Appends ev to cal. Doesn't copy ev
+ */
int push_event(vcalendar* cal, vevent* ev);
#endif /* VCAL_H */