]> wimlib.net Git - wimlib/blob - include/wimlib/apply.h
Support extracting "long" paths on Windows
[wimlib] / include / wimlib / apply.h
1 #ifndef _WIMLIB_APPLY_H
2 #define _WIMLIB_APPLY_H
3
4 #include "wimlib.h"
5 #include "wimlib/types.h"
6
7 #ifdef WITH_NTFS_3G
8 struct _ntfs_volume;
9 #endif
10
11 struct apply_args {
12         WIMStruct *w;
13
14         /* Directory to which we're extracting the WIM image or directory tree,
15          * in user-specified form (may be slightly altered) */
16         const tchar *target;
17         unsigned target_nchars;
18
19 #ifdef __WIN32__
20         /* \\?\-prefixed full path to the above directory; needed to work around
21          * lack of default support for long paths on Windoze. */
22         tchar *target_lowlevel_path;
23         unsigned target_lowlevel_path_nchars;
24 #endif
25
26         /* Absolute path to the above directory; on UNIX this is simply a path
27          * beginning with /, while on Windoze this will be a path beginning with
28          * a drive letter followed by a backslash, but not with \\?\. */
29         tchar *target_realpath;
30         unsigned target_realpath_len;
31
32         struct wim_dentry *extract_root;
33         unsigned long invalid_sequence;
34         int extract_flags;
35         union wimlib_progress_info progress;
36         wimlib_progress_func_t progress_func;
37         int (*apply_dentry)(struct wim_dentry *, void *);
38         union {
39         #ifdef WITH_NTFS_3G
40                 struct {
41                         /* NTFS apply only */
42                         struct _ntfs_volume *vol;
43                 };
44         #endif
45         #ifdef __WIN32__
46                 struct {
47                         /* Normal apply only (Win32) */
48                         unsigned long num_set_sacl_priv_notheld;
49                         unsigned long num_set_sd_access_denied;
50                         unsigned vol_flags;
51                         unsigned long num_hard_links_failed;
52                         unsigned long num_soft_links_failed;
53                         unsigned long num_long_paths;
54                         bool have_vol_flags;
55                 };
56         #else
57                 struct {
58                         /* Normal apply only (UNIX) */
59                         unsigned long num_utime_warnings;
60                 };
61         #endif
62         };
63 };
64
65 #ifdef WITH_NTFS_3G
66 extern int
67 apply_dentry_ntfs(struct wim_dentry *dentry, void *arg);
68
69 extern int
70 apply_dentry_timestamps_ntfs(struct wim_dentry *dentry, void *arg);
71 #endif
72
73 #ifdef __WIN32__
74 extern int
75 win32_do_apply_dentry(const tchar *output_path,
76                       size_t output_path_nbytes,
77                       struct wim_dentry *dentry,
78                       struct apply_args *args);
79
80 extern int
81 win32_do_apply_dentry_timestamps(const tchar *output_path,
82                                  size_t output_path_nbytes,
83                                  struct wim_dentry *dentry,
84                                  struct apply_args *args);
85 #else /* __WIN32__ */
86 extern int
87 unix_do_apply_dentry(const tchar *output_path, size_t output_path_nbytes,
88                      struct wim_dentry *dentry, struct apply_args *args);
89 extern int
90 unix_do_apply_dentry_timestamps(const tchar *output_path,
91                                 size_t output_path_nbytes,
92                                 struct wim_dentry *dentry,
93                                 struct apply_args *args);
94 #endif /* !__WIN32__ */
95
96 /* Internal use only */
97 #define WIMLIB_EXTRACT_FLAG_MULTI_IMAGE         0x80000000
98 #define WIMLIB_EXTRACT_FLAG_NO_STREAMS          0x40000000
99 #define WIMLIB_EXTRACT_MASK_PUBLIC              0x3fffffff
100
101
102 #endif /* _WIMLIB_APPLY_H */