X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=args.h;h=cdf51aac7713c93f3f7dda84c4caa94853b421e5;hb=ee5c4592139dec24b8514a6fd217600fa414a9a3;hp=1da24488ce6fcfb700418efcb2a0f05e408a7081;hpb=8e4a958eea326db65c7621b4c1840cdca97f6d07;p=xboard.git diff --git a/args.h b/args.h index 1da2448..cdf51aa 100644 --- a/args.h +++ b/args.h @@ -113,6 +113,7 @@ char *secondEngineLine; char *icsNick; char *theme; char *replace; +char *engineListFile; void EnsureOnScreen(int *x, int *y, int minX, int minY); char StringGet(void *getClosure); @@ -518,6 +519,7 @@ ArgDescriptor argDescriptors[] = { { "secondChessProgramNames", ArgString, (void *) &secondChessProgramNames, !XBOARD, (ArgIniType) SCP_NAMES }, { "themeNames", ArgString, (void *) &appData.themeNames, TRUE, (ArgIniType) "native -upf false -ub false -ubt false -pid \"\"\n" }, + { "engineList", ArgFilename, (void *) &engineListFile, TRUE, (ArgIniType) "" }, { "addMasterOption", ArgMaster, NULL, FALSE, INVALID }, { "installEngine", ArgInstall, (void *) &firstChessProgramNames, FALSE, (ArgIniType) "" }, { "installTheme", ArgInstall, (void *) &appData.themeNames, FALSE, (ArgIniType) "" }, @@ -1186,9 +1188,9 @@ ParseArgs(GetFunc get, void *cl) break; } if(replace) { // previous -replace option makes this string option conditional - char *p = (char*) replace; + int differs = strcmp(*(char**) ad->argLoc, (char*) replace); free(replace); replace = NULL; // but expires in the process - if(strcmp(*(char**) ad->argLoc, p)) break; // only use to replace the given string + if(differs) break; // only use to replace the given string } ASSIGN(*(char **) ad->argLoc, argValue); break; @@ -1436,6 +1438,9 @@ InitAppData(char *lpCmdLine) /* Parse command line */ ParseArgs(StringGet, &lpCmdLine); + /* if separate engine list is used, parse that too */ + if(*engineListFile) ParseSettingsFile(engineListFile, &engineListFile); + 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);