diff options
author | Pixel <Pixel> | 2002-09-27 12:17:57 +0000 |
---|---|---|
committer | Pixel <Pixel> | 2002-09-27 12:17:57 +0000 |
commit | bfa5de7eccf4604ff8217f619e9685a09e80d545 (patch) | |
tree | a5be5de750ac611145f459a09bda902c3dbc1a70 /includes/lzss.h | |
parent | 60c1003845035ad4cd0e9ea50862bad7626faf0e (diff) |
The week-without-the-network changes
Diffstat (limited to 'includes/lzss.h')
-rw-r--r-- | includes/lzss.h | 76 |
1 files changed, 46 insertions, 30 deletions
diff --git a/includes/lzss.h b/includes/lzss.h index 5bfa68a..17f4806 100644 --- a/includes/lzss.h +++ b/includes/lzss.h @@ -24,41 +24,57 @@ #include "generic.h" #include "Handle.h" -#define LZSS_VERSION "3.0.0-pre1" -#define LZSS_NAME "lzss" +#define LZSS_VERSION String("3.0.0-pre1") +#define LZSS_NAME String("lzss") -typedef struct { - char * name; - int one_is_compressed, bitmap_inversed, one_jump, overlap_trick, negative_trick, sixteen_bits, ptrb, filling; - int window_start; - int l_mask_1, l_shft_1, l_mask_2, l_shft_2; - int j_mask_1, j_shft_1, j_mask_2, j_shft_2; - int f_mask_1, f_shft_1, f_mask_2, f_shft_2; - int v_mask_1, v_shft_1, v_mask_2, v_shft_2; -} scheme_t; +class lzss : public Base { + public: + lzss(); + typedef struct { + char * name; + int one_is_compressed, bitmap_inversed, one_jump, overlap_trick, negative_trick, sixteen_bits, ptrb, filling; + int window_start; + int l_mask_1, l_shft_1, l_mask_2, l_shft_2; + int j_mask_1, j_shft_1, j_mask_2, j_shft_2; + int f_mask_1, f_shft_1, f_mask_2, f_shft_2; + int v_mask_1, v_shft_1, v_mask_2, v_shft_2; + } scheme_t; -enum { - XENO = 0, - DBZ, - FF7, - LM, - MM, - OB, - LODOSS, - FF6, - VP_1, - VP_2, - END -}; + enum { + XENO = 0, + DBZ, + FF7, + LM, + MM, + OB, + LODOSS, + FF6, + VP_1, + VP_2, + END + }; -extern scheme_t scheme, schemes[]; + static const scheme_t schemes[]; + int tolerate, blockb; + long blk, bitmap_count; -extern int tolerate, blockb; -extern long blk, bitmap_count; + unsigned long lzss_decomp(Handle * f_source, Handle * f_cible, long true_length = -1); + void lzss_comp(Handle * f_source, Handle * f_cible, long * delta = NULL); -unsigned long lzss_decomp(Handle * f_source, Handle * f_cible, long true_length = -1); -void lzss_comp(Handle * f_source, Handle * f_cible, long * delta = NULL); + Byte swap_bits(Byte); + + void change_scheme(scheme_t); + scheme_t get_scheme(); -char swap_bits(char); + private: + scheme_t scheme; + int lzss_maxsize, lzss_maxptr; + + unsigned int shift(unsigned int, int); + void compute_limits(void); + unsigned char lzss_rd(unsigned char *, long); + long lzss_comp_strstr(unsigned char *, unsigned char *, long *, long); + unsigned char * lzss_memcomp(unsigned char *, long *, long *); +}; #endif |