idlecheckpoint support in curses
This commit is contained in:
@@ -690,6 +690,7 @@ typedef unsigned char uchar;
|
|||||||
* Currently has support in:
|
* Currently has support in:
|
||||||
* WIN32CON
|
* WIN32CON
|
||||||
* Qt
|
* Qt
|
||||||
|
* curses
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* #define IDLECHECKPOINT */
|
/* #define IDLECHECKPOINT */
|
||||||
|
|||||||
+28
-3
@@ -34,16 +34,41 @@ int
|
|||||||
curses_getch(void)
|
curses_getch(void)
|
||||||
{
|
{
|
||||||
int ch;
|
int ch;
|
||||||
|
boolean timeoutset = FALSE;
|
||||||
|
|
||||||
if (iflags.debug_fuzzer)
|
if (iflags.debug_fuzzer) {
|
||||||
ch = randomkey();
|
ch = randomkey();
|
||||||
else
|
} else if (iflags.idlecheckpoint) {
|
||||||
|
boolean done_a_checkpoint = FALSE;
|
||||||
|
|
||||||
|
done_a_checkpoint = FALSE;
|
||||||
|
timeout(IDLECHECKPOINT_WAIT_TIME * 1000);
|
||||||
|
timeoutset = TRUE;
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
ch = getch();
|
||||||
|
if (ch == ERR && !done_a_checkpoint) {
|
||||||
|
#ifdef INSURANCE
|
||||||
|
save_currentstate();
|
||||||
|
#endif /* INSURANCE */
|
||||||
|
done_a_checkpoint = TRUE;
|
||||||
|
timeout(-1);
|
||||||
|
timeoutset = FALSE;
|
||||||
|
} else {
|
||||||
|
if (timeoutset) {
|
||||||
|
timeout(-1);
|
||||||
|
timeoutset = FALSE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
ch = getch();
|
ch = getch();
|
||||||
|
}
|
||||||
return ch;
|
return ch;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read a character of input from the user */
|
/* Read a character of input from the user */
|
||||||
|
|
||||||
int
|
int
|
||||||
curses_read_char(void)
|
curses_read_char(void)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user