aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/compress.c
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2017-04-26 15:01:41 -0700
committerRob Landley <rob@landley.net>2017-04-30 02:08:59 -0500
commitde3e5ea4fe9c42f27d442aa87b7d16e090e72485 (patch)
tree3a0b150798c41933cf3f6d7cfd251545951db6ab /toys/pending/compress.c
parent083c9bca70a327c7ca452310b6a3e047d446ca59 (diff)
downloadtoybox-de3e5ea4fe9c42f27d442aa87b7d16e090e72485.tar.gz
Implement zlib-based gzip/gunzip/zcat.
Diffstat (limited to 'toys/pending/compress.c')
-rw-r--r--toys/pending/compress.c93
1 files changed, 0 insertions, 93 deletions
diff --git a/toys/pending/compress.c b/toys/pending/compress.c
index 1749ee4f..5605a354 100644
--- a/toys/pending/compress.c
+++ b/toys/pending/compress.c
@@ -16,9 +16,6 @@
// Leave Lrg at end so flag values line up.
USE_COMPRESS(NEWTOY(compress, "zcd9lrg[-cd][!zgLr]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_GZIP(NEWTOY(gzip, USE_GZIP_D("d")"19dcflqStvgLRz[!gLRz]", TOYFLAG_USR|TOYFLAG_BIN))
-USE_ZCAT(NEWTOY(zcat, 0, TOYFLAG_USR|TOYFLAG_BIN))
-USE_GUNZIP(NEWTOY(gunzip, "cflqStv", TOYFLAG_USR|TOYFLAG_BIN))
//zip unzip gzip gunzip zcat
@@ -37,40 +34,6 @@ config COMPRESS
-R raw
-z zip
-config GZIP
- bool "gzip"
- default y
- depends on COMPRESS
- help
- usage: gzip [-19cfqStvzgLR] [FILE...]
-
- Compess (deflate) file(s). With no files, compress stdin to stdout.
-
- On successful decompression, compressed files are replaced with the
- uncompressed version. The input file is removed and replaced with
- a new file without the .gz extension (with same ownership/permissions).
-
- -1 Minimal compression (fastest)
- -9 Max compression (default)
- -c cat to stdout (act as zcat)
- -f force (if output file exists, input is tty, unrecognized extension)
- -q quiet (no warnings)
- -S specify exension (default .*)
- -t test compressed file(s)
- -v verbose (like -l, but compress files)
-
- Compression type:
- -g gzip (default) -L zlib -R raw -z zip
-
-config GZIP_D
- bool
- default y
- depends on GZIP && DECOMPRESS
- help
- usage: gzip [-d]
-
- -d decompress (act as gunzip)
-
config DECOMPRESS
bool "decompress"
default n
@@ -81,37 +44,6 @@ config DECOMPRESS
-c compress with -g gzip (default) -l zlib -r raw -z zip
-d decompress (autodetects type)
-
-
-config ZCAT
- bool "zcat"
- default y
- depends on DECOMPRESS
- help
- usage: zcat [FILE...]
-
- Decompress deflated file(s) to stdout
-
-config GUNZIP
- bool "gunzip"
- default y
- depends on DECOMPRESS
- help
- usage: gunzip [-cflqStv] [FILE...]
-
- Decompess (deflate) file(s). With no files, compress stdin to stdout.
-
- On successful decompression, compressed files are replaced with the
- uncompressed version. The input file is removed and replaced with
- a new file without the .gz extension (with same ownership/permissions).
-
- -c cat to stdout (act as zcat)
- -f force (output file exists, input is tty, unrecognized extension)
- -l list compressed/uncompressed/ratio/name for each input file.
- -q quiet (no warnings)
- -S specify exension (default .*)
- -t test compressed file(s)
- -v verbose (like -l, but decompress files)
*/
#define FOR_compress
@@ -579,28 +511,3 @@ void compress_main(void)
// todo: this
printf("hello world");
}
-
-//#define CLEANUP_compress
-//#define FOR_zcat
-//#include "generated/flags.h"
-
-void zcat_main(void)
-{
- init_deflate(0);
-
- loopfiles(toys.optargs, do_zcat);
-}
-
-void gunzip_main(void)
-{
- init_deflate(0);
-
- loopfiles(toys.optargs, do_zcat);
-}
-
-void gzip_main(void)
-{
- init_deflate(1);
-
- loopfiles(toys.optargs, do_gzip);
-}