From f103f95b11d087f07c0c48bf784cd9197e18f203 Mon Sep 17 00:00:00 2001 From: Michael Haggerty Date: Wed, 12 Sep 2012 16:04:46 +0200 Subject: string_list: add a function string_list_longest_prefix() Add a function that finds the longest string from a string_list that is a prefix of a given string. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- Documentation/technical/api-string-list.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Documentation/technical') diff --git a/Documentation/technical/api-string-list.txt b/Documentation/technical/api-string-list.txt index 0f8b7cee36..32b35d9181 100644 --- a/Documentation/technical/api-string-list.txt +++ b/Documentation/technical/api-string-list.txt @@ -75,6 +75,14 @@ Functions to be deleted. Preserve the order of the items that are retained. +`string_list_longest_prefix`:: + + Return the longest string within a string_list that is a + prefix (in the sense of prefixcmp()) of the specified string, + or NULL if no such prefix exists. This function does not + require the string_list to be sorted (it does a linear + search). + `print_string_list`:: Dump a string_list to stdout, useful mainly for debugging purposes. It -- cgit v1.2.3