version 1.10, 1999/02/28 08:37:45
|
version 1.13, 2000/09/23 15:47:08
|
Line 1
|
Line 1
|
/* direct key io driver |
/* direct key io driver |
|
|
Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc. |
Copyright (C) 1995,1996,1997,1998,1999 Free Software Foundation, Inc. |
|
|
This file is part of Gforth. |
This file is part of Gforth. |
|
|
Line 16
|
Line 16
|
|
|
You should have received a copy of the GNU General Public License |
You should have received a copy of the GNU General Public License |
along with this program; if not, write to the Free Software |
along with this program; if not, write to the Free Software |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. |
|
|
The following is stolen from the readline library for bash |
The following is stolen from the readline library for bash |
*/ |
*/ |
Line 666 long key_avail (FILE * stream)
|
Line 666 long key_avail (FILE * stream)
|
/* When compiling and running in the `Posix' environment, Ultrix does |
/* When compiling and running in the `Posix' environment, Ultrix does |
not restart system calls, so this needs to do it. */ |
not restart system calls, so this needs to do it. */ |
|
|
unsigned getkey(FILE * stream) |
Cell getkey(FILE * stream) |
{ |
{ |
int result; |
Cell result; |
unsigned char c; |
unsigned char c; |
|
|
if(!terminal_prepped) prep_terminal(); |
if(!terminal_prepped) |
|
prep_terminal(); |
|
|
while (pending < 0) |
while (pending < 0) |
{ |
{ |
Line 692 unsigned getkey(FILE * stream)
|
Line 693 unsigned getkey(FILE * stream)
|
return (EOF); |
return (EOF); |
} |
} |
|
|
result = (int) pending; |
/* otherwise there is a character pending; |
|
return it and delete pending char */ |
|
result = (Cell) pending; |
pending = -1L; |
pending = -1L; |
|
|
return result; |
return result; |