X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=include%2Fwimlib.h;h=e5610e5425c1e1280d7148867a15a0d4456c16a9;hb=e0cb5f9264bdea9938e48a37ebe9007467c0dd46;hp=76c79237e42d017238dc4b7a139d9170ad77f899;hpb=f03cd53bd986ce7b1c96dfa51cf4fbb2b9de05d5;p=wimlib diff --git a/include/wimlib.h b/include/wimlib.h index 76c79237..e5610e54 100644 --- a/include/wimlib.h +++ b/include/wimlib.h @@ -504,6 +504,12 @@ enum wimlib_progress_msg { * single extraction operation for optimization purposes. */ WIMLIB_PROGRESS_MSG_EXTRACT_TREE_BEGIN = 1, + /** This message may be sent periodically (not for every file) while + * files or directories are being created, prior to data stream + * extraction. @p info will point to ::wimlib_progress_info.extract. + */ + WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE = 3, + /** File data is currently being extracted. @p info will point to * ::wimlib_progress_info.extract. This is the main message to track * the progress of an extraction operation. */ @@ -513,6 +519,12 @@ enum wimlib_progress_msg { * @p info will point to ::wimlib_progress_info.extract. */ WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN = 5, + /** This message may be sent periodically (not for every file) while + * file and directory metadata is being applied, following data stream + * extraction. @p info will point to ::wimlib_progress_info.extract. + */ + WIMLIB_PROGRESS_MSG_EXTRACT_METADATA = 6, + /** Confirms that the image has been successfully extracted. @p info * will point to ::wimlib_progress_info.extract. This is paired with * ::WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN. */ @@ -626,6 +638,19 @@ enum wimlib_progress_msg { * ::wimlib_progress_info.done_with_file. This message is only received * if ::WIMLIB_WRITE_FLAG_SEND_DONE_WITH_FILE_MESSAGES was provided. */ WIMLIB_PROGRESS_MSG_DONE_WITH_FILE = 26, + + /** wimlib_verify_wim() is starting to verify the metadata for an image. + * @p info will point to ::wimlib_progress_info.verify_image. */ + WIMLIB_PROGRESS_MSG_BEGIN_VERIFY_IMAGE = 27, + + /** wimlib_verify_wim() has finished verifying the metadata for an + * image. @p info will point to ::wimlib_progress_info.verify_image. + */ + WIMLIB_PROGRESS_MSG_END_VERIFY_IMAGE = 28, + + /** wimlib_verify_wim() is verifying stream integrity. @p info will + * point to ::wimlib_progress_info.verify_streams. */ + WIMLIB_PROGRESS_MSG_VERIFY_STREAMS = 29, }; /** Valid return values from user-provided progress functions @@ -837,7 +862,9 @@ union wimlib_progress_info { * ::WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN, * ::WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN, * ::WIMLIB_PROGRESS_MSG_EXTRACT_TREE_BEGIN, + * ::WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE, * ::WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS, + * ::WIMLIB_PROGRESS_MSG_EXTRACT_METADATA, * ::WIMLIB_PROGRESS_MSG_EXTRACT_TREE_END, and * ::WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_END. * @@ -1053,6 +1080,23 @@ union wimlib_progress_info { */ const wimlib_tchar *path_to_file; } done_with_file; + + /** Valid on messages ::WIMLIB_PROGRESS_MSG_BEGIN_VERIFY_IMAGE and + * ::WIMLIB_PROGRESS_MSG_END_VERIFY_IMAGE. */ + struct wimlib_progress_info_verify_image { + const wimlib_tchar *wimfile; + uint32_t total_images; + uint32_t current_image; + } verify_image; + + /** Valid on messages ::WIMLIB_PROGRESS_MSG_VERIFY_STREAMS. */ + struct wimlib_progress_info_verify_streams { + const wimlib_tchar *wimfile; + uint64_t total_streams; + uint64_t total_bytes; + uint64_t completed_streams; + uint64_t completed_bytes; + } verify_streams; }; /** @@ -2627,7 +2671,9 @@ wimlib_export_image(WIMStruct *src_wim, int src_image, * * If a progress function is registered with @p wim, then as each image is * extracted it will receive ::WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN, then - * zero or more ::WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS messages, then + * zero or more ::WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE messages, then zero + * or more ::WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS messages, then zero or more + * ::WIMLIB_PROGRESS_MSG_EXTRACT_METADATA messages, then * ::WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_END. */ extern int @@ -3996,6 +4042,45 @@ wimlib_split(WIMStruct *wim, uint64_t part_size, int write_flags); +/** + * @ingroup G_general + * + * Perform verification checks on a WIM file. + * + * @param wim + * The ::WIMStruct for the WIM file to verify. Note: for an extra layer of + * verification, it is a good idea to have used + * ::WIMLIB_OPEN_FLAG_CHECK_INTEGRITY when you opened the file. + *
+ * If verifying a split WIM, specify the first part of the split WIM here, + * and reference the other parts using wimlib_reference_resource_files() + * before calling this function. + * + * @param verify_flags + * Reserved; must be 0. + * + * @retval 0 if the WIM file was successfully verified; nonzero if it failed + * verification or another error occurred. Some of the possible error codes + * are: + * + * @retval ::WIMLIB_ERR_DECOMPRESSION + * A compressed resource could not be decompressed. + * @retval ::WIMLIB_ERR_INVALID_METADATA_RESOURCE + * The metadata resource for an image is invalid. + * @retval ::WIMLIB_ERR_INVALID_RESOURCE_HASH + * One of the files did not decompress to its original data, as given by a + * cryptographic checksum. + * @retval ::WIMLIB_ERR_RESOURCE_NOT_FOUND + * One of the files referenced by an image could not be located. + * + * If a progress function is registered with @p wim, it will receive the + * following progress messages: ::WIMLIB_PROGRESS_MSG_BEGIN_VERIFY_IMAGE, + * ::WIMLIB_PROGRESS_MSG_END_VERIFY_IMAGE, and + * ::WIMLIB_PROGRESS_MSG_VERIFY_STREAMS. + */ +extern int +wimlib_verify_wim(WIMStruct *wim, int verify_flags); + /** * @ingroup G_mounting_wim_images * @@ -4416,6 +4501,9 @@ wimlib_free_compressor(struct wimlib_compressor *compressor); * * @retval ::WIMLIB_ERR_INVALID_COMPRESSION_TYPE * @p ctype was not a supported compression type. + * @retval ::WIMLIB_ERR_INVALID_PARAM + * @p decompressor_ret was @c NULL, or @p max_block_size is not valid for + * the compression type. * @retval ::WIMLIB_ERR_NOMEM * Insufficient memory to allocate the decompressor. */