Lines Matching defs:in
9 * only standard in to standard out with -9 compression. It also requires
21 * This program is distributed in the hope that it will be useful,
80 * For compression, input is done in window[]. For decompression, output
81 * is done in window except for unlzw.
134 #define NO_FILE (-1) /* in memory compression */
225 static int zip (int in, int out);
283 * The target dependent functions should be defined in tailor.c.
321 static int foreground; /* set if program run in foreground */
324 static int part_nb; /* number of parts in .gz file */
334 static unsigned insize; /* valid bytes in inbuf */
335 static unsigned outcnt; /* bytes in output buffer */
382 * Return the current crc in either case.
439 * to a file or to memory. (The latter is not supported in this version.)
444 * as a sequence of bits. Multi-bit strings in the file may cross
449 * The routines in this file allow a variable-length bit value to
454 * For in-memory compression, the compressed bit stream goes directly
455 * into the requested output buffer. The input data is read in blocks
473 * Write out any remaining bits in an incomplete byte.
500 /* Current input function. Set to mem_read for in-memory compression */
519 * for in-memory compression.
528 * IN assertion: length <= 16 and value fits in length bits.
537 /* If not enough room in bi_buf, use (valid) bits from bi_buf and
539 * unused bits in value.
569 * Write out any remaining bits in an incomplete byte.
632 * is preferable to spend more time in matches to allow very fast string
636 * A similar algorithm is used in comic (by Jan-Mark Wams) and freeze
639 * (by Fiala and Greene) which is guaranteed to run in linear amortized
647 * I found it in 'freeze' written by Leonid Broukhis.
652 * APPNOTE.TXT documentation file in PKZIP 1.93a distribution.
654 * A description of the Rabin and Karp algorithm is given in the book
678 * entire input file can be held in memory (not possible on 16 bit systems).
681 * is still correct, and might even be smaller in some cases.
723 /* A Pos is an index in the character window. We use short instead of int to
724 * save space in the various tables. IPos is used only for parameter passing.
741 * An index in this array is thus a window index modulo 32K.
764 * byte no longer takes part in the hash key, that is:
771 * are discarded. This is used in the lazy match evaluation.
777 static unsigned lookahead; /* number of valid bytes ahead in window */
792 /* Insert new strings in the hash table only if the match length
838 * Insert string s in the dictionary and set match_head to the previous head
892 * in which case the result is equal to prev_length and match_start is
898 /* For MSDOS, OS/2 and 386 Unix, an optimized version is in match.asm or
1021 * move the upper half to the lower one to make room in the upper half.
1087 /* Insert the string window[strstart .. strstart+2] in the
1100 * of window index 0 (in particular we have to avoid a match
1128 /* Insert in hash table all strings up to the end of the match.
1185 * The unzip code was written and put in the public domain by Mark Adler.
1200 * in the compressed file.
1370 * Each code tree is stored in the ZIP file in a compressed form
1372 * all the code strings (in ascending order by source values).
1373 * The actual code strings are reconstructed from the lengths in
1374 * the UNZIP process, as described in the "application note"
1469 * - frequencies can be kept in 16 bit counters
1471 * still in the window so we can still emit a stored block even when input
1477 * adaptation to changes in the input data statistics. (Take for
1503 ush dad; /* father node in Huffman tree */
1542 int elems; /* max number of elements in the tree */
1566 /* The lengths of the bit length codes are sent in order of decreasing
1571 static int heap_len; /* number of elements in the heap */
1608 /* flag_buf is a bit array distinguishing literals from lengths in
1612 static unsigned last_lit; /* running index in l_buf */
1613 static unsigned last_dist; /* running index in d_buf */
1614 static unsigned last_flags; /* running index in flag_buf */
1615 static uch flags; /* current flags not yet saved in flag_buf */
1616 static uch flag_bit; /* current bit used in flags */
1618 /* bits are filled in flags starting at bit 0 (least significant).
1619 * Note: these flags are overkill in the current code since we don't
1633 * Local (static) routines in this file.
1698 * in two different ways: code 284 + 5 bits or code 285, so we
1733 /* Codes 286 and 287 do not exist, but we must include them in the
1772 /* Index within the heap array of least frequent node in the Huffman tree */
1853 * overflow in the case of the bit length tree).
1898 /* Now recompute all bit lengths, scanning in increasing frequency.
1944 /* Check that the bit counts in bl_count are consistent. The last code
1983 /* Construct the initial heap, with least frequent element in
2042 /* and insert the new node in the heap */
2061 * in the bit length tree. Updates opt_len to take into account the repeat
2108 * Send a literal or distance tree in compressed form, using the codes in
2165 * Construct the Huffman tree for the bit lengths and return the index in
2206 int rank; /* index in bl_order */
2213 send_bits(lcodes - 257, 5); /* not +255 as stated in appnote.txt */
2215 send_bits(blcodes - 4, 4); /* not -3 as stated in appnote.txt */
2236 ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
2258 * in bl_order of the last bit length code to send.
2262 /* Determine the best encoding. Compute first the block length in bytes */
2373 "\nlast_lit %u, last_dist %u, in %ld, out ~%ld(%ld%%) ",
2393 unsigned lx = 0; /* running index in l_buf */
2394 unsigned dx = 0; /* running index in d_buf */
2395 unsigned fx = 0; /* running index in flag_buf */
2439 * frequencies does not exceed 64K (to fit in an int on 16 bit machines).
2467 static long header_bytes; /* number of bytes in gzip header */
2470 * Deflate in to out.
2474 static int zip(int in, int out)
2480 ifd = in;