From bfe73d0e5d66c43006a8a0dd8d58e311432bcb57 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Wed, 6 Aug 2014 08:53:51 +0200 Subject: Add item filters This adds the following filter options that allow for restricting the set of items that are read from the appointments file: * --filter-type * --filter-start-from * --filter-start-to * --filter-start-after * --filter-start-before * --filter-end-from * --filter-end-to * --filter-end-after * --filter-end-before Signed-off-by: Lukas Fleischer --- src/io.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/io.c') diff --git a/src/io.c b/src/io.c index a50991f..a6c29ac 100644 --- a/src/io.c +++ b/src/io.c @@ -464,7 +464,7 @@ static void io_load_error(const char *filename, unsigned line, * and then load either: a new appointment, a new event, or a new * recursive item (which can also be either an event or an appointment). */ -void io_load_app(void) +void io_load_app(struct item_filter *filter) { FILE *data_file; int c, is_appointment, is_event, is_recursive; @@ -620,18 +620,19 @@ void io_load_app(void) if (is_recursive) { recur_apoint_scan(data_file, start, end, type, freq, until, notep, - &exc, state); + &exc, state, filter); } else { apoint_scan(data_file, start, end, state, - notep); + notep, filter); } } else if (is_event) { if (is_recursive) { recur_event_scan(data_file, start, id, type, freq, until, notep, - &exc); + &exc, filter); } else { - event_scan(data_file, start, id, notep); + event_scan(data_file, start, id, notep, + filter); } } else { io_load_error(path_apts, line, -- cgit v1.2.3-54-g00ecf