version 1.3, 2003/04/13 18:26:26 |
version 1.4, 2011/09/16 18:12:09 |
|
|
/* |
/* |
* Copyright (C) 1984-2002 Mark Nudelman |
* Copyright (C) 1984-2011 Mark Nudelman |
* |
* |
* You may distribute under the terms of either the GNU General Public |
* You may distribute under the terms of either the GNU General Public |
* License or the Less License, as specified in the README file. |
* License or the Less License, as specified in the README file. |
|
|
|
|
public int tty; |
public int tty; |
extern int sigs; |
extern int sigs; |
|
extern int utf_mode; |
|
|
/* |
/* |
* Open keyboard for input. |
* Open keyboard for input. |
|
|
quit(QUIT_ERROR); |
quit(QUIT_ERROR); |
} |
} |
#endif |
#endif |
|
#if 0 /* allow entering arbitrary hex chars for testing */ |
|
/* ctrl-A followed by two hex chars makes a byte */ |
|
{ |
|
int hex_in = 0; |
|
int hex_value = 0; |
|
if (c == CONTROL('A')) |
|
{ |
|
hex_in = 2; |
|
result = 0; |
|
continue; |
|
} |
|
if (hex_in > 0) |
|
{ |
|
int v; |
|
if (c >= '0' && c <= '9') |
|
v = c - '0'; |
|
else if (c >= 'a' && c <= 'f') |
|
v = c - 'a' + 10; |
|
else if (c >= 'A' && c <= 'F') |
|
v = c - 'A' + 10; |
|
else |
|
hex_in = 0; |
|
hex_value = (hex_value << 4) | v; |
|
if (--hex_in > 0) |
|
{ |
|
result = 0; |
|
continue; |
|
} |
|
c = hex_value; |
|
} |
|
} |
|
#endif |
/* |
/* |
* Various parts of the program cannot handle |
* Various parts of the program cannot handle |
* an input character of '\0'. |
* an input character of '\0'. |
|
|
c = '\340'; |
c = '\340'; |
} while (result != 1); |
} while (result != 1); |
|
|
return (c & 0377); |
return (c & 0xFF); |
} |
} |