INKEY$ [Was: printf, data presentation]

Peter da Silva peter at ficc.uu.net
Sat Jan 14 05:53:09 AEST 1989


In article <84920 at sun.uucp>, swilson%thetone at Sun.COM (Scott Wilson) writes:
> Who said anything about UNIX?  This is comp.lang.c not comp.lang.c.on.unix.
> And yes C does run in environments other than UNIX which is probably why
> the original poster would like to see inkey() standardized.

Well, no. 'C' standards should be based on the availability and appropriate-
ness of the operation on a wide variety of operating systems. The only ones
for which inkey$ is appropriate are those derived from CP/M and other
hobbyist systems on which busy-waiting is reasonable. Everyone else requires
mechanisms that are at wildly different...

Let's look at busy-waiting to monitor two event streams...

For the Macintosh, for example, the whole tty-style user interface (and
inkey$) is superseded by Get/WaitNextEvent. On the Amiga, you just put out
a concurrent wait on two signals or message ports. On UNIX you fork() and
put out two read()s. And so on. Inkey() can be implemented on most of
these systems, but it shouldn't... any more than "near" and "far" should
be included in the standard.
-- 
Peter da Silva, Xenix Support, Ferranti International Controls Corporation.
Work: uunet.uu.net!ficc!peter, peter at ficc.uu.net, +1 713 274 5180.   `-_-'
Home: bigtex!texbell!sugar!peter, peter at sugar.uu.net.                 'U`
Opinions may not represent the policies of FICC or the Xenix Support group.



More information about the Comp.lang.c mailing list