wimlib
|
Track the progress of long WIM operations. More...
Data Structures | |
union | wimlib_progress_info |
A pointer to this union is passed to the user-supplied wimlib_progress_func_t progress function. More... | |
Typedefs | |
typedef enum wimlib_progress_status(* | wimlib_progress_func_t) (enum wimlib_progress_msg msg_type, union wimlib_progress_info *info, void *progctx) |
A user-supplied function that will be called periodically during certain WIM operations. | |
Track the progress of long WIM operations.
Library users can provide a progress function which will be called periodically during operations such as extracting a WIM image or writing a WIM image. A WIMStruct can have a progress function of type wimlib_progress_func_t associated with it by calling wimlib_register_progress_function() or by opening the WIMStruct using wimlib_open_wim_with_progress(). Once this is done, the progress function will be called automatically during many operations, such as wimlib_extract_image() and wimlib_write().
Some functions that do not operate directly on a user-provided WIMStruct, such as wimlib_join(), also take the progress function directly using an extended version of the function, such as wimlib_join_with_progress().
Since wimlib v1.7.0, progress functions are no longer just unidirectional. You can now return WIMLIB_PROGRESS_STATUS_ABORT to cause the current operation to be aborted. wimlib v1.7.0 also added the third argument to wimlib_progress_func_t, which is a user-supplied context.
typedef enum wimlib_progress_status(* wimlib_progress_func_t) (enum wimlib_progress_msg msg_type, union wimlib_progress_info *info, void *progctx) |
A user-supplied function that will be called periodically during certain WIM operations.
The first argument will be the type of operation that is being performed or is about to be started or has been completed.
The second argument will be a pointer to one of a number of structures depending on the first argument. It may be NULL
for some message types. Note that although this argument is not const
, users should not modify it except in explicitly documented cases.
The third argument will be a user-supplied value that was provided when registering or specifying the progress function.
This function must return one of the wimlib_progress_status values. By default, you should return WIMLIB_PROGRESS_STATUS_CONTINUE (0).
enum wimlib_progress_msg |
Possible values of the first parameter to the user-supplied wimlib_progress_func_t progress function.
Enumerator | |
---|---|
WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN | A WIM image is about to be extracted.
|
WIMLIB_PROGRESS_MSG_EXTRACT_TREE_BEGIN | One or more file or directory trees within a WIM image is about to be extracted.
|
WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE | This message may be sent periodically (not for every file) while files and directories are being created, prior to file data extraction.
|
WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS | File data is currently being extracted.
|
WIMLIB_PROGRESS_MSG_EXTRACT_SPWM_PART_BEGIN | Starting to read a new part of a split pipable WIM over the pipe.
|
WIMLIB_PROGRESS_MSG_EXTRACT_METADATA | This message may be sent periodically (not necessarily for every file) while file and directory metadata is being extracted, following file data extraction.
|
WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_END | The image has been successfully extracted.
|
WIMLIB_PROGRESS_MSG_EXTRACT_TREE_END | The files or directory trees have been successfully extracted.
|
WIMLIB_PROGRESS_MSG_SCAN_BEGIN | The directory or NTFS volume is about to be scanned for metadata.
|
WIMLIB_PROGRESS_MSG_SCAN_DENTRY | A directory or file has been scanned.
|
WIMLIB_PROGRESS_MSG_SCAN_END | The directory or NTFS volume has been successfully scanned.
|
WIMLIB_PROGRESS_MSG_WRITE_STREAMS | File data is currently being written to the WIM.
|
WIMLIB_PROGRESS_MSG_WRITE_METADATA_BEGIN | Per-image metadata is about to be written to the WIM file.
|
WIMLIB_PROGRESS_MSG_WRITE_METADATA_END | The per-image metadata has been written to the WIM file.
|
WIMLIB_PROGRESS_MSG_RENAME | wimlib_overwrite() has successfully renamed the temporary file to the original WIM file, thereby committing the changes to the WIM file.
|
WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY | The contents of the WIM file are being checked against the integrity table.
|
WIMLIB_PROGRESS_MSG_CALC_INTEGRITY | An integrity table is being calculated for the WIM being written.
|
WIMLIB_PROGRESS_MSG_SPLIT_BEGIN_PART | A wimlib_split() operation is in progress, and a new split part is about to be started.
|
WIMLIB_PROGRESS_MSG_SPLIT_END_PART | A wimlib_split() operation is in progress, and a split part has been finished.
|
WIMLIB_PROGRESS_MSG_UPDATE_BEGIN_COMMAND | A WIM update command is about to be executed.
|
WIMLIB_PROGRESS_MSG_UPDATE_END_COMMAND | A WIM update command has been executed.
|
WIMLIB_PROGRESS_MSG_REPLACE_FILE_IN_WIM | A file in the image is being replaced as a result of a wimlib_add_command without WIMLIB_ADD_FLAG_NO_REPLACE specified.
|
WIMLIB_PROGRESS_MSG_WIMBOOT_EXCLUDE | An image is being extracted with WIMLIB_EXTRACT_FLAG_WIMBOOT, and a file is being extracted normally (not as a "WIMBoot pointer file") due to it matching a pattern in the
|
WIMLIB_PROGRESS_MSG_UNMOUNT_BEGIN | Starting to unmount an image.
|
WIMLIB_PROGRESS_MSG_DONE_WITH_FILE | wimlib has used a file's data for the last time (including all data streams, if it has multiple).
|
WIMLIB_PROGRESS_MSG_BEGIN_VERIFY_IMAGE | wimlib_verify_wim() is starting to verify the metadata for an image.
|
WIMLIB_PROGRESS_MSG_END_VERIFY_IMAGE | wimlib_verify_wim() has finished verifying the metadata for an image.
|
WIMLIB_PROGRESS_MSG_VERIFY_STREAMS | wimlib_verify_wim() is verifying file data integrity.
|
WIMLIB_PROGRESS_MSG_TEST_FILE_EXCLUSION | The progress function is being asked whether a file should be excluded from capture or not.
This message is only received if the flag WIMLIB_ADD_FLAG_TEST_FILE_EXCLUSION is used. This method for file exclusions is independent of the "capture configuration file" mechanism. |
WIMLIB_PROGRESS_MSG_HANDLE_ERROR | An error has occurred and the progress function is being asked whether to ignore the error or not.
This message provides a limited capability for applications to recover from "unexpected" errors (i.e. those with no in-library handling policy) arising from the underlying operating system. Normally, any such error will cause the library to abort the current operation. By implementing a handler for this message, the application can instead choose to ignore a given error. Currently, only the following types of errors will result in this progress message being sent:
|
Valid return values from user-provided progress functions (wimlib_progress_func_t).
(Note: if an invalid value is returned, WIMLIB_ERR_UNKNOWN_PROGRESS_STATUS will be issued.)
Enumerator | |
---|---|
WIMLIB_PROGRESS_STATUS_CONTINUE | The operation should be continued. This is the normal return value. |
WIMLIB_PROGRESS_STATUS_ABORT | The operation should be aborted. This will cause the current operation to fail with WIMLIB_ERR_ABORTED_BY_PROGRESS. |