X-Git-Url: http://winboard.nl/cgi-bin?p=uci2wb.git;a=blobdiff_plain;f=UCI2WB.c;fp=UCI2WB.c;h=c068847055b9b892159aee4b7417a8f1a4695c6f;hp=1fc24fc2a3e8beeedc4249d49896420f7128bc19;hb=b42dab5e4509f49d27d78747e16a151962a237e2;hpb=47b967aa38dcb5db60229931abf391f42c2abf1f diff --git a/UCI2WB.c b/UCI2WB.c index 1fc24fc..c068847 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -441,12 +441,9 @@ char mySide; char queue[10000], *qStart, *qEnd; void -GUI2Engine() +LaunchSearch() { - char line[256], command[256], *p; - - while(1) { - int i, difficult; + int i; if((computer == stm || computer == ANALYZE && !searching) && !suspended) { DPRINT("# start search\n"); @@ -462,6 +459,17 @@ GUI2Engine() EPRINT((f, "\n")) searching = 2; // suppresses spurious commands during analysis starting new searches } else pause = 2, searching = 3, StartSearch(""); // request suspending of input processing while thinking } else if(ponderAlways && computer == NONE) move[moveNr][0] = 0, StartPonder(moveNr-1); +} + +void +GUI2Engine() +{ + char line[256], command[256], *p; + + while(1) { + int i, difficult; + + LaunchSearch(); // start a search if we need one nomove: for(difficult=0; !difficult; ) { // read and handle commands that can (or must) be handled during thinking fflush(toE); fflush(stdout);