From 02c90ba53a658686bad5cb5f88c555d9eef06399 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Tue, 26 Jun 2012 13:29:54 +0200 Subject: 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 --- src/apoint.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/apoint.c') diff --git a/src/apoint.c b/src/apoint.c index 61acc49..e6e02c4 100644 --- a/src/apoint.c +++ b/src/apoint.c @@ -269,17 +269,15 @@ struct apoint *apoint_scan(FILE * f, struct tm start, struct tm end, char state, return apoint_new(buf, note, tstart, tend - tstart, state); } -void apoint_delete_bynum(long start, unsigned num, enum eraseflg flag) +void apoint_delete(struct apoint *apt, enum eraseflg flag) { - llist_item_t *i; int need_check_notify = 0; LLIST_TS_LOCK(&alist_p); - i = LLIST_TS_FIND_NTH(&alist_p, num, &start, apoint_inday); + llist_item_t *i = LLIST_TS_FIND_FIRST(&alist_p, apt, NULL); if (!i) EXIT(_("no such appointment")); - struct apoint *apt = LLIST_TS_GET_DATA(i); switch (flag) { case ERASE_FORCE_ONLY_NOTE: -- cgit v1.2.3-54-g00ecf