Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP (der Mouse) Newsgroups: comp.lang.c Subject: Re: Getchar w/wout echo Message-ID: <1276@mcgill-vision.UUCP> Date: 1 Sep 88 09:12:48 GMT References: <371@marob.MASA.COM> <225800052@uxe.cso.uiuc.edu> <65197@sun.uucp> <6589@haddock.ima.isc.com> Organization: McGill University, Montreal Lines: 33 In article <6589@haddock.ima.isc.com>, karl@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@haddock.isc.com), The Walking Lint der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu