tests: test the test framework more thoroughly
[gitweb.git] / Documentation / technical / api-string-list.txt
index 0f8b7cee364c3b9944b2f7a521fc2ce4789651a7..155ac8cb10d53053eb37bf0ea52d42623d6cb3c9 100644 (file)
@@ -44,10 +44,9 @@ member (you need this if you add things later) and you should set the
 Example:
 
 ----
-struct string_list list;
+struct string_list list = STRING_LIST_INIT_NODUP;
 int i;
 
-memset(&list, 0, sizeof(struct string_list));
 string_list_append(&list, "foo");
 string_list_append(&list, "bar");
 for (i = 0; i < list.nr; i++)
@@ -75,6 +74,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