/* ** MK_ARC.C Copyright (C) 1992 by MarshallSoft Computing, Inc. ** ** This program is used to compress one or more files into a single ** archive file. For example, to compress all files ending with the ** extension '.C' into an archive named 'C.ARF', type: ** ** MK_ARC *.C C.ARF */ #include #include #include #include #include #include #include "LZW4C.H" #include "RW_IO.H" #include "DIR_IO.H" extern char *malloc(); extern int free(); void SayError(int); void main(argc,argv) int argc; char *argv[]; {int i, k; int RetCode; float Ratio; long TotalCount = 0; char Filename[15]; int Files = 0; char *Ptr; /* begin */ if(argc!=3) {printf("Usage: MK_ARC \n"); exit(1); } RetCode = InitLZW(malloc); if(RetCode<0) {SayError(RetCode); exit(2); } /* flush the keyboard */ puts("\nMK_ARC 1.0: Type any key to abort..."); /* open output file for compression */ Ptr = argv[2]; for(i=0;i 0) {Ratio = (float)(WriterCount()-TotalCount)/(float)ReaderCount(); printf(" OK (%0.2f)\n",Ratio); TotalCount = WriterCount(); } else puts("???"); /* close file */ ReaderClose(); } WriterClose(); TermLZW(free); printf("\n%d files compressed\n",Files); exit(0); }