path: root/string-list.h
diff options
authorStefan Beller <>2014-11-24 21:22:02 (GMT)
committerJunio C Hamano <>2014-11-25 00:04:12 (GMT)
commitfc66505c53f1a471e63b6122b2d629daca6e705b (patch)
treeff9bd3ca23d6be2ef5e18c3d13b46c76a862df5f /string-list.h
parent652e759330da379a8e09e03bbf99e03c10c228cc (diff)
string_list: document string_list_(insert,lookup)
Signed-off-by: Stefan Beller <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'string-list.h')
1 files changed, 10 insertions, 0 deletions
diff --git a/string-list.h b/string-list.h
index 494eb5d..40ffe0c 100644
--- a/string-list.h
+++ b/string-list.h
@@ -55,9 +55,19 @@ 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);