Refactor grep mode

Split io_save_{apts,todo}() into functions that write raw data to a file
and functions that write formatted items to stdout such that one can
easily extend the grep mode for format string support in a follow-up
commit.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
Lukas Fleischer
2016-02-05 09:15:01 +01:00
parent 8bdf0c0b3b
commit e9c8197e4e
4 changed files with 52 additions and 2 deletions

View File

@@ -485,6 +485,7 @@ long update_time_in_date(long date, unsigned hr, unsigned mn)
localtime_r(&t, &lt);
lt.tm_hour = hr;
lt.tm_min = mn;
lt.tm_sec = 0;
new_date = mktime(&lt);
EXIT_IF(new_date == -1, _("error in mktime"));