version 1.25, 2003/12/04 01:37:28 |
version 1.26, 2005/04/03 02:09:28 |
|
|
* keyboard characters, and write characters to the display in a barely |
* keyboard characters, and write characters to the display in a barely |
* buffered fashion. |
* buffered fashion. |
*/ |
*/ |
#include "def.h" |
#include "def.h" |
|
|
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/time.h> |
#include <sys/time.h> |
#include <sys/ioctl.h> |
#include <sys/ioctl.h> |
#include <fcntl.h> |
#include <fcntl.h> |
#include <termios.h> |
#include <termios.h> |
#include <term.h> |
#include <term.h> |
|
|
#define NOBUF 512 /* Output buffer size. */ |
#define NOBUF 512 /* Output buffer size. */ |
|
|
|
|
void |
void |
ttflush(void) |
ttflush(void) |
{ |
{ |
ssize_t written; |
ssize_t written; |
char *buf = obuf; |
char *buf = obuf; |
|
|
if (nobuf == 0) |
if (nobuf == 0) |
return; |
return; |
|
|
ttgetc(void) |
ttgetc(void) |
{ |
{ |
char c; |
char c; |
int ret; |
int ret; |
|
|
do { |
do { |
ret = read(0, &c, 1); |
ret = read(0, &c, 1); |
|
|
|
|
/* |
/* |
* This function returns FALSE if any characters have showed up on the |
* This function returns FALSE if any characters have showed up on the |
* tty before 'msec' miliseconds. |
* tty before 'msec' milliseconds. |
*/ |
*/ |
int |
int |
ttwait(int msec) |
ttwait(int msec) |