X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fdentry.h;h=1500bd7c3c63238ff07baeadb0b59ddb2c9d33be;hb=fcc8d33acee4c9ab11ebe975da030c6e53b182e3;hp=5f7ccd5b6cf886837a5c7cf5b5d692198f5216ce;hpb=7ce0d372fae285051cbc9740c9fa316d22465d9d;p=wimlib diff --git a/src/dentry.h b/src/dentry.h index 5f7ccd5b..1500bd7c 100644 --- a/src/dentry.h +++ b/src/dentry.h @@ -78,12 +78,16 @@ struct wim_ads_entry { * terminating null character. */ u16 stream_name_nbytes; - /* Stream name (UTF-16LE) */ - utf16lechar *stream_name; - /* Number to identify an alternate data stream even after it's possibly * been moved or renamed. */ u32 stream_id; + + /* Stream name (UTF-16LE) */ + utf16lechar *stream_name; + + /* Unused field. We read it into memory so we can write it out + * unchanged. */ + u64 unused; }; @@ -143,8 +147,8 @@ struct wim_dentry { * including the terminating null character. */ u32 full_path_nbytes; - /* Has this dentry been extracted yet? */ - u8 is_extracted : 1; + /* Does this dentry need to be extracted? */ + u8 needs_extraction : 1; /* Only used during NTFS capture */ u8 is_win32_name : 1; @@ -231,9 +235,21 @@ struct wim_inode { /* Used only in NTFS-mode extraction */ u8 i_dos_name_extracted : 1; + /* Set to 0 if reparse point fixups have been done. Otherwise set to 1. + * + * Note: this actually may reflect the SYMBOLIC_LINK_RELATIVE flag. */ + u16 i_not_rpfixed; + /* Number of alternate data streams associated with this inode */ u16 i_num_ads; + /* Unused/unknown fields that we just read into memory so we can + * re-write them unchanged. */ + u64 i_unused_1; + u64 i_unused_2; + u32 i_rp_unknown_1; + u16 i_rp_unknown_2; + /* A hash of the file's contents, or a pointer to the lookup table entry * for this dentry if the lookup table entries have been resolved. * @@ -259,6 +275,9 @@ struct wim_inode { /* Inode number */ u64 i_ino; + /* Device number, used only during image capture */ + u64 i_devno; + /* List of dentries that reference this inode (there should be * link_count of them) */ struct list_head i_dentry; @@ -268,15 +287,6 @@ struct wim_inode { struct list_head i_list; }; - union { - /* Used during image extraction to build a list of inodes that - * share a certain stream */ - struct list_head i_lte_inode_list; - - /* Device number, used only during image capture */ - u64 i_devno; - }; - tchar *i_extracted_file; /* Root of a red-black tree storing the children of this inode (if @@ -372,6 +382,9 @@ print_dentry(struct wim_dentry *dentry, void *lookup_table); extern int print_dentry_full_path(struct wim_dentry *entry, void *ignore); +extern int +calculate_dentry_tree_full_paths(struct wim_dentry *root); + extern tchar * dentry_full_path(struct wim_dentry *dentry); @@ -387,6 +400,9 @@ new_dentry_with_inode(const tchar *name, struct wim_dentry **dentry_ret); extern int new_dentry_with_timeless_inode(const tchar *name, struct wim_dentry **dentry_ret); +extern int +new_filler_directory(const tchar *name, struct wim_dentry **dentry_ret); + extern void free_inode(struct wim_inode *inode); @@ -403,7 +419,7 @@ free_dentry_tree(struct wim_dentry *root, extern void unlink_dentry(struct wim_dentry *dentry); -extern bool +extern struct wim_dentry * dentry_add_child(struct wim_dentry * restrict parent, struct wim_dentry * restrict child); @@ -424,6 +440,10 @@ inode_add_ads_with_data(struct wim_inode *inode, const tchar *name, const void *value, size_t size, struct wim_lookup_table *lookup_table); +extern int +inode_set_unnamed_stream(struct wim_inode *inode, const void *data, size_t len, + struct wim_lookup_table *lookup_table); + extern void inode_remove_ads(struct wim_inode *inode, u16 idx, struct wim_lookup_table *lookup_table); @@ -436,7 +456,7 @@ inode_remove_ads(struct wim_inode *inode, u16 idx, #define WIMLIB_UNIX_DATA_TAG_UTF16LE_NBYTES (sizeof(WIMLIB_UNIX_DATA_TAG_UTF16LE) - 1) /* Format for special alternate data stream entries to store UNIX data for files - * and directories (see: WIMLIB_ADD_IMAGE_FLAG_UNIX_DATA) */ + * and directories (see: WIMLIB_ADD_FLAG_UNIX_DATA) */ struct wimlib_unix_data { u16 version; /* Must be 0 */ u16 uid; @@ -500,8 +520,8 @@ static inline bool inode_is_symlink(const struct wim_inode *inode) { return (inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT) - && ((inode->i_reparse_tag == WIM_IO_REPARSE_TAG_SYMLINK) || - inode->i_reparse_tag == WIM_IO_REPARSE_TAG_MOUNT_POINT); + && (inode->i_reparse_tag == WIM_IO_REPARSE_TAG_SYMLINK || + inode->i_reparse_tag == WIM_IO_REPARSE_TAG_MOUNT_POINT); } static inline bool