Home | History | Annotate | Download | only in examples

Lines Matching defs:code

206     int bits;                   /* current bits per code */
207 unsigned code; /* code, table traversal index */
209 int max; /* maximum bits per code for this stream */
212 unsigned temp; /* current code */
213 unsigned prev; /* previous code */
214 unsigned final; /* last character written for previous code */
246 /* set up: get first 9-bit code, which is the first decompressed byte, but
247 don't create a table entry until the next code */
250 final = prev = (unsigned)last; /* low 8 bits of code */
253 if (last & 1) { /* code must be < 256 */
254 strm->msg = (char *)"invalid lzw code";
266 /* if the table will be full after this, increment the code size */
274 /* get a code of length bits */
277 code = rem; /* low bits of code */
286 code += (unsigned)last << left; /* middle (or high) bits of code */
290 if (NEXT() == -1) /* can't end in middle of code */
292 code += (unsigned)last << left; /* high bits of code */
296 code &= mask; /* mask to current code length */
300 /* process clear code (256) */
301 if (code == 256 && flags) {
306 continue; /* get next code */
309 /* special code to reuse last match */
310 temp = code; /* save the current code */
311 if (code > end) {
312 /* Be picky on the allowed code here, and make sure that the code
314 input does not cause an exception. The code != end + 1 check is
316 code. If this ever causes a problem, that check could be safely
320 if (code != end + 1 || prev > end) {
321 strm->msg = (char *)"invalid lzw code";
325 code = prev;
330 while (code >= 256) {
331 *p++ = suffix[code];
332 code = prefix[code];
335 match[stack++] = (unsigned char)code;
336 final = code;
345 /* set previous code for next iteration */
364 /* loop for next code with final and prev as the last match, rem and
365 left provide the first 0..7 bits of the next code, end is the last
376 The return value is a zlib error code: Z_MEM_ERROR if out of memory,
545 return code from gunpipe(). Otherwise it returns 0.