]> wimlib.net Git - wimlib/blobdiff - include/wimlib/apply.h
Support file counts for extract file structure and metadata progress
[wimlib] / include / wimlib / apply.h
index 8a1bf87e789790ac976b909a46a92921912770b9..73ddd871b2200c2e386cab68679427f751bd87a1 100644 (file)
@@ -88,21 +88,22 @@ extract_progress(struct apply_ctx *ctx, enum wimlib_progress_msg msg)
 extern int
 do_file_extract_progress(struct apply_ctx *ctx, enum wimlib_progress_msg msg);
 
+#define COUNT_PER_FILE_PROGRESS 256
+
 static inline int
 maybe_do_file_progress(struct apply_ctx *ctx, enum wimlib_progress_msg msg)
 {
+       ctx->progress.extract.current_file_count++;
        if (unlikely(!--ctx->count_until_file_progress))
                return do_file_extract_progress(ctx, msg);
        return 0;
 }
 
-/* Call this to reset the counter for report_file_created() and
- * report_file_metadata_applied().  */
-static inline void
-reset_file_progress(struct apply_ctx *ctx)
-{
-       ctx->count_until_file_progress = 1;
-}
+extern int
+start_file_structure_phase(struct apply_ctx *ctx, uint64_t end_file_count);
+
+extern int
+start_file_metadata_phase(struct apply_ctx *ctx, uint64_t end_file_count);
 
 /* Report that a file was created, prior to stream extraction.  */
 static inline int
@@ -118,6 +119,12 @@ report_file_metadata_applied(struct apply_ctx *ctx)
        return maybe_do_file_progress(ctx, WIMLIB_PROGRESS_MSG_EXTRACT_METADATA);
 }
 
+extern int
+end_file_structure_phase(struct apply_ctx *ctx);
+
+extern int
+end_file_metadata_phase(struct apply_ctx *ctx);
+
 /* Returns any of the aliases of an inode that are being extracted.  */
 #define inode_first_extraction_dentry(inode)           \
        list_first_entry(&(inode)->i_extraction_aliases,        \