/* Add all recurrences */
rrule = icalcomponent_get_first_property(comp, ICAL_RRULE_PROPERTY);
+
+ /* One-time event */
+ if (!rrule) {
+ icalarray_append(array, &(ical_inst){
+ .cal = cal,
+ .comp = comp,
+ .start = cstart,
+ .end = cend,
+ });
+ }
+
+ /* Recurring events */
while (rrule) {
recur = icalproperty_get_rrule(rrule);
iter = icalrecur_iterator_new(recur, cstart);
}
}
-void ical_test(void)
+void ical_test(char *path)
{
/* Load ical */
- FILE *file = fopen("data/all.ics", "r");
+ FILE *file = fopen(path, "r");
icalparser *parser = icalparser_new();
icalparser_set_gen_data(parser, file);
icalcomponent *comp = icalparser_parse(parser, (void*)fgets);