diff options
Diffstat (limited to 'string-list.h')
-rw-r--r-- | string-list.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/string-list.h b/string-list.h index d32ba05202..6569cf607b 100644 --- a/string-list.h +++ b/string-list.h @@ -1,5 +1,5 @@ -#ifndef PATH_LIST_H -#define PATH_LIST_H +#ifndef STRING_LIST_H +#define STRING_LIST_H struct string_list_item { char *string; @@ -20,6 +20,11 @@ void string_list_clear(struct string_list *list, int free_util); typedef void (*string_list_clear_func_t)(void *p, const char *str); void string_list_clear_func(struct string_list *list, string_list_clear_func_t clearfunc); +/* Use this function to iterate over each item */ +typedef int (*string_list_each_func_t)(struct string_list_item *, void *); +int for_each_string_list(string_list_each_func_t, + struct string_list *list, void *cb_data); + /* Use these functions only on sorted lists: */ int string_list_has_string(const struct string_list *list, const char *string); int string_list_find_insert_index(const struct string_list *list, const char *string, @@ -34,4 +39,4 @@ struct string_list_item *string_list_append(const char *string, struct string_li void sort_string_list(struct string_list *list); int unsorted_string_list_has_string(struct string_list *list, const char *string); -#endif /* PATH_LIST_H */ +#endif /* STRING_LIST_H */ |