From e13f6bb201dff690208b9cc951b5c098b0d63356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Thu, 3 Oct 2019 00:46:01 +0200 Subject: Slowly going through and fixing everything. --- src/calendar.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/calendar.c') 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 #include +#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) { -- cgit v1.2.3