]> wimlib.net Git - wimlib/blob - include/wimlib/capture.h
7ff82db233d4c2f4b0dba989c1a8955cbb71504f
[wimlib] / include / wimlib / capture.h
1 #ifndef _WIMLIB_CAPTURE_H
2 #define _WIMLIB_CAPTURE_H
3
4 #include "wimlib.h"
5 #include "wimlib/inode_table.h"
6 #include "wimlib/list.h"
7 #include "wimlib/security.h"
8 #include "wimlib/util.h"
9
10 struct wim_lookup_table;
11 struct wim_dentry;
12 struct wim_inode;
13
14 /* Common parameters to implementations of building an in-memory dentry tree
15  * from an on-disk directory structure. */
16 struct add_image_params {
17         /* Pointer to the lookup table of the WIM.  */
18         struct wim_lookup_table *lookup_table;
19
20         /* List of streams that have been added so far, but without their SHA1
21          * message digests being calculated (as a shortcut).  */
22         struct list_head *unhashed_streams;
23
24         /* Hash table of inodes that have been captured for this tree so far. */
25         struct wim_inode_table inode_table;
26
27         /* The set of security descriptors that have been captured for this
28          * image so far. */
29         struct wim_sd_set sd_set;
30
31         /* Pointer to the capture configuration, which indicates whether any
32          * files should be excluded from capture or not. */
33         struct wimlib_capture_config *config;
34
35         /* Flags that affect the capture operation (WIMLIB_ADD_FLAG_*) */
36         int add_flags;
37
38         /* Extra argument; set to point to a pointer to the ntfs_volume for
39          * libntfs-3g capture.  */
40         void *extra_arg;
41
42         u64 capture_root_ino;
43         u64 capture_root_dev;
44
45         /* If non-NULL, the user-supplied progress function. */
46         wimlib_progress_func_t progress_func;
47
48         /* Progress data.  */
49         union wimlib_progress_info progress;
50 };
51
52
53 /* capture_common.c */
54
55 extern void
56 do_capture_progress(struct add_image_params *params, int status,
57                     const struct wim_inode *inode);
58
59 extern bool
60 exclude_path(const tchar *path, size_t path_len,
61              const struct wimlib_capture_config *config,
62              bool exclude_prefix);
63
64 extern struct wimlib_capture_config *
65 copy_capture_config(const struct wimlib_capture_config *config);
66
67 extern int
68 copy_and_canonicalize_capture_config(const struct wimlib_capture_config *config,
69                                      struct wimlib_capture_config **config_copy_ret);
70
71 extern void
72 free_capture_config(struct wimlib_capture_config *config);
73
74
75 #ifdef WITH_NTFS_3G
76 /* ntfs-3g_capture.c */
77 extern int
78 build_dentry_tree_ntfs(struct wim_dentry **root_p,
79                        const tchar *device,
80                        struct add_image_params *params);
81 #endif
82
83 #ifdef __WIN32__
84 /* win32_capture.c */
85 extern int
86 win32_build_dentry_tree(struct wim_dentry **root_ret,
87                         const tchar *root_disk_path,
88                         struct add_image_params *params);
89 #else
90 /* unix_capture.c */
91 extern int
92 unix_build_dentry_tree(struct wim_dentry **root_ret,
93                        const tchar *root_disk_path,
94                        struct add_image_params *params);
95 #endif
96
97 #define WIMLIB_ADD_FLAG_ROOT    0x80000000
98
99 #endif /* _WIMLIB_CAPTURE_H */