Lines Matching +defs:check +defs:code

115    output file, a running CRC-32 check on the output and the total number of
121 int check; /* true if checking crc and total */
136 if (me->check) {
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 */
223 outd.check = 0;
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
318 removed. Leaving this check in greatly improves gun's ability
320 In any case, the prev > end check must be retained. */
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,
379 trailer CRC-32 check or length doesn't match, Z_BUF_ERROR if the input ends
407 strm->msg = (char *)"incorrect header check";
468 outd.check = 1;
481 /* check trailer */
489 strm->msg = (char *)"incorrect data check";
500 strm->msg = (char *)"incorrect length check";
539 decompress without writing and check the gzip trailer for integrity. If
546 return code from gunpipe(). Otherwise it returns 0.