aboutsummaryrefslogtreecommitdiff
path: root/vcal.h
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-01-19 19:06:09 +0100
committerHugo Hörnquist <hugo@hornquist.se>2019-01-19 19:06:14 +0100
commitc42c2834d8c7b5d81465b9d9d127d8384151b9cb (patch)
tree53b1a8eb0368d5f91525604eea2c3173083c1955 /vcal.h
parentCan now parse entire directory in one go. (diff)
downloadcalp-c42c2834d8c7b5d81465b9d9d127d8384151b9cb.tar.gz
calp-c42c2834d8c7b5d81465b9d9d127d8384151b9cb.tar.xz
[BROKEN] Work on adding hash tables.
Diffstat (limited to 'vcal.h')
-rw-r--r--vcal.h43
1 files changed, 38 insertions, 5 deletions
diff --git a/vcal.h b/vcal.h
index e5f4cf7f..8335cbc4 100644
--- a/vcal.h
+++ b/vcal.h
@@ -5,17 +5,50 @@
#include "strbuf.h"
+typedef struct {
+ string key;
+ string value;
+ string* vals;
+ int val_count;
+} parameter;
-/*
- * It's intentionall that there is no vevent_init. That since
- * the length of the strings isn't known.
- */
typedef struct {
+ string key;
+ string val;
+
+ string* aux_values;
+ int value_count;
+
+ parameter* params;
+ int param_count;
+} content_line;
+
+#define TYPE content_line
+#include "hash.h"
+#undef TYPE
+
+struct s_vevent {
+ /*
string dtstart;
string dtend;
string summary;
string description;
-} vevent;
+ */
+ TABLE(content_line) clines;
+};
+
+struct s_vevent;
+typedef struct s_vevent vevent;
+
+int vevent_init (vevent* ev, int init_size);
+
+int init_content_line (content_line* c, int keylen, int vallen);
+int content_line_free (content_line* c);
+int content_line_copy (content_line* dest, content_line* src);
+
+content_line* get_property (vevent* ev, char* key);
+
+int add_content_line (vevent* ev, content_line* c);
/*
* Deep copy from src -> dest