diff options
author | Rob Landley <rob@landley.net> | 2007-01-16 13:26:02 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2007-01-16 13:26:02 -0500 |
commit | 636b5cf46650d3aa3bbc9b29feb0e07589085e3f (patch) | |
tree | 1285eeff7aa30b3360389bcefd5a130eea01ebed /toys | |
parent | 055cfcbe5b0534c700b30216f54336b7581f7be4 (diff) | |
download | toybox-636b5cf46650d3aa3bbc9b29feb0e07589085e3f.tar.gz |
Add a quick and dirt bzcat (stdin to stdout only for the moment) to test
out the bunzip2 library.
Diffstat (limited to 'toys')
-rw-r--r-- | toys/bzcat.c | 14 | ||||
-rw-r--r-- | toys/toylist.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/toys/bzcat.c b/toys/bzcat.c new file mode 100644 index 00000000..30437bb8 --- /dev/null +++ b/toys/bzcat.c @@ -0,0 +1,14 @@ +/* vi: set sw=4 ts=4: */ +/* + * bzcat.c - decompress stdin to stdout using bunzip2. + */ + +#include "toys.h" + +int bzcat_main(void) +{ + char *error = bunzipStream(0, 1); + + if (error) error_exit(error); + return 0; +} diff --git a/toys/toylist.h b/toys/toylist.h index 258df47f..2f95232f 100644 --- a/toys/toylist.h +++ b/toys/toylist.h @@ -67,6 +67,7 @@ NEWTOY(toybox, NULL, 0) // The rest of these are alphabetical, for binary search. +USE_BZCAT(NEWTOY(bzcat, "", TOYFLAG_USR|TOYFLAG_BIN)) USE_CATV(NEWTOY(catv, "vte", TOYFLAG_NOFORK|TOYFLAG_USR|TOYFLAG_BIN)) USE_TOYSH(NEWTOY(cd, NULL, TOYFLAG_NOFORK)) USE_DF(NEWTOY(df, "Pkt*a", TOYFLAG_USR|TOYFLAG_SBIN)) |