home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 10
/
aminetcdnumber101996.iso
/
Aminet
/
util
/
misc
/
chunker.lha
/
Chunker
/
source
/
dechunk.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-11-10
|
1KB
|
65 lines
/*************************************************************************
*
* DeChunker
*
* Copyright ©1995 Lee Kindness and Evan Tuer
* cs2lk@scms.rgu.ac.uk
*
* dechunk.c
*/
#include "dechunk.h"
/*************************************************************************
* main() - DaDDDaaah!
*/
int main(int argc, char **argv)
{
long ret = 10;
/* init */
if( InitSystem() )
{
struct Args *args;
if( args = GetDeChunkArgs(argc, argv) )
{
FILEt dest;
if( dest = mfopen(args->arg_Filename, FILEOPEN_WRITE) )
{
char *srcname;
long num = 0;
FILEt src;
while( (srcname = BuildFName(args->arg_Basename, &num)) &&
(src = mfopen(srcname, FILEOPEN_READ)) )
{
register int c;
mprintf("%s\n", srcname);
for( c = mfgetc(src);
c != EOF;
c = mfgetc(src) )
mfputc(c, dest);
FreeFName(srcname);
mfclose(src);
}
ret = 0;
mfclose(dest);
}
FreeDeChunkArgs(args);
}
FreeSystem();
} else
mprintf("Usage:\n dechunk <outputfile> <basename>\n");
return( ret );
}