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 /* Path to the file or directory currently being scanned */
62 size_t cur_path_nchars;
63 size_t cur_path_alloc_nchars;
65 /* Length of the prefix of 'cur_path' which names the root of the
66 * directory tree currently being scanned */
67 size_t root_path_nchars;
69 /* Can be used by the scan implementation. */
77 do_scan_progress(struct scan_params *params, int status,
78 const struct wim_inode *inode);
81 mangle_pat(tchar *pat, const tchar *path, unsigned long line_no);
84 read_capture_config(const tchar *config_file, const void *buf,
85 size_t bufsize, struct capture_config *config);
88 destroy_capture_config(struct capture_config *config);
91 match_pattern_list(const tchar *path, const struct string_list *list);
94 try_exclude(const struct scan_params *params);
96 typedef int (*scan_tree_t)(struct wim_dentry **, const tchar *,
97 struct scan_params *);
100 /* ntfs-3g_capture.c */
102 ntfs_3g_build_dentry_tree(struct wim_dentry **root_ret,
103 const tchar *device, struct scan_params *params);
107 /* win32_capture.c */
109 win32_build_dentry_tree(struct wim_dentry **root_ret,
110 const tchar *root_disk_path,
111 struct scan_params *params);
112 #define platform_default_scan_tree win32_build_dentry_tree
116 unix_build_dentry_tree(struct wim_dentry **root_ret,
117 const tchar *root_disk_path, struct scan_params *params);
118 #define platform_default_scan_tree unix_build_dentry_tree
121 #ifdef ENABLE_TEST_SUPPORT
123 generate_dentry_tree(struct wim_dentry **root_ret,
124 const tchar *root_disk_path, struct scan_params *params);
127 #define WIMLIB_ADD_FLAG_ROOT 0x80000000
130 report_scan_error(struct scan_params *params, int error_code)
132 return report_error(params->progfunc, params->progctx, error_code,
137 should_ignore_filename(const tchar *name, int name_nchars);
140 attach_scanned_tree(struct wim_dentry *parent, struct wim_dentry *child,
141 struct blob_table *blob_table);
144 pathbuf_init(struct scan_params *params, const tchar *root_path);
147 pathbuf_append_name(struct scan_params *params, const tchar *name,
148 size_t name_nchars, size_t *orig_path_nchars_ret);
151 pathbuf_truncate(struct scan_params *params, size_t nchars);
153 #endif /* _WIMLIB_SCAN_H */