File:  [Research Unix] / researchv10no / ipc / mgrs / authmgr / s5_tty.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:34 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Norman

#include <termio.h>
static struct	termio save_tio;

setraw(on)
	int on;
{
	struct termio tio;

	ioctl(0, TCGETA, (char *)&tio);
	if (on) {
		tio.c_lflag &= ~ICANON;
		tio.c_iflag &= ~ICRNL;
		tio.c_cc[VMIN] = 1;
		tio.c_lflag &= ~ECHO;
		tio.c_cc[VINTR] = -1;
	} else {
		tio.c_lflag |= ICANON;
		tio.c_iflag |= ICRNL;
		tio.c_cc[VMIN] = 1;
		tio.c_lflag |= ECHO;
		tio.c_cc[VINTR] = -1;
	}
	ioctl(0, TCSETA, (char *)&tio);
}


setecho(on)
	int on;
{
	struct termio tio;

	ioctl(0, TCGETA, (char *)&tio);
	if (on) {
		tio.c_lflag |= ECHO;
	} else {
		tio.c_lflag &= ~ECHO;
	}
	ioctl(0, TCSETA, (char *)&tio);
}

savetty()
{
	ioctl(0, TCGETA, (char *)&save_tio);
}

restoretty()
{
	ioctl(0, TCSETA, (char *)&save_tio);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.