From: Bastian Dehn Date: Sat, 14 Feb 2026 13:12:31 +0000 (+0100) Subject: change calc all on top main X-Git-Tag: 1.3.12^2~5 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=b71006f9f669d531c5047fdc84a9291b019cc48c;p=feierabend.git change calc all on top main --- diff --git a/src/feierabend.c b/src/feierabend.c index 148253f..90da2e0 100644 --- a/src/feierabend.c +++ b/src/feierabend.c @@ -53,19 +53,17 @@ void _print_max_work_end(const struct tm max_work_end_tm) printf("\n"); } -void _print_brutto_worktime(const time_t begin, const time_t end) +void _print_brutto_worktime(const time_t brutto_worktime) { - const time_t butto_worktime = get_brutto_worktime(begin, end); - char* timestr = get_time_str(butto_worktime); + char* timestr = get_time_str(brutto_worktime); printf("%-26s%6s\n", "Brutto Arbeitzeit:", timestr); free(timestr); timestr = NULL; } -void _print_netto_worktime(const time_t begin, const time_t end) +void _print_netto_worktime(const time_t netto_worktime) { - const time_t netto_worktime = get_current_worktime(begin, end); char* timestr = get_time_str(netto_worktime); printf("%-26s%6s\n", "Netto Arbeitzeit:", timestr); @@ -73,10 +71,8 @@ void _print_netto_worktime(const time_t begin, const time_t end) timestr = NULL; } -void _print_current_breaktime(const time_t begin, const time_t end) +void _print_current_breaktime(const time_t break_time) { - const time_t brutto_worktime = get_brutto_worktime(begin, end); - const time_t break_time = get_break_time(brutto_worktime); char* timestr = get_time_str(break_time); printf("%-26s%6s\n", "Aktuelle Pausenzeit:", timestr); @@ -84,9 +80,8 @@ void _print_current_breaktime(const time_t begin, const time_t end) timestr = NULL; } -void _print_time_to_end_worktime(const time_t begin, const time_t end) +void _print_time_to_end_worktime(const time_t diff_to_end) { - const time_t diff_to_end = get_current_worktime_diff_to_end_eight_hour(begin, end); char* timestr = get_time_str(diff_to_end); printf("Arbeitzeit bis %02d:%02d Std: %6s\n", SOLL_HOUR, @@ -97,10 +92,9 @@ void _print_time_to_end_worktime(const time_t begin, const time_t end) timestr = NULL; } -void _print_time_to_max_end_worktime(const time_t begin, const time_t end) +void _print_time_to_max_end_worktime(const time_t diff_to_max_end) { - const time_t diff_to_end = get_current_worktime_diff_to_end_ten_hour(begin, end); - char* timestr = get_time_str(diff_to_end); + char* timestr = get_time_str(diff_to_max_end); printf("Arbeitzeit bis 10:00 Std: %6s\n", timestr); free(timestr); @@ -155,6 +149,12 @@ int main(int argc, const char* argv[]) const struct tm work_eight_end_tm = _get_tm_from_time(worktime_eight_end); const struct tm max_work_end_tm = _get_tm_from_time(worktime_max_end); + const time_t netto_worktime = get_current_worktime(begin, end); + const time_t brutto_worktime = get_brutto_worktime(begin, end); + const time_t break_time = get_break_time(brutto_worktime); + const time_t diff_to_end = get_current_worktime_diff_to_end_eight_hour(begin, end); + const time_t diff_to_max_end = get_current_worktime_diff_to_end_ten_hour(begin, end); + _print_time_now(end_tm); printf("\n"); @@ -163,13 +163,13 @@ int main(int argc, const char* argv[]) _print_max_work_end(max_work_end_tm); printf("\n"); - _print_brutto_worktime(begin, end); - _print_netto_worktime(begin, end); - _print_current_breaktime(begin, end); + _print_brutto_worktime(brutto_worktime); + _print_netto_worktime(netto_worktime); + _print_current_breaktime(break_time); printf("\n"); - _print_time_to_end_worktime(begin, end); - _print_time_to_max_end_worktime(begin, end); + _print_time_to_end_worktime(diff_to_end); + _print_time_to_max_end_worktime(diff_to_max_end); return 0; } \ No newline at end of file