aboutsummaryrefslogtreecommitdiff
path: root/src/xz/message.h
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2009-02-22 18:52:49 +0200
committerLasse Collin <lasse.collin@tukaani.org>2009-02-22 18:52:49 +0200
commit68bf7ac2984d3627369a240ef0491934d53f7899 (patch)
treea9a7273c23425b08ce1c626293858bd09406cdd3 /src/xz/message.h
parentAdded files missing from the previous commit. (diff)
downloadxz-68bf7ac2984d3627369a240ef0491934d53f7899.tar.xz
Fixes to progress message handling in xz:
- Don't use Windows-specific code on Windows. The old code required at least Windows 2000. Now it should work on Windows 98 and later, and maybe on Windows 95 too. - Use less precision when showing estimated remaining time. - Fix some small design issues.
Diffstat (limited to '')
-rw-r--r--src/xz/message.h28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/xz/message.h b/src/xz/message.h
index 3d117fe5..24f259c9 100644
--- a/src/xz/message.h
+++ b/src/xz/message.h
@@ -111,21 +111,29 @@ extern void message_version(void) lzma_attribute((noreturn));
extern void message_help(bool long_help) lzma_attribute((noreturn));
+/// \brief Start progress info handling
///
-extern void message_progress_start(const char *filename, uint64_t in_size);
+/// This must be paired with a call to message_progress_end() before the
+/// given *strm becomes invalid.
+///
+/// \param strm Pointer to lzma_stream used for the coding.
+/// \param filename Name of the input file. stdin_filename is
+/// handled specially.
+/// \param in_size Size of the input file, or zero if unknown.
+///
+extern void message_progress_start(
+ lzma_stream *strm, const char *filename, uint64_t in_size);
-///
-extern void message_progress_update(uint64_t in_pos, uint64_t out_pos);
+/// Update the progress info if in verbose mode and enough time has passed
+/// since the previous update. This can be called only when
+/// message_progress_start() has already been used.
+extern void message_progress_update(void);
/// \brief Finishes the progress message if we were in verbose mode
///
-/// \param in_pos Final input position i.e. how much input there was.
-/// \param out_pos Final output position
-/// \param success True if the operation was successful. We don't
-/// print the final progress message if the operation
-/// wasn't successful.
+/// \param finished True if the whole stream was successfully coded
+/// and output written to the output stream.
///
-extern void message_progress_end(
- uint64_t in_pos, uint64_t out_pos, bool success);
+extern void message_progress_end(bool finished);