+#define WIM_INTEGRITY_OK 0
+#define WIM_INTEGRITY_NOT_OK -1
+#define WIM_INTEGRITY_NONEXISTENT -2
+
+extern int
+write_integrity_table(int fd,
+ struct resource_entry *integrity_res_entry,
+ off_t new_lookup_table_end,
+ off_t old_lookup_table_end,
+ wimlib_progress_func_t progress_func);
+
+extern int
+check_wim_integrity(WIMStruct *w, wimlib_progress_func_t progress_func);
+
+/* join.c */
+
+extern int
+new_joined_lookup_table(WIMStruct *w, WIMStruct **additional_swms,
+ unsigned num_additional_swms,
+ struct wim_lookup_table **table_ret);
+
+/* metadata_resource.c */
+
+extern int
+read_metadata_resource(WIMStruct *w,
+ struct wim_image_metadata *image_metadata);
+
+extern int
+write_metadata_resource(WIMStruct *w);
+
+/* ntfs-apply.c */
+
+struct apply_args {
+ WIMStruct *w;
+ const tchar *target;
+ unsigned target_nchars;
+ unsigned wim_source_path_nchars;
+ struct wim_dentry *extract_root;
+ tchar *target_realpath;
+ unsigned target_realpath_len;
+ int extract_flags;
+ union wimlib_progress_info progress;
+ wimlib_progress_func_t progress_func;
+ int (*apply_dentry)(struct wim_dentry *, void *);
+ union {
+ #ifdef WITH_NTFS_3G
+ struct {
+ /* NTFS apply only */
+ struct _ntfs_volume *vol;
+ };
+ #endif
+ #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;
+ unsigned long num_soft_links_failed;
+ bool have_vol_flags;
+ };
+ #else
+ struct {
+ /* Normal apply only (UNIX) */
+ unsigned long num_utime_warnings;
+ };
+ #endif
+ };
+};
+
+extern int
+apply_dentry_ntfs(struct wim_dentry *dentry, void *arg);
+
+extern int
+apply_dentry_timestamps_ntfs(struct wim_dentry *dentry, void *arg);
+
+extern void
+libntfs3g_global_init();
+
+/* ntfs-capture.c */
+
+typedef int (*consume_data_callback_t)(const void *buf, size_t len, void *ctx);
+
+extern int
+read_ntfs_file_prefix(const struct wim_lookup_table_entry *lte,
+ u64 size,
+ consume_data_callback_t cb,
+ void *ctx_or_buf,
+ int _ignored_flags);
+extern int
+build_dentry_tree_ntfs(struct wim_dentry **root_p,
+ const tchar *device,
+ struct add_image_params *ctx);
+
+#ifdef WITH_NTFS_3G
+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);
+