summaryrefslogtreecommitdiff
path: root/src/event.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2012-06-26 13:29:54 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2012-06-30 14:34:35 +0200
commit02c90ba53a658686bad5cb5f88c555d9eef06399 (patch)
tree4c9676d9e1bb703bb757cd05c6ce273e073e5c0e /src/event.c
parente1fbee0071ad6bb5d5c17865c5a7b67a63930e7d (diff)
downloadcalcurse-02c90ba53a658686bad5cb5f88c555d9eef06399.zip
Revise *_delete{,_bynum}()
Always pass an item instead of passing a date and a index. This makes use of the NULL callback that was added with one of the previous patches. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/event.c')
-rw-r--r--src/event.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/event.c b/src/event.c
index 4af9f23..d135a2c 100644
--- a/src/event.c
+++ b/src/event.c
@@ -155,13 +155,12 @@ struct event *event_scan(FILE * f, struct tm start, int id, char *note)
}
/* Delete an event from the list. */
-void event_delete_bynum(long start, unsigned num, enum eraseflg flag)
+void event_delete(struct event *ev, enum eraseflg flag)
{
- llist_item_t *i = LLIST_FIND_NTH(&eventlist, num, &start, event_inday);
+ llist_item_t *i = LLIST_FIND_FIRST(&eventlist, ev, NULL);
if (!i)
EXIT(_("no such appointment"));
- struct event *ev = LLIST_TS_GET_DATA(i);
switch (flag) {
case ERASE_FORCE_ONLY_NOTE: