summaryrefslogtreecommitdiffstats
path: root/src/list.c
diff options
context:
space:
mode:
authorJudd Vinet <judd@archlinux.org>2002-09-16 07:22:13 +0200
committerJudd Vinet <judd@archlinux.org>2002-09-16 07:22:13 +0200
commit6a654187b68d37211dc8af301e611ec4a7f132c4 (patch)
treec215ad278a485fac7c0361fa9d5fcae8b101929b /src/list.c
parent62a783a6bd7649ccd162e32278098080bf450c7b (diff)
downloadpacman-6a654187b68d37211dc8af301e611ec4a7f132c4.tar.gz
pacman-6a654187b68d37211dc8af301e611ec4a7f132c4.tar.xz
Imported from pacman-2.1.tar.gz
Diffstat (limited to 'src/list.c')
-rw-r--r--src/list.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/list.c b/src/list.c
index 2a33b6e3..717aab2b 100644
--- a/src/list.c
+++ b/src/list.c
@@ -93,6 +93,18 @@ int list_count(PMList *list)
return(i);
}
+int list_isin(PMList *haystack, void *needle)
+{
+ PMList *lp;
+
+ for(lp = haystack; lp; lp = lp->next) {
+ if(lp->data == needle) {
+ return(1);
+ }
+ }
+ return(0);
+}
+
/* List one is extended and returned
* List two is freed (but not its data)
*/