/src/barebox/include/file-list.h
Line | Count | Source |
1 | | /* SPDX-License-Identifier: GPL-2.0-only */ |
2 | | #ifndef __FILE_LIST |
3 | | #define __FILE_LIST |
4 | | |
5 | | #include <linux/list.h> |
6 | | |
7 | | struct cdev; |
8 | | |
9 | 0 | #define FILE_LIST_FLAG_SAFE (1 << 0) |
10 | 0 | #define FILE_LIST_FLAG_READBACK (1 << 1) |
11 | 0 | #define FILE_LIST_FLAG_CREATE (1 << 2) |
12 | 0 | #define FILE_LIST_FLAG_UBI (1 << 3) |
13 | 0 | #define FILE_LIST_FLAG_OPTIONAL (1 << 4) |
14 | | |
15 | | struct file_list_entry { |
16 | | const char *name; |
17 | | const char *filename; |
18 | | unsigned long flags; |
19 | | struct list_head list; |
20 | | }; |
21 | | |
22 | | struct file_list { |
23 | | struct list_head list; |
24 | | }; |
25 | | |
26 | | struct file_list *file_list_parse(const char *str); |
27 | | struct file_list *file_list_parse_null(const char *str); |
28 | | char *file_list_to_str(const struct file_list *files); |
29 | | void file_list_free(struct file_list *); |
30 | | |
31 | | int file_list_add_entry(struct file_list *files, const char *name, const char *filename, |
32 | | unsigned long flags); |
33 | | |
34 | | int file_list_add_cdev_entry(struct file_list *files, struct cdev *cdev, |
35 | | unsigned long flags); |
36 | | |
37 | | struct file_list *file_list_new(void); |
38 | | struct file_list *file_list_dup(struct file_list *old); |
39 | | |
40 | | int file_list_detect_all(const struct file_list *files); |
41 | | |
42 | | struct file_list_entry *file_list_entry_by_name(struct file_list *files, const char *name); |
43 | | |
44 | | #define file_list_for_each_entry(files, entry) \ |
45 | 0 | list_for_each_entry(entry, &files->list, list) |
46 | | |
47 | | static inline bool file_list_empty(struct file_list *files) |
48 | 0 | { |
49 | 0 | return !files || list_empty(&files->list); |
50 | 0 | } Unexecuted instantiation: block.c:file_list_empty Unexecuted instantiation: file-list.c:file_list_empty Unexecuted instantiation: fastboot.c:file_list_empty Unexecuted instantiation: parameter.c:file_list_empty |
51 | | |
52 | | #endif /* __FILE_LIST */ |