From ee1abd5ada9b670791f7dd2d306bdbf9228fa439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 24 Mar 2019 23:24:15 +0100 Subject: Add VIRTUAL vcomponents. VIRTUAL vcomponents are vcomponents created without a source. Their primiary purpose is for creating brand new events, which will later be dumped to the proper files. They can however also be used in testing for great effect. --- src/vcal.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/vcal.c') diff --git a/src/vcal.c b/src/vcal.c index fdb68d54..2a610187 100644 --- a/src/vcal.c +++ b/src/vcal.c @@ -34,7 +34,12 @@ INIT_F(vcomponent) { INIT(TRIE(content_line), &self->clines); INIT(LLIST(vcomponent), &self->components); - self->type = NULL; + // vcomponent_push_val (self, "X-HNH-FILENAME", "VIRTUAL"); + vcomponent_push_val (self, "X-HNH-SOURCETYPE", "virtual"); + char* type = "VIRTUAL"; + self->type = (char*) calloc(sizeof(*type), strlen(type) + 1); + strcpy(self->type, type); + self->parent = NULL; self->scm = NULL; @@ -52,6 +57,15 @@ INIT_F(vcomponent, const char* type, const char* filename) { INIT(LLIST(vcomponent), &self->components); if (filename != NULL) { + /* + * NOTE + * RFC-7986 adds additional parameters linked to this one. + * - `SOURCE' :: where a (possibly) updated version of the data can be + * found + * - `URL' :: Where the same data can be fonud, but + * differently (but not where the original data can be fonud + * agani). + */ vcomponent_push_val (self, "X-HNH-FILENAME", filename); } -- cgit v1.2.3