From 5ad504240dc8747eb91efaba14577847eb0bfcdd Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Sun, 3 Apr 2005 08:07:58 +0000 Subject: added list_is_ptrin() --- src/pacman/list.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/pacman/list.c') diff --git a/src/pacman/list.c b/src/pacman/list.c index 84af1784..c639e124 100644 --- a/src/pacman/list.c +++ b/src/pacman/list.c @@ -100,6 +100,18 @@ static list_t *list_last(list_t *list) return(ptr); } +int list_is_ptrin(void *needle, list_t *haystack) +{ + list_t *lp; + + for(lp = haystack; lp; lp = lp->next) { + if(lp->data == needle) { + return(1); + } + } + return(0); +} + /* Test for existence of a string in a list_t */ int list_is_strin(char *needle, list_t *haystack) -- cgit v1.2.3