diff options
Diffstat (limited to 'string-list.h')
| -rw-r--r-- | string-list.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/string-list.h b/string-list.h index 2b438c7733..fa6ba07853 100644 --- a/string-list.h +++ b/string-list.h @@ -172,9 +172,15 @@ void string_list_remove_empty_items(struct string_list *list, int free_util); /* Use these functions only on sorted lists: */ /** Determine if the string_list has a given string or not. */ -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, - int negative_existing_index); +bool string_list_has_string(const struct string_list *list, const char *string); + +/** + * Find the index at which a new element should be inserted into the + * string_list to maintain sorted order. If exact_match is not NULL, + * it will be set to true if the string already exists in the list. + */ +size_t string_list_find_insert_index(const struct string_list *list, const char *string, + bool *exact_match); /** * Insert a new element to the string_list. The returned pointer can |
