diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-03-24 23:24:15 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-03-24 23:46:48 +0100 |
commit | ee1abd5ada9b670791f7dd2d306bdbf9228fa439 (patch) | |
tree | 67c530a4918506b3c0389ec403c3abbf0a606868 /src/vcal.c | |
parent | Set up better test for recurring events. (diff) | |
download | calp-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 '')
-rw-r--r-- | src/vcal.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -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); } |