diff options
author | Judd Vinet <judd@archlinux.org> | 2002-09-16 07:22:13 +0200 |
---|---|---|
committer | Judd Vinet <judd@archlinux.org> | 2002-09-16 07:22:13 +0200 |
commit | 6a654187b68d37211dc8af301e611ec4a7f132c4 (patch) | |
tree | c215ad278a485fac7c0361fa9d5fcae8b101929b /src/list.c | |
parent | 62a783a6bd7649ccd162e32278098080bf450c7b (diff) | |
download | pacman-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.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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) */ |