inkey$, noecho, and other impossibles
Chris Torek
chris at mimsy.UUCP
Wed Jan 11 14:42:51 AEST 1989
->In article <225800106 at uxe.cso.uiuc.edu> mcdonald at uxe.cso.uiuc.edu writes:
->>some such function [like inkey() or kbhit()] should be a
->>STANDARD C (ANSI C) function ....
-In article <310 at twwells.uucp> bill at twwells.UUCP (T. William Wells) writes:
->And to repeat what has been said by many: IT CAN'T BE DONE!
[in some cases where the rest of the dpANS *can*]
In article <84629 at sun.uucp> swilson%thetone at Sun.COM (Scott Wilson) writes:
-This argument is very similar to one I started some time ago related
-to echo/no echo on input, etc. The point of standard libraries is
-to smooth over OS dependencies to provide a uniform interface. If
-inkey() cannot be provided for on some systems, aren't there other
-operations mandated by the Standard that are just as hard to provide?
No.
-For example, what about the legal modes passed to fopen()? Aren't
-there some systems where you simply can't open a file for simultaneous
-reading and writing? Or open for writing at the end of a file? What
-about fseek(), couldn't that be potentially very inefficient to
-implement on some brain-damaged systems?
There are a number of systems on which stdio might be fairly slow. As
far as I know, however, there are *no* systems (other than standalones)
in which it cannot be done at all. But since C runs on IBM machines
that see only input screens (collected by 3270s) and on systems with
half-duplex ASR 33s, it is easy to see that both get-one-character-
without getting-a-line and turn-off-echo are indeed sometimes impossible.
-... I guess what I'm wondering is: are there operations
-already part of the Standard that are there for historical reasons
-(i.e., it has always existed for most implementations) that would be
-rejected if it was recommended as a new feature because it was "too
-operating system dependent?"
Possibly. In fact, malloc() might be one (`too machine dependent').
But most things in the standard can be done everywhere, even on those
old IBM systems.
--
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain: chris at mimsy.umd.edu Path: uunet!mimsy!chris
More information about the Comp.lang.c
mailing list