# define _wimlib_deprecated
#endif
+#define WIMLIB_GUID_LEN 16
+
/**
* Specifies the compression type of a WIM file.
*/
* info will point to ::wimlib_progress_info.extract. */
WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS,
- /** Reserved. */
- WIMLIB_PROGRESS_MSG_EXTRACT_RESERVED,
+ /** Starting to read a new part of a split pipable WIM over the pipe.
+ * @a info will point to ::wimlib_progress_info.extract. */
+ WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN,
/** All the WIM files and directories have been extracted, and
* timestamps are about to be applied. @a info will point to
* ::wimlib_progress_info.integrity. */
WIMLIB_PROGRESS_MSG_CALC_INTEGRITY,
- /** A wimlib_join() operation is in progress. @a info will point to
- * ::wimlib_progress_info.join. */
- WIMLIB_PROGRESS_MSG_JOIN_STREAMS,
+ /** Reserved. (Previously used for WIMLIB_PROGRESS_MSG_JOIN_STREAMS,
+ * but in wimlib v1.5.0 this was removed to simplify the code and now
+ * you'll get ::WIMLIB_PROGRESS_MSG_WRITE_STREAMS messages instead.) */
+ WIMLIB_PROGRESS_MSG_RESERVED,
/** A wimlib_split() operation is in progress, and a new split part is
* about to be started. @a info will point to
* (The actual number of bytes will be less if the data is being
* written compressed.) */
uint64_t total_bytes;
+
/** Number of streams that are going to be written. */
uint64_t total_streams;
uint64_t completed_streams;
/** Number of threads that are being used to compress resources
- * (if applicable). */
+ * (if applicable). */
unsigned num_threads;
/** The compression type being used to write the streams; either
* ::WIMLIB_COMPRESSION_TYPE_LZX. */
int compression_type;
- /** Library internal use only. */
- uint64_t _private;
+ /** Number of split WIM parts from which streams are being
+ * written (may be 0 if irrelevant). */
+ unsigned total_parts;
+
+ /** Number of split WIM parts from which streams have been
+ * written (may be 0 if irrelevant). */
+ unsigned completed_parts;
} write_streams;
/** Valid on messages ::WIMLIB_PROGRESS_MSG_SCAN_BEGIN and
* being extracted. Will be the empty string when extracting a
* full image. */
const wimlib_tchar *extract_root_wim_source_path;
+
+ /** Currently only used for
+ * ::WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN. */
+
+ unsigned part_number;
+
+ /** Currently only used for
+ * ::WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN. */
+ unsigned total_parts;
+
+ /** Currently only used for
+ * ::WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN. */
+ uint8_t guid[WIMLIB_GUID_LEN];
} extract;
/** Valid on messages ::WIMLIB_PROGRESS_MSG_RENAME. */
const wimlib_tchar *filename;
} integrity;
- /** Valid on messages ::WIMLIB_PROGRESS_MSG_JOIN_STREAMS. */
- struct wimlib_progress_info_join {
- /** Total number of bytes of compressed data contained in all
- * the split WIM part's file and metadata resources. */
- uint64_t total_bytes;
-
- /** Number of bytes that have been copied to the joined WIM so
- * far. Will be 0 initially, and equal to @a total_bytes at the
- * end. */
- uint64_t completed_bytes;
-
- /** Number of split WIM parts that have had all their file and
- * metadata resources copied over to the joined WIM so far. */
- unsigned completed_parts;
-
- /** Number of split WIM parts. */
- unsigned total_parts;
- } join;
-
/** Valid on messages ::WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART and
* ::WIMLIB_PROGRESS_MSG_SPLIT_END_PART. */
struct wimlib_progress_info_split {
* reparse-point fixups by default when capturing or applying WIM images. */
#define WIMLIB_CHANGE_RPFIX_FLAG 0x00000008
-#define WIMLIB_GUID_LEN 16
-
/** General information about a WIM file. */
struct wimlib_wim_info {
* create symbolic links. */
#define WIMLIB_EXTRACT_FLAG_STRICT_SYMLINKS 0x00008000
+/** TODO */
+#define WIMLIB_EXTRACT_FLAG_RESUME 0x00010000
+
/******************************
* WIMLIB_MOUNT_FLAG_*
******************************/
/** Assume that strings are represented in UTF-8, even if this is not the
- * locale's character encoding. */
+ * locale's character encoding. Not used on Windows. */
#define WIMLIB_INIT_FLAG_ASSUME_UTF8 0x00000001
+/** Windows-only: do not attempt to acquire additional privileges (currently
+ * SeBackupPrivilege, SeRestorePrivilege, SeSecurityPrivilege, and
+ * SeTakeOwnershipPrivilege) when initializing the library. This is intended
+ * for the case where the calling program manages these privileges itself.
+ * Note: no error is issued if privileges cannot be acquired, although related
+ * errors may be reported later, depending on if the operations performed
+ * actually require additional privileges or not. */
+#define WIMLIB_INIT_FLAG_DONT_ACQUIRE_PRIVILEGES 0x00000002
+
/** Specification of an update to perform on a WIM image. */
struct wimlib_update_command {
* Failed to set security descriptor on a file
* (only if ::WIMLIB_EXTRACT_FLAG_STRICT_ACLS) specified in @p
* extract_flags.
- * @retval ::WIMLIB_ERR_SET_SECURITY
- * Failed to set security descriptor on a file
- * (only if ::WIMLIB_EXTRACT_FLAG_STRICT_ACLS) specified in @p
- * extract_flags.
+ * @retval ::WIMLIB_ERR_SET_TIMESTAMPS
+ * Failed to set timestamps on a file (only if
+ * ::WIMLIB_EXTRACT_FLAG_STRICT_TIMESTAMPS) specified in @p extract_flags.
* @retval ::WIMLIB_ERR_SPLIT_INVALID
* The WIM is a split WIM, but the parts specified do not form a complete
* split WIM because they do not include all the parts of the original WIM,
wimlib_progress_func_t progress_func);
/**
- * Extract one or more images from a pipe on which a pipable WIM is being sent.
+ * Since wimlib v1.5.0: Extract one or more images from a pipe on which a
+ * pipable WIM is being sent.
*
* See the documentation for ::WIMLIB_WRITE_FLAG_PIPABLE for more information
* about pipable WIMs.
* String that specifies the 1-based index or name of the image to extract.
* It is translated to an image index using the same rules that
* wimlib_resolve_image() uses. However, unlike wimlib_extract_image(),
- * only a single image (not all images) can be specified.
+ * only a single image (not all images) can be specified. Alternatively,
+ * specify @p NULL here to use the first image in the WIM if it contains
+ * exactly one image but otherwise return @p WIMLIB_ERR_INVALID_IMAGE.
* @param target
* Same as the corresponding parameter to wimlib_extract_image().
* @param extract_flags
* in this mode; also, ::WIMLIB_EXTRACT_FLAG_TO_STDOUT is invalid and will
* result in ::WIMLIB_ERR_INVALID_PARAM being returned.
* @param progress_func
- * Same as the corresponding parameter to wimlib_extract_image().
+ * Same as the corresponding parameter to wimlib_extract_image(), except
+ * ::WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN messages will also be
+ * received.
*
* @return 0 on success; nonzero on error. The possible error codes include
* those returned by wimlib_extract_image() as well as the following:
/**
* Initialization function for wimlib. Call before using any other wimlib
- * function.
+ * function except wimlib_set_print_errors(). (However, currently this is not
+ * strictly necessary and it will be called automatically if not done manually,
+ * but you should not rely on this behavior.)
*
* @param init_flags
- * On UNIX, specify ::WIMLIB_INIT_FLAG_ASSUME_UTF8 if wimlib should assume
- * that all input data, including filenames, are in UTF-8 rather than the
- * locale-dependent character encoding which may or may not be UTF-8, and
- * that UTF-8 data can be directly printed to the console. On Windows, use
- * 0 for this parameter.
+ * Bitwise OR of ::WIMLIB_INIT_FLAG_ASSUME_UTF8 and/or
+ * ::WIMLIB_INIT_FLAG_DONT_ACQUIRE_PRIVILEGES.
*
* @return 0; other error codes may be returned in future releases.
*/
/**
* Since wimlib 1.2.6: Cleanup function for wimlib. This is not re-entrant.
* You are not required to call this function, but it will release any global
- * memory allocated by the library.
+ * resources allocated by the library.
*/
extern void
wimlib_global_cleanup(void);
*
* By default, error messages are not printed.
*
+ * This can be called before wimlib_global_init().
+ *
* @param show_messages
* @c true if error messages are to be printed; @c false if error messages
* are not to be printed.
* the WIM may be larger than this size, and the WIM file format provides
* no way to split up file resources among multiple WIMs.
* @param write_flags
- * ::WIMLIB_WRITE_FLAG_CHECK_INTEGRITY if integrity tables are to be
- * included in the split WIM parts.
+ * Bitwise OR of relevant flags prefixed with @c WIMLIB_WRITE_FLAG. These
+ * flags will be used to write each split WIM part. Specify 0 here to get
+ * the default behavior.
* @param progress_func
* If non-NULL, a function that will be called periodically with the
- * progress of the current operation.
+ * progress of the current operation
+ * (::WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART and
+ * ::WIMLIB_PROGRESS_MSG_SPLIT_END_PART).
*
* @return 0 on success; nonzero on error. This function may return any value
* returned by wimlib_write() as well as the following error codes:
*
* @retval ::WIMLIB_ERR_SPLIT_UNSUPPORTED
- * @a wim is not part 1 of a stand-alone WIM.
+ * @a wim was not part 1 of a stand-alone WIM.
* @retval ::WIMLIB_ERR_INVALID_PARAM
- * @a swm_name was @c NULL, or @a part_size was 0.
+ * @a swm_name was not a nonempty string, or @a part_size was 0.
*
* Note: the WIM's uncompressed and compressed resources are not checksummed
* when they are copied from the joined WIM to the split WIM parts, nor are
- * compressed resources re-compressed.
+ * compressed resources re-compressed (unless explicitly requested with
+ * ::WIMLIB_WRITE_FLAG_RECOMPRESS).
*/
extern int
wimlib_split(WIMStruct *wim,
wimlib_progress_func_t progress_func);
/**
- * Same as wimlib_write(), but write the WIM directly to a file descriptor,
- * which need not be seekable if the write is done in a special pipable WIM
- * format by providing ::WIMLIB_WRITE_FLAG_PIPABLE in @p write_flags. This can,
- * for example, allow capturing a WIM image and streaming it over the network.
- * See the documentation for ::WIMLIB_WRITE_FLAG_PIPABLE for more information
- * about pipable WIMs.
+ * Since wimlib v1.5.0: Same as wimlib_write(), but write the WIM directly to a
+ * file descriptor, which need not be seekable if the write is done in a special
+ * pipable WIM format by providing ::WIMLIB_WRITE_FLAG_PIPABLE in @p
+ * write_flags. This can, for example, allow capturing a WIM image and
+ * streaming it over the network. See the documentation for
+ * ::WIMLIB_WRITE_FLAG_PIPABLE for more information about pipable WIMs.
+ *
+ * The file descriptor @p fd will not be closed when the write is complete; the
+ * calling code is responsible for this.
*
* Return values are mostly the same as wimlib_write(), but also:
*