X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=0bbe876c9aeb5c2ba47a835fa3de4e6210c8cf9b;hb=b62cf5e6c96ca7a64c184b6218c18eb045142a7b;hp=c144984e450095fab95cd55a92c5aadc2f0115dd;hpb=a58df46e1b619e6d5be974896e5b457ed4b37b23;p=xboard.git diff --git a/backend.c b/backend.c old mode 100644 new mode 100755 index c144984..0bbe876 --- a/backend.c +++ b/backend.c @@ -184,7 +184,6 @@ void FeedMovesToProgram P((ChessProgramState *cps, int upto)); void ResurrectChessProgram P((void)); void DisplayComment P((int moveNumber, char *text)); void DisplayMove P((int moveNumber)); -void DisplayAnalysis P((void)); void ParseGameHistory P((char *game)); void ParseBoard12 P((char *string)); @@ -2023,7 +2022,8 @@ static int loggedOn = FALSE; int gs_gamenum; char gs_kind[MSG_SIZ]; static char player1Name[128] = ""; -static char player2Name[128] = ""; +static char player2Name[128] = ""; +static char cont_seq[] = "\n\\ "; static int player1Rating = -1; static int player2Rating = -1; /*----------------------------*/ @@ -2055,7 +2055,9 @@ read_from_ics(isr, closure, data, count, error) static char buf[BUF_SIZE + 1]; static int firstTime = TRUE, intfSet = FALSE; static ColorClass prevColor = ColorNormal; - static int savingComment = FALSE; + static int savingComment = FALSE; + static int cmatch = 0; // continuation sequence match + char *bp; char str[500]; int i, oldi; int buf_len; @@ -2086,19 +2088,53 @@ read_from_ics(isr, closure, data, count, error) buf[i] = buf[leftover_start + i]; } - /* Copy in new characters, removing nulls and \r's */ - buf_len = leftover_len; - for (i = 0; i < count; i++) { - if (data[i] != NULLCHAR && data[i] != '\r') - buf[buf_len++] = data[i]; - if(!appData.noJoin && buf_len >= 5 && buf[buf_len-5]=='\n' && buf[buf_len-4]=='\\' && - buf[buf_len-3]==' ' && buf[buf_len-2]==' ' && buf[buf_len-1]==' ') { - buf_len -= 5; // [HGM] ICS: join continuation line of Lasker 2.2.3 server with previous - if(buf_len == 0 || buf[buf_len-1] != ' ') - buf[buf_len++] = ' '; // add space (assumes ICS does not break lines within word) - } - } - + /* copy new characters into the buffer */ + bp = buf + leftover_len; + buf_len=leftover_len; + for (i=0; i 0 && appData.periodicUpdates) { - if (programStats.move_name[0] != NULLCHAR) { - sprintf(buf, "depth=%d %d/%d(%s) %+.2f %s%s\nNodes: " u64Display " NPS: %d\nTime: %02d:%02d:%02d.%02d", - programStats.depth, - programStats.nr_moves-programStats.moves_left, - programStats.nr_moves, programStats.move_name, - ((float)programStats.score)/100.0, lst, - only_one_move(lst)? - xtra[programStats.got_fail] : "", - (u64)programStats.nodes, (int)nps, h, m, s, cs); - } else { - sprintf(buf, "depth=%d %d/%d %+.2f %s%s\nNodes: " u64Display " NPS: %d\nTime: %02d:%02d:%02d.%02d", - programStats.depth, - programStats.nr_moves-programStats.moves_left, - programStats.nr_moves, ((float)programStats.score)/100.0, - lst, - only_one_move(lst)? - xtra[programStats.got_fail] : "", - (u64)programStats.nodes, (int)nps, h, m, s, cs); - } - } else { - sprintf(buf, "depth=%d %+.2f %s%s\nNodes: " u64Display " NPS: %d\nTime: %02d:%02d:%02d.%02d", - programStats.depth, - ((float)programStats.score)/100.0, - lst, - only_one_move(lst)? - xtra[programStats.got_fail] : "", - (u64)programStats.nodes, (int)nps, h, m, s, cs); - } - } - DisplayAnalysisText(buf); -} - -void DisplayComment(moveNumber, text) int moveNumber; char *text;