diff options
Diffstat (limited to 'common/list.c')
-rw-r--r-- | common/list.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/common/list.c b/common/list.c index c6d8cb98..31ae9d35 100644 --- a/common/list.c +++ b/common/list.c @@ -99,6 +99,15 @@ struct slist *slist_find(struct slist *list, const void *data, return NULL; } +void slist_foreach(struct slist *list, slist_func_t func, void *user_data) +{ + while (list) { + struct slist *next = list->next; + func(list->data, user_data); + list = next; + } +} + void slist_free(struct slist *list) { struct slist *l, *next; |