Category : C Source Code
Archive   : ANSIINT.ZIP
Filename : TYPEM.C
Output of file : TYPEM.C contained in archive : ANSIINT.ZIP
* TYPEM v1.0 - TYPE Multiple files utility
* Demonstration program for the Telegard ANSI Interpretor
*
* Requires ANSII.OBJ to compile -
*
* NOTE: the distributed ANSII.OBJ object code file has been compiled
* using the LARGE memory model.
*
*/
#include
#include
#define TRUE 1
#define FALSE 0
typedef unsigned char bool;
bool aabort,anext;
void dokey(void)
{
char c;
c=getch();
switch (toupper(c)) {
case 19: /* ^S */
case 'P':
while (!kbhit());
c=getch();
break;
case 3: /* ^C */
case 11: /* ^K */
case 24: /* ^X */
case ' ':
aabort=TRUE;
break;
case 14: /* ^N */
case 'N':
aabort=TRUE;
anext=TRUE;
break;
default:
break;
}
}
void dofile(char *s)
{
FILE *fp;
fp=fopen(s,"rb");
while ((!feof(fp)) && (!aabort) && (!anext)) {
ansioutput(fgetc(fp)); /* MAIN ANSI output routine */
if (kbhit()) dokey();
}
fclose(fp);
}
void usage(void)
{
puts("");
printf("TYPEM v1.0 - %s - TYPE Multiple files utility\n",__DATE__);
puts("Demonstration program for the Telegard ANSI Interpretor");
puts("");
puts("Execution method:");
puts("");
puts(" TYPEM [/W] [filespec1] [filespec2] ... Wildcards (*,?) accepted");
puts(" The \"/W\" option will output files to a demo window");
puts("");
puts("Keys available:");
puts("");
puts(" Pause : \"P\" or ^S");
puts(" Next file : \"N\" or ^N");
puts(" Abort all :
puts("");
puts("The screen will pause after each file, if not aborted.");
exit(1);
}
void cls(void)
{
window(1,1,80,25);
textattr(7);
clrscr();
}
void showwindow(void)
{
int i;
window(1,1,80,25); textbackground(1); textcolor(15); clrscr();
textattr(14);
gotoxy(2,1); for (i=0; i<78; i++) ansioutput('Í');
gotoxy(2,21); for (i=0; i<78; i++) ansioutput('Í');
for (i=2; i<=20; i++) { gotoxy(1,i); ansioutput('³'); }
for (i=2; i<=20; i++) { gotoxy(80,i); ansioutput('³'); }
gotoxy(1,1); ansioutput('Õ');
gotoxy(80,1); ansioutput('¸');
gotoxy(1,21); ansioutput('Ô');
gotoxy(80,21); ansioutput('¾');
textattr(15); window(2,2,79,20); clrscr();
}
main(int argc, char *argv[])
{
struct ffblk dirinfo;
int i;
char c;
bool done,nofiles,windowon;
textattr(7);
if (argc==1) usage(); /* no parameters */
windowon=FALSE;
for (i=1; i
if ((windowon) && (argc==2)) usage(); /* "/W" only parameter */
nofiles=TRUE;
for (i=1; i
done=findfirst(argv[i],&dirinfo,0);
if (!done) nofiles=FALSE;
while ((!done) && (!aabort)) {
aabort=FALSE; anext=FALSE;
cls();
if (windowon) showwindow();
dofile(dirinfo.ff_name);
if ((!aabort) && (!anext)) c=getch();
if (anext) aabort=FALSE;
done=findnext(&dirinfo);
}
if (aabort) break;
}
if (nofiles) printf("\nNo files found.\n"); else cls();
gotoxy(0,24);
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
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/