1 #ifndef _WIMLIB_CAPTURE_H
2 #define _WIMLIB_CAPTURE_H
5 #include "wimlib/list.h"
6 #include "wimlib/security.h"
7 #include "wimlib/util.h"
9 struct wim_lookup_table;
12 /* Hash table to find inodes, given an inode number (in the case of reading
13 * a WIM images), or both an inode number and a device number (in the case of
14 * capturing a WIM image). */
15 struct wim_inode_table {
16 /* Fields for the hash table */
17 struct hlist_head *array;
22 * Linked list of "extra" inodes. These may be:
24 * - inodes with link count 1, which are all allowed to have 0 for their
25 * inode number, meaning we cannot insert them into the hash table.
27 * - Groups we create ourselves by splitting a nominal inode due to
28 * inconsistencies in the dentries. These inodes will share an inode
29 * number with some other inode until assign_inode_numbers() is
32 struct list_head extra_inodes;
35 /* Common parameters to implementations of building an in-memory dentry tree
36 * from an on-disk directory structure. */
37 struct add_image_params {
38 /* Pointer to the lookup table of the WIM. */
39 struct wim_lookup_table *lookup_table;
41 /* Hash table of inodes that have been captured for this tree so far. */
42 struct wim_inode_table inode_table;
44 /* The set of security descriptors that have been captured for this
46 struct wim_sd_set sd_set;
48 /* Pointer to the capture configuration, which indicates whether any
49 * files should be excluded from capture or not. */
50 struct wimlib_capture_config *config;
52 /* Flags that affect the capture operation (WIMLIB_ADD_FLAG_*) */
55 /* Extra argument; set to point to a pointer to the ntfs_volume for
56 * libntfs-3g capture. */
62 /* If non-NULL, the user-supplied progress function. */
63 wimlib_progress_func_t progress_func;
66 union wimlib_progress_info progress;
70 /* capture_common.c */
73 do_capture_progress(struct add_image_params *params, int status);
76 exclude_path(const tchar *path, size_t path_len,
77 const struct wimlib_capture_config *config,
80 extern struct wimlib_capture_config *
81 copy_capture_config(const struct wimlib_capture_config *config);
84 copy_and_canonicalize_capture_config(const struct wimlib_capture_config *config,
85 struct wimlib_capture_config **config_copy_ret);
88 free_capture_config(struct wimlib_capture_config *config);
93 init_inode_table(struct wim_inode_table *table, size_t capacity);
96 inode_table_new_dentry(struct wim_inode_table *table, const tchar *name,
97 u64 ino, u64 devno, bool noshare,
98 struct wim_dentry **dentry_ret);
101 inode_table_prepare_inode_list(struct wim_inode_table *table,
102 struct list_head *head);
105 destroy_inode_table(struct wim_inode_table *table)
112 /* ntfs-3g_capture.c */
114 build_dentry_tree_ntfs(struct wim_dentry **root_p,
116 struct add_image_params *params);
120 /* win32_capture.c */
122 win32_build_dentry_tree(struct wim_dentry **root_ret,
123 const tchar *root_disk_path,
124 struct add_image_params *params);
128 unix_build_dentry_tree(struct wim_dentry **root_ret,
129 const tchar *root_disk_path,
130 struct add_image_params *params);
133 #define WIMLIB_ADD_FLAG_ROOT 0x80000000
135 #endif /* _WIMLIB_CAPTURE_H */