Fix buffer overflow in git-grep
[git/trast.git] / path-list.h
blobca2cbbaa4dccbf3359155e429231f35f55c5f7e0
1 #ifndef PATH_LIST_H
2 #define PATH_LIST_H
4 struct path_list_item {
5 char *path;
6 void *util;
7 };
8 struct path_list
10 struct path_list_item *items;
11 unsigned int nr, alloc;
12 unsigned int strdup_paths:1;
15 void print_path_list(const char *text, const struct path_list *p);
16 void path_list_clear(struct path_list *list, int free_util);
18 /* Use these functions only on sorted lists: */
19 int path_list_has_path(const struct path_list *list, const char *path);
20 struct path_list_item *path_list_insert(const char *path, struct path_list *list);
21 struct path_list_item *path_list_lookup(const char *path, struct path_list *list);
23 /* Use these functions only on unsorted lists: */
24 struct path_list_item *path_list_append(const char *path, struct path_list *list);
25 void sort_path_list(struct path_list *list);
26 int unsorted_path_list_has_path(struct path_list *list, const char *path);
28 #endif /* PATH_LIST_H */