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 /* If non-NULL, the user-supplied progress function. */
56 wimlib_progress_func_t progress_func;
58 /* Extra argument; set to point to a pointer to the ntfs_volume for
59 * libntfs-3g capture. */
67 /* capture_common.c */
70 exclude_path(const tchar *path, size_t path_len,
71 const struct wimlib_capture_config *config,
74 extern struct wimlib_capture_config *
75 copy_capture_config(const struct wimlib_capture_config *config);
78 copy_and_canonicalize_capture_config(const struct wimlib_capture_config *config,
79 struct wimlib_capture_config **config_copy_ret);
82 free_capture_config(struct wimlib_capture_config *config);
87 init_inode_table(struct wim_inode_table *table, size_t capacity);
90 inode_table_new_dentry(struct wim_inode_table *table, const tchar *name,
91 u64 ino, u64 devno, bool noshare,
92 struct wim_dentry **dentry_ret);
95 inode_table_prepare_inode_list(struct wim_inode_table *table,
96 struct list_head *head);
99 destroy_inode_table(struct wim_inode_table *table)
106 /* ntfs-3g_capture.c */
108 build_dentry_tree_ntfs(struct wim_dentry **root_p,
110 struct add_image_params *params);
114 /* win32_capture.c */
116 win32_build_dentry_tree(struct wim_dentry **root_ret,
117 const tchar *root_disk_path,
118 struct add_image_params *params);
122 unix_build_dentry_tree(struct wim_dentry **root_ret,
123 const tchar *root_disk_path,
124 struct add_image_params *params);
127 #define WIMLIB_ADD_FLAG_ROOT 0x80000000
129 #endif /* _WIMLIB_CAPTURE_H */