Path: utzoo!utgpu!watmath!att!ucbvax!tut.cis.ohio-state.edu!cs.utexas.edu!ut-emx!nather
From: nather@ut-emx.UUCP (Ed Nather)
Newsgroups: comp.lang.c
Subject: Re: ReadKey like Function in C
Message-ID: <17228@ut-emx.UUCP>
Date: 17 Aug 89 14:02:51 GMT
References: <148@trigon.UUCP> <225800206@uxe.cso.uiuc.edu> <19095@mimsy.UUCP>
Organization: The University of Texas at Austin, Austin, Texas
Lines: 30

In article <19095@mimsy.UUCP>, chris@mimsy.UUCP (Chris Torek) writes:
> In article <1677@crdgw1.crd.ge.com> davidsen@sungod.crd.ge.com (ody) writes:
> >[...] Therefore, since
> >kbhit() and getch() are probably the widest spread, I would suggest that
> >the MS-DOS haters would still like to adopt this convention, since it
> >would simplify porting programs to other operating systems.
> 
> What does `kbhit()' mean when stdin is a socket?  How about in a VMS
> batch job?
> 
> What does getch() do at end of file?
> 
> Before you settle on  as a standard across hundreds of systems, be sure
>  can well-defined everywhere.

Another question: if we adopt kbhit() do we debug it first, or continue the
bugs into the next generation?

As an example, kbhit() as implemented in MS-DOS has an undocumented "feature"
I had to program around: when the character input on the keyboard is the
Ctrl-C code, and kbhit() is invoked to see if a character is waiting, it
takes it upon itself to abort the program under execution.  

I doubt we'd want to perpetuate such a lousy example of the desired
function.


-- 
Ed Nather
Astronomy Dept, U of Texas @ Austin