Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ncar!umigw!steve From: steve@umigw.MIAMI.EDU (steve emmerson) Newsgroups: comp.lang.c Subject: Re: Getchar w/wout echo Summary: make raw{en,dis}able idempotent? Message-ID: <155@umigw.MIAMI.EDU> Date: 26 Aug 88 13:11:25 GMT References: <371@marob.MASA.COM> <225800052@uxe.cso.uiuc.edu> <65197@sun.uucp> <302@quintus.UUCP> <1988Aug23.164855.26679@utzoo.uucp> <309@ <6589@haddock.ima.isc.com> Reply-To: steve@umigw.miami.edu (steve emmerson) Followup-To: comp.lang.c Distribution: na Organization: University of Miami Lines: 22 In article <6589@haddock.ima.isc.com> karl@haddock.isc.com (Karl Heuer) writes: >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 prefer that rawenable() and rawdisable() be idempotent* rather than undefined, unless, of course, this means that they can't be implemented on some systems. I believe this would enable slightly cleaner programs as the relevant state information would be contained (at least conceptually) in the raw{en,dis}able()/getrawchar() module -- discharging the programer from responsibility over the matter. ------------ * "idempotent" means that the effect of calling it twice is the same as calling it once, i.e. the second call is a functional no-op.) -- Steve Emmerson Inet: steve@umigw.miami.edu [128.116.10.1] SPAN: miami::emmerson (host 3074::) emmerson%miami.span@star.stanford.edu UUCP: ...!ncar!umigw!steve emmerson%miami.span@vlsi.jpl.nasa.gov "Computers are like God in the Old Testament: lots of rules and no mercy"