summaryrefslogtreecommitdiffstats
path: root/src/list.c
diff options
context:
space:
mode:
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)
*/