aboutsummaryrefslogtreecommitdiff
path: root/src/vcal.c
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-03-24 23:24:15 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2019-03-24 23:46:48 +0100
commitee1abd5ada9b670791f7dd2d306bdbf9228fa439 (patch)
tree67c530a4918506b3c0389ec403c3abbf0a606868 /src/vcal.c
parentSet up better test for recurring events. (diff)
downloadcalp-ee1abd5ada9b670791f7dd2d306bdbf9228fa439.tar.gz
calp-ee1abd5ada9b670791f7dd2d306bdbf9228fa439.tar.xz
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.
Diffstat (limited to 'src/vcal.c')
-rw-r--r--src/vcal.c16
1 files changed, 15 insertions, 1 deletions
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);
}