Lines Matching refs:s
68 void zlib_inflate_blocks_reset(s, z, c) in zlib_inflate_blocks_reset() argument
69 inflate_blocks_statef *s; in zlib_inflate_blocks_reset()
74 *c = s->check;
75 if (s->mode == CODES)
76 zlib_inflate_codes_free(s->sub.decode.codes, z);
77 s->mode = TYPE;
78 s->bitk = 0;
79 s->bitb = 0;
80 s->read = s->write = s->window;
81 if (s->checkfn != Z_NULL)
82 z->adler = s->check = (*s->checkfn)(0L, (const Bytef *)Z_NULL, 0);
90 inflate_blocks_statef *s; local
92 s = &WS(z)->working_blocks_state;
93 s->hufts = WS(z)->working_hufts;
94 s->window = WS(z)->working_window;
95 s->end = s->window + w;
96 s->checkfn = c;
97 s->mode = TYPE;
98 zlib_inflate_blocks_reset(s, z, Z_NULL);
99 return s;
103 int zlib_inflate_blocks(s, z, r) in zlib_inflate_blocks() argument
104 inflate_blocks_statef *s; in zlib_inflate_blocks()
120 while (1) switch (s->mode)
125 s->last = t & 1;
132 s->mode = LENS; /* get length of stored block */
140 s->sub.decode.codes = zlib_inflate_codes_new(bl, bd, tl, td, z);
141 if (s->sub.decode.codes == Z_NULL)
148 s->mode = CODES;
152 s->mode = TABLE;
156 s->mode = B_BAD;
166 s->mode = B_BAD;
171 s->sub.left = (uInt)b & 0xffff;
173 s->mode = s->sub.left ? STORED : (s->last ? DRY : TYPE);
179 t = s->sub.left;
185 if ((s->sub.left -= t) != 0)
187 s->mode = s->last ? DRY : TYPE;
191 s->sub.trees.table = t = (uInt)b & 0x3fff;
195 s->mode = B_BAD;
202 s->sub.trees.blens = WS(z)->working_blens;
205 s->sub.trees.index = 0;
206 s->mode = BTREE;
208 while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10))
211 s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7;
214 while (s->sub.trees.index < 19)
215 s->sub.trees.blens[border[s->sub.trees.index++]] = 0;
216 s->sub.trees.bb = 7;
217 t = zlib_inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb,
218 &s->sub.trees.tb, s->hufts, z);
223 s->mode = B_BAD;
226 s->sub.trees.index = 0;
227 s->mode = DTREE;
229 while (t = s->sub.trees.table,
230 s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))
235 t = s->sub.trees.bb;
237 h = s->sub.trees.tb + ((uInt)b & zlib_inflate_mask[t]);
243 s->sub.trees.blens[s->sub.trees.index++] = c;
253 i = s->sub.trees.index;
254 t = s->sub.trees.table;
258 s->mode = B_BAD;
263 c = c == 16 ? s->sub.trees.blens[i - 1] : 0;
265 s->sub.trees.blens[i++] = c;
267 s->sub.trees.index = i;
270 s->sub.trees.tb = Z_NULL;
278 t = s->sub.trees.table;
280 s->sub.trees.blens, &bl, &bd, &tl, &td,
281 s->hufts, z);
285 s->mode = B_BAD;
294 s->sub.decode.codes = c;
296 s->mode = CODES;
299 if ((r = zlib_inflate_codes(s, z, r)) != Z_STREAM_END)
300 return zlib_inflate_flush(s, z, r);
302 zlib_inflate_codes_free(s->sub.decode.codes, z);
304 if (!s->last)
306 s->mode = TYPE;
309 s->mode = DRY;
312 if (s->read != s->write)
314 s->mode = B_DONE;
328 int zlib_inflate_blocks_free(s, z) in zlib_inflate_blocks_free() argument
329 inflate_blocks_statef *s; in zlib_inflate_blocks_free()
332 zlib_inflate_blocks_reset(s, z, Z_NULL);
337 void zlib_inflate_set_dictionary(s, d, n) in zlib_inflate_set_dictionary() argument
338 inflate_blocks_statef *s; in zlib_inflate_set_dictionary()
342 memcpy(s->window, d, n);
343 s->read = s->write = s->window + n;
351 int zlib_inflate_blocks_sync_point(s) in zlib_inflate_blocks_sync_point() argument
352 inflate_blocks_statef *s; in zlib_inflate_blocks_sync_point()
354 return s->mode == LENS;