Xref: utzoo comp.sys.ibm.pc:21065 comp.sources.wanted:5499 Path: utzoo!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!ukma!mailrus!cornell!uw-beaver!uoregon!stevev From: stevev@uoregon.uoregon.edu (Steve VanDevender) Newsgroups: comp.sys.ibm.pc,comp.sources.wanted Subject: Re: PCcurses charget.c and conio.h Keywords: PCcurses Message-ID: <3117@uoregon.uoregon.edu> Date: 9 Nov 88 19:20:52 GMT References: <406@dcscg1.UUCP> Reply-To: stevev@drizzle.UUCP (Steve VanDevender) Organization: University of Oregon, Computer Science, Eugene OR Lines: 45 In article <406@dcscg1.UUCP> cpp90221@dcscg1.UUCP (Duane L. Rezac) writes: >I am working on porting the PCcurses package to the Computer Innovations >C86 Optimizing Compiler (No flames please, That's what I'm stuck with :-( ) > >I have been sucsessful so far with one minor problem. The charget.c function >references a file conio.h, which apparently contains a definition of a macro >kbhit(). Can anyone provide information on what kbhit() is and how I could >code a substitute for the C86 compiler? > >Thanks in Advance > >-- >+-----------------------+---------------------------------------------------+ >| Duane L. Rezac |These views are my own, and NOT representitive of | >| dsacg1!dcscg1!cpp90221|my place of Employment. | >+-----------------------+---------------------------------------------------+ The kbhit() function returns true if input is waiting in the keyboard buffer. Probably the easiest substitute you can code is to use MS-DOS function call 6 by calling the C86 library function bdos() like this: c = bdos(6, 255); On return c will be 0 if no key was available, or will contain the next character from the keyboard. This has the disadvantage that you will have to pass the returned character back. A slightly better, but more difficult, solution is to use MS-DOS call 44h (I/O control for devices) to check the input status of the keyboard, by using the sysint21 call. Check file handle 0 (stdin) using subfunction 6 of the DOS call. (As you might guess, I use C86 too. Could you send me the changes you made to port PC-Curses? I'll still have to port the screen I/O stuff to my HP 150 but it would be nice to have the compiler porting out of the way.) -- Steve VanDevender stevev@drizzle.cs.uoregon.edu stevev@oregon.BITNET "Bipedalism--an unrecognized disease affecting over 99% of the population. Symptoms include lack of traffic sense, slow rate of travel, and the classic, easily recognized behavior known as walking."