summaryrefslogtreecommitdiffstats
path: root/lzip.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lzip.h18
1 files changed, 7 insertions, 11 deletions
diff --git a/lzip.h b/lzip.h
index 0ec2756..32236ed 100644
--- a/lzip.h
+++ b/lzip.h
@@ -1,4 +1,4 @@
-/* Pdlzip - Data compressor based on the LZMA algorithm
+/* Pdlzip - LZMA lossless data compressor
Copyright (C) 2010, 2011, 2012, 2013 Antonio Diaz Diaz.
This program is free software: you have unlimited permission
@@ -49,12 +49,11 @@ struct Pretty_print
const char * name;
const char * stdin_name;
int longest_name;
- int verbosity;
bool first_post;
};
void Pp_init( struct Pretty_print * const pp, const char * const filenames[],
- const int num_filenames, const int v );
+ const int num_filenames );
static inline void Pp_set_name( struct Pretty_print * const pp,
const char * const filename )
@@ -124,7 +123,7 @@ static inline uint8_t Fh_version( const File_header data )
{ return data[4]; }
static inline bool Fh_verify_version( const File_header data )
- { return ( data[4] <= 1 ); }
+ { return ( data[4] == 1 ); }
static inline unsigned Fh_get_dictionary_size( const File_header data )
{
@@ -134,15 +133,15 @@ static inline unsigned Fh_get_dictionary_size( const File_header data )
return sz;
}
-static inline bool Fh_set_dictionary_size( File_header data, const int sz )
+static inline bool Fh_set_dictionary_size( File_header data, const unsigned sz )
{
if( sz >= min_dictionary_size && sz <= max_dictionary_size )
{
data[5] = real_bits( sz - 1 );
if( sz > min_dictionary_size )
{
- const int base_size = 1 << data[5];
- const int wedge = base_size / 16;
+ const unsigned base_size = 1 << data[5];
+ const unsigned wedge = base_size / 16;
int i;
for( i = 7; i >= 1; --i )
if( base_size - ( i * wedge ) >= sz )
@@ -161,9 +160,6 @@ typedef uint8_t File_trailer[20];
enum { Ft_size = 20 };
-static inline int Ft_versioned_size( const int version )
- { return ( ( version >= 1 ) ? 20 : 12 ); }
-
static inline unsigned Ft_get_data_crc( const File_trailer data )
{
unsigned tmp = 0;
@@ -213,7 +209,7 @@ int writeblock( const int fd, const uint8_t * const buf, const int size );
/* defined in main.c */
extern int verbosity;
-
+void cleanup_and_fail( const int retval );
void show_error( const char * const msg, const int errcode, const bool help );
void internal_error( const char * const msg );