Index: src/xz/message.h |
=================================================================== |
--- src/xz/message.h (revision 50504) |
+++ src/xz/message.h (working copy) |
@@ -16,10 +16,14 @@ |
V_ERROR, ///< Only error messages |
V_WARNING, ///< Errors and warnings |
V_VERBOSE, ///< Errors, warnings, and verbose statistics |
- V_DEBUG, ///< Debugging, FIXME remove? |
+ V_DEBUG, ///< Very verbose |
}; |
+/// \brief Signals used for progress message handling |
+extern const int message_progress_sigs[]; |
+ |
+ |
/// \brief Initializes the message functions |
/// |
/// If an error occurs, this function doesn't return. |
@@ -41,7 +45,7 @@ |
/// |
/// This doesn't touch the exit status. |
extern void message(enum message_verbosity verbosity, const char *fmt, ...) |
- lzma_attribute((format(printf, 2, 3))); |
+ lzma_attribute((__format__(__printf__, 2, 3))); |
/// \brief Prints a warning and possibly sets exit status |
@@ -49,7 +53,7 @@ |
/// The message is printed only if verbosity level is at least V_WARNING. |
/// The exit status is set to WARNING unless it was already at ERROR. |
extern void message_warning(const char *fmt, ...) |
- lzma_attribute((format(printf, 1, 2))); |
+ lzma_attribute((__format__(__printf__, 1, 2))); |
/// \brief Prints an error message and sets exit status |
@@ -57,25 +61,25 @@ |
/// The message is printed only if verbosity level is at least V_ERROR. |
/// The exit status is set to ERROR. |
extern void message_error(const char *fmt, ...) |
- lzma_attribute((format(printf, 1, 2))); |
+ lzma_attribute((__format__(__printf__, 1, 2))); |
/// \brief Prints an error message and exits with EXIT_ERROR |
/// |
/// The message is printed only if verbosity level is at least V_ERROR. |
extern void message_fatal(const char *fmt, ...) |
- lzma_attribute((format(printf, 1, 2))) |
- lzma_attribute((noreturn)); |
+ lzma_attribute((__format__(__printf__, 1, 2))) |
+ lzma_attribute((__noreturn__)); |
/// Print an error message that an internal error occurred and exit with |
/// EXIT_ERROR. |
-extern void message_bug(void) lzma_attribute((noreturn)); |
+extern void message_bug(void) lzma_attribute((__noreturn__)); |
/// Print a message that establishing signal handlers failed, and exit with |
/// exit status ERROR. |
-extern void message_signal_handler(void) lzma_attribute((noreturn)); |
+extern void message_signal_handler(void) lzma_attribute((__noreturn__)); |
/// Convert lzma_ret to a string. |
@@ -86,15 +90,19 @@ |
extern void message_mem_needed(enum message_verbosity v, uint64_t memusage); |
+/// Buffer size for message_filters_to_str() |
+#define FILTERS_STR_SIZE 512 |
+ |
+ |
/// \brief Get the filter chain as a string |
/// |
+/// \param buf Pointer to caller allocated buffer to hold |
+/// the filter chain string |
/// \param filters Pointer to the filter chain |
/// \param all_known If true, all filter options are printed. |
/// If false, only the options that get stored |
/// into .xz headers are printed. |
-/// |
-/// \return Pointer to a statically allocated buffer. |
-extern const char *message_filters_to_str( |
+extern void message_filters_to_str(char buf[FILTERS_STR_SIZE], |
const lzma_filter *filters, bool all_known); |
@@ -107,16 +115,12 @@ |
extern void message_try_help(void); |
-/// Print the memory usage limit and exit. |
-extern void message_memlimit(void) lzma_attribute((noreturn)); |
- |
- |
/// Prints the version number to stdout and exits with exit status SUCCESS. |
-extern void message_version(void) lzma_attribute((noreturn)); |
+extern void message_version(void) lzma_attribute((__noreturn__)); |
/// Print the help message. |
-extern void message_help(bool long_help) lzma_attribute((noreturn)); |
+extern void message_help(bool long_help) lzma_attribute((__noreturn__)); |
/// \brief Set the total number of files to be processed |