1 #ifndef _WIMLIB_APPLY_H
2 #define _WIMLIB_APPLY_H
4 #include "wimlib/file_io.h"
5 #include "wimlib/list.h"
6 #include "wimlib/progress.h"
7 #include "wimlib/types.h"
10 /* These can be treated as counts (for required_features) or booleans (for
11 * supported_features). */
13 unsigned long archive_files;
14 unsigned long hidden_files;
15 unsigned long system_files;
16 unsigned long compressed_files;
17 unsigned long encrypted_files;
18 unsigned long encrypted_directories;
19 unsigned long not_context_indexed_files;
20 unsigned long sparse_files;
21 unsigned long named_data_streams;
22 unsigned long hard_links;
23 unsigned long reparse_points;
24 unsigned long symlink_reparse_points;
25 unsigned long other_reparse_points;
26 unsigned long security_descriptors;
27 unsigned long short_names;
28 unsigned long unix_data;
29 unsigned long timestamps;
30 unsigned long case_sensitive_filenames;
33 struct wim_lookup_table_entry;
34 struct read_stream_list_callbacks;
37 /* The WIMStruct from which files are being extracted from the currently
41 /* The target of the extraction, usually the path to a directory. */
44 /* Length of @target in tchars. */
47 /* Extraction flags (WIMLIB_EXTRACT_FLAG_*) */
50 /* User-provided progress function, or NULL if not specified. */
51 wimlib_progress_func_t progfunc;
54 /* Progress data buffer, with progress.extract initialized. */
55 union wimlib_progress_info progress;
57 /* Features required to extract the files (with counts) */
58 struct wim_features required_features;
60 /* Features supported by the extraction mode (with booleans) */
61 struct wim_features supported_features;
63 /* The members below should not be used outside of extract.c */
65 unsigned long invalid_sequence;
66 unsigned long num_streams_remaining;
67 struct list_head stream_list;
68 const struct read_stream_list_callbacks *saved_cbs;
69 struct wim_lookup_table_entry *cur_stream;
70 struct filedes tmpfile_fd;
74 /* Maximum number of UNIX file descriptors, NTFS attributes, or Windows file
75 * handles that can be opened simultaneously to extract a single-instance
76 * stream to multiple destinations. */
77 #define MAX_OPEN_STREAMS 512
80 extract_progress(struct apply_ctx *ctx, enum wimlib_progress_msg msg)
82 return call_progress(ctx->progfunc, msg, &ctx->progress, ctx->progctx);
85 /* Returns any of the aliases of an inode that are being extracted. */
86 #define inode_first_extraction_dentry(inode) \
87 list_first_entry(&(inode)->i_extraction_aliases, \
88 struct wim_dentry, d_extraction_alias_node)
91 extract_stream_list(struct apply_ctx *ctx,
92 const struct read_stream_list_callbacks *cbs);
94 struct apply_operations {
96 int (*get_supported_features)(const tchar *target,
97 struct wim_features *supported_features);
99 int (*extract)(struct list_head *dentry_list, struct apply_ctx *ctx);
102 bool single_tree_only;
106 extern const struct apply_operations win32_apply_ops;
108 extern const struct apply_operations unix_apply_ops;
112 extern const struct apply_operations ntfs_3g_apply_ops;
115 #endif /* _WIMLIB_APPLY_H */