5 #include "wimlib/inode_table.h"
6 #include "wimlib/list.h"
7 #include "wimlib/progress.h"
8 #include "wimlib/security.h"
9 #include "wimlib/textfile.h"
10 #include "wimlib/util.h"
16 struct capture_config {
18 /* List of path patterns to exclude */
19 struct string_list exclusion_pats;
21 /* List of path patterns to include, overriding exclusion_pats */
22 struct string_list exclusion_exception_pats;
27 /* Scan parameters: common parameters to implementations of building an
28 * in-memory dentry tree from an external directory structure. */
31 /* The blob table within which any new blobs discovered during the scan
32 * will be deduplicated. */
33 struct blob_table *blob_table;
35 /* List of new blobs that have been discovered without their SHA-1
36 * message digests having been calculated (as a shortcut). */
37 struct list_head *unhashed_blobs;
39 /* Map from (inode number, device number) pair to inode for new inodes
40 * that have been discovered so far. */
41 struct wim_inode_table *inode_table;
43 /* The set of unique security descriptors to which each newly
44 * discovered, unique security descriptor will be added. */
45 struct wim_sd_set *sd_set;
47 /* The capture configuration in effect, or NULL if none. */
48 struct capture_config *config;
50 /* Flags that affect the scan operation (WIMLIB_ADD_FLAG_*) */
53 /* If non-NULL, the user-supplied progress function. */
54 wimlib_progress_func_t progfunc;
58 union wimlib_progress_info progress;
60 /* Before calling try_exclude(), the scan implementation must set this
61 * to the number of characters that try_exclude() will strip from the
62 * path when testing exclusion patterns. */
63 size_t capture_root_nchars;
65 /* Can be used by the scan implementation. */
73 do_scan_progress(struct scan_params *params, int status,
74 const struct wim_inode *inode);
77 mangle_pat(tchar *pat, const tchar *path, unsigned long line_no);
80 read_capture_config(const tchar *config_file, const void *buf,
81 size_t bufsize, struct capture_config *config);
84 destroy_capture_config(struct capture_config *config);
87 match_pattern_list(const tchar *path, const struct string_list *list);
90 try_exclude(const tchar *full_path, const struct scan_params *params);
92 typedef int (*scan_tree_t)(struct wim_dentry **, const tchar *,
93 struct scan_params *);
96 /* ntfs-3g_capture.c */
98 ntfs_3g_build_dentry_tree(struct wim_dentry **root_ret,
99 const tchar *device, struct scan_params *params);
103 /* win32_capture.c */
105 win32_build_dentry_tree(struct wim_dentry **root_ret,
106 const tchar *root_disk_path,
107 struct scan_params *params);
108 #define platform_default_scan_tree win32_build_dentry_tree
112 unix_build_dentry_tree(struct wim_dentry **root_ret,
113 const tchar *root_disk_path, struct scan_params *params);
114 #define platform_default_scan_tree unix_build_dentry_tree
117 #define WIMLIB_ADD_FLAG_ROOT 0x80000000
120 report_scan_error(struct scan_params *params, int error_code, const tchar *path)
122 return report_error(params->progfunc, params->progctx, error_code, path);
126 should_ignore_filename(const tchar *name, int name_nchars);
129 attach_scanned_tree(struct wim_dentry *parent, struct wim_dentry *child,
130 struct blob_table *blob_table);
132 #endif /* _WIMLIB_SCAN_H */