diff options
author | Hugo Hörnquist <hugo@hornquist.se> | 2019-10-03 00:46:01 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@hornquist.se> | 2019-10-03 00:46:01 +0200 |
commit | e13f6bb201dff690208b9cc951b5c098b0d63356 (patch) | |
tree | 7497e7f8e367ca9cde3aaf588f65f69d31106721 /src/calendar.c | |
parent | Restore directory parsing. (diff) | |
download | calp-e13f6bb201dff690208b9cc951b5c098b0d63356.tar.gz calp-e13f6bb201dff690208b9cc951b5c098b0d63356.tar.xz |
Slowly going through and fixing everything.
Diffstat (limited to '')
-rw-r--r-- | src/calendar.c | 9 |
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) { |