* Massachusetts.
*
* Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006,
- * 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ * 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
*
* Enhancements Copyright 2005 Alessandro Scotti
*
{ "phc", ArgColor, (void *) 5, FALSE, INVALID },
{ "movesPerSession", ArgInt, (void *) &appData.movesPerSession, TRUE, (ArgIniType) MOVES_PER_SESSION },
{ "mps", ArgInt, (void *) &appData.movesPerSession, FALSE, INVALID },
- { "initString", ArgString, (void *) &appData.initString, FALSE, INVALID },
- { "firstInitString", ArgString, (void *) &appData.initString, FALSE, (ArgIniType) INIT_STRING },
+ { "initString", ArgString, (void *) &appData.firstInitString, FALSE, INVALID },
+ { "firstInitString", ArgString, (void *) &appData.firstInitString, FALSE, (ArgIniType) INIT_STRING },
{ "secondInitString", ArgString, (void *) &appData.secondInitString, FALSE, (ArgIniType) INIT_STRING },
{ "firstComputerString", ArgString, (void *) &appData.firstComputerString,
FALSE, (ArgIniType) COMPUTER_STRING },
{ "fd", ArgFilename, (void *) &appData.firstDirectory, FALSE, INVALID },
{ "secondDirectory", ArgFilename, (void *) &appData.secondDirectory, FALSE, (ArgIniType) SECOND_DIRECTORY },
{ "sd", ArgFilename, (void *) &appData.secondDirectory, FALSE, INVALID },
+ { "variations", ArgBoolean, (void *) &appData.variations, TRUE, (ArgIniType) FALSE },
/* some options only used by the XBoard front end, and ignored in WinBoard */
/* Their saving is controlled by XBOARD, which in WinBoard is defined as FALSE */
{ "pixmap", ArgFilename, (void *) &appData.pixmapDirectory, FALSE, INVALID },
{ "bitmapDirectory", ArgFilename, (void *) &appData.bitmapDirectory, XBOARD, (ArgIniType) "" },
{ "bm", ArgFilename, (void *) &appData.bitmapDirectory, FALSE, INVALID },
+ { "soundDirectory", ArgFilename, (void *) &appData.soundDirectory, XBOARD, (ArgIniType) "" },
{ "msLoginDelay", ArgInt, (void *) &appData.msLoginDelay, XBOARD, (ArgIniType) MS_LOGIN_DELAY },
{ "pasteSelection", ArgBoolean, (void *) &appData.pasteSelection, XBOARD, (ArgIniType) FALSE },
{ "dropMenu", ArgBoolean, (void *) &appData.dropMenu, TRUE, (ArgIniType) FALSE },
+ { "pieceMenu", ArgBoolean, (void *) &appData.pieceMenu, TRUE, (ArgIniType) TRUE },
+ { "sweepPromotions", ArgBoolean, (void *) &appData.sweepSelect, TRUE, (ArgIniType) FALSE },
{ "remoteShell", ArgFilename, (void *) &appData.remoteShell, FALSE, (ArgIniType) REMOTE_SHELL },
{ "rsh", ArgFilename, (void *) &appData.remoteShell, FALSE, INVALID },
{ "remoteUser", ArgString, (void *) &appData.remoteUser, FALSE, INVALID },
{ "td", ArgFloat, (void *) &appData.timeDelay, FALSE, INVALID },
{ "timeControl", ArgString, (void *) &appData.timeControl, TRUE, (ArgIniType) TIME_CONTROL },
{ "tc", ArgString, (void *) &appData.timeControl, FALSE, INVALID },
- { "timeIncrement", ArgInt, (void *) &appData.timeIncrement, TRUE, (ArgIniType) TIME_INCREMENT },
- { "inc", ArgInt, (void *) &appData.timeIncrement, FALSE, INVALID },
+ { "timeIncrement", ArgFloat, (void *) &appData.timeIncrement, TRUE, INVALID },
+ { "inc", ArgFloat, (void *) &appData.timeIncrement, FALSE, INVALID },
{ "internetChessServerMode", ArgBoolean, (void *) &appData.icsActive, FALSE, INVALID },
{ "ics", ArgTrue, (void *) &appData.icsActive, FALSE, (ArgIniType) FALSE },
{ "xics", ArgFalse, (void *) &appData.icsActive, FALSE, INVALID },
{ "soundIcsDraw", ArgFilename, (void *) &appData.soundIcsDraw, TRUE, (ArgIniType) "" },
{ "soundIcsUnfinished", ArgFilename, (void *) &appData.soundIcsUnfinished, TRUE, (ArgIniType) "" },
{ "soundIcsAlarm", ArgFilename, (void *) &appData.soundIcsAlarm, TRUE, (ArgIniType) "" },
+ { "disguisePromotedPieces", ArgBoolean, (void *) &appData.disguise, TRUE, (ArgIniType) TRUE },
{ "reuseFirst", ArgBoolean, (void *) &appData.reuseFirst, FALSE, (ArgIniType) TRUE },
{ "reuse", ArgTrue, (void *) &appData.reuseFirst, FALSE, INVALID },
{ "xreuse", ArgFalse, (void *) &appData.reuseFirst, FALSE, INVALID },
{ "defaultPathEGTB", ArgFilename, (void *) &appData.defaultPathEGTB, TRUE, (ArgIniType) "c:\\egtb" },
{ "language", ArgFilename, (void *) &appData.language, TRUE, (ArgIniType) "" },
+ // [HGM] tournament options
+ { "tourney", ArgFilename, (void *) &appData.tourneyFile, FALSE, (ArgIniType) "" },
+ { "tf", ArgFilename, (void *) &appData.tourneyFile, FALSE, INVALID },
+ { "processes", ArgString, (void *) &appData.processes, FALSE, (ArgIniType) " " },
+ { "participants", ArgString, (void *) &appData.participants, FALSE, (ArgIniType) "" },
+ { "tourneyType", ArgInt, (void *) &appData.tourneyType, FALSE, (ArgIniType) 0 },
+ { "tt", ArgInt, (void *) &appData.tourneyType, FALSE, INVALID },
+ { "tourneyCycles", ArgInt, (void *) &appData.tourneyCycles, FALSE, (ArgIniType) 1 },
+ { "cy", ArgInt, (void *) &appData.tourneyCycles, FALSE, INVALID },
+ { "results", ArgString, (void *) &appData.results, FALSE, (ArgIniType) "" },
+ { "syncAfterRound", ArgBoolean, (void *) &appData.roundSync, FALSE, (ArgIniType) FALSE },
+ { "syncAfterCycle", ArgBoolean, (void *) &appData.cycleSync, FALSE, (ArgIniType) TRUE },
+
/* [HGM] board-size, adjudication and misc. options */
{ "oneClickMove", ArgBoolean, (void *) &appData.oneClick, TRUE, (ArgIniType) FALSE },
{ "boardWidth", ArgInt, (void *) &appData.NrFiles, FALSE, (ArgIniType) -1 },
{ "pieceToCharTable", ArgString, (void *) &appData.pieceToCharTable, FALSE, INVALID },
{ "pieceNickNames", ArgString, (void *) &appData.pieceNickNames, FALSE, INVALID },
{ "colorNickNames", ArgString, (void *) &appData.colorNickNames, FALSE, INVALID },
- { "flipBlack", ArgBoolean, (void *) &appData.upsideDown, TRUE, (ArgIniType) FALSE },
- { "allWhite", ArgBoolean, (void *) &appData.allWhite, TRUE, (ArgIniType) FALSE },
+ { "flipBlack", ArgBoolean, (void *) &appData.upsideDown, FALSE, (ArgIniType) FALSE },
+ { "allWhite", ArgBoolean, (void *) &appData.allWhite, FALSE, (ArgIniType) FALSE },
{ "alphaRank", ArgBoolean, (void *) &appData.alphaRank, FALSE, (ArgIniType) FALSE },
{ "firstAlphaRank", ArgBoolean, (void *) &first.alphaRank, FALSE, (ArgIniType) FALSE },
{ "secondAlphaRank", ArgBoolean, (void *) &second.alphaRank, FALSE, (ArgIniType) FALSE },
ch = get(cl);
}
*q = NULLCHAR;
-
for (ad = argDescriptors; ad->argName != NULL; ad++)
if (strcmp(ad->argName, argName + 1) == 0) break;
-
if (ad->argName == NULL)
ExitArgError("Unrecognized argument", argName);
break;
case ArgColor:
- ParseColor((int)ad->argLoc, argValue);
+ ParseColor((int)(intptr_t)ad->argLoc, argValue);
break;
case ArgAttribs: {
break;
case ArgFont:
- ParseFont(argValue, (int)ad->argLoc);
+ ParseFont(argValue, (int)(intptr_t)ad->argLoc);
break;
case ArgCommSettings:
}
void
+ParseArgsFromString(char *p)
+{
+ ParseArgs(StringGet, &p);
+}
+
+void
+ParseArgsFromFile(FILE *f)
+{
+ ParseArgs(FileGet, f);
+}
+
+void
ParseIcsTextMenu(char *icsTextMenuString)
{
// int flags = 0;
case ArgBoolean:
case ArgTrue:
case ArgFalse:
- *(Boolean *) argDescriptors[i].argLoc = (int)argDescriptors[i].defaultValue;
+ *(Boolean *) argDescriptors[i].argLoc = (int)(intptr_t)argDescriptors[i].defaultValue;
break;
case ArgInt:
case ArgX:
case ArgY:
case ArgZ:
- *(int *) argDescriptors[i].argLoc = (int)argDescriptors[i].defaultValue;
+ *(int *) argDescriptors[i].argLoc = (int)(intptr_t)argDescriptors[i].defaultValue;
break;
case ArgString:
case ArgFilename:
*(char **) argDescriptors[i].argLoc = (char *)argDescriptors[i].defaultValue;
break;
case ArgBoardSize:
- *(int *) argDescriptors[i].argLoc = (int)argDescriptors[i].defaultValue;
+ *(int *) argDescriptors[i].argLoc = (int)(intptr_t)argDescriptors[i].defaultValue;
break;
case ArgColor:
- ParseColor((int)argDescriptors[i].argLoc, (char*)argDescriptors[i].defaultValue);
+ ParseColor((int)(intptr_t)argDescriptors[i].argLoc, (char*)argDescriptors[i].defaultValue);
break;
case ArgFloat: // floats cannot be casted to int without precision loss
default: ; // some arg types cannot be initialized through table
// float: casting to int is not harmless, so default cannot be contained in table
appData.timeDelay = TIME_DELAY;
+ appData.timeIncrement = TIME_INCREMENT;
// some complex, platform-dependent stuff that could not be handled from table
SetDefaultTextAttribs();