| 
| #define  | EOF   (-1) | 
|   | 
| #define  | ZE_MISS   -1 | 
|   | 
| #define  | ZE_OK   0 | 
|   | 
| #define  | ZE_EOF   2 | 
|   | 
| #define  | ZE_FORM   3 | 
|   | 
| #define  | ZE_MEM   4 | 
|   | 
| #define  | ZE_LOGIC   5 | 
|   | 
| #define  | ZE_BIG   6 | 
|   | 
| #define  | ZE_NOTE   7 | 
|   | 
| #define  | ZE_TEST   8 | 
|   | 
| #define  | ZE_ABORT   9 | 
|   | 
| #define  | ZE_TEMP   10 | 
|   | 
| #define  | ZE_READ   11 | 
|   | 
| #define  | ZE_NONE   12 | 
|   | 
| #define  | ZE_NAME   13 | 
|   | 
| #define  | ZE_WRITE   14 | 
|   | 
| #define  | ZE_CREAT   15 | 
|   | 
| #define  | ZE_PARMS   16 | 
|   | 
| #define  | ZE_OPEN   18 | 
|   | 
| #define  | ZE_MAXERR   18 | 
|   | 
| #define  | UNKNOWN   (-1) | 
|   | 
| #define  | BINARY   0 | 
|   | 
| #define  | ASCII   1 | 
|   | 
| #define  | BEST   -1 | 
|   | 
| #define  | STORE   0 | 
|   | 
| #define  | DEFLATE   8 | 
|   | 
| #define  | CRCVAL_INITIAL   0L | 
|   | 
| #define  | MSDOS_HIDDEN_ATTR   0x02 | 
|   | 
| #define  | MSDOS_DIR_ATTR   0x10 | 
|   | 
| #define  | LOCHEAD   26 | 
|   | 
| #define  | CENHEAD   42 | 
|   | 
| #define  | ENDHEAD   18 | 
|   | 
| #define  | EB_HEADSIZE   4     /* length of a extra field block header */ | 
|   | 
| #define  | EB_LEN   2     /* offset of data length field in header */ | 
|   | 
| #define  | EB_UT_MINLEN   1     /* minimal UT field contains Flags byte */ | 
|   | 
| #define  | EB_UT_FLAGS   0     /* byte offset of Flags field */ | 
|   | 
| #define  | EB_UT_TIME1   1     /* byte offset of 1st time value */ | 
|   | 
| #define  | EB_UT_FL_MTIME   (1 << 0)      /* mtime present */ | 
|   | 
| #define  | EB_UT_FL_ATIME   (1 << 1)      /* atime present */ | 
|   | 
| #define  | EB_UT_FL_CTIME   (1 << 2)      /* ctime present */ | 
|   | 
| #define  | EB_UT_LEN(n)   (EB_UT_MINLEN + 4 * (n)) | 
|   | 
| #define  | EB_L_UT_SIZE   (EB_HEADSIZE + EB_UT_LEN(3)) | 
|   | 
| #define  | EB_C_UT_SIZE   (EB_HEADSIZE + EB_UT_LEN(1)) | 
|   | 
| #define  | PUTSH(a, f)   {char _putsh_c=(char)((a)&0xff); wfunc(param,&_putsh_c,1); _putsh_c=(char)((a)>>8); wfunc(param,&_putsh_c,1);} | 
|   | 
| #define  | PUTLG(a, f)   {PUTSH((a) & 0xffff,(f)) PUTSH((a) >> 16,(f))} | 
|   | 
| #define  | LOCSIG   0x04034b50L | 
|   | 
| #define  | CENSIG   0x02014b50L | 
|   | 
| #define  | ENDSIG   0x06054b50L | 
|   | 
| #define  | EXTLOCSIG   0x08074b50L | 
|   | 
| #define  | MIN_MATCH   3 | 
|   | 
| #define  | MAX_MATCH   258 | 
|   | 
| #define  | WSIZE   (0x8000) | 
|   | 
| #define  | MIN_LOOKAHEAD   (MAX_MATCH+MIN_MATCH+1) | 
|   | 
| #define  | MAX_DIST   (WSIZE-MIN_LOOKAHEAD) | 
|   | 
| #define  | ZIP_HANDLE   1 | 
|   | 
| #define  | ZIP_FILENAME   2 | 
|   | 
| #define  | ZIP_MEMORY   3 | 
|   | 
| #define  | ZIP_FOLDER   4 | 
|   | 
| #define  | MAX_BITS   15 | 
|   | 
| #define  | MAX_BL_BITS   7 | 
|   | 
| #define  | LENGTH_CODES   29 | 
|   | 
| #define  | LITERALS   256 | 
|   | 
| #define  | END_BLOCK   256 | 
|   | 
| #define  | L_CODES   (LITERALS+1+LENGTH_CODES) | 
|   | 
| #define  | D_CODES   30 | 
|   | 
| #define  | BL_CODES   19 | 
|   | 
| #define  | STORED_BLOCK   0 | 
|   | 
| #define  | STATIC_TREES   1 | 
|   | 
| #define  | DYN_TREES   2 | 
|   | 
| #define  | LIT_BUFSIZE   0x8000 | 
|   | 
| #define  | DIST_BUFSIZE   LIT_BUFSIZE | 
|   | 
| #define  | REP_3_6   16 | 
|   | 
| #define  | REPZ_3_10   17 | 
|   | 
| #define  | REPZ_11_138   18 | 
|   | 
| #define  | HEAP_SIZE   (2*L_CODES+1) | 
|   | 
| #define  | Buf_size   (8 * 2*sizeof(char)) | 
|   | 
| #define  | PUTSHORT(state, w) | 
|   | 
| #define  | PUTBYTE(state, b) | 
|   | 
| #define  | HASH_BITS   15 | 
|   | 
| #define  | HASH_SIZE   (unsigned)(1<<HASH_BITS) | 
|   | 
| #define  | HASH_MASK   (HASH_SIZE-1) | 
|   | 
| #define  | WMASK   (WSIZE-1) | 
|   | 
| #define  | NIL   0 | 
|   | 
| #define  | FAST   4 | 
|   | 
| #define  | SLOW   2 | 
|   | 
| #define  | TOO_FAR   4096 | 
|   | 
| #define  | EQUAL   0 | 
|   | 
| #define  | H_SHIFT   ((HASH_BITS+MIN_MATCH-1)/MIN_MATCH) | 
|   | 
| #define  | max_insert_length   max_lazy_match | 
|   | 
| #define  | send_code(state, c, tree)   send_bits(state, tree[c].fc.code, tree[c].dl.len) | 
|   | 
| #define  | d_code(dist)   ((dist) < 256 ? state.ts.dist_code[dist] : state.ts.dist_code[256+((dist)>>7)]) | 
|   | 
| #define  | Max(a, b)   (a >= b ? a : b) | 
|   | 
| #define  | SMALLEST   1 | 
|   | 
| #define  | pqremove(tree, top) | 
|   | 
| #define  | smaller(tree, n, m) | 
|   | 
| #define  | UPDATE_HASH(h, c)   (h = (((h)<<H_SHIFT) ^ (c)) & HASH_MASK) | 
|   | 
| #define  | INSERT_STRING(s, match_head) | 
|   | 
| #define  | check_match(state, start, match, length) | 
|   | 
| #define  | FLUSH_BLOCK(state, eof) | 
|   | 
| #define  | CRC32(c, b)   (crc_table[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8)) | 
|   | 
| #define  | DO1(buf)   crc = CRC32(crc, *buf++) | 
|   | 
| #define  | DO2(buf)   DO1(buf); DO1(buf) | 
|   | 
| #define  | DO4(buf)   DO2(buf); DO2(buf) | 
|   | 
| #define  | DO8(buf)   DO4(buf); DO4(buf) | 
|   | 
 | 
| void  | Assert (TState &state, bool cond, const char *msg) | 
|   | 
| void __cdecl  | Trace (const char *x,...) | 
|   | 
| void __cdecl  | Tracec (bool, const char *x,...) | 
|   | 
| void  | init_block (TState &) | 
|   | 
| void  | pqdownheap (TState &, ct_data *tree, int k) | 
|   | 
| void  | gen_bitlen (TState &, tree_desc *desc) | 
|   | 
| void  | gen_codes (TState &state, ct_data *tree, int max_code) | 
|   | 
| void  | build_tree (TState &, tree_desc *desc) | 
|   | 
| void  | scan_tree (TState &, ct_data *tree, int max_code) | 
|   | 
| void  | send_tree (TState &state, ct_data *tree, int max_code) | 
|   | 
| int  | build_bl_tree (TState &) | 
|   | 
| void  | send_all_trees (TState &state, int lcodes, int dcodes, int blcodes) | 
|   | 
| void  | compress_block (TState &state, ct_data *ltree, ct_data *dtree) | 
|   | 
| void  | set_file_type (TState &) | 
|   | 
| void  | send_bits (TState &state, int value, int length) | 
|   | 
| unsigned  | bi_reverse (unsigned code, int len) | 
|   | 
| void  | bi_windup (TState &state) | 
|   | 
| void  | copy_block (TState &state, char *buf, unsigned len, int header) | 
|   | 
| void  | ct_init (TState &state, ush *attr) | 
|   | 
| ulg  | flush_block (TState &state, char *buf, ulg stored_len, int eof) | 
|   | 
| int  | ct_tally (TState &state, int dist, int lc) | 
|   | 
| void  | bi_init (TState &state, char *tgt_buf, unsigned tgt_size, int flsh_allowed) | 
|   | 
| void  | fill_window (TState &state) | 
|   | 
| ulg  | deflate_fast (TState &state) | 
|   | 
| int  | longest_match (TState &state, IPos cur_match) | 
|   | 
| void  | lm_init (TState &state, int pack_level, ush *flags) | 
|   | 
| ulg  | deflate (TState &state) | 
|   | 
| int  | putlocal (struct zlist far *z, WRITEFUNC wfunc, void *param) | 
|   | 
| int  | putextended (struct zlist far *z, WRITEFUNC wfunc, void *param) | 
|   | 
| int  | putcentral (struct zlist far *z, WRITEFUNC wfunc, void *param) | 
|   | 
| int  | putend (int n, ulg s, ulg c, extent m, char *z, WRITEFUNC wfunc, void *param) | 
|   | 
| ulg  | crc32 (ulg crc, const uch *buf, extent len) | 
|   | 
| void  | update_keys (unsigned long *keys, char c) | 
|   | 
| char  | decrypt_byte (unsigned long *keys) | 
|   | 
| char  | zencode (unsigned long *keys, char c) | 
|   | 
| bool  | HasZipSuffix (const TCHAR *fn) | 
|   | 
| lutime_t  | filetime2timet (const FILETIME ft) | 
|   | 
| void  | filetime2dosdatetime (const FILETIME ft, WORD *dosdate, WORD *dostime) | 
|   | 
| ZRESULT  | GetFileInfo (HANDLE hf, ulg *attr, long *size, iztimes *times, ulg *timestamp) | 
|   | 
| unsigned int  | FormatZipMessageZ (ZRESULT code, char *buf, unsigned int len) | 
|   | 
| HZIP  | CreateZipInternal (void *z, unsigned int len, DWORD flags, const char *password) | 
|   | 
| HZIP  | CreateZipHandle (HANDLE h, const char *password) | 
|   | 
| HZIP  | CreateZip (const TCHAR *fn, const char *password) | 
|   | 
| HZIP  | CreateZip (void *z, unsigned int len, const char *password) | 
|   | 
| ZRESULT  | ZipAddInternal (HZIP hz, const TCHAR *dstzn, void *src, unsigned int len, DWORD flags) | 
|   | 
| ZRESULT  | ZipAdd (HZIP hz, const TCHAR *dstzn, const TCHAR *fn) | 
|   | 
| ZRESULT  | ZipAdd (HZIP hz, const TCHAR *dstzn, void *src, unsigned int len) | 
|   | 
| ZRESULT  | ZipAddHandle (HZIP hz, const TCHAR *dstzn, HANDLE h) | 
|   | 
| ZRESULT  | ZipAddHandle (HZIP hz, const TCHAR *dstzn, HANDLE h, unsigned int len) | 
|   | 
| ZRESULT  | ZipAddFolder (HZIP hz, const TCHAR *dstzn) | 
|   | 
| ZRESULT  | ZipGetMemory (HZIP hz, void **buf, unsigned long *len) | 
|   | 
| ZRESULT  | CloseZipZ (HZIP hz) | 
|   | 
| bool  | IsZipHandleZ (HZIP hz) | 
|   | 
 | 
| const int  | extra_lbits [LENGTH_CODES] = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0} | 
|   | 
| const int  | extra_dbits [D_CODES] = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13} | 
|   | 
| const int  | extra_blbits [BL_CODES] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7} | 
|   | 
| const uch  | bl_order [BL_CODES] = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15} | 
|   | 
| const config  | configuration_table [10] | 
|   | 
| const ulg  | crc_table [256] | 
|   | 
| bool  | has_seeded =false | 
|   | 
| ZRESULT  | lasterrorZ =ZR_OK | 
|   |