+ /* Successful scan, and visiting inode for the first time */
+
+ /* Tally size of all data streams. */
+ const struct wim_lookup_table_entry *lte;
+ for (unsigned i = 0; i <= inode->i_num_ads; i++) {
+ lte = inode_stream_lte_resolved(inode, i);
+ if (lte)
+ params->progress.scan.num_bytes_scanned += lte->size;
+ }
+
+ /* Tally the file itself. */
+ if (inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY)
+ params->progress.scan.num_dirs_scanned++;
+ else
+ params->progress.scan.num_nondirs_scanned++;
+ }
+
+ /* Call the user-provided progress function. */
+ return call_progress(params->progfunc, WIMLIB_PROGRESS_MSG_SCAN_DENTRY,
+ ¶ms->progress, params->progctx);
+}
+
+/*
+ * Given a null-terminated pathname pattern @pat that has been read from line
+ * @line_no of the file @path, validate and canonicalize the pattern.
+ *
+ * On success, returns 0.
+ * On failure, returns WIMLIB_ERR_INVALID_CAPTURE_CONFIG.
+ * In either case, @pat may have been modified in-place (and possibly
+ * shortened).
+ */
+int
+mangle_pat(tchar *pat, const tchar *path, unsigned long line_no)
+{