Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 49 lines (41 sloc) 2.189 kB
0afcb5f string-list: rename the include guard to STRING_LIST_H
Thiago Farina authored
1 #ifndef STRING_LIST_H
2 #define STRING_LIST_H
c455c87 @dscho Rename path_list to string_list
dscho authored
3
4 struct string_list_item {
5 char *string;
6 void *util;
7 };
9cba13c @jrn standardize brace placement in struct definitions
jrn authored
8 struct string_list {
c455c87 @dscho Rename path_list to string_list
dscho authored
9 struct string_list_item *items;
10 unsigned int nr, alloc;
11 unsigned int strdup_strings:1;
12 };
13
183113a string_list: Add STRING_LIST_INIT macro and make use of it.
Thiago Farina authored
14 #define STRING_LIST_INIT_NODUP { NULL, 0, 0, 0 }
15 #define STRING_LIST_INIT_DUP { NULL, 0, 0, 1 }
16
cb944f6 @qur string_list: Fix argument order for print_string_list
qur authored
17 void print_string_list(const struct string_list *p, const char *text);
c455c87 @dscho Rename path_list to string_list
dscho authored
18 void string_list_clear(struct string_list *list, int free_util);
19
cfa1ee6 Add find_insert_index, insert_at_index and clear_func functions to st…
Marius Storm-Olsen authored
20 /* Use this function to call a custom clear function on each util pointer */
21 /* The string associated with the util pointer is passed as the second argument */
22 typedef void (*string_list_clear_func_t)(void *p, const char *str);
23 void string_list_clear_func(struct string_list *list, string_list_clear_func_t clearfunc);
24
8d31635 @raalkml Add a for_each_string_list_item macro
raalkml authored
25 /* Use this function or the macro below to iterate over each item */
c6f5a7a @jaysoffian string-list: new for_each_string_list() function
jaysoffian authored
26 typedef int (*string_list_each_func_t)(struct string_list_item *, void *);
b684e97 @qur string_list: Fix argument order for for_each_string_list
qur authored
27 int for_each_string_list(struct string_list *list,
28 string_list_each_func_t, void *cb_data);
8d31635 @raalkml Add a for_each_string_list_item macro
raalkml authored
29 #define for_each_string_list_item(item,list) \
30 for (item = (list)->items; item < (list)->items + (list)->nr; ++item)
c6f5a7a @jaysoffian string-list: new for_each_string_list() function
jaysoffian authored
31
c455c87 @dscho Rename path_list to string_list
dscho authored
32 /* Use these functions only on sorted lists: */
33 int string_list_has_string(const struct string_list *list, const char *string);
cfa1ee6 Add find_insert_index, insert_at_index and clear_func functions to st…
Marius Storm-Olsen authored
34 int string_list_find_insert_index(const struct string_list *list, const char *string,
35 int negative_existing_index);
78a395d @qur string_list: Fix argument order for string_list_insert
qur authored
36 struct string_list_item *string_list_insert(struct string_list *list, const char *string);
aadceea @qur string_list: Fix argument order for string_list_insert_at_index
qur authored
37 struct string_list_item *string_list_insert_at_index(struct string_list *list,
38 int insert_at, const char *string);
e8c8b71 @qur string_list: Fix argument order for string_list_lookup
qur authored
39 struct string_list_item *string_list_lookup(struct string_list *list, const char *string);
c455c87 @dscho Rename path_list to string_list
dscho authored
40
41 /* Use these functions only on unsorted lists: */
1d2f80f @qur string_list: Fix argument order for string_list_append
qur authored
42 struct string_list_item *string_list_append(struct string_list *list, const char *string);
c455c87 @dscho Rename path_list to string_list
dscho authored
43 void sort_string_list(struct string_list *list);
44 int unsorted_string_list_has_string(struct string_list *list, const char *string);
e242148 @bebarino string-list: add unsorted_string_list_lookup()
bebarino authored
45 struct string_list_item *unsorted_string_list_lookup(struct string_list *list,
46 const char *string);
86d4b52 string-list: Add API to remove an item from an unsorted list
Johannes Sixt authored
47 void unsorted_string_list_delete_item(struct string_list *list, int i, int free_util);
0afcb5f string-list: rename the include guard to STRING_LIST_H
Thiago Farina authored
48 #endif /* STRING_LIST_H */
Something went wrong with that request. Please try again.