Category : Graphic Animations - Lots of older FLI's
Archive   : UN-GL100.ZIP
Filename : UN-GL.C

 
Output of file : UN-GL.C contained in archive : UN-GL100.ZIP
/* un-gl.c
*
* 9/28/92 A quick and dirty program to separate a .gl file
* into its component parts.
*
*/
#include
#include

int main( int argc, char **argv)
{
int i = 1;
FILE *infile, *outfile;
char outname[20];
long length;
long pos;
int toread, towrite;
char buffer[512];
int headerlength;
long headerpos;

if (argc == 1) {
fprintf( stderr, "un-gl Copyright 1992 by George Dinwiddie\n"
" Version 1.00 Distribute freely.\n"
" USAGE: un-gl \n"
" Breaks each GRASP (.gl) file in filelist down\n"
" into its component files.\n" );
return 1;
}
for (argv++; *argv; argv++) {
printf( "Input file '%s'. \r", *argv );
if ((infile = fopen( *argv, "rb" )) == NULL) {
fprintf( stderr, "\nCannot open file '%s'.\n", *argv );
continue;
}
if (fread( &headerlength, sizeof( int ), 1, infile ) <= 0) {
headerlength = 0;
}
while ((headerpos = ftell( infile )) < headerlength+sizeof(int) ) {
if (fread( &pos, sizeof( long ), 1, infile ) <= 0) {
pos = 0L;
}
if (fread( outname, sizeof( char ), 13, infile ) <= 0) {
outname[0] = '\0';
}
headerpos = ftell( infile );
if (*outname == '\0')
continue;
printf( "Output file '%s'. \r", outname );
if ((outfile = fopen( outname, "wb" )) == NULL) {
fprintf( stderr, "\nCannot open file '%s'.\n", outname );
break;
}
fseek( infile, pos, 0 );
if (fread( &length, sizeof( long ), 1, infile ) <= 0) {
length = 0;
}
while (length > 0) {
toread = min( length, 512 );
if (toread != (towrite = fread( buffer, sizeof( char ), toread, infile))) {
fprintf( stderr, "\nRead %d bytes trying to read %d bytes.\n", towrite, toread );
if (towrite <= 0)
break;
}
length -= towrite;
fwrite( buffer, sizeof( char ), towrite, outfile );
}
fclose( outfile );
fseek( infile, headerpos, 0 );
}
fclose( infile );
}
return 0;
}


  3 Responses to “Category : Graphic Animations - Lots of older FLI's
Archive   : UN-GL100.ZIP
Filename : UN-GL.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/