From fb86f5dd0def0486e192f8c24b1f78ef963dc7e5 Mon Sep 17 00:00:00 2001 From: circulosmeos Date: Tue, 3 Sep 2019 20:12:25 +0200 Subject: [PATCH] Added point number to `-l` output --- README.md | 8 ++++---- gztool.c | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 0dd3cd1..2c9e792 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ Copy gztool.c to the directory where you compiled zlib, and do: Usage ===== - gztool (v0.7) + gztool (v0.7.2) GZIP files indexer and data retriever. Create small indexes for gzipped files and use them for quick and random positioned data extraction. @@ -199,7 +199,7 @@ Examples of use Size of uncompressed file: 147773440 Bytes List of points: @ compressed/uncompressed byte (index data size in Bytes @window's beginning at index file), ... - @ 10 / 0 ( 0 @56 ), @ 3059779 / 10495261 ( 13127 @80 ), @ 6418423 / 21210594 ( 6818 @13231 ), @ 9534259 / 31720206 ( 7238 @20073 )... + #1: @ 10 / 0 ( 0 @56 ), #2: @ 3059779 / 10495261 ( 13127 @80 ), #3: @ 6418423 / 21210594 ( 6818 @13231 ), #4: @ 9534259 / 31720206 ( 7238 @20073 )... ... If `gztool` finds the gzip file companion of the index file, some statistics are shown, like the index/gzip size ratio, or the ratio of compression of the gzip file. @@ -210,7 +210,7 @@ Also, if the gzip is complete, the size of the uncompressed data is shown. This $ gztool -l gzip_filename -I index_filename -In this latter case only a pair of index+gzip filenames can be indicated on each use. +In this latter case only a pair of index+gzip filenames can be indicated with each use. Index file format ================= @@ -262,7 +262,7 @@ Other tools which try to provide random access to gzipped files Version ======= -This version is **v0.7**. +This version is **v0.7.2**. Please, read the *Disclaimer*. This is still a beta release. In case of any errors, please open an *Issue*. diff --git a/gztool.c b/gztool.c index c815e42..da82b9a 100644 --- a/gztool.c +++ b/gztool.c @@ -148,7 +148,7 @@ #define local static -#define GZTOOL_VERSION "0.7.1" +#define GZTOOL_VERSION "0.7.2" #define SPAN 10485760L /* desired distance between access points */ #define WINSIZE 32768U /* sliding window size */ @@ -2330,10 +2330,10 @@ local int action_list_info( unsigned char *file_name, unsigned char *input_gzip_ if ( list_verbosity == VERBOSITY_MANIAC ) fprintf( stdout, "Checking compressed windows...\n\t" ); } - for (j=0; jhave; j++) { + for ( j=0; jhave; j++ ) { if ( list_verbosity == VERBOSITY_EXCESSIVE && verbosity_level > VERBOSITY_NONE ) - fprintf( stdout, "@ %ld / %ld ( %d @%ld ), ", index->list[j].in, index->list[j].out, index->list[j].window_size, index->list[j].window_beginning ); + fprintf( stdout, "#%ld: @ %ld / %ld ( %d @%ld ), ", j +1, index->list[j].in, index->list[j].out, index->list[j].window_size, index->list[j].window_beginning ); if ( list_verbosity == VERBOSITY_MANIAC ) { uint64_t local_window_size = index->list[j].window_size; if ( local_window_size > 0 ) { @@ -2350,8 +2350,8 @@ local int action_list_info( unsigned char *file_name, unsigned char *input_gzip_ if ( verbosity_level > VERBOSITY_NONE ) { comp_win_counter += index->list[j].window_size; uncomp_win_counter += local_window_size; - fprintf( stdout, "@ %ld / %ld ( %d/%ld %.2f%% ), ", - index->list[j].in, index->list[j].out, index->list[j].window_size, + fprintf( stdout, "#%ld: @ %ld / %ld ( %d/%ld %.2f%% ), ", + j +1, index->list[j].in, index->list[j].out, index->list[j].window_size, local_window_size, ((local_window_size>0)?(100.0 - (double)(index->list[j].window_size) / (double)local_window_size * 100.0):0.0) ); } }