]> wimlib.net Git - wimlib/blobdiff - src/wimlib_internal.h
mount_image.c: Use fuse_context.umask only when available
[wimlib] / src / wimlib_internal.h
index 10784571a0118eee4b00627f5d9866e08a8a2a3a..d0b2f89cd2fc8035a38a39afba7b1f6736d70130 100644 (file)
@@ -474,7 +474,8 @@ init_inode_table(struct wim_inode_table *table, size_t capacity);
 
 extern int
 inode_table_new_dentry(struct wim_inode_table *table, const tchar *name,
-                      u64 ino, u64 devno, struct wim_dentry **dentry_ret);
+                      u64 ino, u64 devno, bool noshare,
+                      struct wim_dentry **dentry_ret);
 
 extern void
 inode_ref_streams(struct wim_inode *inode);
@@ -540,6 +541,8 @@ write_metadata_resource(WIMStruct *w);
 struct apply_args {
        WIMStruct *w;
        const tchar *target;
+       tchar *target_realpath;
+       unsigned target_realpath_len;
        int extract_flags;
        union wimlib_progress_info progress;
        wimlib_progress_func_t progress_func;
@@ -551,18 +554,21 @@ struct apply_args {
                        struct _ntfs_volume *vol;
                };
        #endif
-               struct {
-                       /* Normal apply only (UNIX) */
-                       unsigned long num_utime_warnings;
-               };
-
+       #ifdef __WIN32__
                struct {
                        /* Normal apply only (Win32) */
                        unsigned long num_set_sacl_priv_notheld;
                        unsigned long num_set_sd_access_denied;
                        unsigned vol_flags;
+                       unsigned long num_hard_links_failed;
                        bool have_vol_flags;
                };
+       #else
+               struct {
+                       /* Normal apply only (UNIX) */
+                       unsigned long num_utime_warnings;
+               };
+       #endif
        };
 };
 
@@ -595,6 +601,74 @@ extern int
 do_ntfs_umount(struct _ntfs_volume *vol);
 #endif
 
+/* reparse.c */
+
+/* Structured format for symbolic link, junction point, or mount point reparse
+ * data. */
+struct reparse_data {
+       /* Reparse point tag (see WIM_IO_REPARSE_TAG_* values) */
+       u32 rptag;
+
+       /* Length of reparse data, not including the 8-byte header (ReparseTag,
+        * ReparseDataLength, ReparseReserved) */
+       u16 rpdatalen;
+
+       /* ReparseReserved */
+       u16 rpreserved;
+
+       /* Flags (only for WIM_IO_REPARSE_TAG_SYMLINK reparse points).
+        * SYMBOLIC_LINK_RELATIVE means this is a relative symbolic link;
+        * otherwise should be set to 0. */
+#define SYMBOLIC_LINK_RELATIVE 0x00000001
+       u32 rpflags;
+
+       /* Pointer to the substitute name of the link (UTF-16LE). */
+       utf16lechar *substitute_name;
+
+       /* Pointer to the print name of the link (UTF-16LE). */
+       utf16lechar *print_name;
+
+       /* Number of bytes of the substitute name, not including null terminator
+        * if present */
+       u16 substitute_name_nbytes;
+
+       /* Number of bytes of the print name, not including null terminator if
+        * present */
+       u16 print_name_nbytes;
+};
+
+enum {
+       SUBST_NAME_IS_RELATIVE_LINK = -1,
+       SUBST_NAME_IS_VOLUME_JUNCTION = -2,
+       SUBST_NAME_IS_UNKNOWN = -3,
+};
+extern int
+parse_substitute_name(const utf16lechar *substitute_name,
+                     u16 substitute_name_nbytes,
+                     u32 rptag);
+
+extern int
+parse_reparse_data(const u8 *rpbuf, u16 rpbuflen, struct reparse_data *rpdata);
+
+extern int
+make_reparse_buffer(const struct reparse_data *rpdata, u8 *buf);
+
+extern int
+wim_inode_get_reparse_data(const struct wim_inode *inode, u8 *rpbuf);
+
+#ifndef __WIN32__
+ssize_t
+wim_inode_readlink(const struct wim_inode *inode, char *buf, size_t buf_len);
+
+extern int
+wim_inode_set_symlink(struct wim_inode *inode, const char *target,
+                     struct wim_lookup_table *lookup_table);
+#endif
+extern tchar *
+capture_fixup_absolute_symlink(tchar *dest,
+                              u64 capture_root_ino, u64 capture_root_dev);
+
+
 /* resource.c */
 
 #define WIMLIB_RESOURCE_FLAG_RAW               0x1
@@ -657,19 +731,6 @@ write_security_data(const struct wim_security_data *sd, u8 *p);
 extern void
 free_security_data(struct wim_security_data *sd);
 
-/* symlink.c */
-
-#ifndef __WIN32__
-ssize_t
-inode_readlink(const struct wim_inode *inode, char *buf, size_t buf_len,
-              const WIMStruct *w, bool threadsafe);
-
-extern int
-inode_set_symlink(struct wim_inode *inode, const char *target,
-                 struct wim_lookup_table *lookup_table,
-                 struct wim_lookup_table_entry **lte_ret);
-#endif
-
 /* verify.c */
 
 extern int