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 (const char *argv0)
 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.
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_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 (const char *filename, uint64_t in_size)
void message_progress_update (uint64_t in_pos, uint64_t out_pos)
void message_progress_end (uint64_t in_pos, uint64_t out_pos, bool success)
 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 ( const char *  argv0  ) 

Initializes the message functions.

Parameters:
argv0 Name of the program i.e. argv[0] from main()
verbosity Verbosity level

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

References argv0, message_signal_handler(), progress_automatic, and progress_signal_handler().

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.

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(), my_exit(), 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 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 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 argv0, message(), and V_WARNING.

void message_version ( void   ) 

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

References my_exit().

void message_help ( bool  long_help  ) 
void message_progress_end ( uint64_t  in_pos,
uint64_t  out_pos,
bool  success 
)

Finishes the progress message if we were in verbose mode.

Parameters:
in_pos Final input position i.e. how much input there was.
out_pos Final output position
success True if the operation was successful. We don't print the final progress message if the operation wasn't successful.

References filename, my_time(), opt_mode, progress_active, progress_automatic, progress_sizes(), progress_speed(), progress_time(), signals_block(), signals_unblock(), start_time, user_abort, V_VERBOSE, and verbosity.


Generated on Tue Oct 6 14:02:23 2009 for XZ Utils by  doxygen 1.6.1