/build/buildd/xz-utils-4.999.9beta+20091116/src/xz/message.h File Reference

Printing messages to stderr. More...

Enumerations

enum  message_verbosity {
  V_SILENT, V_ERROR, V_WARNING, V_VERBOSE,
  V_DEBUG
}
 

Verbosity levels.

More...

Functions

void message_init (void)
 Initializes the message functions.
void message_verbosity_increase (void)
 Increase verbosity level by one step unless it was at maximum.
void message_verbosity_decrease (void)
 Decrease verbosity level by one step unless it was at minimum.
enum message_verbosity message_verbosity_get (void)
 Get the current verbosity level.
void message_set_files (unsigned int files)
void message (enum message_verbosity verbosity, const char *fmt,...) lzma_attribute((format(printf
 Print a message if verbosity level is at least "verbosity".
void void message_warning (const char *fmt,...) lzma_attribute((format(printf
 Prints a warning and possibly sets exit status.
void void void message_error (const char *fmt,...) lzma_attribute((format(printf
 Prints an error message and sets exit status.
void void void void message_fatal (const char *fmt,...) lzma_attribute((format(printf
 Prints an error message and exits with EXIT_ERROR.
void void void void lzma_attribute ((noreturn))
void message_bug (void) lzma_attribute((noreturn))
void message_signal_handler (void) lzma_attribute((noreturn))
const char * message_strm (lzma_ret code)
 Convert lzma_ret to a string.
void message_filters (enum message_verbosity v, const lzma_filter *filters)
 Print the filter chain.
void message_try_help (void)
 Print a message that user should try --help.
void message_memlimit (void) lzma_attribute((noreturn))
 Print the memory usage limit and exit.
void message_version (void) lzma_attribute((noreturn))
 Prints the version number to stdout and exits with exit status SUCCESS.
void message_help (bool long_help) lzma_attribute((noreturn))
 Print the help message.
void message_progress_start (lzma_stream *strm, const char *filename, uint64_t in_size)
 Start progress info handling.
void message_progress_update (void)
void message_progress_end (bool finished)
 Finishes the progress message if we were in verbose mode.

Detailed Description

Printing messages to stderr.


Enumeration Type Documentation

Verbosity levels.

Enumerator:
V_SILENT 

No messages.

V_ERROR 

Only error messages.

V_WARNING 

Errors and warnings.

V_VERBOSE 

Errors, warnings, and verbose statistics.

V_DEBUG 

Debugging, FIXME remove?


Function Documentation

void message_init ( void   ) 

Initializes the message functions.

If an error occurs, this function doesn't return.

References message_signal_handler(), and progress_automatic.

void message_verbosity_increase ( void   ) 

Increase verbosity level by one step unless it was at maximum.

References V_DEBUG, and verbosity.

void message_verbosity_decrease ( void   ) 

Decrease verbosity level by one step unless it was at minimum.

References V_SILENT, and verbosity.

enum message_verbosity message_verbosity_get ( void   ) 

Get the current verbosity level.

References verbosity.

void message_set_files ( unsigned int  files  ) 

Set the total number of files to be processed (stdin is counted as a file here). The default is one.

References files_total.

void message ( enum message_verbosity  verbosity,
const char *  fmt,
  ... 
)

Print a message if verbosity level is at least "verbosity".

This doesn't touch the exit status.

Referenced by message_try_help(), and str_to_uint64().

void void message_warning ( const char *  fmt,
  ... 
)

Prints a warning and possibly sets exit status.

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.

Referenced by coder_normal(), compressed_name(), io_copy_attrs(), io_open_src(), and uncompressed_name().

void void void message_error ( const char *  fmt,
  ... 
)

Prints an error message and sets exit status.

The message is printed only if verbosity level is at least V_ERROR. The exit status is set to ERROR.

Referenced by coder_init(), coder_normal(), compressed_name(), io_close_dest(), io_open_src(), io_read(), io_unlink(), io_write(), is_empty_filename(), is_tty_stdin(), is_tty_stdout(), and uncompressed_name().

void void void void message_fatal ( const char *  fmt,
  ... 
)

Prints an error message and exits with EXIT_ERROR.

The message is printed only if verbosity level is at least V_ERROR.

Referenced by coder_add_filter(), message_bug(), message_signal_handler(), options_lzma(), parse_options(), str_to_uint64(), suffix_set(), and xrealloc().

void message_bug ( void   ) 

Print an error message that an internal error occurred and exit with EXIT_ERROR.

References message_fatal().

void message_signal_handler ( void   ) 

Print a message that establishing signal handlers failed, and exit with exit status ERROR.

References message_fatal().

Referenced by message_init(), and signals_init().

const char* message_strm ( lzma_ret  code  ) 
void message_filters ( enum message_verbosity  v,
const lzma_filter filters 
)
void message_try_help ( void   ) 

Print a message that user should try --help.

References message(), and V_WARNING.

void message_memlimit ( void   ) 

Print the memory usage limit and exit.

References hardware_memlimit_get(), uint64_to_str(), V_SILENT, and verbosity.

void message_version ( void   ) 

Prints the version number to stdout and exits with exit status SUCCESS.

References LZMA_VERSION, lzma_version_number(), lzma_version_string(), LZMA_VERSION_STRING, V_SILENT, and verbosity.

void message_help ( bool  long_help  ) 
void message_progress_start ( lzma_stream strm,
const char *  filename,
uint64_t  in_size 
)

Start progress info handling.

This must be paired with a call to message_progress_end() before the given *strm becomes invalid.

Parameters:
strm Pointer to lzma_stream used for the coding.
filename Name of the input file. stdin_filename is handled specially.
in_size Size of the input file, or zero if unknown.

References current_filename_printed, expected_in_size, filename, files_pos, my_time(), print_filename(), progress_automatic, progress_started, start_time, V_VERBOSE, and verbosity.

Referenced by coder_run().

void message_progress_update ( void   ) 

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.

References print_filename(), progress_active, progress_automatic, progress_elapsed(), progress_percentage(), progress_pos(), progress_remaining(), progress_sizes(), progress_speed(), signals_block(), signals_unblock(), V_VERBOSE, and verbosity.

Referenced by coder_normal(), and coder_passthru().

void message_progress_end ( bool  finished  ) 

Finishes the progress message if we were in verbose mode.

Parameters:
finished True if the whole stream was successfully coded and output written to the output stream.

References progress_started.

Referenced by coder_run().


Generated on Mon Dec 21 22:54:41 2009 for XZ Utils by  doxygen 1.6.1