+/** Fail immediately if the full security descriptor of any file or directory
+ * cannot be set exactly as specified in the WIM file. The default behavior
+ * without this flag is to fall back to setting the security descriptor with the
+ * SACL omitted, then only the default inherited security descriptor, if we do
+ * not have permission to set the desired one. */
+#define WIMLIB_EXTRACT_FLAG_STRICT_ACLS 0x00000080
+
+/* Extract equivalent to ::WIMLIB_ADD_FLAG_RPFIX; force reparse-point
+ * fixups on, so absolute symbolic links or junction points will be fixed to be
+ * absolute relative to the actual extraction root. Done by default if
+ * WIM_HDR_FLAG_RP_FIX is set in the WIM header. This flag may only be
+ * specified when extracting a full image. */
+#define WIMLIB_EXTRACT_FLAG_RPFIX 0x00000100
+
+/** Force reparse-point fixups on extraction off, regardless of the state of the
+ * WIM_HDR_FLAG_RP_FIX flag in the WIM header. */
+#define WIMLIB_EXTRACT_FLAG_NORPFIX 0x00000200
+
+/** Extract files to standard output rather than to the filesystem. */
+#define WIMLIB_EXTRACT_FLAG_TO_STDOUT 0x00000400
+
+/******************************
+ * WIMLIB_MOUNT_FLAG_*
+ ******************************/
+
+/** Mount the WIM image read-write rather than the default of read-only. */
+#define WIMLIB_MOUNT_FLAG_READWRITE 0x00000001
+
+/** Enable FUSE debugging by passing the @c -d flag to @c fuse_main().*/
+#define WIMLIB_MOUNT_FLAG_DEBUG 0x00000002
+
+/** Do not allow accessing alternate data streams in the mounted WIM image. */
+#define WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_NONE 0x00000004
+
+/** Access alternate data streams in the mounted WIM image through extended file
+ * attributes. This is the default mode. */
+#define WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_XATTR 0x00000008
+
+/** Access alternate data streams in the mounted WIM image by specifying the
+ * file name, a colon, then the alternate file stream name. */
+#define WIMLIB_MOUNT_FLAG_STREAM_INTERFACE_WINDOWS 0x00000010
+
+/** Use UNIX file owners, groups, and modes if available in the WIM (see
+ * ::WIMLIB_ADD_FLAG_UNIX_DATA). */
+#define WIMLIB_MOUNT_FLAG_UNIX_DATA 0x00000020
+
+/** Allow other users to see the mounted filesystem. (this passes the @c
+ * allow_other option to FUSE mount) */
+#define WIMLIB_MOUNT_FLAG_ALLOW_OTHER 0x00000040
+
+/******************************
+ * WIMLIB_OPEN_FLAG_*
+ ******************************/
+
+/** Verify the WIM contents against the WIM's integrity table, if present. */
+#define WIMLIB_OPEN_FLAG_CHECK_INTEGRITY 0x00000001
+
+/** Do not issue an error if the WIM is part of a split WIM. */
+#define WIMLIB_OPEN_FLAG_SPLIT_OK 0x00000002
+
+/******************************
+ * WIMLIB_UNMOUNT_FLAG_*
+ ******************************/
+
+/** Include an integrity table in the WIM after it's been unmounted. Ignored
+ * for read-only mounts. */
+#define WIMLIB_UNMOUNT_FLAG_CHECK_INTEGRITY 0x00000001
+
+/** Unless this flag is given, changes to a read-write mounted WIM are
+ * discarded. Ignored for read-only mounts. */
+#define WIMLIB_UNMOUNT_FLAG_COMMIT 0x00000002
+
+/** See ::WIMLIB_WRITE_FLAG_REBUILD */
+#define WIMLIB_UNMOUNT_FLAG_REBUILD 0x00000004
+
+/** See ::WIMLIB_WRITE_FLAG_RECOMPRESS */
+#define WIMLIB_UNMOUNT_FLAG_RECOMPRESS 0x00000008
+
+/******************************
+ * WIMLIB_WRITE_FLAG_*
+ ******************************/
+
+/** Include an integrity table in the new WIM file. */
+#define WIMLIB_WRITE_FLAG_CHECK_INTEGRITY 0x00000001
+
+/** Re-build the entire WIM file rather than appending data to it, if possible.
+ * (Applies to wimlib_overwrite(), not wimlib_write()). */
+#define WIMLIB_WRITE_FLAG_REBUILD 0x00000002
+
+/** Recompress all resources, even if they could otherwise be copied from a
+ * different WIM with the same compression type (in the case of
+ * wimlib_export_image() being called previously). */
+#define WIMLIB_WRITE_FLAG_RECOMPRESS 0x00000004
+
+/** Call fsync() when the WIM file is closed */
+#define WIMLIB_WRITE_FLAG_FSYNC 0x00000008
+
+/* Specifying this flag overrides the default behavior of wimlib_overwrite()
+ * after one or more calls to wimlib_delete_image(), which is to rebuild the
+ * entire WIM.
+ *
+ * If you specifiy this flag to wimlib_overwrite(), only minimal changes to
+ * correctly remove the image from the WIM will be taken. In particular, all
+ * streams will be left alone, even if they are no longer referenced. This is
+ * probably not what you want, because almost no space will be spaced by
+ * deleting an image in this way. */
+#define WIMLIB_WRITE_FLAG_SOFT_DELETE 0x00000010
+
+/******************************
+ * WIMLIB_INIT_FLAG_*
+ ******************************/
+
+/** Assume that strings are represented in UTF-8, even if this is not the
+ * locale's character encoding. */
+#define WIMLIB_INIT_FLAG_ASSUME_UTF8 0x00000001
+
+/** Specification of an update to perform on a WIM image. */
+struct wimlib_update_command {
+
+ /** The specific type of update to perform. */
+ enum wimlib_update_op {
+ /** Add a new file or directory tree to the WIM image in a
+ * certain location. */
+ WIMLIB_UPDATE_OP_ADD = 0,
+
+ /** Delete a file or directory tree from the WIM image. */
+ WIMLIB_UPDATE_OP_DELETE,
+
+ /** Rename a file or directory tree in the WIM image. */
+ WIMLIB_UPDATE_OP_RENAME,
+ } op;
+ union {
+ /** Data for a ::WIMLIB_UPDATE_OP_ADD operation. */
+ struct wimlib_add_command {
+ /** Filesystem path to the file or directory tree to
+ * add. */
+ wimlib_tchar *fs_source_path;
+ /** Path, specified from the root of the WIM image, at
+ * which to add the file or directory tree within the
+ * WIM image. */
+ wimlib_tchar *wim_target_path;
+
+ /** Configuration for excluded files. @c NULL means
+ * exclude no files. */
+ struct wimlib_capture_config *config;
+
+ /** Bitwise OR of WIMLIB_ADD_FLAG_* flags. */
+ int add_flags;
+ } add;
+ /** Data for a ::WIMLIB_UPDATE_OP_DELETE operation. */
+ struct wimlib_delete_command {
+ /** Path, specified from the root of the WIM image, for
+ * the file or directory tree within the WIM image to be
+ * deleted. */
+ wimlib_tchar *wim_path;
+ /** Bitwise OR of WIMLIB_DELETE_FLAG_* flags. */
+ int delete_flags;
+ } delete;
+ /** Data for a ::WIMLIB_UPDATE_OP_RENAME operation. */
+ struct wimlib_rename_command {
+ /** Path, specified from the root of the WIM image, for
+ * the source file or directory tree within the WIM
+ * image. */
+ wimlib_tchar *wim_source_path;
+ /** Path, specified from the root of the WIM image, for
+ * the destination file or directory tree within the WIM
+ * image. */
+ wimlib_tchar *wim_target_path;
+ /** Reserved; set to 0. */
+ int rename_flags;
+ } rename;
+ };
+};
+
+/** Specification of a file or directory tree to extract from a WIM image. */
+struct wimlib_extract_command {
+ /** Path to file or directory tree within the WIM image to extract. It
+ * must be provided as an absolute path from the root of the WIM image.
+ * The path separators may be either forward slashes or backslashes. */
+ wimlib_tchar *wim_source_path;
+
+ /** Filesystem path to extract the file or directory tree to. */
+ wimlib_tchar *fs_dest_path;
+
+ /** Bitwise or of zero or more of the WIMLIB_EXTRACT_FLAG_* flags. */
+ int extract_flags;
+};