X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gnushogi%2Fcursesdsp.c;h=5540edeebefaafd8a56b9cb28a56bdc878f978fc;hb=d23b84fee73518dfb6b281d1eaedbe4fc4aa34b2;hp=fb4437d05b0209329df13b925bc4fcd1c8acaead;hpb=cbf4ad5e9942032a96215a4c7f095a4777bf0021;p=gnushogi.git diff --git a/gnushogi/cursesdsp.c b/gnushogi/cursesdsp.c index fb4437d..5540ede 100644 --- a/gnushogi/cursesdsp.c +++ b/gnushogi/cursesdsp.c @@ -716,8 +716,8 @@ Curses_OutputMove(void) } -static void -UpdateClocks(void) +void +Curses_UpdateClocks(void) { short m, s; long dt; @@ -1196,25 +1196,12 @@ Curses_DoTable(short table[NO_SQUARES]) } -/* - * Determine the time that has passed since the search was started. If the - * elapsed time exceeds the target(ResponseTime + ExtraTime) then set timeout - * to true which will terminate the search. - * iop = COMPUTE_MODE calculate et, bump ETnodes - * iop = COMPUTE_AND_INIT_MODE calculate et, set timeout if time exceeded, - * set reference time - */ void -Curses_ElapsedTime(ElapsedTime_mode iop) +Curses_PollForInput(void) { - long current_time; int i; int nchar; -#ifdef HAVE_GETTIMEOFDAY - struct timeval tv; -#endif - if ((i = ioctl((int) 0, FIONREAD, &nchar))) { perror("FIONREAD"); @@ -1232,6 +1219,25 @@ Curses_ElapsedTime(ElapsedTime_mode iop) flag.bothsides = false; } +} + +/* + * Determine the time that has passed since the search was started. If the + * elapsed time exceeds the target(ResponseTime + ExtraTime) then set timeout + * to true which will terminate the search. + * iop = COMPUTE_MODE calculate et, bump ETnodes + * iop = COMPUTE_AND_INIT_MODE calculate et, set timeout if time exceeded, + * set reference time + */ +void +Curses_ElapsedTime(ElapsedTime_mode iop) +{ + long current_time; +#ifdef HAVE_GETTIMEOFDAY + struct timeval tv; +#endif + + PollForInput(); #ifdef HAVE_GETTIMEOFDAY gettimeofday(&tv, NULL);