Category : Alternate Operating Systems - Quarterdeck DesqView, CP/M, etc
Archive   : AT2IBM.ZIP
Filename : IBM2AT.C

 
Output of file : IBM2AT.C contained in archive : AT2IBM.ZIP
/* PUBLICWARE - brought to you by Rat*Ware Softworks */
/* This is FREE SOFTWARE, no donations required */
/* Feel free to copy it and pass it on to friends. */
/* LONG LIVE ATARI and ibm */

#include
#include

/* Convert IBM ASCII text file to Atari ATASCII text file */

/* Constants */

#define ATARI_RETURN 155
#define CR 13
#define LF 10

main( argc, argv )
int argc;
char *argv[];
{
int i, cnt;
FILE *fil, *ifil;
char file[80], ifile[80], *junk;

cnt = 1;


printf("\nIBM2AT - Convert IBM Standard ASCII to Atari ASCII\n");
printf("PUBLICWARE from Rat*Ware Softworks, by Mat*Rat\n\n");

if (argc < 2)
{
puts("\nIBM FILE to convert to Atari format?");
junk = gets( file );

}
else
strcpy(file,argv[cnt++]);

while (argc > 0)
{
fil = fopen( file, "rb");
if (fil == NULL)
{
puts("Couldn't find Atari input file:");
puts(file);
}
else
{
filecnv( file, ifile ); /* Convert ATARI filename to IBM filename */
ifil = fopen( ifile, "wb" );
if (ifile != NULL)
{
while( (i=fgetc(fil)) != EOF)
{
if (i == CR) /* Convert CRs to ATASCII RET*/
fputc(ATARI_RETURN, ifil);
else
if (i != LF) /* dump LFs completely */
fputc(i, ifil);
}
fclose( fil );
fclose( ifil);
}

else
{
puts("Can't open output file:");
puts(ifile);
fclose( fil );
}
}
argc--;
if (argc > 1)
strcpy(file, argv[cnt++]);
else
argc = 0;

} /* while end */

} /* main end */

filecnv( atafil, ibmfil )
char *atafil, *ibmfil;
{
char ext[10], *exptr;


strcpy(ibmfil, atafil);
strcpy(ext, ".ATX"); /* Atari Text */
exptr = strchr(ibmfil, '.');
if (exptr == 0)
strcat(ibmfil, ext);
else
strcpy(exptr, ext);

puts("Input IBM file is:");
puts(atafil);
puts("Output Atari file is:");
puts(ibmfil);

}










  3 Responses to “Category : Alternate Operating Systems - Quarterdeck DesqView, CP/M, etc
Archive   : AT2IBM.ZIP
Filename : IBM2AT.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/