diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-12-22 12:27:29 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-12-22 12:27:30 -0800 |
commit | 12b9f08953f4f558789f833b0fe438c25ce6d4b1 (patch) | |
tree | c5bcb65236b5753be77f9a3744dfc01de94b85eb /string-list.h | |
parent | Merge branch 'sv/doc-stripspace' (diff) | |
parent | string_list: remove string_list_insert_at_index() from its API (diff) | |
download | tgif-12b9f08953f4f558789f833b0fe438c25ce6d4b1.tar.xz |
Merge branch 'sb/string-list'
API simplification.
* sb/string-list:
string_list: remove string_list_insert_at_index() from its API
mailmap: use higher level string list functions
string_list: document string_list_(insert,lookup)
Diffstat (limited to 'string-list.h')
-rw-r--r-- | string-list.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/string-list.h b/string-list.h index 2cc5e48427..d3809a1417 100644 --- a/string-list.h +++ b/string-list.h @@ -55,9 +55,17 @@ void string_list_remove_empty_items(struct string_list *list, int free_util); 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); +/* + * Inserts the given string into the sorted list. + * If the string already exists, the list is not altered. + * Returns the string_list_item, the string is part of. + */ struct string_list_item *string_list_insert(struct string_list *list, const char *string); -struct string_list_item *string_list_insert_at_index(struct string_list *list, - int insert_at, const char *string); + +/* + * Checks if the given string is part of a sorted list. If it is part of the list, + * return the coresponding string_list_item, NULL otherwise. + */ struct string_list_item *string_list_lookup(struct string_list *list, const char *string); /* |