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>
This commit is contained in:
11
src/io.c
11
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,
|
||||
|
||||
Reference in New Issue
Block a user