X-Git-Url: https://git.wh0rd.org/?p=dump.git;a=blobdiff_plain;f=dump%2Fmain.c;fp=dump%2Fmain.c;h=fa50044de5861eddeaab61dec63d92c83c672182;hp=ae3e3caa6ee64f3c12ebdcc47390db0a5bb628b4;hb=e3956dfb7715a21919aa66dd4209a2dc1c3c82da;hpb=acf85e7a305b04b699e17104be519912a7ae90f0 diff --git a/dump/main.c b/dump/main.c index ae3e3ca..fa50044 100644 --- a/dump/main.c +++ b/dump/main.c @@ -37,7 +37,7 @@ #ifndef lint static const char rcsid[] = - "$Id: main.c,v 1.97 2010/04/28 09:29:50 stelian Exp $"; + "$Id: main.c,v 1.98 2011/06/10 13:07:29 stelian Exp $"; #endif /* not lint */ #include @@ -84,6 +84,8 @@ static const char rcsid[] = #include "pathnames.h" #include "bylabel.h" +#include "transformation.h" + #ifndef SBOFF #define SBOFF (SBLOCK * DEV_BSIZE) #endif @@ -178,6 +180,7 @@ int sizest = 0; /* return size estimate only */ int compressed = 0; /* use zlib to compress the output, compress level 1-9 */ long long bytes_written = 0; /* total bytes written */ long uncomprblks = 0;/* uncompressed blocks written */ +Transformation *transformation = &transformation_null; long smtc_errno; @@ -239,6 +242,7 @@ main(int argc, char *argv[]) quit("TP_BSIZE must be a multiple of DEV_BSIZE\n"); memset(&lastlevel, 0, NUM_STR_SIZE); memset(&level, 0, NUM_STR_SIZE); + transformation = &transformation_null; /* Default dump level is zero. */ level[0] = '0'; @@ -359,6 +363,7 @@ main(int argc, char *argv[]) case 'j': compressed = 2; zipflag = COMPRESS_BZLIB; + transformation = transformation_bzlib_factory(1, 2); if (optarg) compressed = numarg("compress level", 1L, 9L); break; @@ -450,6 +455,7 @@ main(int argc, char *argv[]) #ifdef HAVE_LZO case 'y': compressed = 2; + transformation = transformation_lzo_factory(1); zipflag = COMPRESS_LZO; break; #endif /* HAVE_LZO */ @@ -457,6 +463,7 @@ main(int argc, char *argv[]) #ifdef HAVE_ZLIB case 'z': compressed = 2; + transformation = transformation_zlib_factory(1, 2); zipflag = COMPRESS_ZLIB; if (optarg) compressed = numarg("compress level", 1L, 9L); @@ -793,7 +800,7 @@ main(int argc, char *argv[]) if (zipflag == COMPRESS_LZO) msg("Compressing output (lzo)\n"); else - msg("Compressing output at compression level %d (%s)\n", + msg("Compressing output at transformation level %d (%s)\n", compressed, zipflag == COMPRESS_ZLIB ? "zlib" : "bzlib"); } }