version 1.8, 1995/03/13 09:17:29
|
version 1.9, 1995/09/06 21:00:19
|
Line 570 long key_avail (stream)
|
Line 570 long key_avail (stream)
|
long chars_avail = pending; |
long chars_avail = pending; |
int result; |
int result; |
|
|
|
if(!terminal_prepped) prep_terminal(); |
|
|
#if defined (FIONREAD) |
#if defined (FIONREAD) |
result = ioctl (tty, FIONREAD, &chars_avail); |
result = ioctl (tty, FIONREAD, &chars_avail); |
#endif |
#endif |
Line 605 unsigned char getkey(stream)
|
Line 607 unsigned char getkey(stream)
|
int result; |
int result; |
unsigned char c; |
unsigned char c; |
|
|
|
if(!terminal_prepped) prep_terminal(); |
|
|
while (pending < 0) |
while (pending < 0) |
{ |
{ |
result = read (fileno (stream), &c, sizeof (char)); |
result = read (fileno (stream), &c, sizeof (char)); |
Line 615 unsigned char getkey(stream)
|
Line 619 unsigned char getkey(stream)
|
/* If zero characters are returned, then the file that we are |
/* If zero characters are returned, then the file that we are |
reading from is empty! Return EOF in that case. */ |
reading from is empty! Return EOF in that case. */ |
if (result == 0) |
if (result == 0) |
return (0); |
return CTRL('D'); |
|
|
/* If the error that we received was SIGINT, then try again, |
/* If the error that we received was SIGINT, then try again, |
this is simply an interrupted system call to read (). |
this is simply an interrupted system call to read (). |
Line 745 signal_throw(int sig)
|
Line 749 signal_throw(int sig)
|
static void |
static void |
termprep (int sig) |
termprep (int sig) |
{ |
{ |
terminal_prepped=0; prep_terminal(); |
terminal_prepped=0; |
signal(sig,termprep); |
signal(sig,termprep); |
} |
} |
|
|