From fc66505c53f1a471e63b6122b2d629daca6e705b Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Mon, 24 Nov 2014 13:22:02 -0800 Subject: string_list: document string_list_(insert,lookup) Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- string-list.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'string-list.h') diff --git a/string-list.h b/string-list.h index 494eb5d95d..40ffe0c703 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); /* -- cgit v1.2.3 From f8c4ab611ac5b714b6b4fd296c59512f97f87195 Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Mon, 24 Nov 2014 13:22:04 -0800 Subject: string_list: remove string_list_insert_at_index() from its API There no longer is a caller to this function. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- string-list.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'string-list.h') diff --git a/string-list.h b/string-list.h index 40ffe0c703..ee9b100970 100644 --- a/string-list.h +++ b/string-list.h @@ -61,8 +61,6 @@ int string_list_find_insert_index(const struct string_list *list, const char *st * 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, -- cgit v1.2.3