Category : C Source Code
Archive   : TECO.ZIP
Filename : ECHO.C
Output of file : ECHO.C contained in archive : TECO.ZIP
#include
#include
static char last='\0';
static char this='\0';
echo(c) /* Echo char appropriately on console */
{
#include "teco.h"
if (cancel) return; /* Skip if ^O sent */
this=toascii(c); /* Mask off parity */
if (this == 27) { /* Check for
this='$'; /* ..if so echo $ */
} else { /* Else process it */
if (iscntrl(this)) {
if (this == 10) {
if (last == 13) {
last=this;
return;
} else {
fprintf(stderr,"\n");
goto check;
}
} else {
if (this == 13) {
fprintf(stderr,"\n");
goto check;
}
if (this == 9) {
fprintf(stderr,"\11");
goto check;
} else {
fprintf(stderr,"\^");
this=this+64;
}
}
}
}
fprintf(stderr,"%c",this);
last=this;
return;
check: last=this;
if (kbhit()) {
if (15 == toascii(getch())) {
cancel=1;
fprintf(stderr,"\^O\n");
}
}
}
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/