1 #ifndef _WIMLIB_REPARSE_H
2 #define _WIMLIB_REPARSE_H
6 #include "wimlib/types.h"
10 struct blob_descriptor;
12 #define REPARSE_POINT_MAX_SIZE (16 * 1024)
14 /* On-disk format of reparse point buffer */
15 struct reparse_buffer_disk {
20 u8 rpdata[REPARSE_POINT_MAX_SIZE - 8];
23 le16 substitute_name_offset;
24 le16 substitute_name_nbytes;
25 le16 print_name_offset;
26 le16 print_name_nbytes;
28 u8 data[REPARSE_POINT_MAX_SIZE - 20];
29 } _packed_attribute symlink;
32 le16 substitute_name_offset;
33 le16 substitute_name_nbytes;
34 le16 print_name_offset;
35 le16 print_name_nbytes;
36 u8 data[REPARSE_POINT_MAX_SIZE - 16];
37 } _packed_attribute junction;
41 #define REPARSE_DATA_OFFSET (offsetof(struct reparse_buffer_disk, rpdata))
43 #define REPARSE_DATA_MAX_SIZE (REPARSE_POINT_MAX_SIZE - REPARSE_DATA_OFFSET)
46 /* Structured format for symbolic link, junction point, or mount point reparse
49 /* Reparse point tag (see WIM_IO_REPARSE_TAG_* values) */
52 /* Length of reparse data, not including the 8-byte header (ReparseTag,
53 * ReparseDataLength, ReparseReserved) */
59 /* Flags (only for WIM_IO_REPARSE_TAG_SYMLINK reparse points).
60 * SYMBOLIC_LINK_RELATIVE means this is a relative symbolic link;
61 * otherwise should be set to 0. */
62 #define SYMBOLIC_LINK_RELATIVE 0x00000001
65 /* Pointer to the substitute name of the link (UTF-16LE). */
66 utf16lechar *substitute_name;
68 /* Pointer to the print name of the link (UTF-16LE). */
69 utf16lechar *print_name;
71 /* Number of bytes of the substitute name, not including null terminator
73 u16 substitute_name_nbytes;
75 /* Number of bytes of the print name, not including null terminator if
77 u16 print_name_nbytes;
81 parse_reparse_data(const u8 * restrict rpbuf, u16 rpbuflen,
82 struct reparse_data * restrict rpdata);
85 make_reparse_buffer(const struct reparse_data * restrict rpdata,
87 u16 * restrict rpbuflen_ret);
91 wim_inode_readlink(const struct wim_inode * restrict inode, char * restrict buf,
92 size_t buf_len, struct blob_descriptor *blob);
95 wim_inode_set_symlink(struct wim_inode *inode, const char *target,
96 struct blob_table *blob_table);
99 #endif /* _WIMLIB_REPARSE_H */