char *buf, int count, int error));
void read_from_ics P((InputSourceRef isr, VOIDSTAR closure,
char *buf, int count, int error));
+void ics_printf P((char *format, ...));
void SendToICS P((char *s));
void SendToICSDelayed P((char *s, long msdelay));
void SendMoveToICS P((ChessMove moveType, int fromX, int fromY,
void InitEngineUCI( const char * iniDir, ChessProgramState * cps ); // [HGM] moved here from winboard.c
char *ProbeBook P((int moveNr, char *book)); // [HGM] book: returns a book move
char *SendMoveToBookUser P((int nr, ChessProgramState *cps, int initial)); // [HGM] book
+void ics_update_width P((int new_width));
extern char installDir[MSG_SIZ];
extern int tinyLayout, smallLayout;
if(appData.keepAlive) ScheduleDelayedEvent(KeepAlive, appData.keepAlive*60*1000);
}
+/* added routine for printf style output to ics */
+void ics_printf(char *format, ...)
+{
+ char buffer[MSG_SIZ], *args;
+
+ args = (char *)&format + sizeof(format);
+ vsnprintf(buffer, sizeof(buffer), format, args);
+ buffer[sizeof(buffer)-1] = '\0';
+ SendToICS(buffer);
+}
+
void
SendToICS(s)
char *s;
for (i = 0; i < count; i++) {
if (data[i] != NULLCHAR && data[i] != '\r')
buf[buf_len++] = data[i];
- if(buf_len >= 5 && buf[buf_len-5]=='\n' && buf[buf_len-4]=='\\' &&
+ 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] != ' ')
sprintf(str,
"/set-quietly interface %s\n/set-quietly style 12\n",
programVersion);
+ strcat(str, "/set-quietly wrap 0\n");
} else if (ics_type == ICS_CHESSNET) {
sprintf(str, "/style 12\n");
#ifdef WIN32
strcat(str, "$iset nohighlight 1\n");
#endif
+ strcat(str, "$iset nowrap 1\n");
strcat(str, "$iset lock 1\n$style 12\n");
}
SendToICS(str);
+ NotifyFrontendLogin();
intfSet = TRUE;
}
programStats.ok_to_send = 0;
}
+void ics_update_width(new_width)
+ int new_width;
+{
+ ics_printf("set width %d\n", new_width);
+}
+
void
SendMoveToProgram(moveNum, cps)
int moveNum;
} else moveCount = 6;
}
}
-#if 1
- if (appData.debugMode) { int i;
- fprintf(debugFP, "repeat test fmm=%d bmm=%d ep=%d, reps=%d\n",
- forwardMostMove, backwardMostMove, epStatus[backwardMostMove],
- appData.drawRepeats);
- for( i=forwardMostMove; i>=backwardMostMove; i-- )
- fprintf(debugFP, "%d ep=%d\n", i, epStatus[i]);
+
+ if (appData.debugMode) { int i;
+ fprintf(debugFP, "repeat test fmm=%d bmm=%d ep=%d, reps=%d\n",
+ forwardMostMove, backwardMostMove, epStatus[backwardMostMove],
+ appData.drawRepeats);
+ for( i=forwardMostMove; i>=backwardMostMove; i-- )
+ fprintf(debugFP, "%d ep=%d\n", i, epStatus[i]);
+
+ }
- }
-#endif
/* Check for rep-draws */
count = 0;
for(k = forwardMostMove-2;
/* [HGM] add time */
char buf[MSG_SIZ]; int seconds = 0;
-#if 1
if(i >= backwardMostMove) {
if(WhiteOnMove(i))
seconds = timeRemaining[0][i] - timeRemaining[0][i+1]
+ GetTimeQuota(i/2) / (1000*WhitePlayer()->other->timeOdds);
}
seconds = (seconds+50)/100; // deci-seconds, rounded to nearest
-#else
- seconds = (pvInfoList[i].time + 5)/10; // [HGM] PVtime: use engine time
-#endif
if( seconds <= 0) buf[0] = 0; else
if( seconds < 30 ) sprintf(buf, " %3.1f%c", seconds/10., 0); else {