1 /*----------------------------------------------------------------------------
2 * jacu - Just Another Compression Utility
3 *----------------------------------------------------------------------------
4 * This file is part of jacu.
6 * jacu is free software; you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation; either version 2 of the License, or (at your option) any later
11 * jacu is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 * You should have received a copy of the GNU General Public License along
17 * with jacu; if not, write to the Free Software Foundation, Inc., 59 Temple
18 * Place, Suite 330, Boston, MA 02111-1307 USA
19 *----------------------------------------------------------------------------
23 #include "statichuff.h"
26 int main(int argc, char* argv[])
33 long int volumesize = 0;
36 char *staticmodel = NULL;
38 while ((ch = getopt(argc, argv, "scdm:t:")) != -1) {
48 volumesize = atoi(optarg);
58 default: fprintf(stderr, "Usage: %s [-cds] [-t volsizekb] sourcefile targetfile [-m modeldumpfile]\n", argv[0]);
63 if ( (argc == 1) || (cflag & dflag) || !(cflag | dflag) || ((argc - optind) < 2) ) {
64 fprintf(stderr, "Usage: %s [-cds] [-t volsizekb] sourcefile targetfile [-m modeldumpfile]\n", argv[0]);
65 if ((tflag == 1) && (volumesize < 0)) fprintf(stderr,"Error: The volume size must be a non-zero value\n");
71 shuff = shuff_init_encoder_byfile(argv[optind],argv[optind+1],volumesize*1024);
72 if (mflag == 1) shuff_loadmodel(shuff,staticmodel);
73 shuff_encode_file(shuff);
74 if (sflag == 1) shuff_savemodel(shuff);
75 shuff_deinit_encoder(shuff);
81 shuff = shuff_init_decoder(argv[optind],argv[optind+1]);
82 shuff_decode_file(shuff);
83 shuff_deinit_decoder(shuff);