diff options
author | Ryo Nakamura <upa@haeena.net> | 2023-03-13 21:02:26 +0900 |
---|---|---|
committer | Ryo Nakamura <upa@haeena.net> | 2023-03-13 21:02:26 +0900 |
commit | ceb9ebd5a8ee6e013cf05b51a5a0ca2aac1ff3ee (patch) | |
tree | 14dfe99b309e63ff1ea194affb8735f26ea96be0 /src/list.h | |
parent | 3810d6314dfa276f5f65509f9d204399f6db4e05 (diff) |
revise walk_src_path.
In new walk_src_path, resolve dst path and resolve chunks are
invoked when adding a path.
Diffstat (limited to 'src/list.h')
-rw-r--r-- | src/list.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -554,5 +554,20 @@ static inline int list_count(struct list_head *head) } +/** + * list_free_f - free items in a list with a function + * @head the heaf for your list. + * @f function that releases an item in the list. + */ +static inline void list_free_f(struct list_head *head, void (*f)(struct list_head *)) +{ + struct list_head *p, *n; + + list_for_each_safe(p, n, head) { + list_del(p); + f(p); + } +} + #endif |