/home/steven/tmp/wz/xz-utils/xz-utils-4.999.9beta+20100131/src/xz/list.c File Reference

Listing information about .xz files. More...

#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]


Detailed Description

Listing information about .xz files.


Function Documentation

static bool parse_indexes ( lzma_index **  idx,
file_pair *  pair 
) [static]

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.

Parameters:
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.

Parameters:
pair Input file
iter Location of the Block whose Check value should be printed.
Returns:
False on success, true on I/O error.

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  ) 


Variable Documentation

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",
}


Generated on Mon Feb 15 15:28:22 2010 for XZ Utils by  doxygen 1.5.6