Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/archival/gzip.c
- Timestamp:
- Jan 1, 2014, 12:47:38 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi-busybox/archival/gzip.c
r2725 r3232 40 40 */ 41 41 42 //usage:#define gzip_trivial_usage 43 //usage: "[-cfd] [FILE]..." 44 //usage:#define gzip_full_usage "\n\n" 45 //usage: "Compress FILEs (or stdin)\n" 46 //usage: "\n -d Decompress" 47 //usage: "\n -c Write to stdout" 48 //usage: "\n -f Force" 49 //usage: 50 //usage:#define gzip_example_usage 51 //usage: "$ ls -la /tmp/busybox*\n" 52 //usage: "-rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/busybox.tar\n" 53 //usage: "$ gzip /tmp/busybox.tar\n" 54 //usage: "$ ls -la /tmp/busybox*\n" 55 //usage: "-rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/busybox.tar.gz\n" 56 42 57 #include "libbb.h" 43 #include " archive.h"58 #include "bb_archive.h" 44 59 45 60 … … 67 82 /* =========================================================================== 68 83 */ 69 #define SMALL_MEM 84 #if CONFIG_GZIP_FAST == 0 85 # define SMALL_MEM 86 #elif CONFIG_GZIP_FAST == 1 87 # define MEDIUM_MEM 88 #elif CONFIG_GZIP_FAST == 2 89 # define BIG_MEM 90 #else 91 # error "Invalid CONFIG_GZIP_FAST value" 92 #endif 70 93 71 94 #ifndef INBUFSIZ … … 1157 1180 */ 1158 1181 Assert(code + G2.bl_count[MAX_BITS] - 1 == (1 << MAX_BITS) - 1, 1159 1182 "inconsistent bit counts"); 1160 1183 Tracev((stderr, "\ngen_codes: max_code %d ", max_code)); 1161 1184 … … 1505 1528 out_length >>= 3; 1506 1529 Trace((stderr, 1507 1508 1509 1530 "\nlast_lit %u, last_dist %u, in %ld, out ~%ld(%ld%%) ", 1531 G2.last_lit, G2.last_dist, in_length, out_length, 1532 100L - out_length * 100L / in_length)); 1510 1533 if (G2.last_dist < G2.last_lit / 2 && out_length < in_length / 2) 1511 1534 return 1; … … 1599 1622 1600 1623 Trace((stderr, 1601 1602 1603 1624 "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u dist %u ", 1625 opt_lenb, G2.opt_len, static_lenb, G2.static_len, stored_len, 1626 G2.last_lit, G2.last_dist)); 1604 1627 1605 1628 if (static_lenb <= opt_lenb) … … 1639 1662 send_bits((DYN_TREES << 1) + eof, 3); 1640 1663 send_all_trees(G2.l_desc.max_code + 1, G2.d_desc.max_code + 1, 1641 1664 max_blindex + 1); 1642 1665 compress_block((ct_data *) G2.dyn_ltree, (ct_data *) G2.dyn_dtree); 1643 1666 G2.compressed_len += 3 + G2.opt_len; … … 1659 1682 /* =========================================================================== 1660 1683 * Update a hash value with the given input byte 1661 * IN assertion: all calls to toUPDATE_HASH are made with consecutive1684 * IN assertion: all calls to UPDATE_HASH are made with consecutive 1662 1685 * input characters, so that a running hash key can be computed from the 1663 1686 * previous key instead of complete recalculation each time. … … 1690 1713 * of the hash chain (the most recent string with same hash key). Return 1691 1714 * the previous length of the hash chain. 1692 * IN assertion: all calls to toINSERT_STRING are made with consecutive1715 * IN assertion: all calls to INSERT_STRING are made with consecutive 1693 1716 * input characters and the first MIN_MATCH bytes of s are valid 1694 1717 * (except for the last MIN_MATCH-1 bytes of the input file). */ … … 1993 2016 /* ======================================================================== */ 1994 2017 static 1995 IF_DESKTOP(long long) int FAST_FUNC pack_gzip( unpack_info_t *infoUNUSED_PARAM)2018 IF_DESKTOP(long long) int FAST_FUNC pack_gzip(transformer_aux_data_t *aux UNUSED_PARAM) 1996 2019 { 1997 2020 struct stat s;
Note:
See TracChangeset
for help on using the changeset viewer.