home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GEMini Atari
/
GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso
/
zip
/
mint
/
mntlib16.lzh
/
MNTLIB16
/
CONSOLE.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-03
|
706b
|
45 lines
/* console I/O routines */
/* written by Eric R. Smith, placed in the public domain */
/* BUGS: under TOS, all tty input is assumed to come from the keyboard
* (unless we can figure out otherwise)
*/
#include <osbind.h>
#include <mintbind.h>
#define CTRL(x) (x & 0x1f)
extern int __mint;
#define CBUFSIZ 80
int
_console_read_byte(fd)
int fd;
{
short f;
if (__mint) {
return Fgetchar(fd, 0);
}
if (fd == 0)
return Crawcin();
if (fd == 2)
return Cauxin();
f = fd;
if (f < 0 && f >= -3)
return Bconin(f+3);
return Bconin(2);
}
void
_console_write_byte(fd, outc)
int fd, outc;
{
unsigned char c;
c = outc;
(void)Fwrite(fd, 1L, &c);
}