]> asedeno.scripts.mit.edu Git - git.git/blobdiff - Documentation/technical/api-string-list.txt
Merge branch 'jk/maint-status-keep-index-timestamp'
[git.git] / Documentation / technical / api-string-list.txt
index 92b3ecdae28afa06331382f937fd887dfcca6b15..3f575bdcff3a6b38304710b22371784c2e7443c9 100644 (file)
@@ -38,10 +38,10 @@ struct string_list list;
 int i;
 
 memset(&list, 0, sizeof(struct string_list));
-string_list_append("foo", &list);
-string_list_append("bar", &list);
+string_list_append(&list, "foo");
+string_list_append(&list, "bar");
 for (i = 0; i < list.nr; i++)
-       printf("%s\n", list.items[i].path)
+       printf("%s\n", list.items[i].string)
 ----
 
 NOTE: It is more efficient to build an unsorted list and sort it
@@ -104,8 +104,12 @@ write `string_list_insert(...)->util = ...;`.
 `unsorted_string_list_has_string`::
 
        It's like `string_list_has_string()` but for unsorted lists.
+
+`unsorted_string_list_lookup`::
+
+       It's like `string_list_lookup()` but for unsorted lists.
 +
-This function needs to look through all items, as opposed to its
+The above two functions need to look through all items, as opposed to their
 counterpart for sorted lists, which performs a binary search.
 
 Data structures
@@ -113,7 +117,7 @@ Data structures
 
 * `struct string_list_item`
 
-Represents an item of the list. The `path` member is a pointer to the
+Represents an item of the list. The `string` member is a pointer to the
 string, and you may use the `util` member for any purpose, if you want.
 
 * `struct string_list`