int junk;
Boolean singleList;
char *homeDir;
+char *firstEngineLine;
+char *secondEngineLine;
+char *icsNick;
void EnsureOnScreen(int *x, int *y, int minX, int minY);
char StringGet(void *getClosure);
{ "secondChessProgram", ArgFilename, (void *) &appData.secondChessProgram,
FALSE, (ArgIniType) SECOND_CHESS_PROGRAM },
{ "scp", ArgFilename, (void *) &appData.secondChessProgram, FALSE, INVALID },
+ { "fe", ArgString, (void *) &firstEngineLine, FALSE, "" },
+ { "se", ArgString, (void *) &secondEngineLine, FALSE, "" },
{ "firstPlaysBlack", ArgBoolean, (void *) &appData.firstPlaysBlack, FALSE, FALSE },
{ "fb", ArgTrue, (void *) &appData.firstPlaysBlack, FALSE, FALSE },
{ "xfb", ArgFalse, (void *) &appData.firstPlaysBlack, FALSE, INVALID },
{ "ics", ArgTrue, (void *) &appData.icsActive, FALSE, (ArgIniType) FALSE },
{ "xics", ArgFalse, (void *) &appData.icsActive, FALSE, INVALID },
{ "-ics", ArgFalse, (void *) &appData.icsActive, FALSE, INVALID },
+ { "is", ArgString, (void *) &icsNick, FALSE, "" },
{ "internetChessServerHost", ArgString, (void *) &appData.icsHost, FALSE, (ArgIniType) "" },
{ "icshost", ArgString, (void *) &appData.icsHost, FALSE, INVALID },
{ "internetChessServerPort", ArgString, (void *) &appData.icsPort, FALSE, (ArgIniType) ICS_PORT },
if(appData.viewer && appData.viewerOptions[0]) ParseArgsFromString(appData.viewerOptions);
if(appData.tourney && appData.tourneyOptions[0]) ParseArgsFromString(appData.tourneyOptions);
+ chessProgram = GetEngineLine(firstEngineLine, 0) || GetEngineLine(secondEngineLine, 1);
+ appData.icsActive = GetEngineLine(icsNick, 10);
/* [HGM] make sure board size is acceptable */
if(appData.NrFiles > BOARD_FILES ||
}
int
+GetEngineLine (char *s, int n)
+{
+ int i;
+ char buf[MSG_SIZ];
+ extern char *icsNames;
+ if(!s || !*s) return 0;
+ NamesToList(n == 10 ? icsNames : firstChessProgramNames, command, mnemonic, "all");
+ for(i=1; mnemonic[i]; i++) if(!strcmp(s, mnemonic[i])) break;
+ if(!mnemonic[i]) return 0;
+ snprintf(buf, MSG_SIZ, "-%s %s", n == 10 ? "icshost" : "fcp", command[i]);
+ if(n == 1) SwapEngines(n);
+ ParseArgsFromString(buf);
+ if(n == 1) SwapEngines(n);
+ if(n == 0 && *appData.secondChessProgram == NULLCHAR) {
+ SwapEngines(1); // set second same as first if not yet set (to suppress WB startup dialog)
+ ParseArgsFromString(buf);
+ }
+ return 1;
+}
+
+int
SetPlayer (int player, char *p)
{ // [HGM] find the engine line of the partcipant given by number, and parse its options.
int i;
void ApplyMove P((int fromX, int fromY, int toX, int toY, int promoChar, Board board));
void PackMove P((int fromX, int fromY, int toX, int toY, ChessSquare promoPiece));
void ics_printf P((char *format, ...));
+int GetEngineLine P((char *nick, int engine));
char *StrStr P((char *string, char *match));
char *StrCaseStr P((char *string, char *match));