Category : C Source Code
Archive   : XINU.ZIP
Filename : TTYCNTL.C
# include
# include
# include
# include
# include
/*-----------------------------------------------------------------------------
* ttycntl -- control a tty device by setting modes
*-----------------------------------------------------------------------------
*/
ttycntl(devptr, func, addr)
struct devsw *devptr;
int func;
char *addr;
{
register struct tty *ttyp;
char ch;
char ps;
ttyp = &tty[devptr->dvminor];
switch ( func ) {
case TCSETBRK:
ttyp->ioaddr->ctstat |= SLUTBREAK;
break;
case TCRSTBRK:
ttyp->ioaddr->ctstat &= ~SLUTBREAK;
break;
case TCNEXTC:
disable(ps);
wait(ttyp->isem);
ch = ttyp->ibuff[ttyp->itail];
restore(ps);
signal(ttyp->isem);
return(ch);
case TCMODER:
ttyp->imode = IMRAW;
break;
case TCMODEC:
ttyp->imode = IMCOOKED;
break;
case TCMODEK:
ttyp->imode = IMCBREAK;
break;
case TCECHO:
ttyp->iecho = TRUE;
break;
case TCNOECHO:
ttyp->iecho = FALSE;
break;
case TCICHARS:
return(scount(ttyp->isem));
default:
return(SYSERR);
}
return(OK);
}
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/