1 /* hunzip: file decompression for sorted dictionaries with optional encryption,
2 * algorithm: prefix-suffix encoding and 16-bit Huffman encoding */
12 #define HZIP_EXTENSION ".hz"
14 #define MSG_OPEN "error: %s: cannot open\n"
15 #define MSG_FORMAT "error: %s: not in hzip format\n"
16 #define MSG_MEMORY "error: %s: missing memory\n"
17 #define MSG_KEY "error: %s: missing or bad password\n"
24 class LIBHUNSPELL_DLL_EXPORTED Hunzip
30 int bufsiz
, lastbit
, inc
, inbits
, outc
;
31 struct bit
* dec
; // code table
32 char in
[BUFSIZE
]; // input buffer
33 char out
[BUFSIZE
+ 1]; // Huffman-decoded buffer
34 char line
[BUFSIZE
+ 50]; // decoded line
35 int getcode(const char * key
);
37 int fail(const char * err
, const char * par
);
40 Hunzip(const char * filename
, const char * key
= NULL
);
42 const char * getline();