78 #define _(proto) proto
84 typedef unsigned char uch;
85 typedef unsigned short ush;
114 #define OF(args) args
118 #define NLMZIP_ERROR 1
119 #define NLMZIP_WARNING 2
122 #define NLMZIP_STORED 0
123 #define NLMZIP_COMPRESSED 1
124 #define NLMZIP_PACKED 2
125 #define NLMZIP_LZHED 3
126 #define NLMZIP_DEFLATED 8
127 #define NLMZIP_MAX_METHODS 9
130 #define INBUFSIZ 0x8000
131 #define DIST_BUFSIZE 0x8000
134 #define OUTBUFSIZ 16384
138 #define head (Nlmzip_prev+WSIZE)
141 #define MAGIC_KEY "\037\213"
145 #define ASCII_FLAG 0x01
146 #define CONTINUATION 0x02
147 #define EXTRA_FIELD 0x04
148 #define ORIG_NAME 0x08
150 #define ENCRYPTED 0x20
151 #define RESERVED 0xC0
154 #define UNKNOWN 0xffff
160 #define MAX_MATCH 258
165 #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
173 #define MAX_DIST 1024
176 #define SH(p) ((ush)(uch)((p)[0]) | ((ush)(uch)((p)[1]) << 8))
177 #define LG(p) ((ulg)(SH(p)) | ((ulg)(SH((p)+2)) << 16))
180 #define URCOMPRERR(x) Nlmzip_Err(__FILE__,__LINE__,x)
void Nlmzip_bi_init(void)
void Nlmzip_WriteShort(unsigned short)
void Nlmzip_flush_window(void)
void Nlmzip_clear_bufs(void)
void Nlmzip_send_bits(int, int)
void Nlmzip_Err(const char *, int, const char *)
unsigned short Nlmzip_prev[]
void Nlmzip_WriteData(unsigned char *, int)
void Nlmzip_copy_block(char *, Uint4, int)
int Nlmzip_ReadData(unsigned char *, int)
unsigned char Nlmzip_window[]
int Nlmzip_ct_tally(int, int)
unsigned char Nlmzip_outbuf[]
unsigned char Nlmzip_inbuf[]
void Nlmzip_ReadUndo(void)
ulg Nlmzip_flush_block(char *, ulg, int)
Uint4 Nlmzip_bi_reverse(Uint4, int)
void Nlmzip_lm_init(int, unsigned short *)
unsigned char Nlmzip_ReadByte(void)
void Nlmzip_ct_init(unsigned short *, int *)
void Nlmzip_WriteByte(unsigned char)
void Nlmzip_WriteLong(ulg)
void Nlmzip_bi_windup(void)
unsigned short Nlmzip_d_buf[]
ulg Nlmzip_updcrc(unsigned char *, Uint4)
int32_t Int4
4-byte (32-bit) signed integer
uint32_t Uint4
4-byte (32-bit) unsigned integer