fixed compiler warning for file-browser code
[xboard.git] / args.h
diff --git a/args.h b/args.h
index 9a5b9e9..1b736cc 100644 (file)
--- a/args.h
+++ b/args.h
@@ -5,7 +5,7 @@
  * Massachusetts. 
  *
  * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006,
- * 2007, 2008, 2009 Free Software Foundation, Inc.
+ * 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
  *
  * Enhancements Copyright 2005 Alessandro Scotti
  *
@@ -208,6 +208,7 @@ ArgDescriptor argDescriptors[] = {
   { "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 },
@@ -240,6 +241,9 @@ ArgDescriptor argDescriptors[] = {
   { "internetChessserverHelper", ArgFilename, (void *) &appData.icsHelper, 
        FALSE, INVALID }, // for XB
   { "icshelper", ArgFilename, (void *) &appData.icsHelper, FALSE, (ArgIniType) "" },
+  { "seekGraph", ArgBoolean, (void *) &appData.seekGraph, TRUE, (ArgIniType) FALSE },
+  { "sg", ArgTrue, (void *) &appData.seekGraph, FALSE, INVALID },
+  { "autoRefresh", ArgBoolean, (void *) &appData.autoRefresh, TRUE, (ArgIniType) FALSE },
   { "gateway", ArgString, (void *) &appData.gateway, FALSE, (ArgIniType) "" },
   { "loadGameFile", ArgFilename, (void *) &appData.loadGameFile, FALSE, (ArgIniType) "" },
   { "lgf", ArgFilename, (void *) &appData.loadGameFile, FALSE, INVALID },
@@ -508,6 +512,7 @@ ArgDescriptor argDescriptors[] = {
   { "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 },
+  { "shuffleOpenings", ArgTrue, (void *) &shuffleOpenings, FALSE, INVALID },
   { "gameListTags", ArgString, (void *) &appData.gameListTags, TRUE, (ArgIniType) GLT_DEFAULT_TAGS },
   { "saveOutOfBookInfo", ArgBoolean, (void *) &appData.saveOutOfBookInfo, TRUE, (ArgIniType) TRUE },
   { "showEvalInMoveHistory", ArgBoolean, (void *) &appData.showEvalInMoveHistory, TRUE, (ArgIniType) TRUE },
@@ -538,6 +543,7 @@ ArgDescriptor argDescriptors[] = {
   { "defaultPathEGTB", ArgFilename, (void *) &appData.defaultPathEGTB, TRUE, (ArgIniType) "c:\\egtb" },
 
   /* [HGM] board-size, adjudication and misc. options */
+  { "oneClickMove", ArgBoolean, (void *) &appData.oneClick, TRUE, (ArgIniType) FALSE },
   { "boardWidth", ArgInt, (void *) &appData.NrFiles, TRUE, (ArgIniType) -1 },
   { "boardHeight", ArgInt, (void *) &appData.NrRanks, TRUE, (ArgIniType) -1 },
   { "holdingsSize", ArgInt, (void *) &appData.holdingsSize, TRUE, (ArgIniType) -1 },
@@ -554,6 +560,7 @@ ArgDescriptor argDescriptors[] = {
   { "trivialDraws", ArgBoolean, (void *) &appData.trivialDraws, TRUE, (ArgIniType) FALSE },
   { "ruleMoves", ArgInt, (void *) &appData.ruleMoves, TRUE, (ArgIniType) 51 },
   { "repeatsToDraw", ArgInt, (void *) &appData.drawRepeats, TRUE, (ArgIniType) 6 },
+  { "backgroundObserve", ArgBoolean, (void *) &appData.bgObserve, TRUE, (ArgIniType) FALSE },
   { "autoKibitz", ArgTrue, (void *) &appData.autoKibitz, FALSE, INVALID },
   { "engineDebugOutput", ArgInt, (void *) &appData.engineComments, FALSE, (ArgIniType) 1 },
   { "userName", ArgString, (void *) &appData.userName, FALSE, INVALID },
@@ -572,6 +579,7 @@ ArgDescriptor argDescriptors[] = {
   { "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 },
@@ -617,6 +625,7 @@ ArgDescriptor argDescriptors[] = {
   { "zippyReplyTimeout", ArgInt, (void *)&junk, FALSE, INVALID },
 #endif
   /* [HGM] options for broadcasting and time odds */
+  { "chatBoxes", ArgString, (void *) &appData.chatBoxes, !XBOARD, (ArgIniType) NULL },
   { "serverMoves", ArgString, (void *) &appData.serverMovesName, FALSE, (ArgIniType) NULL },
   { "suppressLoadMoves", ArgBoolean, (void *) &appData.suppressLoadMoves, FALSE, (ArgIniType) FALSE },
   { "serverPause", ArgInt, (void *) &appData.serverPause, FALSE, (ArgIniType) 15 },
@@ -697,6 +706,14 @@ ExitArgError(char *msg, char *badArg)
   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)
@@ -917,19 +934,19 @@ ParseArgs(GetFunc get, void *cl)
 
     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;