diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2012-09-12 16:04:44 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-09-12 11:43:25 -0700 |
commit | eb5f0c7a616531a024a582b72ca6d8775ff98d46 (patch) | |
tree | 1c791a163140cb2988c7d2049ce706ad93e0c23d /Documentation | |
parent | ff919f965d20d003e3882c70de667f41a86349ac (diff) | |
download | git-eb5f0c7a616531a024a582b72ca6d8775ff98d46.tar.gz |
string_list: add a new function, filter_string_list()
This function allows entries that don't match a specified criterion to
be discarded from a string_list while preserving the order of the
remaining entries.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/technical/api-string-list.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Documentation/technical/api-string-list.txt b/Documentation/technical/api-string-list.txt index 1dcad47f7c..300b301093 100644 --- a/Documentation/technical/api-string-list.txt +++ b/Documentation/technical/api-string-list.txt @@ -33,6 +33,9 @@ member (you need this if you add things later) and you should set the . Can remove individual items of an unsorted list using `unsorted_string_list_delete_item`. +. Can remove items not matching a criterion from a sorted or unsorted + list using `filter_string_list`. + . Finally it should free the list using `string_list_clear`. Example: @@ -61,6 +64,14 @@ Functions * General ones (works with sorted and unsorted lists as well) +`filter_string_list`:: + + Apply a function to each item in a list, retaining only the + items for which the function returns true. If free_util is + true, call free() on the util members of any items that have + to be deleted. Preserve the order of the items that are + retained. + `print_string_list`:: Dump a string_list to stdout, useful mainly for debugging purposes. It |