From d311ad067f47608252b9276df90087db98b1100f Mon Sep 17 00:00:00 2001 From: Nagy Gabor Date: Fri, 16 Nov 2007 20:50:58 +0100 Subject: Generalized alpm_list_find. The old alpm_list_find was renamed to alpm_list_find_ptr, and a new alpm_list_find was introduced, which uses the fn comparison-function parameter in its decision. Now both alpm_list_find_ptr (a new ptrcmp helper function was also added) and alpm_list_find_str are just an alpm_list_find call. Signed-off-by: Nagy Gabor Signed-off-by: Chantry Xavier [Dan: made ptrcmp a static function] Signed-off-by: Dan McGee --- lib/libalpm/alpm_list.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/libalpm/alpm_list.h') diff --git a/lib/libalpm/alpm_list.h b/lib/libalpm/alpm_list.h index d6e9882b..a24aa8db 100644 --- a/lib/libalpm/alpm_list.h +++ b/lib/libalpm/alpm_list.h @@ -72,8 +72,9 @@ void *alpm_list_getdata(const alpm_list_t *entry); /* misc */ int alpm_list_count(const alpm_list_t *list); -int alpm_list_find(const alpm_list_t *haystack, const void *needle); -int alpm_list_find_str(const alpm_list_t *haystack,const char *needle); +int alpm_list_find(const alpm_list_t *haystack, const void *needle, alpm_list_fn_cmp fn); +int alpm_list_find_ptr(const alpm_list_t *haystack, const void *needle); +int alpm_list_find_str(const alpm_list_t *haystack, const char *needle); alpm_list_t *alpm_list_diff(const alpm_list_t *lhs, const alpm_list_t *rhs, alpm_list_fn_cmp fn); #ifdef __cplusplus -- cgit v1.2.3-24-g4f1b