diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2006-03-13 20:54:47 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2006-03-13 20:54:47 +0000 |
commit | 1477aa78883562b5d5e97e4ec6fa2d23216673c2 (patch) | |
tree | d40e8420180c283e1af85997cfdedeb6bdab8ad3 /common/list.c | |
parent | 1fe7ab081842276d8db73a44cc64c2115b618cc2 (diff) |
More passkey handler functionality
Diffstat (limited to 'common/list.c')
-rw-r--r-- | common/list.c | 13 |
1 files changed, 13 insertions, 0 deletions
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; |