summaryrefslogtreecommitdiff
path: root/Documentation/technical/api-string-list.txt
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2012-09-12 14:04:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-09-12 18:43:25 (GMT)
commiteb5f0c7a616531a024a582b72ca6d8775ff98d46 (patch)
tree1c791a163140cb2988c7d2049ce706ad93e0c23d /Documentation/technical/api-string-list.txt
parentff919f965d20d003e3882c70de667f41a86349ac (diff)
downloadgit-eb5f0c7a616531a024a582b72ca6d8775ff98d46.zip
git-eb5f0c7a616531a024a582b72ca6d8775ff98d46.tar.gz
git-eb5f0c7a616531a024a582b72ca6d8775ff98d46.tar.bz2
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/technical/api-string-list.txt')
-rw-r--r--Documentation/technical/api-string-list.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/Documentation/technical/api-string-list.txt b/Documentation/technical/api-string-list.txt
index 1dcad47..300b301 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