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>
This commit is contained in:
Lukas Fleischer
2012-06-26 13:29:54 +02:00
parent e1fbee0071
commit 02c90ba53a
7 changed files with 26 additions and 38 deletions

View File

@@ -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: