Skip to content

Commit fc66505

Browse files
stefanbellergitster
authored andcommitted
string_list: document string_list_(insert,lookup)
Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 652e759 commit fc66505

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

string-list.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,19 @@ void string_list_remove_empty_items(struct string_list *list, int free_util);
5555
int string_list_has_string(const struct string_list *list, const char *string);
5656
int string_list_find_insert_index(const struct string_list *list, const char *string,
5757
int negative_existing_index);
58+
/*
59+
* Inserts the given string into the sorted list.
60+
* If the string already exists, the list is not altered.
61+
* Returns the string_list_item, the string is part of.
62+
*/
5863
struct string_list_item *string_list_insert(struct string_list *list, const char *string);
5964
struct string_list_item *string_list_insert_at_index(struct string_list *list,
6065
int insert_at, const char *string);
66+
67+
/*
68+
* Checks if the given string is part of a sorted list. If it is part of the list,
69+
* return the coresponding string_list_item, NULL otherwise.
70+
*/
6171
struct string_list_item *string_list_lookup(struct string_list *list, const char *string);
6272

6373
/*

0 commit comments

Comments
 (0)