Allow passing more complex data to list callbacks

Change the data type of the "data" parameter from "long" to "void *" in
llist_find_*() signatures to allow for passing more complex objects.
Change all llist_find_*() invocations and callbacks accordingly.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer
2012-06-26 11:22:08 +02:00
parent 8a85aaafa5
commit b8b6830dfd
7 changed files with 42 additions and 42 deletions

View File

@@ -104,9 +104,9 @@ struct event *event_new(char *mesg, char *note, long day, int id)
}
/* Check if the event belongs to the selected day */
unsigned event_inday(struct event *i, long start)
unsigned event_inday(struct event *i, long *start)
{
return (i->day < start + DAYINSEC && i->day >= start);
return (i->day < *start + DAYINSEC && i->day >= *start);
}
/* Write to file the event in user-friendly format */
@@ -157,7 +157,7 @@ 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)
{
llist_item_t *i = LLIST_FIND_NTH(&eventlist, num, start, event_inday);
llist_item_t *i = LLIST_FIND_NTH(&eventlist, num, &start, event_inday);
if (!i)
EXIT(_("no such appointment"));