From b8b6830dfd75f6870b2171e7f31cb0cdb927532e Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Tue, 26 Jun 2012 11:22:08 +0200 Subject: 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 --- src/llist.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/llist.c') diff --git a/src/llist.c b/src/llist.c index 847b795..addce42 100644 --- a/src/llist.c +++ b/src/llist.c @@ -112,7 +112,7 @@ llist_item_t *llist_next(llist_item_t * i) * Return the successor of a list item if it is matched by some filter * callback. Return NULL otherwise. */ -llist_item_t *llist_next_filter(llist_item_t * i, long data, +llist_item_t *llist_next_filter(llist_item_t * i, void *data, llist_fn_match_t fn_match) { if (i && i->next && fn_match(i->next->data, data)) @@ -205,7 +205,7 @@ void llist_remove(llist_t * l, llist_item_t * i) /* * Find the first item matched by some filter callback. */ -llist_item_t *llist_find_first(llist_t * l, long data, +llist_item_t *llist_find_first(llist_t * l, void *data, llist_fn_match_t fn_match) { llist_item_t *i; @@ -221,7 +221,7 @@ llist_item_t *llist_find_first(llist_t * l, long data, /* * Find the next item matched by some filter callback. */ -llist_item_t *llist_find_next(llist_item_t * i, long data, +llist_item_t *llist_find_next(llist_item_t * i, void *data, llist_fn_match_t fn_match) { if (i) { @@ -238,7 +238,7 @@ llist_item_t *llist_find_next(llist_item_t * i, long data, /* * Find the nth item matched by some filter callback. */ -llist_item_t *llist_find_nth(llist_t * l, int n, long data, +llist_item_t *llist_find_nth(llist_t * l, int n, void *data, llist_fn_match_t fn_match) { llist_item_t *i; -- cgit v1.2.3-54-g00ecf