xref: /csrg-svn/sys/hp300/stand/prf.c (revision 63165)
141488Smckusick /*
2*63165Sbostic  * Copyright (c) 1982, 1986, 1990, 1993
3*63165Sbostic  *	The Regents of the University of California.  All rights reserved.
441488Smckusick  *
541488Smckusick  * %sccs.include.redist.c%
641488Smckusick  *
7*63165Sbostic  *	@(#)prf.c	8.1 (Berkeley) 06/10/93
841488Smckusick  */
941488Smckusick 
1054073Shibler /*
1154073Shibler  * XXX we know that scankbd is only called from read/write to interrupt
1254073Shibler  * a boot program.  Since we restart only on ^C and we do that here, we
1354073Shibler  * always return 0 to avoid a longjmp in the caller.
1454073Shibler  */
scankbd()1549160Sbostic scankbd()
1641488Smckusick {
1749160Sbostic 	register int c;
1841488Smckusick 
1941488Smckusick 	c = cngetc();
2041488Smckusick 	if (c == ('c'&037)) {
2141488Smckusick 		printf("^C");
2241488Smckusick 		_stop("");
2341488Smckusick 		/* NOTREACHED */
2441488Smckusick 	}
2554073Shibler 	return(0);
2641488Smckusick }
2741488Smckusick 
getchar()2841488Smckusick getchar()
2941488Smckusick {
3049160Sbostic 	register int c;
3141488Smckusick 
3241488Smckusick 	while((c = cngetc()) == 0)
3341488Smckusick 		;
3441488Smckusick 	if (c == '\r')
3541488Smckusick 		c = '\n';
3641488Smckusick 	else if (c == ('c'&037)) {
3741488Smckusick 		printf("^C");
3841488Smckusick 		_stop("");
3941488Smckusick 		/* NOTREACHED */
4041488Smckusick 	}
4154073Shibler 	if (c != '\b' && c != '\177')
4254073Shibler 		putchar(c);
4341488Smckusick 	return(c);
4441488Smckusick }
4541488Smckusick 
putchar(c)4649160Sbostic putchar(c)
4749160Sbostic 	register int c;
4841488Smckusick {
4949160Sbostic 	cnputc(c);
5049160Sbostic 	if (c == '\n')
5149160Sbostic 		cnputc('\r');
5241488Smckusick }
53