diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-04-14 11:28:22 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-04-19 11:42:34 +0200 |
commit | 6f883c0f3f4c08fe8e125f269da9b940519ccf44 (patch) | |
tree | b66a7de57c6e56004f4f96867884270bc635d27f /src/args.c | |
parent | 1de34587abc135edf9af8f9d8d6094ac10f0143c (diff) | |
download | calcurse-6f883c0f3f4c08fe8e125f269da9b940519ccf44.zip |
Use generic lists for events.
Use the new generic list implementation instead of those insane "next"
pointers in events. Includes some cleanups.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/args.c')
-rw-r--r-- | src/args.c | 39 |
1 files changed, 18 insertions, 21 deletions
@@ -352,7 +352,6 @@ app_arg (int add_line, struct date *day, long date, int print_note, { llist_item_t *i; struct recur_event *re; - struct event *j; struct recur_apoint *ra; long today; unsigned print_date = 1; @@ -397,30 +396,28 @@ app_arg (int add_line, struct date *day, long date, int print_note, } } - for (j = eventlist; j != NULL; j = j->next) + LLIST_FIND_FOREACH (&eventlist, today, event_inday, i) { - if (event_inday (j, today)) - { - if (regex && regexec (regex, j->mesg, 0, 0, 0) != 0) - continue; + struct apoint *ev = LLIST_TS_GET_DATA (i); + if (regex && regexec (regex, ev->mesg, 0, 0, 0) != 0) + continue; - app_found = 1; - if (add_line) - { - fputs ("\n", stdout); - add_line = 0; - } - if (print_date) - { - arg_print_date (today, conf); - print_date = 0; - } - fputs (" * ", stdout); - fputs (j->mesg, stdout); + app_found = 1; + if (add_line) + { fputs ("\n", stdout); - if (print_note && j->note) - print_notefile (stdout, j->note, 2); + add_line = 0; } + if (print_date) + { + arg_print_date (today, conf); + print_date = 0; + } + fputs (" * ", stdout); + fputs (ev->mesg, stdout); + fputs ("\n", stdout); + if (print_note && ev->note) + print_notefile (stdout, ev->note, 2); } /* Same process is performed but this time on the appointments. */ |