From 1477aa78883562b5d5e97e4ec6fa2d23216673c2 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 13 Mar 2006 20:54:47 +0000 Subject: More passkey handler functionality --- common/list.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'common/list.c') diff --git a/common/list.c b/common/list.c index bda2b564..c6d8cb98 100644 --- a/common/list.c +++ b/common/list.c @@ -86,6 +86,19 @@ struct slist *slist_remove(struct slist *list, void *data) return list; } +struct slist *slist_find(struct slist *list, const void *data, + cmp_func_t cmp_func) +{ + struct slist *l; + + for (l = list; l != NULL; l = l->next) { + if (!cmp_func(l->data, data)) + return l; + } + + return NULL; +} + void slist_free(struct slist *list) { struct slist *l, *next; -- cgit