1 #ifndef _WIMLIB_REPARSE_H
2 #define _WIMLIB_REPARSE_H
4 #include "wimlib/types.h"
7 struct wim_lookup_table;
9 #define REPARSE_POINT_MAX_SIZE (16 * 1024)
11 /* Structured format for symbolic link, junction point, or mount point reparse
14 /* Reparse point tag (see WIM_IO_REPARSE_TAG_* values) */
17 /* Length of reparse data, not including the 8-byte header (ReparseTag,
18 * ReparseDataLength, ReparseReserved) */
24 /* Flags (only for WIM_IO_REPARSE_TAG_SYMLINK reparse points).
25 * SYMBOLIC_LINK_RELATIVE means this is a relative symbolic link;
26 * otherwise should be set to 0. */
27 #define SYMBOLIC_LINK_RELATIVE 0x00000001
30 /* Pointer to the substitute name of the link (UTF-16LE). */
31 utf16lechar *substitute_name;
33 /* Pointer to the print name of the link (UTF-16LE). */
34 utf16lechar *print_name;
36 /* Number of bytes of the substitute name, not including null terminator
38 u16 substitute_name_nbytes;
40 /* Number of bytes of the print name, not including null terminator if
42 u16 print_name_nbytes;
46 SUBST_NAME_IS_RELATIVE_LINK = -1,
47 SUBST_NAME_IS_VOLUME_JUNCTION = -2,
48 SUBST_NAME_IS_UNKNOWN = -3,
51 parse_substitute_name(const utf16lechar *substitute_name,
52 u16 substitute_name_nbytes,
56 parse_reparse_data(const u8 * restrict rpbuf, u16 rpbuflen,
57 struct reparse_data * restrict rpdata);
60 make_reparse_buffer(const struct reparse_data * restrict rpdata,
62 u16 * restrict rpbuflen_ret);
65 wim_inode_get_reparse_data(const struct wim_inode * restrict inode,
67 u16 * restrict rpbuflen_ret,
68 struct wim_lookup_table_entry *lte_override);
72 wim_inode_readlink(const struct wim_inode * restrict inode, char * restrict buf,
73 size_t buf_len, struct wim_lookup_table_entry *lte);
76 wim_inode_set_symlink(struct wim_inode *inode, const char *target,
77 struct wim_lookup_table *lookup_table);
81 capture_fixup_absolute_symlink(tchar *dest,
82 u64 capture_root_ino, u64 capture_root_dev);
84 #endif /* _WIMLIB_REPARSE_H */