Getchar w/wout echo

der Mouse mouse at mcgill-vision.UUCP
Thu Sep 1 19:12:48 AEST 1988


In article <6589 at haddock.ima.isc.com>, karl at haddock.ima.isc.com (Karl Heuer) writes:
> [raw-character input: first-cut proposal]

> rawenable() and rawdisable() change the state from cooked to raw or
> from raw to cooked, respectively; if called from the "wrong" state,
> the behavior is undefined.

I would much prefer for calling rawenable from raw mode, or rawdisable
from cooked mode, to be a no-op.  I'd also want an inquiry function, to
determine the current state.  If these features aren't provided, you
can be sure lots (most?) of the applications using this will
immediately provide

static int inrawmode = 0;
startraw(){if(!inrawmode){rawenable();inrawmode=1;}}
stopraw(){if(inrawmode){rawdisable();inrawmode=0;}}
raw_p(){return(inrawmode);}

so you might as well standardize them that way.

> If getrawchar() is called from cooked mode, or any stdio function
> from raw mode, the behavior is undefined.

Does this include all stdio functions, all stdio functions that
actually perform I/O, or only stdio functions acting on stdin (or the
stream in question, if any stream may be put in raw mode)?

> Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint

					der Mouse

			old: mcgill-vision!mouse
			new: mouse at larry.mcrcim.mcgill.edu



More information about the Comp.lang.c mailing list