diff options
Diffstat (limited to '')
-rw-r--r-- | src/calendar.c | 6 | ||||
-rw-r--r-- | src/parse.c | 9 | ||||
-rw-r--r-- | src/struct.h | 2 | ||||
-rw-r--r-- | src/struct.scm.c | 13 |
4 files changed, 15 insertions, 15 deletions
diff --git a/src/calendar.c b/src/calendar.c index a90dfe44..7d8d598e 100644 --- a/src/calendar.c +++ b/src/calendar.c @@ -47,8 +47,7 @@ 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 line = scm_make_vline(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); @@ -73,8 +72,7 @@ int handle_dir(SCM cal, char* path) { /* NAME is the `fancy' name of the calendar. */ // vcomponent_push_val(cal, "NAME", basename(path)); - SCM line = scm_make_vline(); - scm_struct_set_x(line, vline_value, scm_from_utf8_string("vdir")); + SCM line = scm_make_vline(scm_from_utf8_string("vdir")); scm_add_line_x(cal, scm_from_utf8_string("X-HNH-SOURCETYPE"), line); struct dirent* d; diff --git a/src/parse.c b/src/parse.c index 48b58b95..8c370958 100644 --- a/src/parse.c +++ b/src/parse.c @@ -69,7 +69,7 @@ int parse_file(char* filename, FILE* f, SCM root) { SNEW(strbuf, str); SCM component = root; - SCM line = scm_make_vline(); + SCM line = scm_make_vline(SCM_UNDEFINED); SCM attr_key; /* string */ SCM line_key = scm_from_utf8_string(""); /* string */ @@ -98,9 +98,8 @@ int parse_file(char* filename, FILE* f, SCM root) { /* TODO it should be possible to create this object once at the top of this function */ - SCM templine = scm_make_vline(); - scm_struct_set_x(templine, vline_value, - scm_from_utf8_stringn(filename, strlen(filename))); + SCM templine = + scm_make_vline(scm_from_utf8_stringn(filename, strlen(filename))); scm_add_line_x(child, scm_from_utf8_string("X-HNH-FILENAME"), templine); @@ -120,7 +119,7 @@ int parse_file(char* filename, FILE* f, SCM root) { INFO_F("Adding attribute [%s]", str.mem); scm_struct_set_x(line, vline_value, scm_from_strbuf(&str)); scm_add_line_x(component, line_key, line); - line = scm_make_vline(); + line = scm_make_vline(SCM_UNDEFINED); } strbuf_soft_reset (&str); diff --git a/src/struct.h b/src/struct.h index d39cf471..a66dc201 100644 --- a/src/struct.h +++ b/src/struct.h @@ -17,7 +17,7 @@ SCM scm_make_vcomponent(SCM); SCM scm_add_line_x (SCM, SCM, SCM); SCM scm_add_child_x (SCM, SCM); -SCM scm_make_vline (); +SCM scm_make_vline (SCM); SCM scm_add_attribute_x (SCM, SCM, SCM); #endif /* STRUCT_H */ diff --git a/src/struct.scm.c b/src/struct.scm.c index 9b11696d..a8e7b3c6 100644 --- a/src/struct.scm.c +++ b/src/struct.scm.c @@ -28,7 +28,7 @@ SCM_DEFINE(scm_parse_cal_path, "parse-cal-path", 1, 0, 0, (SCM path), "") { - SCM root = scm_make_vcomponent(SCM_UNSPECIFIED); + SCM root = scm_make_vcomponent(SCM_UNDEFINED); char* p = scm_to_utf8_stringn(path, NULL); read_vcalendar(root, p); @@ -58,12 +58,15 @@ SCM_DEFINE(scm_add_child_x, "add-child!", 2, 0, 0, } -SCM_DEFINE(scm_make_vline, "make-vline", 0, 0, 0, - (), "") +SCM_DEFINE(scm_make_vline, "make-vline", 0, 1, 0, + (SCM value), "") { + + if (SCM_UNBNDP (value)) value = SCM_BOOL_F; + return scm_make_struct_no_tail - (vline_vtable, - scm_list_2(SCM_BOOL_F, scm_make_hash_table(scm_from_int(0x10)))); + (vline_vtable, + scm_list_2(value, scm_make_hash_table(scm_from_int(0x10)))); } |