aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/calendar.c24
-rw-r--r--src/guile_interface.scm.c2
-rw-r--r--src/parse.c3
-rw-r--r--src/vcal.c6
4 files changed, 22 insertions, 13 deletions
diff --git a/src/calendar.c b/src/calendar.c
index d7c2d7dd..2c21bd11 100644
--- a/src/calendar.c
+++ b/src/calendar.c
@@ -49,8 +49,12 @@ int handle_file(vcomponent* cal, char* path) {
strbuf_load (&sourcetype, "X-HNH-SOURCETYPE");
const char* bname = basename(path);
- vcomponent_push_val(cal, &name, scm_from_utf8_stringn (bname, strlen(bname)));
- vcomponent_push_val(cal, &sourcetype, scm_from_utf8_symbol("file"));
+ vcomponent_push_val(cal, &name,
+ scm_cons (scm_from_utf8_stringn (bname, strlen(bname)),
+ SCM_BOOL_F));
+ vcomponent_push_val(cal, &sourcetype,
+ scm_cons (scm_from_utf8_symbol("file"),
+ SCM_BOOL_F));
char* resolved_path = realpath(path, NULL);
open_ics (resolved_path, cal);
free (resolved_path);
@@ -81,8 +85,12 @@ int handle_dir(vcomponent* cal, char* path) {
const char* bname = basename(path);
/* NAME is the `fancy' name of the calendar. */
- vcomponent_push_val(cal, &name, scm_from_utf8_stringn(bname, strlen(bname)));
- vcomponent_push_val(cal, &sourcetype, scm_from_utf8_symbol("vdir"));
+ vcomponent_push_val(cal, &name,
+ scm_cons(scm_from_utf8_stringn(bname, strlen(bname)),
+ SCM_BOOL_F));
+ vcomponent_push_val(cal, &sourcetype,
+ scm_cons(scm_from_utf8_symbol("vdir"),
+ SCM_BOOL_F));
FREE(strbuf)(&name);
FREE(strbuf)(&sourcetype);
@@ -110,7 +118,9 @@ int handle_dir(vcomponent* cal, char* path) {
fclose(f);
SNEW(strbuf, color);
strbuf_load (&color, "COLOR");
- vcomponent_push_val(cal, &color, scm_from_utf8_stringn(info_buf, strlen(info_buf)));
+ vcomponent_push_val(cal, &color,
+ scm_cons(scm_from_utf8_stringn(info_buf, strlen(info_buf)),
+ SCM_BOOL_F));
FREE(strbuf)(&color);
} else if (strcmp (d->d_name, "displayname") == 0) {
f = fopen(resolved_path, "r");
@@ -127,7 +137,9 @@ int handle_dir(vcomponent* cal, char* path) {
*/
SNEW(strbuf, name);
strbuf_load (&name, "NAME");
- vcomponent_push_val(cal, &name, scm_from_utf8_stringn(info_buf, strlen(info_buf)));
+ vcomponent_push_val(cal, &name,
+ scm_cons(scm_from_utf8_stringn(info_buf, strlen(info_buf)),
+ SCM_BOOL_F));
FREE(strbuf)(&name);
} else {
open_ics (resolved_path, cal);
diff --git a/src/guile_interface.scm.c b/src/guile_interface.scm.c
index 7828389f..e54b81d5 100644
--- a/src/guile_interface.scm.c
+++ b/src/guile_interface.scm.c
@@ -222,7 +222,7 @@ SCM_DEFINE(vcomponent_set_type_x, "%vcomponent-set-type!", 2, 0, 0,
if (comp->type) free (comp->type);
- char* ntype = scm_to_utf8_stringn (type, NULL);
+ char* ntype = scm_to_utf8_stringn (scm_symbol_to_string(type), NULL);
comp->type = calloc(sizeof(*ntype), strlen(ntype) + 1);
strcpy(comp->type, ntype);
diff --git a/src/parse.c b/src/parse.c
index d9a75296..cd64e192 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -46,9 +46,7 @@ int parse_file(char* filename, FILE* f, vcomponent* root) {
TRANSFER(&cline_val, &ctx.str);
/* Actuall end of line, handle value */
- INFO_F("cp: %p", content_pair);
handle_kv(&cline_key, &cline_val, &content_pair, &ctx);
- INFO_F("cp: %p", content_pair);
p_ctx = p_key;
} /* Else continue on current line */
@@ -154,7 +152,6 @@ int handle_kv (
strbuf_cap (key);
strbuf_cap (val);
- INFO_F("%s: %s", key->mem, val->mem);
/*
* The key being BEGIN means that we decend into a new component.
diff --git a/src/vcal.c b/src/vcal.c
index f9f2cb75..208a47a9 100644
--- a/src/vcal.c
+++ b/src/vcal.c
@@ -47,7 +47,7 @@ INIT_F(vcomponent) {
// vcomponent_push_val (self, "X-HNH-FILENAME", "VIRTUAL");
SNEW(strbuf, s);
strbuf_load(&s, "X-HNH-SOURCETYPE");
- vcomponent_push_val (self, &s, scm_from_utf8_symbol("virtual"));
+ vcomponent_push_val (self, &s, scm_cons(scm_from_utf8_symbol("virtual"), SCM_BOOL_F));
FREE(strbuf)(&s);
char* type = "VIRTUAL";
self->type = (char*) calloc(sizeof(*type), strlen(type) + 1);
@@ -85,7 +85,7 @@ INIT_F(vcomponent, const char* type, const char* filename) {
*/
SNEW(strbuf, fname);
strbuf_load (&fname, "X-HNH-FILENAME");
- vcomponent_push_val (self, &fname, scm_from_utf8_stringn(filename, strlen(filename)));
+ vcomponent_push_val (self, &fname, scm_cons(scm_from_utf8_stringn(filename, strlen(filename)), SCM_BOOL_F));
}
self->type = (char*) calloc(sizeof(*type), strlen(type) + 1);
@@ -195,7 +195,7 @@ int vcomponent_push_val (vcomponent* comp, strbuf* key, SCM val) {
SCM k = scm_string_to_symbol (scm_from_utf8_stringn (key->mem, key->len));
// TODO this should cons
- scm_hashq_set_x (comp->clines, k, val);
+ scm_hashq_set_x (comp->clines, k, scm_list_1 (val));
return 0;
}