Skip to content

Commit 1f10b84

Browse files
committed
Merge branch 'en/string-list-can-be-custom-sorted'
API-doc update. * en/string-list-can-be-custom-sorted: string-list: note in docs that callers can specify sorting function
2 parents a3648c0 + 065027e commit 1f10b84

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

string-list.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
/**
55
* The string_list API offers a data structure and functions to handle
66
* sorted and unsorted arrays of strings. A "sorted" list is one whose
7-
* entries are sorted by string value in `strcmp()` order.
7+
* entries are sorted by string value in the order specified by the `cmp`
8+
* member (`strcmp()` by default).
89
*
910
* The caller:
1011
*
@@ -209,7 +210,8 @@ struct string_list_item *string_list_append(struct string_list *list, const char
209210
struct string_list_item *string_list_append_nodup(struct string_list *list, char *string);
210211

211212
/**
212-
* Sort the list's entries by string value in `strcmp()` order.
213+
* Sort the list's entries by string value in order specified by list->cmp
214+
* (strcmp() if list->cmp is NULL).
213215
*/
214216
void string_list_sort(struct string_list *list);
215217

0 commit comments

Comments
 (0)