#include "private.h"
#include "tuklib_integer.h"
Functions | |
static bool | parse_indexes (lzma_index **idx, file_pair *pair) |
Parse the Index(es) from the given .xz file. | |
static const char * | get_ratio (uint64_t compressed_size, uint64_t uncompressed_size) |
Get the compression ratio. | |
static const char * | get_check_names (uint32_t checks, bool space_after_comma) |
Get a comma-separated list of Check names. | |
static bool | print_check_value (file_pair *pair, const lzma_index_iter *iter) |
Read the Check value from the .xz file and print it. | |
static void | print_info_basic (const lzma_index *idx, file_pair *pair) |
static void | print_adv_helper (uint64_t stream_count, uint64_t block_count, uint64_t compressed_size, uint64_t uncompressed_size, uint32_t checks) |
static void | print_info_adv (const lzma_index *idx, file_pair *pair) |
static void | print_info_robot (const lzma_index *idx, file_pair *pair) |
static void | update_totals (const lzma_index *idx) |
static void | print_totals_basic (void) |
static void | print_totals_adv (void) |
static void | print_totals_robot (void) |
void | list_totals (void) |
Show the totals after all files have been listed. | |
void | list_file (const char *filename) |
List information about the given .xz file. | |
Variables | |
struct { | |
uint64_t files | |
uint64_t streams | |
uint64_t blocks | |
uint64_t compressed_size | |
uint64_t uncompressed_size | |
uint32_t checks | |
} | totals |
static const char | check_names [LZMA_CHECK_ID_MAX+1][12] |
static bool parse_indexes | ( | lzma_index ** | idx, | |
file_pair * | pair | |||
) | [static] |
Parse the Index(es) from the given .xz file.
idx | If decoding is successful, *idx will be set to point to lzma_index containing the decoded information. On error, *idx is not modified. | |
pair | Input file |
References lzma_stream::avail_in, lzma_stream_flags::backward_size, hardware_memlimit_get(), io_pread(), LZMA_BUF_ERROR, lzma_code(), LZMA_DATA_ERROR, lzma_end(), lzma_index_cat(), lzma_index_decoder(), lzma_index_end(), lzma_index_memused(), lzma_index_stream_flags(), lzma_index_stream_padding(), lzma_index_total_size(), lzma_memusage(), LZMA_OK, LZMA_RUN, LZMA_STREAM_END, lzma_stream_flags_compare(), lzma_stream_footer_decode(), lzma_stream_header_decode(), LZMA_STREAM_HEADER_SIZE, LZMA_STREAM_INIT, memlimit, message_bug(), message_error(), message_mem_needed(), message_strm(), lzma_stream::next_in, strm, io_buf::u32, io_buf::u8, and V_ERROR.
Referenced by list_file().
static const char* get_ratio | ( | uint64_t | compressed_size, | |
uint64_t | uncompressed_size | |||
) | [static] |
Get the compression ratio.
This has slightly different format than that is used by in message.c.
static const char* get_check_names | ( | uint32_t | checks, | |
bool | space_after_comma | |||
) | [static] |
Get a comma-separated list of Check names.
checks | Bit mask of Checks to print | |
space_after_comma | It's better to not use spaces in table-like listings, but in more verbose formats a space after a comma is good for readability. |
References LZMA_CHECK_ID_MAX, and my_snprintf().
static bool print_check_value | ( | file_pair * | pair, | |
const lzma_index_iter * | iter | |||
) | [static] |
Read the Check value from the .xz file and print it.
Since this requires a seek, listing all Check values for all Blocks can be slow.
pair | Input file | |
iter | Location of the Block whose Check value should be printed. |
References lzma_index_iter::block, lzma_stream_flags::check, lzma_index_iter::compressed_file_offset, lzma_index_iter::flags, io_pread(), LZMA_CHECK_NONE, lzma_check_size(), lzma_index_iter::stream, lzma_index_iter::total_size, io_buf::u32, io_buf::u64, and io_buf::u8.
void list_totals | ( | void | ) |
Show the totals after all files have been listed.
References message_verbosity_get(), totals, and V_WARNING.
void list_file | ( | const char * | filename | ) |
List information about the given .xz file.
References io_close(), io_open_src(), lzma_index_end(), message_error(), message_fatal(), message_filename(), message_verbosity_get(), opt_format, parse_indexes(), and V_WARNING.
struct { ... } totals [static] |
Totals that are displayed if there was more than one file. The "files" counter is also used in print_info_adv() to show the file number.
Referenced by list_totals().
const char check_names[LZMA_CHECK_ID_MAX+1][12] [static] |
Initial value:
{ "None", "CRC32", "Unknown-2", "Unknown-3", "CRC64", "Unknown-5", "Unknown-6", "Unknown-7", "Unknown-8", "Unknown-9", "SHA-256", "Unknown-11", "Unknown-12", "Unknown-13", "Unknown-14", "Unknown-15", }