From ebfebbfb4b77fa42f84e07b6fe671c56cdd12a35 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 7 Nov 2015 16:29:08 +0100 Subject: Adding upstream version 0.9. Signed-off-by: Daniel Baumann --- plzip.h | 66 +++++++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 38 insertions(+), 28 deletions(-) (limited to 'plzip.h') diff --git a/plzip.h b/plzip.h index b12bbbd..f9aed10 100644 --- a/plzip.h +++ b/plzip.h @@ -16,6 +16,17 @@ along with this program. If not, see . */ +#ifndef LLONG_MAX +#define LLONG_MAX 0x7FFFFFFFFFFFFFFFLL +#endif +#ifndef LLONG_MIN +#define LLONG_MIN (-LLONG_MAX - 1LL) +#endif +#ifndef ULLONG_MAX +#define ULLONG_MAX 0xFFFFFFFFFFFFFFFFULL +#endif + + class Pretty_print { const char * const stdin_name; @@ -44,14 +55,16 @@ public: first_post = true; } - void reset() const throw() { if( name_.size() ) first_post = true; } - const char * name() const throw() { return name_.c_str(); } - void operator()( const char * const msg = 0 ) const throw(); + void reset() const { if( name_.size() ) first_post = true; } + const char * name() const { return name_.c_str(); } + void operator()( const char * const msg = 0 ) const; }; /*--------------------- Defined in compress.cc ---------------------*/ +int readblock( const int fd, uint8_t * const buf, const int size ); +int writeblock( const int fd, const uint8_t * const buf, const int size ); void xinit( pthread_mutex_t * const mutex ); void xinit( pthread_cond_t * const cond ); void xdestroy( pthread_mutex_t * const mutex ); @@ -62,6 +75,28 @@ void xwait( pthread_cond_t * const cond, pthread_mutex_t * const mutex ); void xsignal( pthread_cond_t * const cond ); void xbroadcast( pthread_cond_t * const cond ); +int compress( const int data_size, const int dictionary_size, + const int match_len_limit, const int num_workers, + const int infd, const int outfd, + const Pretty_print & pp, const int debug_level ); + + +/*-------------------- Defined in decompress.cc --------------------*/ + +int decompress( const int num_workers, const int infd, const int outfd, + const Pretty_print & pp, const int debug_level, + const bool testing ); + + +/*----------------------- Defined in main.cc -----------------------*/ + +extern int verbosity; + +void fatal(); // terminate the program + +void show_error( const char * const msg, const int errcode = 0, const bool help = false ); +void internal_error( const char * const msg ); + class Slot_tally { @@ -104,28 +139,3 @@ public: xunlock( &mutex ); } }; - - -int compress( const int data_size, const int dictionary_size, - const int match_len_limit, const int num_workers, - const int infd, const int outfd, - const Pretty_print & pp, const int debug_level ); - - -/*-------------------- Defined in decompress.cc --------------------*/ - -int decompress( const int num_workers, const int infd, const int outfd, - const Pretty_print & pp, const int debug_level, - const bool testing ); - - -/*----------------------- Defined in main.cc -----------------------*/ - -extern int verbosity; - -void fatal(); // terminate the program - -void show_error( const char * const msg, const int errcode = 0, const bool help = false ) throw(); -void internal_error( const char * const msg ) throw(); -int readblock( const int fd, uint8_t * const buf, const int size ) throw(); -int writeblock( const int fd, const uint8_t * const buf, const int size ) throw(); -- cgit v1.2.3