*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
-
/* big objects in bss:
* 00000020 b bl_count
* 00000074 b base_length
* 00000480 b static_ltree
* 000008f4 b dyn_ltree
*/
-
/* TODO: full support for -v for DESKTOP
* "/usr/bin/gzip -v a bogus aa" should say:
a: 85.1% -- replaced with a.gz
aa: 85.1% -- replaced with aa.gz
*/
+//config:config GZIP
+//config: bool "gzip"
+//config: default y
+//config: help
+//config: gzip is used to compress files.
+//config: It's probably the most widely used UNIX compression program.
+//config:
+//config:config FEATURE_GZIP_LONG_OPTIONS
+//config: bool "Enable long options"
+//config: default y
+//config: depends on GZIP && LONG_OPTS
+//config: help
+//config: Enable use of long options, increases size by about 106 Bytes
+//config:
+//config:config GZIP_FAST
+//config: int "Trade memory for gzip speed (0:small,slow - 2:fast,big)"
+//config: default 0
+//config: range 0 2
+//config: depends on GZIP
+//config: help
+//config: Enable big memory options for gzip.
+//config: 0: small buffers, small hash-tables
+//config: 1: larger buffers, larger hash-tables
+//config: 2: larger buffers, largest hash-tables
+//config: Larger models may give slightly better compression
+
+//applet:IF_GZIP(APPLET(gzip, BB_DIR_BIN, BB_SUID_DROP))
+//kbuild:lib-$(CONFIG_GZIP) += gzip.o
+
//usage:#define gzip_trivial_usage
//usage: "[-cfd] [FILE]..."
//usage:#define gzip_full_usage "\n\n"
//usage: "-rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/busybox.tar.gz\n"
#include "libbb.h"
-#include "archive.h"
+#include "bb_archive.h"
/* ===========================================================================
* must be all ones.
*/
Assert(code + G2.bl_count[MAX_BITS] - 1 == (1 << MAX_BITS) - 1,
- "inconsistent bit counts");
+ "inconsistent bit counts");
Tracev((stderr, "\ngen_codes: max_code %d ", max_code));
for (n = 0; n <= max_code; n++) {
}
out_length >>= 3;
Trace((stderr,
- "\nlast_lit %u, last_dist %u, in %ld, out ~%ld(%ld%%) ",
- G2.last_lit, G2.last_dist, in_length, out_length,
- 100L - out_length * 100L / in_length));
+ "\nlast_lit %u, last_dist %u, in %ld, out ~%ld(%ld%%) ",
+ G2.last_lit, G2.last_dist, in_length, out_length,
+ 100L - out_length * 100L / in_length));
if (G2.last_dist < G2.last_lit / 2 && out_length < in_length / 2)
return 1;
}
static_lenb = (G2.static_len + 3 + 7) >> 3;
Trace((stderr,
- "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u dist %u ",
- opt_lenb, G2.opt_len, static_lenb, G2.static_len, stored_len,
- G2.last_lit, G2.last_dist));
+ "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u dist %u ",
+ opt_lenb, G2.opt_len, static_lenb, G2.static_len, stored_len,
+ G2.last_lit, G2.last_dist));
if (static_lenb <= opt_lenb)
opt_lenb = static_lenb;
} else {
send_bits((DYN_TREES << 1) + eof, 3);
send_all_trees(G2.l_desc.max_code + 1, G2.d_desc.max_code + 1,
- max_blindex + 1);
+ max_blindex + 1);
compress_block((ct_data *) G2.dyn_ltree, (ct_data *) G2.dyn_dtree);
G2.compressed_len += 3 + G2.opt_len;
}
/* ======================================================================== */
static
-IF_DESKTOP(long long) int FAST_FUNC pack_gzip(unpack_info_t *info UNUSED_PARAM)
+IF_DESKTOP(long long) int FAST_FUNC pack_gzip(transformer_aux_data_t *aux UNUSED_PARAM)
{
struct stat s;