aboutsummaryrefslogtreecommitdiffstats
path: root/src/io.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2014-08-06 08:53:51 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2014-08-06 12:08:14 +0200
commitbfe73d0e5d66c43006a8a0dd8d58e311432bcb57 (patch)
tree584c1f12effddb2501566a872f7787be65124b89 /src/io.c
parent4ec7fe123925144506297df5eba4ed41c6f8331d (diff)
downloadcalcurse-bfe73d0e5d66c43006a8a0dd8d58e311432bcb57.tar.gz
calcurse-bfe73d0e5d66c43006a8a0dd8d58e311432bcb57.zip
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 <calcurse@cryptocrack.de>
Diffstat (limited to 'src/io.c')
-rw-r--r--src/io.c11
1 files changed, 6 insertions, 5 deletions
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,