#include "wimlib/error.h"
#include "wimlib/lookup_table.h"
#include "wimlib/paths.h"
+#include "wimlib/progress.h"
#include "wimlib/textfile.h"
#include "wimlib/wildcard.h"
* Flags, optional progress function, and progress data for the capture
* operation.
* @status
- * Status of the scanned file (ok, unsupported, excluded, or excluded
- * symlink).
+ * Status of the scanned file.
* @inode
* If @status is WIMLIB_SCAN_DENTRY_OK, this is a pointer to the WIM inode
* that has been created for the scanned file. The first time the file is
* seen, inode->i_nlink will be 1. On subsequent visits of the same inode
* via additional hard links, inode->i_nlink will be greater than 1.
*/
-void
+int
do_capture_progress(struct add_image_params *params, int status,
const struct wim_inode *inode)
{
switch (status) {
case WIMLIB_SCAN_DENTRY_OK:
if (!(params->add_flags & WIMLIB_ADD_FLAG_VERBOSE))
- return;
+ return 0;
case WIMLIB_SCAN_DENTRY_UNSUPPORTED:
case WIMLIB_SCAN_DENTRY_EXCLUDED:
- case WIMLIB_SCAN_DENTRY_EXCLUDED_SYMLINK:
+ case WIMLIB_SCAN_DENTRY_FIXED_SYMLINK:
+ case WIMLIB_SCAN_DENTRY_NOT_FIXED_SYMLINK:
if (!(params->add_flags & WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE))
- return;
+ return 0;
}
params->progress.scan.status = status;
if (status == WIMLIB_SCAN_DENTRY_OK && inode->i_nlink == 1) {
else
params->progress.scan.num_nondirs_scanned++;
}
+
/* Call the user-provided progress function. */
- if (params->progress_func) {
- params->progress_func(WIMLIB_PROGRESS_MSG_SCAN_DENTRY,
- ¶ms->progress);
- }
+ return call_progress(params->progfunc, WIMLIB_PROGRESS_MSG_SCAN_DENTRY,
+ ¶ms->progress, params->progctx);
}
/*