26 # define PUP(a) *(a)++
29 # define PUP(a) *++(a)
72 unsigned char FAR *in;
74 unsigned char FAR *out;
75 unsigned char FAR *beg;
76 unsigned char FAR *end;
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
115 lmask = (1U << state->
lenbits) - 1;
116 dmask = (1U << state->
distbits) - 1;
127 this = lcode[
hold & lmask];
129 op = (unsigned)(this.bits);
132 op = (unsigned)(this.op);
135 "inflate: literal '%c'\n" :
136 "inflate: literal 0x%02x\n", this.
val));
137 PUP(out) = (
unsigned char)(this.
val);
140 len = (unsigned)(this.
val);
147 len += (unsigned)
hold & ((1U << op) - 1);
151 Tracevv((stderr,
"inflate: length %u\n", len));
158 this = dcode[
hold & dmask];
160 op = (unsigned)(this.bits);
163 op = (unsigned)(this.op);
165 dist = (unsigned)(this.
val);
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);
190 strm->msg = (
char *)
"invalid distance too far back";
205 else if (
write < op) {
261 else if ((op & 64) == 0) {
262 this = dcode[this.
val + (hold & ((1U << op) - 1))];
266 strm->msg = (
char *)
"invalid distance code";
271 else if ((op & 64) == 0) {
272 this = lcode[this.
val + (hold & ((1U << op) - 1))];
276 Tracevv((stderr,
"inflate: end of block\n"));
281 strm->msg = (
char *)
"invalid literal/length code";
285 }
while (in <
last && out < end);
294 strm->next_in = in +
OFF;
295 strm->next_out = out +
OFF;
296 strm->avail_in = (unsigned)(in <
last ? 5 + (
last - in) : 5 - (in -
last));
297 strm->avail_out = (unsigned)(out < end ?
298 257 + (end - out) : 257 - (out - end));