aboutsummaryrefslogtreecommitdiff
path: root/src/calendar.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/calendar.c')
-rw-r--r--src/calendar.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/calendar.c b/src/calendar.c
index 2cd25f13..a90dfe44 100644
--- a/src/calendar.c
+++ b/src/calendar.c
@@ -10,6 +10,8 @@
#include <libgen.h>
#include <libguile.h>
+#include "struct.h"
+
#include "parse.h"
#include "err.h"
@@ -45,6 +47,9 @@ int handle_file(SCM cal, char* path) {
/* NAME is the `fancy' name of the calendar. */
// vcomponent_push_val(cal, "NAME", basename(path));
// vcomponent_push_val(cal, "X-HNH-SOURCETYPE", "file");
+ SCM line = scm_make_vline();
+ scm_struct_set_x(line, vline_value, scm_from_utf8_string("file"));
+ scm_add_line_x(cal, scm_from_utf8_string("X-HNH-SOURCETYPE"), line);
char* resolved_path = realpath(path, NULL);
open_ics (resolved_path, cal);
free (resolved_path);
@@ -68,7 +73,9 @@ int handle_dir(SCM cal, char* path) {
/* NAME is the `fancy' name of the calendar. */
// vcomponent_push_val(cal, "NAME", basename(path));
- // vcomponent_push_val(cal, "X-HNH-SOURCETYPE", "vdir");
+ SCM line = scm_make_vline();
+ scm_struct_set_x(line, vline_value, scm_from_utf8_string("vdir"));
+ scm_add_line_x(cal, scm_from_utf8_string("X-HNH-SOURCETYPE"), line);
struct dirent* d;
while ((d = readdir(dir)) != NULL) {