1
0
Fork 0

Adding upstream version 1.15.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-21 11:17:49 +01:00
parent 6a117924f6
commit abf5fed346
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
10 changed files with 45 additions and 49 deletions

View file

@ -1,16 +1,11 @@
2013-07-29 Antonio Diaz Diaz <antonio@gnu.org> 2013-09-14 Antonio Diaz Diaz <antonio@gnu.org>
* Version 1.15-rc1 released. * Version 1.15 released.
* Minor changes.
* Added chapter 'Unzcrash' to the manual.
2013-06-17 Antonio Diaz Diaz <antonio@gnu.org>
* Version 1.15-pre1 released.
* repair.cc: Repair multi-member files with up to one byte error * repair.cc: Repair multi-member files with up to one byte error
per member. per member.
* merge.cc: Merge multi-member files. * merge.cc: Merge multi-member files.
* Added chapters 'Repairing files' and 'Merging files' to the manual. * Added chapters 'Repairing files', 'Merging files' and 'Unzcrash'
to the manual.
2013-05-31 Antonio Diaz Diaz <antonio@gnu.org> 2013-05-31 Antonio Diaz Diaz <antonio@gnu.org>

View file

@ -57,8 +57,7 @@ $(VPATH)/doc/$(pkgname).info : $(VPATH)/doc/$(pkgname).texinfo
man : $(VPATH)/doc/$(progname).1 man : $(VPATH)/doc/$(progname).1
$(VPATH)/doc/$(progname).1 : $(progname) $(VPATH)/doc/$(progname).1 : $(progname)
help2man -n 'recovers data from damaged lzip files' \ help2man -n 'recovers data from damaged lzip files' -o $@ ./$(progname)
-o $@ ./$(progname)
Makefile : $(VPATH)/configure $(VPATH)/Makefile.in Makefile : $(VPATH)/configure $(VPATH)/Makefile.in
./config.status ./config.status

View file

@ -156,12 +156,12 @@ Arg_parser::Arg_parser( const int argc, const char * const argv[],
while( argind < argc ) while( argind < argc )
{ {
const unsigned char ch1 = argv[argind][0]; const unsigned char ch1 = argv[argind][0];
const unsigned char ch2 = ( ch1 ? argv[argind][1] : 0 ); const unsigned char ch2 = ch1 ? argv[argind][1] : 0;
if( ch1 == '-' && ch2 ) // we found an option if( ch1 == '-' && ch2 ) // we found an option
{ {
const char * const opt = argv[argind]; const char * const opt = argv[argind];
const char * const arg = (argind + 1 < argc) ? argv[argind+1] : 0; const char * const arg = ( argind + 1 < argc ) ? argv[argind+1] : 0;
if( ch2 == '-' ) if( ch2 == '-' )
{ {
if( !argv[argind][2] ) { ++argind; break; } // we found "--" if( !argv[argind][2] ) { ++argind; break; } // we found "--"

2
configure vendored
View file

@ -6,7 +6,7 @@
# to copy, distribute and modify it. # to copy, distribute and modify it.
pkgname=lziprecover pkgname=lziprecover
pkgversion=1.15-rc1 pkgversion=1.15
progname=lziprecover progname=lziprecover
srctrigger=doc/${pkgname}.texinfo srctrigger=doc/${pkgname}.texinfo

View file

@ -202,7 +202,7 @@ int LZ_decoder::decode_member( const Pretty_print & pp )
Bit_model bm_rep1[State::states]; Bit_model bm_rep1[State::states];
Bit_model bm_rep2[State::states]; Bit_model bm_rep2[State::states];
Bit_model bm_len[State::states][pos_states]; Bit_model bm_len[State::states][pos_states];
Bit_model bm_dis_slot[max_dis_states][1<<dis_slot_bits]; Bit_model bm_dis_slot[dis_states][1<<dis_slot_bits];
Bit_model bm_dis[modeled_distances-end_dis_model]; Bit_model bm_dis[modeled_distances-end_dis_model];
Bit_model bm_align[dis_align_size]; Bit_model bm_align[dis_align_size];
Len_model match_len_model; Len_model match_len_model;
@ -237,12 +237,7 @@ int LZ_decoder::decode_member( const Pretty_print & pp )
int len; int len;
if( rdec.decode_bit( bm_rep[state()] ) == 1 ) // 2nd bit if( rdec.decode_bit( bm_rep[state()] ) == 1 ) // 2nd bit
{ {
if( rdec.decode_bit( bm_rep0[state()] ) == 0 ) // 3rd bit if( rdec.decode_bit( bm_rep0[state()] ) == 1 ) // 3rd bit
{
if( rdec.decode_bit( bm_len[state()][pos_state] ) == 0 ) // 4th bit
{ state.set_short_rep(); put_byte( get_byte( rep0 ) ); continue; }
}
else
{ {
unsigned distance; unsigned distance;
if( rdec.decode_bit( bm_rep1[state()] ) == 0 ) // 4th bit if( rdec.decode_bit( bm_rep1[state()] ) == 0 ) // 4th bit
@ -258,8 +253,13 @@ int LZ_decoder::decode_member( const Pretty_print & pp )
rep1 = rep0; rep1 = rep0;
rep0 = distance; rep0 = distance;
} }
len = min_match_len + rdec.decode_len( rep_len_model, pos_state ); else
{
if( rdec.decode_bit( bm_len[state()][pos_state] ) == 0 ) // 4th bit
{ state.set_short_rep(); put_byte( get_byte( rep0 ) ); continue; }
}
state.set_rep(); state.set_rep();
len = min_match_len + rdec.decode_len( rep_len_model, pos_state );
} }
else else
{ {

View file

@ -214,7 +214,8 @@ class LZ_decoder
uint32_t crc_; uint32_t crc_;
const int outfd; // output file descriptor const int outfd; // output file descriptor
unsigned long long stream_position() const { return partial_data_pos + stream_pos; } unsigned long long stream_position() const
{ return partial_data_pos + stream_pos; }
void flush_data(); void flush_data();
bool verify_trailer( const Pretty_print & pp ) const; bool verify_trailer( const Pretty_print & pp ) const;

View file

@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1.
.TH LZIPRECOVER "1" "July 2013" "Lziprecover 1.15-rc1" "User Commands" .TH LZIPRECOVER "1" "September 2013" "Lziprecover 1.15" "User Commands"
.SH NAME .SH NAME
Lziprecover \- recovers data from damaged lzip files Lziprecover \- recovers data from damaged lzip files
.SH SYNOPSIS .SH SYNOPSIS

View file

@ -12,7 +12,7 @@ File: lziprecover.info, Node: Top, Next: Introduction, Up: (dir)
Lziprecover Manual Lziprecover Manual
****************** ******************
This manual is for Lziprecover (version 1.15-rc1, 29 July 2013). This manual is for Lziprecover (version 1.15, 14 September 2013).
* Menu: * Menu:
@ -325,7 +325,7 @@ additional information before, between, or after them.
`ID string' `ID string'
A four byte string, identifying the lzip format, with the value A four byte string, identifying the lzip format, with the value
"LZIP". "LZIP" (0x4C, 0x5A, 0x49, 0x50).
`VN (version number, 1 byte)' `VN (version number, 1 byte)'
Just in case something needs to be modified in the future. 1 for Just in case something needs to be modified in the future. 1 for
@ -340,8 +340,8 @@ additional information before, between, or after them.
Bits 4-0 contain the base 2 logarithm of the base size (12 to 29). Bits 4-0 contain the base 2 logarithm of the base size (12 to 29).
Bits 7-5 contain the number of wedges (0 to 7) to substract from Bits 7-5 contain the number of wedges (0 to 7) to substract from
the base size to obtain the dictionary size. the base size to obtain the dictionary size.
Example: 0xD3 = (2^19 - 6 * 2^15) = (512KiB - 6 * 32KiB) = 320KiB Example: 0xD3 = 2^19 - 6 * 2^15 = 512 KiB - 6 * 32 KiB = 320 KiB
Valid values for dictionary size range from 4KiB to 512MiB. Valid values for dictionary size range from 4 KiB to 512 MiB.
`Lzma stream' `Lzma stream'
The lzma stream, finished by an end of stream marker. Uses default The lzma stream, finished by an end of stream marker. Uses default
@ -379,7 +379,7 @@ show status.
lziprecover -tv file.lz lziprecover -tv file.lz
Example 3: Decompress `file.lz' partially until 10KiB of decompressed Example 3: Decompress `file.lz' partially until 10 KiB of decompressed
data are produced. data are produced.
lziprecover -D 0,10KiB file.lz lziprecover -D 0,10KiB file.lz
@ -467,7 +467,7 @@ programs with a suitable command line syntax.
`-V' `-V'
`--version' `--version'
Print the version number of lziprecover on the standard output and Print the version number of unzcrash on the standard output and
exit. exit.
`-b RANGE' `-b RANGE'
@ -541,16 +541,16 @@ Concept index
 
Tag Table: Tag Table:
Node: Top228 Node: Top228
Node: Introduction1095 Node: Introduction1096
Node: Invoking lziprecover3248 Node: Invoking lziprecover3249
Node: Repairing files8686 Node: Repairing files8687
Node: Merging files9405 Node: Merging files9406
Node: File format11176 Node: File format11177
Node: Examples13660 Node: Examples13687
Ref: ddrescue-example14860 Ref: ddrescue-example14888
Node: Unzcrash15969 Node: Unzcrash15997
Node: Problems18344 Node: Problems18369
Node: Concept index18894 Node: Concept index18919
 
End Tag Table End Tag Table

View file

@ -6,8 +6,8 @@
@finalout @finalout
@c %**end of header @c %**end of header
@set UPDATED 29 July 2013 @set UPDATED 14 September 2013
@set VERSION 1.15-rc1 @set VERSION 1.15
@dircategory Data Compression @dircategory Data Compression
@direntry @direntry
@ -356,7 +356,8 @@ All multibyte values are stored in little endian order.
@table @samp @table @samp
@item ID string @item ID string
A four byte string, identifying the lzip format, with the value "LZIP". A four byte string, identifying the lzip format, with the value "LZIP"
(0x4C, 0x5A, 0x49, 0x50).
@item VN (version number, 1 byte) @item VN (version number, 1 byte)
Just in case something needs to be modified in the future. 1 for now. Just in case something needs to be modified in the future. 1 for now.
@ -369,8 +370,8 @@ wedges between 0 and 7. The size of a wedge is (base_size / 16).@*
Bits 4-0 contain the base 2 logarithm of the base size (12 to 29).@* Bits 4-0 contain the base 2 logarithm of the base size (12 to 29).@*
Bits 7-5 contain the number of wedges (0 to 7) to substract from the Bits 7-5 contain the number of wedges (0 to 7) to substract from the
base size to obtain the dictionary size.@* base size to obtain the dictionary size.@*
Example: 0xD3 = (2^19 - 6 * 2^15) = (512KiB - 6 * 32KiB) = 320KiB@* Example: 0xD3 = 2^19 - 6 * 2^15 = 512 KiB - 6 * 32 KiB = 320 KiB@*
Valid values for dictionary size range from 4KiB to 512MiB. Valid values for dictionary size range from 4 KiB to 512 MiB.
@item Lzma stream @item Lzma stream
The lzma stream, finished by an end of stream marker. Uses default values The lzma stream, finished by an end of stream marker. Uses default values
@ -413,7 +414,7 @@ lziprecover -tv file.lz
@sp 1 @sp 1
@noindent @noindent
Example 3: Decompress @samp{file.lz} partially until 10KiB of Example 3: Decompress @samp{file.lz} partially until 10 KiB of
decompressed data are produced. decompressed data are produced.
@example @example
@ -529,7 +530,7 @@ Print an informative help message describing the options and exit.
@item -V @item -V
@itemx --version @itemx --version
Print the version number of lziprecover on the standard output and exit. Print the version number of unzcrash on the standard output and exit.
@item -b @var{range} @item -b @var{range}
@itemx --bits=@var{range} @itemx --bits=@var{range}

4
lzip.h
View file

@ -68,10 +68,10 @@ enum {
max_match_len = min_match_len + max_len_symbols - 1, // 273 max_match_len = min_match_len + max_len_symbols - 1, // 273
min_match_len_limit = 5, min_match_len_limit = 5,
max_dis_states = 4 }; dis_states = 4 };
inline int get_dis_state( const int len ) inline int get_dis_state( const int len )
{ return std::min( len - min_match_len, max_dis_states - 1 ); } { return std::min( len - min_match_len, dis_states - 1 ); }
inline int get_lit_state( const uint8_t prev_byte ) inline int get_lit_state( const uint8_t prev_byte )
{ return ( prev_byte >> ( 8 - literal_context_bits ) ); } { return ( prev_byte >> ( 8 - literal_context_bits ) ); }