ReadKey like Function in C

Jay "you ignorant splut!" Maynard jay at splut.conmicro.com
Sun Aug 13 23:50:29 AEST 1989


In article <3727 at buengc.BU.EDU> bph at buengc.bu.edu (Blair P. Houghton) writes:
>All it's gotta say is something to the effect that there should
>be a function, call it "readkey()", that returns the value of
>the next char from stdin as soon after it's typed as it's needed.
>You could even qualify it to apply only when tty input can be
>used as stdin.

Let's look at an environment where this is not possible: IBM 370-class
mainframe, with stdin (and /dev/tty??) pointed at a 3270 terminal.
Characters are not sent to the host until ENTER (or a PF key) is
pressed. There's no way to give a character to a program as soon as it's
typed because the CPU doesn't know that it has. Your readkey() cannot be
implemented in this environment, yet it is a valid one for ANSI C.

(Flames about how 3270s are horribly broken sent to /dev/null; there are
millions of them out there, doing real work every day.)

(Anyone at Amdahl wanna comment on UTS's 3270 handling?)

-- 
Jay Maynard, EMT-P, K5ZC, PP-ASEL   | Never ascribe to malice that which can
jay at splut.conmicro.com       (eieio)| adequately be explained by stupidity.
{attctc,bellcore}!texbell!splut!jay +----------------------------------------
"Rabid rerouters *love* to route mail to devnull at hell.org" - Brandon Allbery



More information about the Comp.std.c mailing list