26 # define PUP(a) *(a)++ 29 # define PUP(a) *++(a) 74 unsigned char FAR *
out;
75 unsigned char FAR *beg;
76 unsigned char FAR *
end;
86 code const FAR *lcode;
87 code const FAR *dcode;
95 unsigned char FAR *from;
99 in = strm->next_in -
OFF;
100 last = in + (strm->avail_in - 5);
101 out = strm->next_out -
OFF;
102 beg = out - (
start - strm->avail_out);
103 end = out + (strm->avail_out - 257);
104 #ifdef INFLATE_STRICT 107 wsize = state->
wsize;
108 whave = state->
whave;
109 wnext = state->
wnext;
115 lmask = (1U << state->
lenbits) - 1;
116 dmask = (1U << state->
distbits) - 1;
122 hold += (
unsigned long)(
PUP(in)) << bits;
124 hold += (
unsigned long)(
PUP(in)) << bits;
127 here = lcode[hold & lmask];
129 op = (unsigned)(here.
bits);
132 op = (unsigned)(here.
op);
135 "inflate: literal '%c'\n" :
136 "inflate: literal 0x%02x\n", here.
val));
137 PUP(out) = (
unsigned char)(here.
val);
140 len = (unsigned)(here.
val);
144 hold += (
unsigned long)(
PUP(in)) << bits;
147 len += (unsigned)hold & ((1U << op) - 1);
151 Tracevv((stderr,
"inflate: length %u\n", len));
153 hold += (
unsigned long)(
PUP(in)) << bits;
155 hold += (
unsigned long)(
PUP(in)) << bits;
158 here = dcode[hold & dmask];
160 op = (unsigned)(here.
bits);
163 op = (unsigned)(here.
op);
165 dist = (unsigned)(here.
val);
168 hold += (
unsigned long)(
PUP(in)) << bits;
171 hold += (
unsigned long)(
PUP(in)) << bits;
175 dist += (unsigned)hold & ((1U << op) - 1);
176 #ifdef INFLATE_STRICT 178 strm->msg = (
char *)
"invalid distance too far back";
185 Tracevv((stderr,
"inflate: distance %u\n", dist));
186 op = (unsigned)(out - beg);
192 (
char *)
"invalid distance too far back";
196 #ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR 197 if (len <= op - whave) {
206 }
while (--op > whave);
227 else if (wnext < op) {
228 from += wsize + wnext - op;
283 else if ((op & 64) == 0) {
284 here = dcode[here.
val + (hold & ((1U << op) - 1))];
288 strm->msg = (
char *)
"invalid distance code";
293 else if ((op & 64) == 0) {
294 here = lcode[here.
val + (hold & ((1U << op) - 1))];
298 Tracevv((stderr,
"inflate: end of block\n"));
303 strm->msg = (
char *)
"invalid literal/length code";
307 }
while (in < last && out < end);
313 hold &= (1U <<
bits) - 1;
316 strm->next_in = in +
OFF;
317 strm->next_out = out +
OFF;
318 strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in -
last));
319 strm->avail_out = (unsigned)(out < end ?
320 257 + (end - out) : 257 - (out -
end));
code const FAR * distcode
void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start)
local int out(void *out_desc, unsigned char *buf, unsigned len)
typedef long(ZCALLBACK *tell_file_func) OF((voidpf opaque
unsigned char FAR * window