idlecheckpoint support in curses
This commit is contained in:
@@ -690,6 +690,7 @@ typedef unsigned char uchar;
|
||||
* Currently has support in:
|
||||
* WIN32CON
|
||||
* Qt
|
||||
* curses
|
||||
*/
|
||||
|
||||
/* #define IDLECHECKPOINT */
|
||||
|
||||
+28
-3
@@ -34,16 +34,41 @@ int
|
||||
curses_getch(void)
|
||||
{
|
||||
int ch;
|
||||
boolean timeoutset = FALSE;
|
||||
|
||||
if (iflags.debug_fuzzer)
|
||||
if (iflags.debug_fuzzer) {
|
||||
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();
|
||||
}
|
||||
return ch;
|
||||
}
|
||||
|
||||
/* Read a character of input from the user */
|
||||
|
||||
int
|
||||
curses_read_char(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user