+/** A pointer to this union is passed to the user-supplied
+ * ::wimlib_progress_func_t progress function. One (or none) of the structures
+ * contained in this union will be applicable for the operation
+ * (::wimlib_progress_msg) indicated in the first argument to the progress
+ * function. */
+union wimlib_progress_info {
+
+ /* N.B. I wanted these to be anonymous structs, but Doxygen won't
+ * document them if they aren't given a name... */
+
+ /** Valid on messages ::WIMLIB_PROGRESS_MSG_WRITE_STREAMS. */
+ struct wimlib_progress_info_write_streams {
+ /** Number of bytes that are going to be written for all the
+ * streams combined. This is the amount in uncompressed data.
+ * (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;
+
+ /** Number of uncompressed bytes that have been written so far.
+ * Will be 0 initially, and equal to @a total_bytes at the end.
+ * */
+ uint64_t completed_bytes;
+
+ /** Number of streams that have been written. Will be 0
+ * initially, and equal to @a total_streams at the end. */
+ uint64_t completed_streams;
+
+ /** Number of threads that are being used to compress resources
+ * (if applicable). */
+ unsigned num_threads;
+
+ /** The compression type being used to write the streams; either
+ * ::WIMLIB_COMPRESSION_TYPE_NONE,
+ * ::WIMLIB_COMPRESSION_TYPE_XPRESS, or
+ * ::WIMLIB_COMPRESSION_TYPE_LZX. */
+ int compression_type;
+
+ /** Library internal use only. */
+ uint64_t _private;
+ } write_streams;
+
+ /** Valid on messages ::WIMLIB_PROGRESS_MSG_SCAN_BEGIN and
+ * ::WIMLIB_PROGRESS_MSG_SCAN_END. */
+ struct wimlib_progress_info_scan {
+ /** Directory or NTFS volume that is being scanned. */
+ const wimlib_tchar *source;
+
+ /** Path to the file or directory that is about to be scanned,
+ * relative to the root of the image capture or the NTFS volume.
+ * */
+ const wimlib_tchar *cur_path;
+
+ /** True iff @a cur_path is being excluded from the image
+ * capture due to the capture configuration file. */
+ bool excluded;
+
+ /** Target path in the WIM. Only valid on messages
+ * ::WIMLIB_PROGRESS_MSG_SCAN_BEGIN and
+ * ::WIMLIB_PROGRESS_MSG_SCAN_END. */
+ const wimlib_tchar *wim_target_path;
+ } scan;
+
+ /** Valid on messages ::WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN,
+ * ::WIMLIB_PROGRESS_MSG_EXTRACT_DIR_STRUCTURE_BEGIN,
+ * ::WIMLIB_PROGRESS_MSG_EXTRACT_DIR_STRUCTURE_END,
+ * ::WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS, and
+ * ::WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_END. */
+ struct wimlib_progress_info_extract {
+ /** Number of the image being extracted (1-based). */
+ int image;
+
+ /** Flags passed to to wimlib_extract_image() */
+ int extract_flags;
+
+ /** Full path to the WIM file being extracted. */
+ const wimlib_tchar *wimfile_name;
+
+ /** Name of the image being extracted. */
+ const wimlib_tchar *image_name;
+
+ /** Directory or NTFS volume to which the image is being
+ * extracted. */
+ const wimlib_tchar *target;
+
+ /** Current dentry being extracted. (Valid only if message is
+ * ::WIMLIB_PROGRESS_MSG_EXTRACT_DENTRY.) */
+ const wimlib_tchar *cur_path;
+
+ /** Number of bytes of uncompressed data that will be extracted.
+ * Takes into account hard links (they are not counted for each
+ * link.)
+ * */
+ uint64_t total_bytes;
+
+ /** Number of bytes that have been written so far. Will be 0
+ * initially, and equal to @a total_bytes at the end. */
+ uint64_t completed_bytes;
+
+ /** Number of streams that will be extracted. This may more or
+ * less than the number of "files" to be extracted due to
+ * special cases (hard links, symbolic links, and alternate data
+ * streams.) */
+ uint64_t num_streams;
+ } extract;
+
+ /** Valid on messages ::WIMLIB_PROGRESS_MSG_RENAME. */
+ struct wimlib_progress_info_rename {
+ /** Name of the temporary file that the WIM was written to. */
+ const wimlib_tchar *from;
+
+ /** Name of the original WIM file to which the temporary file is
+ * being renamed. */
+ const wimlib_tchar *to;
+ } rename;
+
+ /** Valid on messages ::WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY and
+ * ::WIMLIB_PROGRESS_MSG_CALC_INTEGRITY. */
+ struct wimlib_progress_info_integrity {
+ /** Number of bytes from the end of the WIM header to the end of
+ * the lookup table (the area that is covered by the SHA1
+ * integrity checks.) */
+ uint64_t total_bytes;
+
+ /** Number of bytes that have been SHA1-summed so far. Will be
+ * 0 initially, and equal @a total_bytes at the end. */
+ uint64_t completed_bytes;
+
+ /** Number of chunks that the checksummed region is divided
+ * into. */
+ uint32_t total_chunks;
+
+ /** Number of chunks that have been SHA1-summed so far. Will
+ * be 0 initially, and equal to @a total_chunks at the end. */
+ uint32_t completed_chunks;
+
+ /** Size of the chunks used for the integrity calculation. */
+ uint32_t chunk_size;
+
+ /** Filename of the WIM (only valid if the message is
+ * ::WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY). */
+ 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 {
+ /** Total size of the original WIM's file and metadata resources
+ * (compressed). */
+ uint64_t total_bytes;
+
+ /** Number of bytes of file and metadata resources that have
+ * been copied out of the original WIM so far. Will be 0
+ * initially, and equal to @a total_bytes at the end. */
+ uint64_t completed_bytes;
+
+ /** Number of the split WIM part that is about to be started
+ * (::WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART) or has just been
+ * finished (::WIMLIB_PROGRESS_MSG_SPLIT_END_PART). */
+ unsigned cur_part_number;
+
+ /** Name of the split WIM part that is about to be started
+ * (::WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART) or has just been
+ * finished (::WIMLIB_PROGRESS_MSG_SPLIT_END_PART). */
+ const wimlib_tchar *part_name;
+ } split;
+};