{ "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 },
{ "remoteShell", ArgFilename, (void *) &appData.remoteShell, FALSE, (ArgIniType) REMOTE_SHELL },
{ "rsh", ArgFilename, (void *) &appData.remoteShell, FALSE, INVALID },
{ "remoteUser", ArgString, (void *) &appData.remoteUser, FALSE, INVALID },
{ "adjudicateLossThreshold", ArgInt, (void *) &appData.adjudicateLossThreshold, TRUE, (ArgIniType) 0 },
{ "delayBeforeQuit", ArgInt, (void *) &appData.delayBeforeQuit, TRUE, (ArgIniType) 0 },
{ "delayAfterQuit", ArgInt, (void *) &appData.delayAfterQuit, TRUE, (ArgIniType) 0 },
- { "nameOfDebugFile", ArgFilename, (void *) &appData.nameOfDebugFile, FALSE, (ArgIniType) "winboard.debug" },
+ { "nameOfDebugFile", ArgFilename, (void *) &appData.nameOfDebugFile, FALSE, (ArgIniType) DEBUG_FILE },
{ "debugfile", ArgFilename, (void *) &appData.nameOfDebugFile, FALSE, INVALID },
{ "pgnEventHeader", ArgString, (void *) &appData.pgnEventHeader, TRUE, (ArgIniType) "Computer Chess Game" },
{ "defaultFrcPosition", ArgInt, (void *) &appData.defaultFrcPosition, TRUE, (ArgIniType) -1 },
{ "secondHasOwnBookUCI", ArgBoolean, (void *) &appData.secondHasOwnBookUCI, FALSE, (ArgIniType) TRUE },
{ "sNoOwnBookUCI", ArgFalse, (void *) &appData.secondHasOwnBookUCI, FALSE, INVALID },
{ "secondXBook", ArgFalse, (void *) &appData.secondHasOwnBookUCI, FALSE, INVALID },
+ { "adapterCommand", ArgFilename, (void *) &appData.adapterCommand, TRUE, (ArgIniType) "polyglot -noini -ec \"%fcp\" -ed \"%fd\"" },
{ "polyglotDir", ArgFilename, (void *) &appData.polyglotDir, TRUE, (ArgIniType) "" },
{ "usePolyglotBook", ArgBoolean, (void *) &appData.usePolyglotBook, TRUE, (ArgIniType) FALSE },
{ "polyglotBook", ArgFilename, (void *) &appData.polyglotBook, TRUE, (ArgIniType) "" },
{ "autoLogo", ArgBoolean, (void *) &appData.autoLogo, TRUE, INVALID },
{ "firstOptions", ArgString, (void *) &appData.firstOptions, FALSE, (ArgIniType) "" },
{ "secondOptions", ArgString, (void *) &appData.secondOptions, FALSE, (ArgIniType) "" },
- { "firstNeedsNoncompliantFEN", ArgString, (void *) &appData.fenOverride1, FALSE, (ArgIniType) "" },
- { "secondNeedsNoncompliantFEN", ArgString, (void *) &appData.fenOverride2, FALSE, (ArgIniType) "" },
+ { "firstNeedsNoncompliantFEN", ArgString, (void *) &appData.fenOverride1, FALSE, (ArgIniType) NULL },
+ { "secondNeedsNoncompliantFEN", ArgString, (void *) &appData.fenOverride2, FALSE, (ArgIniType) NULL },
{ "keepAlive", ArgInt, (void *) &appData.keepAlive, FALSE, INVALID },
{ "icstype", ArgInt, (void *) &ics_type, FALSE, INVALID },
{ "forceIllegalMoves", ArgTrue, (void *) &appData.forceIllegal, FALSE, INVALID },
+ { "showTargetSquares", ArgBoolean, (void *) &appData.markers, TRUE, FALSE },
#ifdef ZIPPY
{ "zippyTalk", ArgBoolean, (void *) &appData.zippyTalk, FALSE, (ArgIniType) ZIPPY_TALK },
exit(2);
}
+int
+ValidateInt(char *s)
+{
+ char *p = s;
+ if(*p == '-' || *p == '+') p++;
+ while(*p) if(!isdigit(*p++)) ExitArgError("Bad integer value", s);
+ return atoi(s);
+}
char
StringGet(void *getClosure)
switch (ad->argType) {
case ArgInt:
- *(int *) ad->argLoc = atoi(argValue);
+ *(int *) ad->argLoc = ValidateInt(argValue);
break;
case ArgX:
- *(int *) ad->argLoc = atoi(argValue) + wpMain.x; // [HGM] placement: translate stored relative to absolute
+ *(int *) ad->argLoc = ValidateInt(argValue) + wpMain.x; // [HGM] placement: translate stored relative to absolute
break;
case ArgY:
- *(int *) ad->argLoc = atoi(argValue) + wpMain.y; // (this is really kludgey, it should be done where used...)
+ *(int *) ad->argLoc = ValidateInt(argValue) + wpMain.y; // (this is really kludgey, it should be done where used...)
break;
case ArgZ:
- *(int *) ad->argLoc = atoi(argValue);
+ *(int *) ad->argLoc = ValidateInt(argValue);
EnsureOnScreen(&wpMain.x, &wpMain.y, minX, minY);
break;
}
fclose(f);
}
+
+Boolean
+GetArgValue(char *name)
+{ // retrieve (as text) current value of string or int argument given by name
+ // (this is used for maing the values available in the adapter command)
+ ArgDescriptor *ad;
+
+ for (ad = argDescriptors; ad->argName != NULL; ad++)
+ if (strcmp(ad->argName, name) == 0) break;
+
+ if (ad->argName == NULL) return FALSE;
+
+ switch(ad->argType) {
+ case ArgString:
+ case ArgFilename:
+ strcpy(name, *(char**) ad->argLoc);
+ return TRUE;
+ case ArgInt:
+ sprintf(name, "%d", *(int*) ad->argLoc);
+ return TRUE;
+ case ArgBoolean:
+ sprintf(name, "%s", *(Boolean*) ad->argLoc ? "true" : "false");
+ return TRUE;
+ default: ;
+ }
+
+ return FALSE;
+}