Skip to content

Commit

Permalink
string_list: document string_list_(insert,lookup)
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Stefan Beller authored and Junio C Hamano committed Nov 25, 2014
1 parent 652e759 commit fc66505
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions string-list.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/*
Expand Down

0 comments on commit fc66505

Please sign in to comment.