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;
13 /* Hash table to find inodes, given an inode number (in the case of reading
14 * a WIM images), or both an inode number and a device number (in the case of
15 * capturing a WIM image). */
16 struct wim_inode_table {
17 /* Fields for the hash table */
18 struct hlist_head *array;
23 * Linked list of "extra" inodes. These may be:
25 * - inodes with link count 1, which are all allowed to have 0 for their
26 * inode number, meaning we cannot insert them into the hash table.
28 * - Groups we create ourselves by splitting a nominal inode due to
29 * inconsistencies in the dentries. These inodes will share an inode
30 * number with some other inode until assign_inode_numbers() is
33 struct list_head extra_inodes;
36 /* Common parameters to implementations of building an in-memory dentry tree
37 * from an on-disk directory structure. */
38 struct add_image_params {
39 /* Pointer to the lookup table of the WIM. */
40 struct wim_lookup_table *lookup_table;
42 /* Hash table of inodes that have been captured for this tree so far. */
43 struct wim_inode_table inode_table;
45 /* The set of security descriptors that have been captured for this
47 struct wim_sd_set sd_set;
49 /* Pointer to the capture configuration, which indicates whether any
50 * files should be excluded from capture or not. */
51 struct wimlib_capture_config *config;
53 /* Flags that affect the capture operation (WIMLIB_ADD_FLAG_*) */
56 /* Extra argument; set to point to a pointer to the ntfs_volume for
57 * libntfs-3g capture. */
63 /* If non-NULL, the user-supplied progress function. */
64 wimlib_progress_func_t progress_func;
67 union wimlib_progress_info progress;
71 /* capture_common.c */
74 do_capture_progress(struct add_image_params *params, int status,
75 const struct wim_inode *inode);
78 exclude_path(const tchar *path, size_t path_len,
79 const struct wimlib_capture_config *config,
82 extern struct wimlib_capture_config *
83 copy_capture_config(const struct wimlib_capture_config *config);
86 copy_and_canonicalize_capture_config(const struct wimlib_capture_config *config,
87 struct wimlib_capture_config **config_copy_ret);
90 free_capture_config(struct wimlib_capture_config *config);
95 init_inode_table(struct wim_inode_table *table, size_t capacity);
98 inode_table_new_dentry(struct wim_inode_table *table, const tchar *name,
99 u64 ino, u64 devno, bool noshare,
100 struct wim_dentry **dentry_ret);
103 inode_table_prepare_inode_list(struct wim_inode_table *table,
104 struct list_head *head);
107 destroy_inode_table(struct wim_inode_table *table)
114 /* ntfs-3g_capture.c */
116 build_dentry_tree_ntfs(struct wim_dentry **root_p,
118 struct add_image_params *params);
122 /* win32_capture.c */
124 win32_build_dentry_tree(struct wim_dentry **root_ret,
125 const tchar *root_disk_path,
126 struct add_image_params *params);
130 unix_build_dentry_tree(struct wim_dentry **root_ret,
131 const tchar *root_disk_path,
132 struct add_image_params *params);
135 #define WIMLIB_ADD_FLAG_ROOT 0x80000000
137 #endif /* _WIMLIB_CAPTURE_H */