Lines Matching defs:code
207 int bits; /* current bits per code */
208 unsigned code; /* code, table traversal index */
210 int max; /* maximum bits per code for this stream */
213 unsigned temp; /* current code */
214 unsigned prev; /* previous code */
215 unsigned final; /* last character written for previous code */
247 /* set up: get first 9-bit code, which is the first decompressed byte, but
248 don't create a table entry until the next code */
251 final = prev = (unsigned)last; /* low 8 bits of code */
254 if (last & 1) { /* code must be < 256 */
255 strm->msg = (char *)"invalid lzw code";
267 /* if the table will be full after this, increment the code size */
275 /* get a code of length bits */
278 code = rem; /* low bits of code */
287 code += (unsigned)last << left; /* middle (or high) bits of code */
291 if (NEXT() == -1) /* can't end in middle of code */
293 code += (unsigned)last << left; /* high bits of code */
297 code &= mask; /* mask to current code length */
301 /* process clear code (256) */
302 if (code == 256 && flags) {
307 continue; /* get next code */
310 /* special code to reuse last match */
311 temp = code; /* save the current code */
312 if (code > end) {
313 /* Be picky on the allowed code here, and make sure that the code
315 input does not cause an exception. The code != end + 1 check is
317 code. If this ever causes a problem, that check could be safely
321 if (code != end + 1 || prev > end) {
322 strm->msg = (char *)"invalid lzw code";
326 code = prev;
331 while (code >= 256) {
332 *p++ = suffix[code];
333 code = prefix[code];
336 match[stack++] = (unsigned char)code;
337 final = code;
346 /* set previous code for next iteration */
365 /* loop for next code with final and prev as the last match, rem and
366 left provide the first 0..7 bits of the next code, end is the last
377 The return value is a zlib error code: Z_MEM_ERROR if out of memory,
546 return code from gunpipe(). Otherwise it returns 0.