Merge branch 'master-20091209' into gtk
authorArun Persaud <arun@nubati.net>
Sat, 9 Jan 2010 23:44:04 +0000 (15:44 -0800)
committerArun Persaud <arun@nubati.net>
Sat, 9 Jan 2010 23:57:58 +0000 (15:57 -0800)
Conflicts:
Makefile.am
backend.c
xboard.c
xhistory.c
xhistory.h

compiles, but there command line arguments are not recognized anymore. will fix this later.

45 files changed:
Makefile.am
args.h [new file with mode: 0644]
backend.c
backend.h
common.h
configure.ac
frontend.h
gtk-interface.xml
pixmaps/asdd72.xpm
pixmaps/asdl72.xpm
pixmaps/cvdd37.xpm
pixmaps/cvdd45.xpm
pixmaps/cvdd49.xpm
pixmaps/cvdl37.xpm
pixmaps/cvdl45.xpm
pixmaps/cvdl49.xpm
pixmaps/hdd49.xpm
pixmaps/hdd72.xpm
pixmaps/hdl49.xpm
pixmaps/hdl72.xpm
uci.c
winboard/WB4Jaws.dev
winboard/Winboard.dev
winboard/config.h
winboard/makefile.gcc
winboard/makefile.ms
winboard/parser.c
winboard/wchat.c
winboard/wengineoutput.c [moved from winboard/wengineo.c with 100% similarity]
winboard/winboard.c
winboard/winboard.dsp
winboard/winboard.h
winboard/woptions.c [changed mode: 0755->0644]
xboard.c
xboard.conf [new file with mode: 0644]
xboard.h
xedittags.c
xedittags.h
xengineoutput.c
xevalgraph.c [new file with mode: 0644]
xgamelist.c
xgamelist.h
xhistory.c
xhistory.h
xoptions.c

index d678c54..c0dc779 100644 (file)
@@ -19,16 +19,18 @@ xboard_SOURCES = backend.c backend.h backendz.h \
                 lists.c lists.h \
                 moves.c moves.h \
                 parser.l parser.h \
-                pgntags.c \
+                pgntags.c \
                 uci.c \
-                xboard.c xboard.h \
+                xboard.c xboard.h args.h \
                 xedittags.c xedittags.h \
                 engineoutput.c engineoutput.h \
                 xengineoutput.c \
+                evalgraph.c evalgraph.h xevalgraph.c \
                 xgamelist.c xgamelist.h\
                 xhistory.c  xhistory.h \
                 xoptions.c \
                 $(ZPY)
+
 xboard_LDADD = -lm  @XAW_LIBS@ @GTK_LIBS@
 
 EXTRA_DIST = pixmaps bitmaps winboard\
@@ -43,5 +45,8 @@ info_TEXINFOS =  xboard.texi
 xboard_TEXINFOS =  copyright.texi 
 man6_MANS = xboard.man
 
+install-data-local: $(srcdir)/xboard.conf
+       $(INSTALL_DATA) $(srcdir)/xboard.conf $(DESTDIR)/etc/xboard
+
 xboard.man: xboard.texi copyright.texi gpl.texinfo version.texi
        $(srcdir)/texi2man $(srcdir)/xboard.texi > xboard.man || (rm -f xboard.man ; false)
diff --git a/args.h b/args.h
new file mode 100644 (file)
index 0000000..0b021ac
--- /dev/null
+++ b/args.h
@@ -0,0 +1,1366 @@
+/*
+ * args.c -- Option parsing and saving for X and Windows versions of XBoard
+ *
+ * Copyright 1991 by Digital Equipment Corporation, Maynard,
+ * Massachusetts. 
+ *
+ * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006,
+ * 2007, 2008, 2009 Free Software Foundation, Inc.
+ *
+ * Enhancements Copyright 2005 Alessandro Scotti
+ *
+ * The following terms apply to Digital Equipment Corporation's copyright
+ * interest in XBoard:
+ * ------------------------------------------------------------------------
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ * ------------------------------------------------------------------------
+ *
+ * The following terms apply to the enhanced version of XBoard
+ * distributed by the Free Software Foundation:
+ * ------------------------------------------------------------------------
+ *
+ * GNU XBoard is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or (at
+ * your option) any later version.
+ *
+ * GNU XBoard is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.  *
+ *
+ *------------------------------------------------------------------------
+ ** See the file ChangeLog for a revision history.  
+*/
+
+// Note: this file is not a normal header, but contains executable code
+// for #inclusion in winboard.c and xboard.c, rather than separate compilation,
+// so that it can make use of the proper context of #defined symbols and 
+// declarations in those files.
+
+typedef enum {
+  ArgString, ArgInt, ArgFloat, ArgBoolean, ArgTrue, ArgFalse, ArgNone, 
+  ArgColor, ArgAttribs, ArgFilename, ArgBoardSize, ArgFont, ArgCommSettings,
+  ArgSettingsFilename,
+  ArgX, ArgY, ArgZ // [HGM] placement: for window-placement options stored relative to main window
+} ArgType;
+
+typedef void *ArgIniType;
+
+#define INVALID (ArgIniType) 6915 /* Some number unlikely to be needed as default for anything */
+#define MAX_ARG_LEN 128*1024 /* [AS] For Roger Brown's very long list! */
+
+typedef struct {
+  char *argName;
+  ArgType argType;
+  /***
+  union {
+    String *pString;       // ArgString
+    int *pInt;             // ArgInt
+    float *pFloat;         // ArgFloat
+    Boolean *pBoolean;     // ArgBoolean
+    COLORREF *pColor;      // ArgColor
+    ColorClass cc;         // ArgAttribs
+    String *pFilename;     // ArgFilename
+    BoardSize *pBoardSize; // ArgBoardSize
+    int whichFont;         // ArgFont
+    DCB *pDCB;             // ArgCommSettings
+    String *pFilename;     // ArgSettingsFilename
+  } argLoc;
+  ***/
+  void *argLoc;
+  Boolean save;
+  ArgIniType defaultValue;
+} ArgDescriptor;
+
+typedef struct {
+  char *item;
+  char *command;
+  Boolean getname;
+  Boolean immediate;
+} IcsTextMenuEntry;
+
+IcsTextMenuEntry icsTextMenuEntry[ICS_TEXT_MENU_SIZE];
+
+int junk;
+
+void EnsureOnScreen(int *x, int *y, int minX, int minY);
+char StringGet(void *getClosure);
+void ParseFont(char *name, int number);
+void SetFontDefaults();
+void CreateFonts();
+void ParseColor(int n, char *name);
+void ParseTextAttribs(ColorClass cc, char *s);
+void ParseBoardSize(void * addr, char *name);
+void ParseCommPortSettings(char *name);
+void LoadAllSounds();
+void SetCommPortDefaults();
+void SaveFontArg(FILE *f, ArgDescriptor *ad);
+void ExportSounds();
+void SaveAttribsArg(FILE *f, ArgDescriptor *ad);
+void SaveColor(FILE *f, ArgDescriptor *ad);
+void SaveBoardSize(FILE *f, char *name, void *addr);
+void PrintCommPortSettings(FILE *f, char *name);
+void GetWindowCoords();
+int  MySearchPath(char *installDir, char *name, char *fullname);
+int  MyGetFullPathName(char *name, char *fullname);
+int  MainWindowUp();
+void PopUpStartupDialog();
+typedef char GetFunc(void *getClosure);
+void ParseArgs(GetFunc get, void *cl);
+
+// [HGM] this is an exact duplicate of something in winboard.c. Move to backend.c?
+char *defaultTextAttribs[] = 
+{
+  COLOR_SHOUT, COLOR_SSHOUT, COLOR_CHANNEL1, COLOR_CHANNEL, COLOR_KIBITZ,
+  COLOR_TELL, COLOR_CHALLENGE, COLOR_REQUEST, COLOR_SEEK, COLOR_NORMAL,
+  "#000000"
+};
+
+ArgDescriptor argDescriptors[] = {
+  /* positional arguments */
+  { "loadGameFile", ArgFilename, (void *) &appData.loadGameFile, FALSE, INVALID },
+  { "", ArgNone, NULL, FALSE, INVALID },
+  /* keyword arguments */
+  JAWS_ARGS
+  { "whitePieceColor", ArgColor, (void *) 0, TRUE, (ArgIniType) WHITE_PIECE_COLOR },
+  { "wpc", ArgColor, (void *) 0, FALSE, INVALID },
+  { "blackPieceColor", ArgColor, (void *) 1, TRUE, (ArgIniType) BLACK_PIECE_COLOR },
+  { "bpc", ArgColor, (void *) 1, FALSE, INVALID },
+  { "lightSquareColor", ArgColor, (void *) 2, TRUE, (ArgIniType) LIGHT_SQUARE_COLOR },
+  { "lsc", ArgColor, (void *) 2, FALSE, INVALID },
+  { "darkSquareColor", ArgColor, (void *) 3, TRUE, (ArgIniType) DARK_SQUARE_COLOR },
+  { "dsc", ArgColor, (void *) 3, FALSE, INVALID },
+  { "highlightSquareColor", ArgColor, (void *) 4, TRUE, (ArgIniType) HIGHLIGHT_SQUARE_COLOR },
+  { "hsc", ArgColor, (void *) 4, FALSE, INVALID },
+  { "premoveHighlightColor", ArgColor, (void *) 5, TRUE, (ArgIniType) PREMOVE_HIGHLIGHT_COLOR },
+  { "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 },
+  { "secondInitString", ArgString, (void *) &appData.secondInitString, FALSE, (ArgIniType) INIT_STRING },
+  { "firstComputerString", ArgString, (void *) &appData.firstComputerString,
+    FALSE, (ArgIniType) COMPUTER_STRING },
+  { "secondComputerString", ArgString, (void *) &appData.secondComputerString,
+    FALSE, (ArgIniType) COMPUTER_STRING },
+  { "firstChessProgram", ArgFilename, (void *) &appData.firstChessProgram,
+    FALSE, (ArgIniType) FIRST_CHESS_PROGRAM },
+  { "fcp", ArgFilename, (void *) &appData.firstChessProgram, FALSE, INVALID },
+  { "secondChessProgram", ArgFilename, (void *) &appData.secondChessProgram,
+    FALSE, (ArgIniType) SECOND_CHESS_PROGRAM },
+  { "scp", ArgFilename, (void *) &appData.secondChessProgram, FALSE, INVALID },
+  { "firstPlaysBlack", ArgBoolean, (void *) &appData.firstPlaysBlack, FALSE, FALSE },
+  { "fb", ArgTrue, (void *) &appData.firstPlaysBlack, FALSE, FALSE },
+  { "xfb", ArgFalse, (void *) &appData.firstPlaysBlack, FALSE, INVALID },
+  { "-fb", ArgFalse, (void *) &appData.firstPlaysBlack, FALSE, INVALID },
+  { "noChessProgram", ArgBoolean, (void *) &appData.noChessProgram, FALSE, FALSE },
+  { "ncp", ArgTrue, (void *) &appData.noChessProgram, FALSE, INVALID },
+  { "xncp", ArgFalse, (void *) &appData.noChessProgram, FALSE, INVALID },
+  { "-ncp", ArgFalse, (void *) &appData.noChessProgram, FALSE, INVALID },
+  { "firstHost", ArgString, (void *) &appData.firstHost, FALSE, (ArgIniType) FIRST_HOST },
+  { "fh", ArgString, (void *) &appData.firstHost, FALSE, INVALID },
+  { "secondHost", ArgString, (void *) &appData.secondHost, FALSE, (ArgIniType) SECOND_HOST },
+  { "sh", ArgString, (void *) &appData.secondHost, FALSE, INVALID },
+  { "firstDirectory", ArgFilename, (void *) &appData.firstDirectory, FALSE, (ArgIniType) FIRST_DIRECTORY },
+  { "fd", ArgFilename, (void *) &appData.firstDirectory, FALSE, INVALID },
+  { "secondDirectory", ArgFilename, (void *) &appData.secondDirectory, FALSE, (ArgIniType) SECOND_DIRECTORY },
+  { "sd", ArgFilename, (void *) &appData.secondDirectory, FALSE, INVALID },
+
+  /* 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 */
+  { "internetChessServerInputBox", ArgBoolean, (void *) &appData.icsInputBox, XBOARD, (ArgIniType) FALSE },
+  { "icsinput", ArgTrue, (void *) &appData.icsInputBox, FALSE, INVALID },
+  { "xicsinput", ArgFalse, (void *) &appData.icsInputBox, FALSE, INVALID },
+  { "cmail", ArgString, (void *) &appData.cmailGameName, FALSE, (ArgIniType) "" },
+  { "soundProgram", ArgFilename, (void *) &appData.soundProgram, XBOARD, (ArgIniType) "play" },
+  { "fontSizeTolerance", ArgInt, (void *) &appData.fontSizeTolerance, XBOARD, (ArgIniType) 4 },
+  { "lowTimeWarningColor", ArgColor, (void *) 6, XBOARD, (ArgIniType) LOWTIMEWARNING_COLOR },
+  { "lowTimeWarning", ArgBoolean, (void *) &appData.lowTimeWarning, XBOARD, (ArgIniType) FALSE },
+  { "titleInWindow", ArgBoolean, (void *) &appData.titleInWindow, XBOARD, (ArgIniType) FALSE },
+  { "title", ArgTrue, (void *) &appData.titleInWindow, FALSE, INVALID },
+  { "xtitle", ArgFalse, (void *) &appData.titleInWindow, FALSE, INVALID },
+  { "flashCount", ArgInt, (void *) &appData.flashCount, XBOARD, INVALID }, // let X handle this
+  { "flashRate", ArgInt, (void *) &appData.flashRate, XBOARD, (ArgIniType) FLASH_RATE },
+  { "pixmapDirectory", ArgFilename, (void *) &appData.pixmapDirectory, XBOARD, (ArgIniType) "" },
+  { "pixmap", ArgFilename, (void *) &appData.pixmapDirectory, FALSE, INVALID },
+  { "bitmapDirectory", ArgFilename, (void *) &appData.bitmapDirectory, XBOARD, (ArgIniType) "" },
+  { "bm", ArgFilename, (void *) &appData.bitmapDirectory, FALSE, INVALID },
+  { "msLoginDelay", ArgInt, (void *) &appData.msLoginDelay, XBOARD, (ArgIniType) MS_LOGIN_DELAY },
+  { "pasteSelection", ArgBoolean, (void *) &appData.pasteSelection, XBOARD, (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 },
+  { "ruser", ArgString, (void *) &appData.remoteUser, FALSE, INVALID },
+  { "timeDelay", ArgFloat, (void *) &appData.timeDelay, TRUE, 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 },
+  { "internetChessServerMode", ArgBoolean, (void *) &appData.icsActive, FALSE, INVALID },
+  { "ics", ArgTrue, (void *) &appData.icsActive, FALSE, (ArgIniType) FALSE },
+  { "xics", ArgFalse, (void *) &appData.icsActive, FALSE, INVALID },
+  { "-ics", ArgFalse, (void *) &appData.icsActive, FALSE, INVALID },
+  { "internetChessServerHost", ArgString, (void *) &appData.icsHost, FALSE, (ArgIniType) "" },
+  { "icshost", ArgString, (void *) &appData.icsHost, FALSE, INVALID },
+  { "internetChessServerPort", ArgString, (void *) &appData.icsPort, FALSE, (ArgIniType) ICS_PORT },
+  { "icsport", ArgString, (void *) &appData.icsPort, FALSE, INVALID },
+  { "internetChessServerCommPort", ArgString, (void *) &appData.icsCommPort, FALSE, (ArgIniType) ICS_COMM_PORT },
+  { "icscomm", ArgString, (void *) &appData.icsCommPort, FALSE, INVALID },
+  { "internetChessServerComPort", ArgString, (void *) &appData.icsCommPort, FALSE, INVALID },
+  { "icscom", ArgString, (void *) &appData.icsCommPort, FALSE, INVALID },
+  { "internetChessServerLogonScript", ArgFilename, (void *) &appData.icsLogon, FALSE, (ArgIniType) ICS_LOGON },
+  { "icslogon", ArgFilename, (void *) &appData.icsLogon, FALSE, INVALID },
+  { "useTelnet", ArgBoolean, (void *) &appData.useTelnet, FALSE, INVALID },
+  { "telnet", ArgTrue, (void *) &appData.useTelnet, FALSE, INVALID },
+  { "xtelnet", ArgFalse, (void *) &appData.useTelnet, FALSE, INVALID },
+  { "-telnet", ArgFalse, (void *) &appData.useTelnet, FALSE, INVALID },
+  { "telnetProgram", ArgFilename, (void *) &appData.telnetProgram, FALSE, (ArgIniType) TELNET_PROGRAM },
+  { "internetChessserverHelper", ArgFilename, (void *) &appData.icsHelper, 
+       FALSE, INVALID }, // for XB
+  { "icshelper", ArgFilename, (void *) &appData.icsHelper, FALSE, (ArgIniType) "" },
+  { "gateway", ArgString, (void *) &appData.gateway, FALSE, (ArgIniType) "" },
+  { "loadGameFile", ArgFilename, (void *) &appData.loadGameFile, FALSE, (ArgIniType) "" },
+  { "lgf", ArgFilename, (void *) &appData.loadGameFile, FALSE, INVALID },
+  { "loadGameIndex", ArgInt, (void *) &appData.loadGameIndex, FALSE, (ArgIniType) 0 },
+  { "lgi", ArgInt, (void *) &appData.loadGameIndex, FALSE, INVALID },
+  { "saveGameFile", ArgFilename, (void *) &appData.saveGameFile, TRUE, (ArgIniType) "" },
+  { "sgf", ArgFilename, (void *) &appData.saveGameFile, FALSE, INVALID },
+  { "autoSaveGames", ArgBoolean, (void *) &appData.autoSaveGames, TRUE, (ArgIniType) FALSE },
+  { "autosave", ArgTrue, (void *) &appData.autoSaveGames, FALSE, INVALID },
+  { "xautosave", ArgFalse, (void *) &appData.autoSaveGames, FALSE, INVALID },
+  { "-autosave", ArgFalse, (void *) &appData.autoSaveGames, FALSE, INVALID },
+  { "loadPositionFile", ArgFilename, (void *) &appData.loadPositionFile, FALSE, (ArgIniType) "" },
+  { "lpf", ArgFilename, (void *) &appData.loadPositionFile, FALSE, INVALID },
+  { "loadPositionIndex", ArgInt, (void *) &appData.loadPositionIndex, FALSE, (ArgIniType) 1 },
+  { "lpi", ArgInt, (void *) &appData.loadPositionIndex, FALSE, INVALID },
+  { "savePositionFile", ArgFilename, (void *) &appData.savePositionFile, FALSE, (ArgIniType) "" },
+  { "spf", ArgFilename, (void *) &appData.savePositionFile, FALSE, INVALID },
+  { "matchMode", ArgBoolean, (void *) &appData.matchMode, FALSE, (ArgIniType) FALSE },
+  { "mm", ArgTrue, (void *) &appData.matchMode, FALSE, INVALID },
+  { "xmm", ArgFalse, (void *) &appData.matchMode, FALSE, INVALID },
+  { "-mm", ArgFalse, (void *) &appData.matchMode, FALSE, INVALID },
+  { "matchGames", ArgInt, (void *) &appData.matchGames, FALSE, (ArgIniType) 0 },
+  { "mg", ArgInt, (void *) &appData.matchGames, FALSE, INVALID },
+  { "monoMode", ArgBoolean, (void *) &appData.monoMode, TRUE, (ArgIniType) FALSE },
+  { "mono", ArgTrue, (void *) &appData.monoMode, FALSE, INVALID },
+  { "xmono", ArgFalse, (void *) &appData.monoMode, FALSE, INVALID },
+  { "-mono", ArgFalse, (void *) &appData.monoMode, FALSE, INVALID },
+  { "debugMode", ArgBoolean, (void *) &appData.debugMode, FALSE, (ArgIniType) FALSE },
+  { "debug", ArgTrue, (void *) &appData.debugMode, FALSE, INVALID },
+  { "xdebug", ArgFalse, (void *) &appData.debugMode, FALSE, INVALID },
+  { "-debug", ArgFalse, (void *) &appData.debugMode, FALSE, INVALID },
+  { "clockMode", ArgBoolean, (void *) &appData.clockMode, FALSE, (ArgIniType) TRUE },
+  { "clock", ArgTrue, (void *) &appData.clockMode, FALSE, INVALID },
+  { "xclock", ArgFalse, (void *) &appData.clockMode, FALSE, INVALID },
+  { "-clock", ArgFalse, (void *) &appData.clockMode, FALSE, INVALID },
+  { "searchTime", ArgString, (void *) &appData.searchTime, FALSE, (ArgIniType) "" },
+  { "st", ArgString, (void *) &appData.searchTime, FALSE, INVALID },
+  { "searchDepth", ArgInt, (void *) &appData.searchDepth, FALSE, (ArgIniType) 0 },
+  { "depth", ArgInt, (void *) &appData.searchDepth, FALSE, INVALID },
+  { "showCoords", ArgBoolean, (void *) &appData.showCoords, TRUE, (ArgIniType) FALSE },
+  { "coords", ArgTrue, (void *) &appData.showCoords, FALSE, INVALID },
+  { "xcoords", ArgFalse, (void *) &appData.showCoords, FALSE, INVALID },
+  { "-coords", ArgFalse, (void *) &appData.showCoords, FALSE, INVALID },
+  { "showThinking", ArgBoolean, (void *) &appData.showThinking, TRUE, (ArgIniType) FALSE },
+  { "thinking", ArgTrue, (void *) &appData.showThinking, FALSE, INVALID },
+  { "xthinking", ArgFalse, (void *) &appData.showThinking, FALSE, INVALID },
+  { "-thinking", ArgFalse, (void *) &appData.showThinking, FALSE, INVALID },
+  { "ponderNextMove", ArgBoolean, (void *) &appData.ponderNextMove, TRUE, (ArgIniType) TRUE },
+  { "ponder", ArgTrue, (void *) &appData.ponderNextMove, FALSE, INVALID },
+  { "xponder", ArgFalse, (void *) &appData.ponderNextMove, FALSE, INVALID },
+  { "-ponder", ArgFalse, (void *) &appData.ponderNextMove, FALSE, INVALID },
+  { "periodicUpdates", ArgBoolean, (void *) &appData.periodicUpdates, TRUE, (ArgIniType) TRUE },
+  { "periodic", ArgTrue, (void *) &appData.periodicUpdates, FALSE, INVALID },
+  { "xperiodic", ArgFalse, (void *) &appData.periodicUpdates, FALSE, INVALID },
+  { "-periodic", ArgFalse, (void *) &appData.periodicUpdates, FALSE, INVALID },
+  { "popupExitMessage", ArgBoolean, (void *) &appData.popupExitMessage, TRUE, (ArgIniType) TRUE },
+  { "exit", ArgTrue, (void *) &appData.popupExitMessage, FALSE, INVALID },
+  { "xexit", ArgFalse, (void *) &appData.popupExitMessage, FALSE, INVALID },
+  { "-exit", ArgFalse, (void *) &appData.popupExitMessage, FALSE, INVALID },
+  { "popupMoveErrors", ArgBoolean, (void *) &appData.popupMoveErrors, TRUE, (ArgIniType) FALSE },
+  { "popup", ArgTrue, (void *) &appData.popupMoveErrors, FALSE, INVALID },
+  { "xpopup", ArgFalse, (void *) &appData.popupMoveErrors, FALSE, INVALID },
+  { "-popup", ArgFalse, (void *) &appData.popupMoveErrors, FALSE, INVALID },
+  { "popUpErrors", ArgBoolean, (void *) &appData.popupMoveErrors, 
+    FALSE, INVALID }, /* only so that old WinBoard.ini files from betas can be read */
+  { "clockFont", ArgFont, (void *) CLOCK_FONT, TRUE, INVALID },
+  { "messageFont", ArgFont, (void *) MESSAGE_FONT, !XBOARD, INVALID },
+  { "font", ArgFont, (void *) MESSAGE_FONT, XBOARD, INVALID },
+  { "coordFont", ArgFont, (void *) COORD_FONT, TRUE, INVALID },
+  { "tagsFont", ArgFont, (void *) EDITTAGS_FONT, TRUE, INVALID },
+  { "commentFont", ArgFont, (void *) COMMENT_FONT, TRUE, INVALID },
+  { "icsFont", ArgFont, (void *) CONSOLE_FONT, TRUE, INVALID },
+  { "moveHistoryFont", ArgFont, (void *) MOVEHISTORY_FONT, TRUE, INVALID }, /* [AS] */
+  { "boardSize", ArgBoardSize, (void *) &boardSize,
+    TRUE, (ArgIniType) -1 }, /* must come after all fonts */
+  { "size", ArgBoardSize, (void *) &boardSize, FALSE, INVALID },
+  { "ringBellAfterMoves", ArgBoolean, (void *) &appData.ringBellAfterMoves,
+    FALSE, (ArgIniType) TRUE }, /* historical; kept only so old winboard.ini files will parse */
+  { "bell", ArgTrue, (void *) &appData.ringBellAfterMoves, FALSE, INVALID }, // for XB
+  { "xbell", ArgFalse, (void *) &appData.ringBellAfterMoves, FALSE, INVALID }, // for XB
+  { "movesound", ArgTrue, (void *) &appData.ringBellAfterMoves, FALSE, INVALID }, // for XB
+  { "xmovesound", ArgFalse, (void *) &appData.ringBellAfterMoves, FALSE, INVALID }, // for XB
+  { "alwaysOnTop", ArgBoolean, (void *) &alwaysOnTop, TRUE, INVALID },
+  { "top", ArgTrue, (void *) &alwaysOnTop, FALSE, INVALID },
+  { "xtop", ArgFalse, (void *) &alwaysOnTop, FALSE, INVALID },
+  { "-top", ArgFalse, (void *) &alwaysOnTop, FALSE, INVALID },
+  { "autoCallFlag", ArgBoolean, (void *) &appData.autoCallFlag, TRUE, (ArgIniType) FALSE },
+  { "autoflag", ArgTrue, (void *) &appData.autoCallFlag, FALSE, INVALID },
+  { "xautoflag", ArgFalse, (void *) &appData.autoCallFlag, FALSE, INVALID },
+  { "-autoflag", ArgFalse, (void *) &appData.autoCallFlag, FALSE, INVALID },
+  { "autoComment", ArgBoolean, (void *) &appData.autoComment, TRUE, (ArgIniType) FALSE },
+  { "autocomm", ArgTrue, (void *) &appData.autoComment, FALSE, INVALID },
+  { "xautocomm", ArgFalse, (void *) &appData.autoComment, FALSE, INVALID },
+  { "-autocomm", ArgFalse, (void *) &appData.autoComment, FALSE, INVALID },
+  { "autoObserve", ArgBoolean, (void *) &appData.autoObserve, TRUE, (ArgIniType) FALSE },
+  { "autobs", ArgTrue, (void *) &appData.autoObserve, FALSE, INVALID },
+  { "xautobs", ArgFalse, (void *) &appData.autoObserve, FALSE, INVALID },
+  { "-autobs", ArgFalse, (void *) &appData.autoObserve, FALSE, INVALID },
+  { "flipView", ArgBoolean, (void *) &appData.flipView, FALSE, (ArgIniType) FALSE },
+  { "flip", ArgTrue, (void *) &appData.flipView, FALSE, INVALID },
+  { "xflip", ArgFalse, (void *) &appData.flipView, FALSE, INVALID },
+  { "-flip", ArgFalse, (void *) &appData.flipView, FALSE, INVALID },
+  { "autoFlipView", ArgBoolean, (void *) &appData.autoFlipView, TRUE, (ArgIniType) TRUE },
+  { "autoflip", ArgTrue, (void *) &appData.autoFlipView, FALSE, INVALID },
+  { "xautoflip", ArgFalse, (void *) &appData.autoFlipView, FALSE, INVALID },
+  { "-autoflip", ArgFalse, (void *) &appData.autoFlipView, FALSE, INVALID },
+  { "autoRaiseBoard", ArgBoolean, (void *) &appData.autoRaiseBoard, TRUE, (ArgIniType) TRUE },
+  { "autoraise", ArgTrue, (void *) &appData.autoRaiseBoard, FALSE, INVALID },
+  { "xautoraise", ArgFalse, (void *) &appData.autoRaiseBoard, FALSE, INVALID },
+  { "-autoraise", ArgFalse, (void *) &appData.autoRaiseBoard, FALSE, INVALID },
+  { "alwaysPromoteToQueen", ArgBoolean, (void *) &appData.alwaysPromoteToQueen, TRUE, (ArgIniType) FALSE },
+  { "queen", ArgTrue, (void *) &appData.alwaysPromoteToQueen, FALSE, INVALID },
+  { "xqueen", ArgFalse, (void *) &appData.alwaysPromoteToQueen, FALSE, INVALID },
+  { "-queen", ArgFalse, (void *) &appData.alwaysPromoteToQueen, FALSE, INVALID },
+  { "oldSaveStyle", ArgBoolean, (void *) &appData.oldSaveStyle, TRUE, (ArgIniType) FALSE },
+  { "oldsave", ArgTrue, (void *) &appData.oldSaveStyle, FALSE, INVALID },
+  { "xoldsave", ArgFalse, (void *) &appData.oldSaveStyle, FALSE, INVALID },
+  { "-oldsave", ArgFalse, (void *) &appData.oldSaveStyle, FALSE, INVALID },
+  { "quietPlay", ArgBoolean, (void *) &appData.quietPlay, TRUE, (ArgIniType) FALSE },
+  { "quiet", ArgTrue, (void *) &appData.quietPlay, FALSE, INVALID },
+  { "xquiet", ArgFalse, (void *) &appData.quietPlay, FALSE, INVALID },
+  { "-quiet", ArgFalse, (void *) &appData.quietPlay, FALSE, INVALID },
+  { "getMoveList", ArgBoolean, (void *) &appData.getMoveList, TRUE, (ArgIniType) TRUE },
+  { "moves", ArgTrue, (void *) &appData.getMoveList, FALSE, INVALID },
+  { "xmoves", ArgFalse, (void *) &appData.getMoveList, FALSE, INVALID },
+  { "-moves", ArgFalse, (void *) &appData.getMoveList, FALSE, INVALID },
+  { "testLegality", ArgBoolean, (void *) &appData.testLegality, TRUE, (ArgIniType) TRUE },
+  { "legal", ArgTrue, (void *) &appData.testLegality, FALSE, INVALID },
+  { "xlegal", ArgFalse, (void *) &appData.testLegality, FALSE, INVALID },
+  { "-legal", ArgFalse, (void *) &appData.testLegality, FALSE, INVALID },
+  { "premove", ArgBoolean, (void *) &appData.premove, TRUE, (ArgIniType) TRUE },
+  { "pre", ArgTrue, (void *) &appData.premove, FALSE, INVALID },
+  { "xpre", ArgFalse, (void *) &appData.premove, FALSE, INVALID },
+  { "-pre", ArgFalse, (void *) &appData.premove, FALSE, INVALID },
+  { "premoveWhite", ArgBoolean, (void *) &appData.premoveWhite, TRUE, (ArgIniType) FALSE },
+  { "prewhite", ArgTrue, (void *) &appData.premoveWhite, FALSE, INVALID },
+  { "xprewhite", ArgFalse, (void *) &appData.premoveWhite, FALSE, INVALID },
+  { "-prewhite", ArgFalse, (void *) &appData.premoveWhite, FALSE, INVALID },
+  { "premoveWhiteText", ArgString, (void *) &appData.premoveWhiteText, TRUE, (ArgIniType) "" },
+  { "premoveBlack", ArgBoolean, (void *) &appData.premoveBlack, TRUE, (ArgIniType) FALSE },
+  { "preblack", ArgTrue, (void *) &appData.premoveBlack, FALSE, INVALID },
+  { "xpreblack", ArgFalse, (void *) &appData.premoveBlack, FALSE, INVALID },
+  { "-preblack", ArgFalse, (void *) &appData.premoveBlack, FALSE, INVALID },
+  { "premoveBlackText", ArgString, (void *) &appData.premoveBlackText, TRUE, (ArgIniType) "" },
+  { "icsAlarm", ArgBoolean, (void *) &appData.icsAlarm, TRUE, (ArgIniType) TRUE},
+  { "alarm", ArgTrue, (void *) &appData.icsAlarm, FALSE},
+  { "xalarm", ArgFalse, (void *) &appData.icsAlarm, FALSE},
+  { "-alarm", ArgFalse, (void *) &appData.icsAlarm, FALSE},
+  { "icsAlarmTime", ArgInt, (void *) &appData.icsAlarmTime, TRUE, (ArgIniType) 5000},
+  { "localLineEditing", ArgBoolean, (void *) &appData.localLineEditing, FALSE, (ArgIniType) TRUE},
+  { "edit", ArgTrue, (void *) &appData.localLineEditing, FALSE, INVALID },
+  { "xedit", ArgFalse, (void *) &appData.localLineEditing, FALSE, INVALID },
+  { "-edit", ArgFalse, (void *) &appData.localLineEditing, FALSE, INVALID },
+  { "animateMoving", ArgBoolean, (void *) &appData.animate, TRUE, (ArgIniType) TRUE },
+  { "animate", ArgTrue, (void *) &appData.animate, FALSE, INVALID },
+  { "xanimate", ArgFalse, (void *) &appData.animate, FALSE, INVALID },
+  { "-animate", ArgFalse, (void *) &appData.animate, FALSE, INVALID },
+  { "animateSpeed", ArgInt, (void *) &appData.animSpeed, TRUE, (ArgIniType) 10 },
+  { "animateDragging", ArgBoolean, (void *) &appData.animateDragging, TRUE, (ArgIniType) TRUE },
+  { "drag", ArgTrue, (void *) &appData.animateDragging, FALSE, INVALID },
+  { "xdrag", ArgFalse, (void *) &appData.animateDragging, FALSE, INVALID },
+  { "-drag", ArgFalse, (void *) &appData.animateDragging, FALSE, INVALID },
+  { "blindfold", ArgBoolean, (void *) &appData.blindfold, TRUE, (ArgIniType) FALSE },
+  { "blind", ArgTrue, (void *) &appData.blindfold, FALSE, INVALID },
+  { "xblind", ArgFalse, (void *) &appData.blindfold, FALSE, INVALID },
+  { "-blind", ArgFalse, (void *) &appData.blindfold, FALSE, INVALID },
+  { "highlightLastMove", ArgBoolean,
+    (void *) &appData.highlightLastMove, TRUE, (ArgIniType) TRUE },
+  { "highlight", ArgTrue, (void *) &appData.highlightLastMove, FALSE, INVALID },
+  { "xhighlight", ArgFalse, (void *) &appData.highlightLastMove, FALSE, INVALID },
+  { "-highlight", ArgFalse, (void *) &appData.highlightLastMove, FALSE, INVALID },
+  { "highlightDragging", ArgBoolean,
+    (void *) &appData.highlightDragging, TRUE, INVALID },
+  { "highdrag", ArgTrue, (void *) &appData.highlightDragging, FALSE, INVALID },
+  { "xhighdrag", ArgFalse, (void *) &appData.highlightDragging, FALSE, INVALID },
+  { "-highdrag", ArgFalse, (void *) &appData.highlightDragging, FALSE, INVALID },
+  { "colorizeMessages", ArgBoolean, (void *) &appData.colorize, TRUE, (ArgIniType) TRUE },
+  { "colorize", ArgTrue, (void *) &appData.colorize, FALSE, INVALID },
+  { "xcolorize", ArgFalse, (void *) &appData.colorize, FALSE, INVALID },
+  { "-colorize", ArgFalse, (void *) &appData.colorize, FALSE, INVALID },
+  { "colorShout", ArgAttribs, (void *) ColorShout, TRUE, INVALID },
+  { "colorSShout", ArgAttribs, (void *) ColorSShout, TRUE, INVALID },
+  { "colorCShout", ArgAttribs, (void *) ColorSShout, FALSE, INVALID }, // for XB
+  { "colorChannel1", ArgAttribs, (void *) ColorChannel1, TRUE, INVALID },
+  { "colorChannel", ArgAttribs, (void *) ColorChannel, TRUE, INVALID },
+  { "colorKibitz", ArgAttribs, (void *) ColorKibitz, TRUE, INVALID },
+  { "colorTell", ArgAttribs, (void *) ColorTell, TRUE, INVALID },
+  { "colorChallenge", ArgAttribs, (void *) ColorChallenge, TRUE, INVALID },
+  { "colorRequest", ArgAttribs, (void *) ColorRequest, TRUE, INVALID },
+  { "colorSeek", ArgAttribs, (void *) ColorSeek, TRUE, INVALID },
+  { "colorNormal", ArgAttribs, (void *) ColorNormal, TRUE, INVALID },
+  { "colorBackground", ArgColor, (void *) 7, TRUE, COLOR_BKGD },
+  { "soundShout", ArgFilename, (void *) &appData.soundShout, TRUE, (ArgIniType) "" },
+  { "soundSShout", ArgFilename, (void *) &appData.soundSShout, TRUE, (ArgIniType) "" },
+  { "soundCShout", ArgFilename, (void *) &appData.soundSShout, FALSE, (ArgIniType) "" }, // for XB
+  { "soundChannel1", ArgFilename, (void *) &appData.soundChannel1, TRUE, (ArgIniType) "" },
+  { "soundChannel", ArgFilename, (void *) &appData.soundChannel, TRUE, (ArgIniType) "" },
+  { "soundKibitz", ArgFilename, (void *) &appData.soundKibitz, TRUE, (ArgIniType) "" },
+  { "soundTell", ArgFilename, (void *) &appData.soundTell, TRUE, (ArgIniType) "" },
+  { "soundChallenge", ArgFilename, (void *) &appData.soundChallenge, TRUE, (ArgIniType) "" },
+  { "soundRequest", ArgFilename, (void *) &appData.soundRequest, TRUE, (ArgIniType) "" },
+  { "soundSeek", ArgFilename, (void *) &appData.soundSeek, TRUE, (ArgIniType) "" },
+  { "soundMove", ArgFilename, (void *) &appData.soundMove, TRUE, (ArgIniType) "" },
+  { "soundBell", ArgFilename, (void *) &appData.soundBell, TRUE, (ArgIniType) SOUND_BELL },
+  { "soundIcsWin", ArgFilename, (void *) &appData.soundIcsWin, TRUE, (ArgIniType) "" },
+  { "soundIcsLoss", ArgFilename, (void *) &appData.soundIcsLoss, TRUE, (ArgIniType) "" },
+  { "soundIcsDraw", ArgFilename, (void *) &appData.soundIcsDraw, TRUE, (ArgIniType) "" },
+  { "soundIcsUnfinished", ArgFilename, (void *) &appData.soundIcsUnfinished, TRUE, (ArgIniType) "" },
+  { "soundIcsAlarm", ArgFilename, (void *) &appData.soundIcsAlarm, TRUE, (ArgIniType) "" },
+  { "reuseFirst", ArgBoolean, (void *) &appData.reuseFirst, FALSE, (ArgIniType) TRUE },
+  { "reuse", ArgTrue, (void *) &appData.reuseFirst, FALSE, INVALID },
+  { "xreuse", ArgFalse, (void *) &appData.reuseFirst, FALSE, INVALID },
+  { "-reuse", ArgFalse, (void *) &appData.reuseFirst, FALSE, INVALID },
+  { "reuseChessPrograms", ArgBoolean,
+    (void *) &appData.reuseFirst, FALSE, INVALID }, /* backward compat only */
+  { "reuseSecond", ArgBoolean, (void *) &appData.reuseSecond, FALSE, (ArgIniType) TRUE },
+  { "reuse2", ArgTrue, (void *) &appData.reuseSecond, FALSE, INVALID },
+  { "xreuse2", ArgFalse, (void *) &appData.reuseSecond, FALSE, INVALID },
+  { "-reuse2", ArgFalse, (void *) &appData.reuseSecond, FALSE, INVALID },
+  { "comPortSettings", ArgCommSettings, (void *) /*&dcb*/ 0, TRUE, INVALID },
+  { "settingsFile", ArgSettingsFilename, (void *) &settingsFileName, FALSE, (ArgIniType) SETTINGS_FILE },
+  { "ini", ArgSettingsFilename, (void *) &settingsFileName, FALSE, INVALID },
+  { "saveSettingsFile", ArgFilename, (void *) &settingsFileName, FALSE, INVALID },
+  { "saveSettingsOnExit", ArgBoolean, (void *) &saveSettingsOnExit, TRUE, (ArgIniType) TRUE },
+  { "chessProgram", ArgBoolean, (void *) &chessProgram, FALSE, (ArgIniType) FALSE },
+  { "cp", ArgTrue, (void *) &chessProgram, FALSE, INVALID },
+  { "xcp", ArgFalse, (void *) &chessProgram, FALSE, INVALID },
+  { "-cp", ArgFalse, (void *) &chessProgram, FALSE, INVALID },
+  { "icsMenu", ArgString, (void *) &icsTextMenuString, TRUE, (ArgIniType) ICS_TEXT_MENU_DEFAULT },
+  { "icsNames", ArgString, (void *) &icsNames, TRUE, (ArgIniType) ICS_NAMES },
+  { "firstChessProgramNames", ArgString, (void *) &firstChessProgramNames,
+    TRUE, (ArgIniType) FCP_NAMES },
+  { "secondChessProgramNames", ArgString, (void *) &secondChessProgramNames,
+    TRUE, (ArgIniType) SCP_NAMES },
+  { "initialMode", ArgString, (void *) &appData.initialMode, FALSE, (ArgIniType) "" },
+  { "mode", ArgString, (void *) &appData.initialMode, FALSE, INVALID },
+  { "variant", ArgString, (void *) &appData.variant, FALSE, (ArgIniType) "normal" },
+  { "firstProtocolVersion", ArgInt, (void *) &appData.firstProtocolVersion, FALSE, (ArgIniType) PROTOVER },
+  { "secondProtocolVersion", ArgInt, (void *) &appData.secondProtocolVersion,FALSE, (ArgIniType) PROTOVER },
+  { "showButtonBar", ArgBoolean, (void *) &appData.showButtonBar, TRUE, (ArgIniType) TRUE },
+  { "buttons", ArgTrue, (void *) &appData.showButtonBar, FALSE, INVALID },
+  { "xbuttons", ArgFalse, (void *) &appData.showButtonBar, FALSE, INVALID },
+  { "-buttons", ArgFalse, (void *) &appData.showButtonBar, FALSE, INVALID },
+
+  /* [AS] New features */
+  { "firstScoreAbs", ArgBoolean, (void *) &appData.firstScoreIsAbsolute, FALSE, (ArgIniType) FALSE },
+  { "secondScoreAbs", ArgBoolean, (void *) &appData.secondScoreIsAbsolute, FALSE, (ArgIniType) FALSE },
+  { "pgnExtendedInfo", ArgBoolean, (void *) &appData.saveExtendedInfoInPGN, TRUE, (ArgIniType) FALSE },
+  { "hideThinkingFromHuman", ArgBoolean, (void *) &appData.hideThinkingFromHuman, TRUE, (ArgIniType) FALSE },
+  { "liteBackTextureFile", ArgString, (void *) &appData.liteBackTextureFile, TRUE, (ArgIniType) "" },
+  { "darkBackTextureFile", ArgString, (void *) &appData.darkBackTextureFile, TRUE, (ArgIniType) "" },
+  { "liteBackTextureMode", ArgInt, (void *) &appData.liteBackTextureMode, TRUE, (ArgIniType) BACK_TEXTURE_MODE_PLAIN },
+  { "darkBackTextureMode", ArgInt, (void *) &appData.darkBackTextureMode, TRUE, (ArgIniType) BACK_TEXTURE_MODE_PLAIN },
+  { "renderPiecesWithFont", ArgString, (void *) &appData.renderPiecesWithFont, TRUE, (ArgIniType) "" },
+  { "fontPieceToCharTable", ArgString, (void *) &appData.fontToPieceTable, TRUE, (ArgIniType) "" },
+  { "fontPieceBackColorWhite", ArgColor, (void *) 8, TRUE, (ArgIniType) WHITE_PIECE_COLOR },
+  { "fontPieceForeColorWhite", ArgColor, (void *) 9, TRUE, (ArgIniType) WHITE_PIECE_COLOR },
+  { "fontPieceBackColorBlack", ArgColor, (void *) 10, TRUE, (ArgIniType) BLACK_PIECE_COLOR },
+  { "fontPieceForeColorBlack", ArgColor, (void *) 11, TRUE, (ArgIniType) BLACK_PIECE_COLOR },
+  { "fontPieceSize", ArgInt, (void *) &appData.fontPieceSize, TRUE, (ArgIniType) 80 },
+  { "overrideLineGap", ArgInt, (void *) &appData.overrideLineGap, TRUE, (ArgIniType) 1 },
+  { "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" },
+  { "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 },
+  { "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 },
+  { "evalHistColorWhite", ArgColor, (void *) 12, TRUE, (ArgIniType) "#FFFFB0" },
+  { "evalHistColorBlack", ArgColor, (void *) 13, TRUE, (ArgIniType) "#AD5D3D" },
+  { "highlightMoveWithArrow", ArgBoolean, (void *) &appData.highlightMoveWithArrow, TRUE, (ArgIniType) FALSE },
+  { "highlightArrowColor", ArgColor, (void *) 14, TRUE, (ArgIniType) "#FFFF80" },
+  { "stickyWindows", ArgBoolean, (void *) &appData.useStickyWindows, TRUE, (ArgIniType) TRUE },
+  { "adjudicateDrawMoves", ArgInt, (void *) &appData.adjudicateDrawMoves, TRUE, (ArgIniType) 0 },
+  { "autoDisplayComment", ArgBoolean, (void *) &appData.autoDisplayComment, TRUE, (ArgIniType) TRUE },
+  { "autoDisplayTags", ArgBoolean, (void *) &appData.autoDisplayTags, TRUE, (ArgIniType) TRUE },
+  { "firstIsUCI", ArgBoolean, (void *) &appData.firstIsUCI, FALSE, (ArgIniType) FALSE },
+  { "fUCI", ArgTrue, (void *) &appData.firstIsUCI, FALSE, INVALID },
+  { "secondIsUCI", ArgBoolean, (void *) &appData.secondIsUCI, FALSE, (ArgIniType) FALSE },
+  { "sUCI", ArgTrue, (void *) &appData.secondIsUCI, FALSE, INVALID },
+  { "firstHasOwnBookUCI", ArgBoolean, (void *) &appData.firstHasOwnBookUCI, FALSE, (ArgIniType) TRUE },
+  { "fNoOwnBookUCI", ArgFalse, (void *) &appData.firstHasOwnBookUCI, FALSE, INVALID },
+  { "firstXBook", ArgFalse, (void *) &appData.firstHasOwnBookUCI, FALSE, INVALID },
+  { "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 %%cp -ed %%d" },
+  { "polyglotDir", ArgFilename, (void *) &appData.polyglotDir, TRUE, (ArgIniType) "" },
+  { "usePolyglotBook", ArgBoolean, (void *) &appData.usePolyglotBook, TRUE, (ArgIniType) FALSE },
+  { "polyglotBook", ArgFilename, (void *) &appData.polyglotBook, TRUE, (ArgIniType) "" },
+  { "defaultHashSize", ArgInt, (void *) &appData.defaultHashSize, TRUE, (ArgIniType) 64 }, 
+  { "defaultCacheSizeEGTB", ArgInt, (void *) &appData.defaultCacheSizeEGTB, TRUE, (ArgIniType) 4 },
+  { "defaultPathEGTB", ArgFilename, (void *) &appData.defaultPathEGTB, TRUE, (ArgIniType) "c:\\egtb" },
+
+  /* [HGM] board-size, adjudication and misc. options */
+  { "boardWidth", ArgInt, (void *) &appData.NrFiles, TRUE, (ArgIniType) -1 },
+  { "boardHeight", ArgInt, (void *) &appData.NrRanks, TRUE, (ArgIniType) -1 },
+  { "holdingsSize", ArgInt, (void *) &appData.holdingsSize, TRUE, (ArgIniType) -1 },
+  { "matchPause", ArgInt, (void *) &appData.matchPause, TRUE, (ArgIniType) 10000 },
+  { "pieceToCharTable", ArgString, (void *) &appData.pieceToCharTable, FALSE, INVALID },
+  { "flipBlack", ArgBoolean, (void *) &appData.upsideDown, TRUE, (ArgIniType) FALSE },
+  { "allWhite", ArgBoolean, (void *) &appData.allWhite, TRUE, (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 },
+  { "testClaims", ArgBoolean, (void *) &appData.testClaims, TRUE, (ArgIniType) FALSE },
+  { "checkMates", ArgBoolean, (void *) &appData.checkMates, TRUE, (ArgIniType) FALSE },
+  { "materialDraws", ArgBoolean, (void *) &appData.materialDraws, TRUE, (ArgIniType) FALSE },
+  { "trivialDraws", ArgBoolean, (void *) &appData.trivialDraws, TRUE, (ArgIniType) FALSE },
+  { "ruleMoves", ArgInt, (void *) &appData.ruleMoves, TRUE, (ArgIniType) 51 },
+  { "repeatsToDraw", ArgInt, (void *) &appData.drawRepeats, TRUE, (ArgIniType) 6 },
+  { "autoKibitz", ArgTrue, (void *) &appData.autoKibitz, FALSE, INVALID },
+  { "engineDebugOutput", ArgInt, (void *) &appData.engineComments, FALSE, (ArgIniType) 1 },
+  { "userName", ArgString, (void *) &appData.userName, FALSE, INVALID },
+  { "rewindIndex", ArgInt, (void *) &appData.rewindIndex, FALSE, INVALID },
+  { "sameColorGames", ArgInt, (void *) &appData.sameColorGames, FALSE, INVALID },
+  { "smpCores", ArgInt, (void *) &appData.smpCores, TRUE, (ArgIniType) 1 },
+  { "egtFormats", ArgString, (void *) &appData.egtFormats, TRUE, (ArgIniType) "" },
+  { "niceEngines", ArgInt, (void *) &appData.niceEngines, TRUE, INVALID },
+  { "firstLogo", ArgFilename, (void *) &appData.firstLogo, FALSE, INVALID },
+  { "secondLogo", ArgFilename, (void *) &appData.secondLogo, FALSE, INVALID },
+  { "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) "" },
+  { "keepAlive", ArgInt, (void *) &appData.keepAlive, FALSE, INVALID },
+  { "icstype", ArgInt, (void *) &ics_type, FALSE, INVALID },
+  { "forceIllegalMoves", ArgTrue, (void *) &appData.forceIllegal, FALSE, INVALID },
+
+#ifdef ZIPPY
+  { "zippyTalk", ArgBoolean, (void *) &appData.zippyTalk, FALSE, (ArgIniType) ZIPPY_TALK },
+  { "zt", ArgTrue, (void *) &appData.zippyTalk, FALSE, INVALID },
+  { "xzt", ArgFalse, (void *) &appData.zippyTalk, FALSE, INVALID },
+  { "-zt", ArgFalse, (void *) &appData.zippyTalk, FALSE, INVALID },
+  { "zippyPlay", ArgBoolean, (void *) &appData.zippyPlay, FALSE, (ArgIniType) ZIPPY_PLAY },
+  { "zp", ArgTrue, (void *) &appData.zippyPlay, FALSE, INVALID },
+  { "xzp", ArgFalse, (void *) &appData.zippyPlay, FALSE, INVALID },
+  { "-zp", ArgFalse, (void *) &appData.zippyPlay, FALSE, INVALID },
+  { "zippyLines", ArgFilename, (void *) &appData.zippyLines, FALSE, (ArgIniType) ZIPPY_LINES },
+  { "zippyPinhead", ArgString, (void *) &appData.zippyPinhead, FALSE, (ArgIniType) ZIPPY_PINHEAD },
+  { "zippyPassword", ArgString, (void *) &appData.zippyPassword, FALSE, (ArgIniType) ZIPPY_PASSWORD },
+  { "zippyPassword2", ArgString, (void *) &appData.zippyPassword2, FALSE, (ArgIniType) ZIPPY_PASSWORD2 },
+  { "zippyWrongPassword", ArgString, (void *) &appData.zippyWrongPassword,
+    FALSE, (ArgIniType) ZIPPY_WRONG_PASSWORD },
+  { "zippyAcceptOnly", ArgString, (void *) &appData.zippyAcceptOnly, FALSE, (ArgIniType) ZIPPY_ACCEPT_ONLY },
+  { "zippyUseI", ArgBoolean, (void *) &appData.zippyUseI, FALSE, (ArgIniType) ZIPPY_USE_I },
+  { "zui", ArgTrue, (void *) &appData.zippyUseI, FALSE, INVALID },
+  { "xzui", ArgFalse, (void *) &appData.zippyUseI, FALSE, INVALID },
+  { "-zui", ArgFalse, (void *) &appData.zippyUseI, FALSE, INVALID },
+  { "zippyBughouse", ArgInt, (void *) &appData.zippyBughouse, FALSE, (ArgIniType) ZIPPY_BUGHOUSE },
+  { "zippyNoplayCrafty", ArgBoolean, (void *) &appData.zippyNoplayCrafty,
+    FALSE, (ArgIniType) ZIPPY_NOPLAY_CRAFTY },
+  { "znc", ArgTrue, (void *) &appData.zippyNoplayCrafty, FALSE, INVALID },
+  { "xznc", ArgFalse, (void *) &appData.zippyNoplayCrafty, FALSE, INVALID },
+  { "-znc", ArgFalse, (void *) &appData.zippyNoplayCrafty, FALSE, INVALID },
+  { "zippyGameEnd", ArgString, (void *) &appData.zippyGameEnd, FALSE, (ArgIniType) ZIPPY_GAME_END },
+  { "zippyGameStart", ArgString, (void *) &appData.zippyGameStart, FALSE, (ArgIniType) ZIPPY_GAME_START },
+  { "zippyAdjourn", ArgBoolean, (void *) &appData.zippyAdjourn, FALSE, (ArgIniType) ZIPPY_ADJOURN },
+  { "zadj", ArgTrue, (void *) &appData.zippyAdjourn, FALSE, INVALID },
+  { "xzadj", ArgFalse, (void *) &appData.zippyAdjourn, FALSE, INVALID },
+  { "-zadj", ArgFalse, (void *) &appData.zippyAdjourn, FALSE, INVALID },
+  { "zippyAbort", ArgBoolean, (void *) &appData.zippyAbort, FALSE, (ArgIniType) ZIPPY_ABORT },
+  { "zab", ArgTrue, (void *) &appData.zippyAbort, FALSE, INVALID },
+  { "xzab", ArgFalse, (void *) &appData.zippyAbort, FALSE, INVALID },
+  { "-zab", ArgFalse, (void *) &appData.zippyAbort, FALSE, INVALID },
+  { "zippyVariants", ArgString, (void *) &appData.zippyVariants, FALSE, (ArgIniType) ZIPPY_VARIANTS },
+  { "zippyMaxGames", ArgInt, (void *)&appData.zippyMaxGames, FALSE, (ArgIniType) ZIPPY_MAX_GAMES},
+  { "zippyReplayTimeout", ArgInt, (void *)&appData.zippyReplayTimeout, FALSE, (ArgIniType) ZIPPY_REPLAY_TIMEOUT },
+  { "zippyShortGame", ArgInt, (void *)&appData.zippyShortGame, FALSE, INVALID },
+  /* Kludge to allow winboard.ini files from buggy 4.0.4 to be read: */
+  { "zippyReplyTimeout", ArgInt, (void *)&junk, FALSE, INVALID },
+#endif
+  /* [HGM] options for broadcasting and time odds */
+  { "serverMoves", ArgString, (void *) &appData.serverMovesName, FALSE, (ArgIniType) NULL },
+  { "suppressLoadMoves", ArgBoolean, (void *) &appData.suppressLoadMoves, FALSE, (ArgIniType) FALSE },
+  { "serverPause", ArgInt, (void *) &appData.serverPause, FALSE, (ArgIniType) 15 },
+  { "firstTimeOdds", ArgInt, (void *) &appData.firstTimeOdds, FALSE, (ArgIniType) 1 },
+  { "secondTimeOdds", ArgInt, (void *) &appData.secondTimeOdds, FALSE, (ArgIniType) 1 },
+  { "timeOddsMode", ArgInt, (void *) &appData.timeOddsMode, TRUE, INVALID },
+  { "firstAccumulateTC", ArgInt, (void *) &appData.firstAccumulateTC, FALSE, (ArgIniType) 1 },
+  { "secondAccumulateTC", ArgInt, (void *) &appData.secondAccumulateTC, FALSE, (ArgIniType) 1 },
+  { "firstNPS", ArgInt, (void *) &appData.firstNPS, FALSE, (ArgIniType) -1 },
+  { "secondNPS", ArgInt, (void *) &appData.secondNPS, FALSE, (ArgIniType) -1 },
+  { "noGUI", ArgTrue, (void *) &appData.noGUI, FALSE, INVALID },
+  { "keepLineBreaksICS", ArgBoolean, (void *) &appData.noJoin, TRUE, INVALID },
+  { "wrapContinuationSequence", ArgString, (void *) &appData.wrapContSeq, FALSE, INVALID },
+  { "useInternalWrap", ArgTrue, (void *) &appData.useInternalWrap, FALSE, INVALID }, /* noJoin usurps this if set */
+
+  // [HGM] placement: put all window layouts last in ini file, but man X,Y before all others
+  { "minX", ArgZ, (void *) &minX, FALSE, INVALID }, // [HGM] placement: to make suer auxialary windows can be placed
+  { "minY", ArgZ, (void *) &minY, FALSE, INVALID },
+  { "winWidth",  ArgInt, (void *) &wpMain.width,  TRUE, INVALID }, // [HGM] placement: dummies to remember right & bottom
+  { "winHeight", ArgInt, (void *) &wpMain.height, TRUE, INVALID }, //       for attaching auxiliary windows to them
+  { "x", ArgInt, (void *) &wpMain.x, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "y", ArgInt, (void *) &wpMain.y, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "icsX", ArgX,   (void *) &wpConsole.x, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "icsY", ArgY,   (void *) &wpConsole.y, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "icsW", ArgInt, (void *) &wpConsole.width, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "icsH", ArgInt, (void *) &wpConsole.height, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "analysisX", ArgX,   (void *) &junk, FALSE, INVALID }, // [HGM] placement: analysis window no longer exists
+  { "analysisY", ArgY,   (void *) &junk, FALSE, INVALID }, //       provided for compatibility with old ini files
+  { "analysisW", ArgInt, (void *) &junk, FALSE, INVALID },
+  { "analysisH", ArgInt, (void *) &junk, FALSE, INVALID },
+  { "commentX", ArgX,   (void *) &wpComment.x, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "commentY", ArgY,   (void *) &wpComment.y, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "commentW", ArgInt, (void *) &wpComment.width, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "commentH", ArgInt, (void *) &wpComment.height, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "tagsX", ArgX,   (void *) &wpTags.x, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "tagsY", ArgY,   (void *) &wpTags.y, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "tagsW", ArgInt, (void *) &wpTags.width, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "tagsH", ArgInt, (void *) &wpTags.height, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "gameListX", ArgX,   (void *) &wpGameList.x, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "gameListY", ArgY,   (void *) &wpGameList.y, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "gameListW", ArgInt, (void *) &wpGameList.width, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "gameListH", ArgInt, (void *) &wpGameList.height, TRUE, (ArgIniType) CW_USEDEFAULT },
+  /* [AS] Layout stuff */
+  { "moveHistoryUp", ArgBoolean, (void *) &wpMoveHistory.visible, TRUE, (ArgIniType) TRUE },
+  { "moveHistoryX", ArgX,   (void *) &wpMoveHistory.x, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "moveHistoryY", ArgY,   (void *) &wpMoveHistory.y, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "moveHistoryW", ArgInt, (void *) &wpMoveHistory.width, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "moveHistoryH", ArgInt, (void *) &wpMoveHistory.height, TRUE, (ArgIniType) CW_USEDEFAULT },
+
+  { "evalGraphUp", ArgBoolean, (void *) &wpEvalGraph.visible, TRUE, (ArgIniType) TRUE },
+  { "evalGraphX", ArgX,   (void *) &wpEvalGraph.x, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "evalGraphY", ArgY,   (void *) &wpEvalGraph.y, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "evalGraphW", ArgInt, (void *) &wpEvalGraph.width, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "evalGraphH", ArgInt, (void *) &wpEvalGraph.height, TRUE, (ArgIniType) CW_USEDEFAULT },
+
+  { "engineOutputUp", ArgBoolean, (void *) &wpEngineOutput.visible, TRUE, (ArgIniType) TRUE },
+  { "engineOutputX", ArgX,   (void *) &wpEngineOutput.x, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "engineOutputY", ArgY,   (void *) &wpEngineOutput.y, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "engineOutputW", ArgInt, (void *) &wpEngineOutput.width, TRUE, (ArgIniType) CW_USEDEFAULT },
+  { "engineOutputH", ArgInt, (void *) &wpEngineOutput.height, TRUE, (ArgIniType) CW_USEDEFAULT },
+
+  { NULL, ArgNone, NULL, FALSE, INVALID }
+};
+
+
+/* Kludge for indirection files on command line */
+char* lastIndirectionFilename;
+ArgDescriptor argDescriptorIndirection =
+{ "", ArgSettingsFilename, (void *) NULL, FALSE };
+
+void
+ExitArgError(char *msg, char *badArg)
+{
+  char buf[MSG_SIZ];
+
+  sprintf(buf, "%s %s", msg, badArg);
+  DisplayFatalError(buf, 0, 2);
+  exit(2);
+}
+
+
+char
+StringGet(void *getClosure)
+{
+  char **p = (char **) getClosure;
+  return *((*p)++);
+}
+
+char
+FileGet(void *getClosure)
+{
+  int c;
+  FILE* f = (FILE*) getClosure;
+
+  c = getc(f);
+  if (c == '\r') c = getc(f); // work around DOS format files by bypassing the '\r' completely
+  if (c == EOF)
+    return NULLCHAR;
+  else
+    return (char) c;
+}
+
+/* Parse settings file named "name". If file found, return the
+   full name in fullname and return TRUE; else return FALSE */
+Boolean
+ParseSettingsFile(char *name, char **addr)
+{
+  FILE *f;
+  int ok; char buf[MSG_SIZ], fullname[MSG_SIZ];
+
+  ok = MySearchPath(installDir, name, fullname);
+  if(!ok && strchr(name, '.') == NULL) { // [HGM] append default file-name extension '.ini' when needed
+    sprintf(buf, "%s.ini", name);
+    ok = MySearchPath(installDir, buf, fullname);
+  }
+  if (ok) {
+    f = fopen(fullname, "r");
+    if (f != NULL) {
+      if (addr != NULL) {
+           *addr = strdup(fullname);
+      }
+      ParseArgs(FileGet, f);
+      fclose(f);
+      return TRUE;
+    }
+  }
+  return FALSE;
+}
+
+void
+ParseArgs(GetFunc get, void *cl)
+{
+  char argName[MAX_ARG_LEN];
+  char argValue[MAX_ARG_LEN];
+  ArgDescriptor *ad;
+  char start;
+  char *q;
+  int i, octval;
+  char ch;
+  int posarg = 0;
+
+  ch = get(cl);
+  for (;;) {
+    while (ch == ' ' || ch == '\n' || ch == '\t') ch = get(cl);
+    if (ch == NULLCHAR) break;
+    if (ch == ';') {
+      /* Comment to end of line */
+      ch = get(cl);
+      while (ch != '\n' && ch != NULLCHAR) ch = get(cl);
+      continue;
+    } else if (ch == '/' || ch == '-') {
+      /* Switch */
+      q = argName;
+      while (ch != ' ' && ch != '=' && ch != ':' && ch != NULLCHAR &&
+            ch != '\n' && ch != '\t') {
+       *q++ = ch;
+       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);
+
+    } else if (ch == '@') {
+      /* Indirection file */
+      ad = &argDescriptorIndirection;
+      ch = get(cl);
+    } else {
+      /* Positional argument */
+      ad = &argDescriptors[posarg++];
+      strcpy(argName, ad->argName);
+    }
+
+    if (ad->argType == ArgTrue) {
+      *(Boolean *) ad->argLoc = TRUE;
+      continue;
+    }
+    if (ad->argType == ArgFalse) {
+      *(Boolean *) ad->argLoc = FALSE;
+      continue;
+    }
+
+    while (ch == ' ' || ch == '=' || ch == ':' || ch == '\t') ch = get(cl);
+    if (ch == NULLCHAR || ch == '\n') {
+      ExitArgError("No value provided for argument", argName);
+    }
+    q = argValue;
+    if (ch == '{') {
+      // Quoting with { }.  No characters have to (or can) be escaped.
+      // Thus the string cannot contain a '}' character.
+      start = ch;
+      ch = get(cl);
+      while (start) {
+       switch (ch) {
+       case NULLCHAR:
+         start = NULLCHAR;
+         break;
+         
+       case '}':
+         ch = get(cl);
+         start = NULLCHAR;
+         break;
+
+       default:
+         *q++ = ch;
+         ch = get(cl);
+         break;
+       }
+      }          
+    } else if (ch == '\'' || ch == '"') {
+      // Quoting with ' ' or " ", with \ as escape character.
+      // Inconvenient for long strings that may contain Windows filenames.
+      start = ch;
+      ch = get(cl);
+      while (start) {
+       switch (ch) {
+       case NULLCHAR:
+         start = NULLCHAR;
+         break;
+
+       default:
+        not_special:
+         *q++ = ch;
+         ch = get(cl);
+         break;
+
+       case '\'':
+       case '\"':
+         if (ch == start) {
+           ch = get(cl);
+           start = NULLCHAR;
+           break;
+         } else {
+           goto not_special;
+         }
+
+       case '\\':
+          if (ad->argType == ArgFilename
+             || ad->argType == ArgSettingsFilename) {
+             goto not_special;
+         }
+         ch = get(cl);
+         switch (ch) {
+         case NULLCHAR:
+           ExitArgError("Incomplete \\ escape in value for", argName);
+           break;
+         case 'n':
+           *q++ = '\n';
+           ch = get(cl);
+           break;
+         case 'r':
+           *q++ = '\r';
+           ch = get(cl);
+           break;
+         case 't':
+           *q++ = '\t';
+           ch = get(cl);
+           break;
+         case 'b':
+           *q++ = '\b';
+           ch = get(cl);
+           break;
+         case 'f':
+           *q++ = '\f';
+           ch = get(cl);
+           break;
+         default:
+           octval = 0;
+           for (i = 0; i < 3; i++) {
+             if (ch >= '0' && ch <= '7') {
+               octval = octval*8 + (ch - '0');
+               ch = get(cl);
+             } else {
+               break;
+             }
+           }
+           if (i > 0) {
+             *q++ = (char) octval;
+           } else {
+             *q++ = ch;
+             ch = get(cl);
+           }
+           break;
+         }
+         break;
+       }
+      }
+    } else {
+      while (ch != ' ' && ch != NULLCHAR && ch != '\t' && ch != '\n') {
+       *q++ = ch;
+       ch = get(cl);
+      }
+    }
+    *q = NULLCHAR;
+
+    switch (ad->argType) {
+    case ArgInt:
+      *(int *) ad->argLoc = atoi(argValue);
+      break;
+
+    case ArgX:
+      *(int *) ad->argLoc = atoi(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...)
+      break;
+
+    case ArgZ:
+      *(int *) ad->argLoc = atoi(argValue);
+      EnsureOnScreen(&wpMain.x, &wpMain.y, minX, minY); 
+      break;
+
+    case ArgFloat:
+      *(float *) ad->argLoc = (float) atof(argValue);
+      break;
+
+    case ArgString:
+    case ArgFilename:
+      *(char **) ad->argLoc = strdup(argValue);
+      break;
+
+    case ArgSettingsFilename:
+      {
+       if (ParseSettingsFile(argValue, (char**)ad->argLoc)) {
+       } else {
+         if (ad->argLoc != NULL) {
+         } else {
+           ExitArgError("Failed to open indirection file", argValue);
+         }
+       }
+      }
+      break;
+
+    case ArgBoolean:
+      switch (argValue[0]) {
+      case 't':
+      case 'T':
+       *(Boolean *) ad->argLoc = TRUE;
+       break;
+      case 'f':
+      case 'F':
+       *(Boolean *) ad->argLoc = FALSE;
+       break;
+      default:
+       ExitArgError("Unrecognized boolean argument value", argValue);
+       break;
+      }
+      break;
+
+    case ArgColor:
+      ParseColor((int)ad->argLoc, argValue);
+      break;
+
+    case ArgAttribs: {
+      ColorClass cc = (ColorClass)ad->argLoc;
+       ParseTextAttribs(cc, argValue); // [HGM] wrapper for platform independency
+      }
+      break;
+      
+    case ArgBoardSize:
+      ParseBoardSize(ad->argLoc, argValue);
+      break;
+
+    case ArgFont:
+      ParseFont(argValue, (int)ad->argLoc);
+      break;
+
+    case ArgCommSettings:
+      ParseCommPortSettings(argValue);
+      break;
+
+    case ArgNone:
+      ExitArgError("Unrecognized argument", argValue);
+      break;
+    case ArgTrue:
+    case ArgFalse: ;
+    }
+  }
+}
+
+void
+ParseIcsTextMenu(char *icsTextMenuString)
+{
+//  int flags = 0;
+  IcsTextMenuEntry *e = icsTextMenuEntry;
+  char *p = icsTextMenuString;
+  while (e->item != NULL && e < icsTextMenuEntry + ICS_TEXT_MENU_SIZE) {
+    free(e->item);
+    e->item = NULL;
+    if (e->command != NULL) {
+      free(e->command);
+      e->command = NULL;
+    }
+    e++;
+  }
+  e = icsTextMenuEntry;
+  while (*p && e < icsTextMenuEntry + ICS_TEXT_MENU_SIZE) {
+    if (*p == ';' || *p == '\n') {
+      e->item = strdup("-");
+      e->command = NULL;
+      p++;
+    } else if (*p == '-') {
+      e->item = strdup("-");
+      e->command = NULL;
+      p++;
+      if (*p) p++;
+    } else {
+      char *q, *r, *s, *t;
+      char c;
+      q = strchr(p, ',');
+      if (q == NULL) break;
+      *q = NULLCHAR;
+      r = strchr(q + 1, ',');
+      if (r == NULL) break;
+      *r = NULLCHAR;
+      s = strchr(r + 1, ',');
+      if (s == NULL) break;
+      *s = NULLCHAR;
+      c = ';';
+      t = strchr(s + 1, c);
+      if (t == NULL) {
+       c = '\n';
+       t = strchr(s + 1, c);
+      }
+      if (t != NULL) *t = NULLCHAR;
+      e->item = strdup(p);
+      e->command = strdup(q + 1);
+      e->getname = *(r + 1) != '0';
+      e->immediate = *(s + 1) != '0';
+      *q = ',';
+      *r = ',';
+      *s = ',';
+      if (t == NULL) break;
+      *t = c;
+      p = t + 1;
+    }
+    e++;
+  } 
+}
+
+void
+SetDefaultTextAttribs()
+{
+  ColorClass cc;
+  for (cc = (ColorClass)0; cc < ColorNone; cc++) {
+    ParseTextAttribs(cc, defaultTextAttribs[cc]);
+  }
+}
+
+void
+SetDefaultsFromList()
+{ // [HGM] ini: take defaults from argDescriptor list
+  int i;
+
+  for(i=0; argDescriptors[i].argName != NULL; i++) {
+    if(argDescriptors[i].defaultValue != INVALID)
+      switch(argDescriptors[i].argType) {
+        case ArgBoolean:
+        case ArgTrue:
+        case ArgFalse:
+          *(Boolean *) argDescriptors[i].argLoc = (int)argDescriptors[i].defaultValue;
+          break;
+        case ArgInt:
+        case ArgX:
+        case ArgY:
+        case ArgZ:
+          *(int *) argDescriptors[i].argLoc = (int)argDescriptors[i].defaultValue;
+          break;
+        case ArgString:
+        case ArgFilename:
+        case ArgSettingsFilename:
+          *(char **) argDescriptors[i].argLoc = (char *)argDescriptors[i].defaultValue;
+          break;
+        case ArgBoardSize:
+          *(int *) argDescriptors[i].argLoc = (int)argDescriptors[i].defaultValue;
+          break;
+        case ArgColor:
+          ParseColor((int)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
+    }
+  }
+}
+
+void
+InitAppData(char *lpCmdLine)
+{
+  int i;
+  char buf[MAX_ARG_LEN], currDir[MSG_SIZ];
+  char *p;
+
+  /* Initialize to defaults */
+  SetDefaultsFromList(); // this sets most defaults
+
+  // some parameters for which there are no options!
+  appData.Iconic = FALSE; /*unused*/
+  appData.icsEngineAnalyze = FALSE;
+
+  // float: casting to int is not harmless, so default cannot be contained in table
+  appData.timeDelay = TIME_DELAY;
+
+  // some complex, platform-dependent stuff that could not be handled from table
+  SetDefaultTextAttribs();
+  SetFontDefaults();
+  SetCommPortDefaults();
+
+  /* Parse default settings file if any */
+  ParseSettingsFile(settingsFileName, &settingsFileName);
+
+  /* Parse command line */
+  ParseArgs(StringGet, &lpCmdLine);
+
+  /* [HGM] make sure board size is acceptable */
+  if(appData.NrFiles > BOARD_FILES ||
+     appData.NrRanks > BOARD_RANKS   )
+      DisplayFatalError("Recompile with BOARD_RANKS or BOARD_FILES, to support this size", 0, 2);
+
+  /* [HGM] After parsing the options from the .ini file, and overruling them
+   * with options from the command line, we now make an even higher priority
+   * overrule by WB options attached to the engine command line. This so that
+   * tournament managers can use WB options (such as /timeOdds) that follow
+   * the engines.
+   */
+  if(appData.firstChessProgram != NULL) {
+      char *p = StrStr(appData.firstChessProgram, "WBopt");
+      static char *f = "first";
+      char buf[MSG_SIZ], *q = buf;
+      if(p != NULL) { // engine command line contains WinBoard options
+          sprintf(buf, p+6, f, f, f, f, f, f, f, f, f, f); // replace %s in them by "first"
+          ParseArgs(StringGet, &q);
+          p[-1] = 0; // cut them offengine command line
+      }
+  }
+  // now do same for second chess program
+  if(appData.secondChessProgram != NULL) {
+      char *p = StrStr(appData.secondChessProgram, "WBopt");
+      static char *s = "second";
+      char buf[MSG_SIZ], *q = buf;
+      if(p != NULL) { // engine command line contains WinBoard options
+          sprintf(buf, p+6, s, s, s, s, s, s, s, s, s, s); // replace %s in them by "first"
+          ParseArgs(StringGet, &q);
+          p[-1] = 0; // cut them offengine command line
+      }
+  }
+
+  /* Propagate options that affect others */
+  if (appData.matchMode || appData.matchGames) chessProgram = TRUE;
+  if (appData.icsActive || appData.noChessProgram) {
+     chessProgram = FALSE;  /* not local chess program mode */
+  }
+
+  /* Open startup dialog if needed */
+  if ((!appData.noChessProgram && !chessProgram && !appData.icsActive) ||
+      (appData.icsActive && *appData.icsHost == NULLCHAR) ||
+      (chessProgram && (*appData.firstChessProgram == NULLCHAR ||
+                        *appData.secondChessProgram == NULLCHAR))) 
+               PopUpStartupDialog();
+
+  /* Make sure save files land in the right (?) directory */
+  if (MyGetFullPathName(appData.saveGameFile, buf)) {
+    appData.saveGameFile = strdup(buf);
+  }
+  if (MyGetFullPathName(appData.savePositionFile, buf)) {
+    appData.savePositionFile = strdup(buf);
+  }
+
+  /* Finish initialization for fonts and sounds */
+  CreateFonts();
+
+  GetCurrentDirectory(MSG_SIZ, currDir);
+  SetCurrentDirectory(installDir);
+  LoadAllSounds();
+  SetCurrentDirectory(currDir);
+
+  p = icsTextMenuString;
+  if (p[0] == '@') {
+    FILE* f = fopen(p + 1, "r");
+    if (f == NULL) {
+      DisplayFatalError(p + 1, errno, 2);
+      return;
+    }
+    i = fread(buf, 1, sizeof(buf)-1, f);
+    fclose(f);
+    buf[i] = NULLCHAR;
+    p = buf;
+  }
+  ParseIcsTextMenu(strdup(p));
+}
+
+void
+SaveSettings(char* name)
+{
+  FILE *f;
+  ArgDescriptor *ad;
+  char dir[MSG_SIZ], buf[MSG_SIZ];
+
+  if (!MainWindowUp()) return;
+
+  GetCurrentDirectory(MSG_SIZ, dir);
+  if(MySearchPath(installDir, name, buf)) {
+    f = fopen(buf, "w");
+  } else {
+    SetCurrentDirectory(installDir);
+    f = fopen(name, "w");
+    SetCurrentDirectory(dir);
+  }
+  if (f == NULL) {
+    DisplayError(name, errno);
+    return;
+  }
+
+  fprintf(f, ";\n");
+  fprintf(f, "; %s Save Settings file\n", PACKAGE_STRING);
+  fprintf(f, ";\n");
+  fprintf(f, "; You can edit the values of options that are already set in this file,\n");
+  fprintf(f, "; but if you add other options, the next Save Settings will not save them.\n");
+  fprintf(f, "; Use a shortcut, an @indirection file, or a .bat file instead.\n");
+  fprintf(f, ";\n");
+
+  GetWindowCoords();
+
+  /* [AS] Move history */
+  wpMoveHistory.visible = MoveHistoryIsUp();
+
+  /* [AS] Eval graph */
+  wpEvalGraph.visible = EvalGraphIsUp();
+
+  /* [AS] Engine output */
+  wpEngineOutput.visible = EngineOutputIsUp();
+
+  // [HGM] in WB we have to copy sound names to appData first
+  ExportSounds();
+
+  for (ad = argDescriptors; ad->argName != NULL; ad++) {
+    if (!ad->save) continue;
+    switch (ad->argType) {
+    case ArgString:
+      {
+       char *p = *(char **)ad->argLoc;
+       if(p == NULL) break; // just in case
+       if ((strchr(p, '\\') || strchr(p, '\n')) && !strchr(p, '}')) {
+         /* Quote multiline values or \-containing values
+            with { } if possible */
+         fprintf(f, OPTCHAR "%s" SEPCHAR "{%s}\n", ad->argName, p);
+       } else {
+         /* Else quote with " " */
+         fprintf(f, OPTCHAR "%s" SEPCHAR "\"", ad->argName);
+         while (*p) {
+           if (*p == '\n') fprintf(f, "\n");
+           else if (*p == '\r') fprintf(f, "\\r");
+           else if (*p == '\t') fprintf(f, "\\t");
+           else if (*p == '\b') fprintf(f, "\\b");
+           else if (*p == '\f') fprintf(f, "\\f");
+           else if (*p < ' ') fprintf(f, "\\%03o", *p);
+           else if (*p == '\"') fprintf(f, "\\\"");
+           else if (*p == '\\') fprintf(f, "\\\\");
+           else putc(*p, f);
+           p++;
+         }
+         fprintf(f, "\"\n");
+       }
+      }
+      break;
+    case ArgInt:
+    case ArgZ:
+      fprintf(f, OPTCHAR "%s" SEPCHAR "%d\n", ad->argName, *(int *)ad->argLoc);
+      break;
+    case ArgX:
+      fprintf(f, OPTCHAR "%s" SEPCHAR "%d\n", ad->argName, *(int *)ad->argLoc - wpMain.x); // [HGM] placement: store relative value
+      break;
+    case ArgY:
+      fprintf(f, OPTCHAR "%s" SEPCHAR "%d\n", ad->argName, *(int *)ad->argLoc - wpMain.y);
+      break;
+    case ArgFloat:
+      fprintf(f, OPTCHAR "%s" SEPCHAR "%g\n", ad->argName, *(float *)ad->argLoc);
+      break;
+    case ArgBoolean:
+      fprintf(f, OPTCHAR "%s" SEPCHAR "%s\n", ad->argName, 
+       (*(Boolean *)ad->argLoc) ? "true" : "false");
+      break;
+    case ArgTrue:
+      if (*(Boolean *)ad->argLoc) fprintf(f, OPTCHAR "%s\n", ad->argName);
+      break;
+    case ArgFalse:
+      if (!*(Boolean *)ad->argLoc) fprintf(f, OPTCHAR "%s\n", ad->argName);
+      break;
+    case ArgColor:
+      SaveColor(f, ad);
+      break;
+    case ArgAttribs:
+      SaveAttribsArg(f, ad);
+      break;
+    case ArgFilename:
+      if(*(char**)ad->argLoc == NULL) break; // just in case
+      if (strchr(*(char **)ad->argLoc, '\"')) {
+       fprintf(f, OPTCHAR "%s" SEPCHAR "'%s'\n", ad->argName, *(char **)ad->argLoc);
+      } else {
+       fprintf(f, OPTCHAR "%s" SEPCHAR "\"%s\"\n", ad->argName, *(char **)ad->argLoc);
+      }
+      break;
+    case ArgBoardSize:
+      SaveBoardSize(f, ad->argName, ad->argLoc);
+      break;
+    case ArgFont:
+      SaveFontArg(f, ad);
+      break;
+    case ArgCommSettings:
+      PrintCommPortSettings(f, ad->argName);
+    case ArgNone:
+    case ArgSettingsFilename: ;
+    }
+  }
+  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;
+}
index 4808895..96e898a 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -2052,7 +2052,7 @@ read_from_ics(isr, closure, data, count, error)
      int count;
      int error;
 {
-#define BUF_SIZE 8192
+#define BUF_SIZE (16*1024) /* overflowed at 8K with "inchannel 1" on FICS? */
 #define STARTED_NONE 0
 #define STARTED_MOVES 1
 #define STARTED_BOARD 2
@@ -6964,8 +6964,13 @@ if(appData.debugMode) fprintf(debugFP, "nodes = %d, %lld\n", (int) programStats.
                }
 
                 /* [AS] Negate score if machine is playing black and reporting absolute scores */
-                if( cps->scoreIsAbsolute &&
-                    ((gameMode == MachinePlaysBlack) || (gameMode == TwoMachinesPlay && cps->twoMachinesColor[0] == 'b')) )
+                if( cps->scoreIsAbsolute && 
+                    ( gameMode == MachinePlaysBlack ||
+                      gameMode == TwoMachinesPlay && cps->twoMachinesColor[0] == 'b' ||
+                      gameMode == IcsPlayingBlack ||     // [HGM] also add other situations where engine should report black POV
+                     (gameMode == AnalyzeMode || gameMode == AnalyzeFile || gameMode == IcsObserving && appData.icsEngineAnalyze) &&
+                     !WhiteOnMove(currentMove)
+                    ) )
                 {
                     curscore = -curscore;
                 }
@@ -13761,7 +13766,7 @@ PositionToFEN(move, overrideCastling)
     *p++ = ' ';
 
   if(q = overrideCastling) { // [HGM] FRC: override castling & e.p fields for non-compliant engines
-    while(*p++ = *q++); if(q != overrideCastling+1) p[-1] = ' ';
+    while(*p++ = *q++); if(q != overrideCastling+1) p[-1] = ' '; else --p;
   } else {
   if(nrCastlingRights) {
      q = p;
index 3ad4966..26a61f6 100644 (file)
--- a/backend.h
+++ b/backend.h
@@ -203,12 +203,14 @@ char *VariantName P((VariantClass v));
 VariantClass StringToVariant P((char *e));
 double u64ToDouble P((u64 value));
 void OutputChatMessage P((int partner, char *mess));
-
+void EditPositionDone P((Boolean fakeRights));
+Boolean GetArgValue P((char *name));
 
 char *StrStr P((char *string, char *match));
 char *StrCaseStr P((char *string, char *match));
 char *StrSave P((char *s));
 char *StrSavePtr P((char *s, char **savePtr));
+char *SavePart P((char *));
 
 #ifndef _amigados
 int StrCaseCmp P((char *s1, char *s2));
index 03f7bb0..cd21c7e 100644 (file)
--- a/common.h
+++ b/common.h
@@ -173,6 +173,15 @@ int pclose(FILE *);
 #define NULLCHAR                '\000'
 #define FEATURE_TIMEOUT         10000 /*ms*/
 
+#define CLOCK_FONT 0
+#define MESSAGE_FONT 1
+#define COORD_FONT 2
+#define CONSOLE_FONT 3
+#define COMMENT_FONT 4
+#define EDITTAGS_FONT 5
+#define MOVEHISTORY_FONT 6
+#define NUM_FONTS 7
+
 /* Default to no flashing (the "usual" XBoard behavior) */
 #define FLASH_COUNT    0               /* Number of times to flash */
 #define FLASH_RATE     5               /* Flashes per second */
@@ -180,6 +189,11 @@ int pclose(FILE *);
 /* Default delay per character (in msec) while sending login script */
 #define MS_LOGIN_DELAY  0
 
+/* [AS] Support for background textures */
+#define BACK_TEXTURE_MODE_DISABLED      0
+#define BACK_TEXTURE_MODE_PLAIN         1
+#define BACK_TEXTURE_MODE_FULL_RANDOM   2
+
 /* Zippy defaults */
 #define ZIPPY_TALK FALSE
 #define ZIPPY_PLAY FALSE
@@ -543,6 +557,7 @@ typedef struct {
     Boolean secondIsUCI;
     Boolean firstHasOwnBookUCI;
     Boolean secondHasOwnBookUCI;
+    char * adapterCommand;
     char * polyglotDir;
     Boolean usePolyglotBook;
     char * polyglotBook;
@@ -678,6 +693,21 @@ typedef struct {
     int time;   /* Milliseconds */
 } ChessProgramStats_Move;
 
+/* [AS] Layout management */
+typedef struct {
+    Boolean visible;
+    int x;
+    int y;
+    int width;
+    int height;
+} WindowPlacement;
+
+extern WindowPlacement wpEngineOutput;
+extern WindowPlacement wpEvalGraph;
+extern WindowPlacement wpMoveHistory;
+extern WindowPlacement wpGameList;
+extern WindowPlacement wpTags;
+
 // [HGM] chat  
 #define MAX_CHAT 3
 extern int chatCount;
index 5d8e00e..3bf8303 100644 (file)
@@ -111,6 +111,8 @@ AC_CHECK_FUNC(setlocale, [],
 
 AC_CHECK_LIB(seq, getpseudotty)
 
+
+dnl | check for X-libraries
 AC_PATH_XTRA
 if test -n "$no_x" ; then
   echo $PACKAGE requires the X Window System header files and libraries!
@@ -335,7 +337,6 @@ dnl| USE_PTYS=1
 
 dnl| add some libs for OS X
   *-apple-* )
-    X_LIBS="$X_LIBS -lXmu -lX11 -lXt "    
   ;;
 esac
 
@@ -412,6 +413,13 @@ enable_sigint=$enableval
 AC_DEFINE(ATTENTION, 1)])
 
 
+dnl | save all information for X in X_LIBS, also add the libraries themself
+dnl | since AC_PATH_XTRA only adds the paths
+X_LIBS="$X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS -lXmu -lX11 -lXt "    
+AC_SUBST(X_CFLAGS)
+AC_SUBST(X_LIBS)
+
+
 AC_CONFIG_FILES([Makefile cmail])
 AC_CONFIG_COMMANDS([test-stamp-h],[test -z "$CONFIG_HEADERS" || date > stamp-h])
 AC_CONFIG_COMMANDS([chmod-cmail],[chmod 755 cmail])
index 9b43b46..fb49e57 100644 (file)
@@ -206,5 +206,9 @@ void EngineOutputPopUp P((void));
 void EngineOutputPopDown P((void));
 int  EngineOutputIsUp P((void));
 int  EngineOutputDialogExists P((void));
+void EvalGraphPopUp P((void));
+void EvalGraphPopDown P((void));
+Boolean EvalGraphIsUp P((void));
+int  EvalGraphDialogExists P((void));
 
 #endif
index 64cb593..7a2cf7e 100644 (file)
                           </object>
                         </child>
                         <child>
-                          <object class="GtkCheckMenuItem" id="menuOptions.Show Thinking">
+                          <object class="GtkCheckMenuItem" id="menuOptions.Hide Thinking">
                             <property name="visible">True</property>
-                            <property name="label" translatable="yes">Show Thinking</property>
+                            <property name="label" translatable="yes">Hide Thinking</property>
                             <property name="use_underline">True</property>
                             <signal name="toggled" handler="HideThinkingProc"/>
                           </object>
index 6283f88..65f0a0a 100644 (file)
@@ -48,19 +48,19 @@ static char *asdd72[] = {
 "......       ......      XX            XX            ......       ......",\r
 ".....         ....        XX            XX            ....         .....",\r
 "....           ..          XX            XX            ..           ....",\r
-"....            ..          XX            XX          ..            ....",\r
-"....             ..          XX            XX        ..             ....",\r
-"....              ..      X   XX            XX      ..              ....",\r
-".....              ..    XX    XX            XX    ..              .....",\r
-"......              ..   X      XX            X   ..              ......",\r
-".......              ..          X               ..              .......",\r
-"........              ..                        ..              ........",\r
-".........              ..          ..          ..              .........",\r
-"............            ..        ....        ..            ............",\r
-".............            ..      ......      ..            .............",\r
-"............ X            ..    ........    ..            X ............",\r
-"...........   X            ..  ..........  ..            X   ...........",\r
-"..........     X            ................            X     ..........",\r
+"....            XX          XX            XX          XX            ....",\r
+"....             XX          XX            XX        XX             ....",\r
+"....              XX      X   XX            XX      XX              ....",\r
+".....              XX    XX    XX            XX    XX              .....",\r
+"......              XX   X      XX            X   XX              ......",\r
+".......              XX          X               XX              .......",\r
+"........              XX                        XX              ........",\r
+".........              XX          ..          XX              .........",\r
+"............            XX        ....        XX            ............",\r
+".............            XX      ......      XX            .............",\r
+"............ X            XX    ........    XX            X ............",\r
+"...........   X            XX  ..........  XX            X   ...........",\r
+"..........     X            XX............XX            X     ..........",\r
 ".........       X            ..............            X       .........",\r
 "........         X            ............            X         ........",\r
 ".......           X            ..........            X           .......",\r
index 656c0d9..6dcd22e 100644 (file)
@@ -48,19 +48,19 @@ static char *asdl72[] = {
 "......       ......      XX            XX            ......       ......",\r
 ".....         ....        XX            XX            ....         .....",\r
 "....           ..          XX            XX            ..           ....",\r
-"....            ..          XX            XX          ..            ....",\r
-"....             ..          XX            XX        ..             ....",\r
-"....              ..      X   XX            XX      ..              ....",\r
-".....              ..    XX    XX            XX    ..              .....",\r
-"......              ..   X      XX            X   ..              ......",\r
-".......              ..          X               ..              .......",\r
-"........              ..                        ..              ........",\r
-".........              ..          ..          ..              .........",\r
-"............            ..        ....        ..            ............",\r
-".............            ..      ......      ..            .............",\r
-"............ X            ..    ........    ..            X ............",\r
-"...........   X            ..  ..........  ..            X   ...........",\r
-"..........     X            ................            X     ..........",\r
+"....            XX          XX            XX          XX            ....",\r
+"....             XX          XX            XX        XX             ....",\r
+"....              XX      X   XX            XX      XX              ....",\r
+".....              XX    XX    XX            XX    XX              .....",\r
+"......              XX   X      XX            X   XX              ......",\r
+".......              XX          X               XX              .......",\r
+"........              XX                        XX              ........",\r
+".........              XX          ..          XX              .........",\r
+"............            XX        ....        XX            ............",\r
+".............            XX      ......      XX            .............",\r
+"............ X            XX    ........    XX            X ............",\r
+"...........   X            XX  ..........  XX            X   ...........",\r
+"..........     X            XX............XX            X     ..........",\r
 ".........       X            ..............            X       .........",\r
 "........         X            ............            X         ........",\r
 ".......           X            ..........            X           .......",\r
index 8f13c79..25d7b5d 100644 (file)
@@ -14,22 +14,22 @@ static char *cvdd37[] = {
 "...............  XXX   XX  ..........",\r
 "..............  X           .........",\r
 ".............  X        XX  .........",\r
-"............  .           X  ........",\r
-"............ ..           X  ........",\r
-"...........  .                .......",\r
-"........... ..     X          .......",\r
-"........... .                  ......",\r
-".......... ..                  ......",\r
-".......... ..       ..          .....",\r
-".......... .        ....     XX .....",\r
-"............         ....     X .....",\r
-"......... ..          ....  X   .....",\r
-"......... ..          .....    ......",\r
-"......... ..           ..............",\r
-"......... ..            .............",\r
-"......... ..             ............",\r
-"......... ..              ...........",\r
-"......... .               ...........",\r
+"............  X           X  ........",\r
+"............ XX           X  ........",\r
+"...........  X                .......",\r
+"........... XX     X          .......",\r
+"........... X                  ......",\r
+".......... XX                  ......",\r
+".......... XX       ..          .....",\r
+".......... X        ....     XX .....",\r
+"..........XX         ....     X .....",\r
+"......... XX          ....  X   .....",\r
+"......... XX          .....    ......",\r
+"......... XX           ..............",\r
+"......... XX            .............",\r
+"......... XX             ............",\r
+"......... XX              ...........",\r
+"......... X               ...........",\r
 ".........                 ...........",\r
 ".......... XXXXXXXXXXXXXX ...........",\r
 ".........                  ..........",\r
index 11f9175..4dbdc6c 100644 (file)
@@ -16,27 +16,27 @@ static char *cvdd45[] = {
 ".................  XX         X   ...........",\r
 "................  X               ...........",\r
 "...............  X            X    ..........",\r
-"..............  .             XX   ..........",\r
-".............. ..              XX  ..........",\r
-".............  .                    .........",\r
-"............. ..                    .........",\r
-"............  .                     .........",\r
-"............ ..        X             ........",\r
-"............ .                       ........",\r
-"..............          .             .......",\r
-"........... ..          ..             ......",\r
-"........... ..          ....        XX ......",\r
-"........... .            .....       X ......",\r
-".............            ......        ......",\r
-".............             ......  X    ......",\r
-".......... ..              .....      .......",\r
-".......... ..              ...... ...........",\r
-".......... ..               .................",\r
-".......... ..                ................",\r
-".......... ..                 ...............",\r
-".......... ..                 ...............",\r
-".......... ..                  ..............",\r
-".......... .                   ..............",\r
+"..............  X             XX   ..........",\r
+".............. XX              XX  ..........",\r
+".............  X                    .........",\r
+"............. XX                    .........",\r
+"............  X                     .........",\r
+"............ XX        X             ........",\r
+"............ X                       ........",\r
+"............XX          .             .......",\r
+"........... XX          ..             ......",\r
+"........... XX          ....        XX ......",\r
+"........... X            .....       X ......",\r
+"...........XX            ......        ......",\r
+"...........XX             ......  X    ......",\r
+".......... XX              .....      .......",\r
+".......... XX              ...... ...........",\r
+".......... XX               .................",\r
+".......... XX                ................",\r
+".......... XX                 ...............",\r
+".......... XX                 ...............",\r
+".......... XX                  ..............",\r
+".......... X                   ..............",\r
 "..........                     ..............",\r
 ".......... XXXXXXXXXXXXXXXXXXX ..............",\r
 ".........                       .............",\r
index 47bc2c0..c282075 100644 (file)
@@ -16,30 +16,30 @@ static char *cvdd49[] = {
 "..................  XX               ............",\r
 ".................  X                 ............",\r
 "................  X             XX    ...........",\r
-"...............  .               XX   ...........",\r
-"............... ..                XX  ...........",\r
-".............. ..                  X  ...........",\r
-".............. ..                      ..........",\r
-"............. ..                       ..........",\r
-"............. ..                        .........",\r
-"............  .          X               ........",\r
-"............ ..                          ........",\r
-"............ ..           .               .......",\r
-"............ .            ..              .......",\r
-"........... ..            ....         XX  ......",\r
-"........... ..             .....       XX  ......",\r
-"........... ..             ......       X  ......",\r
-"........... .               ......   X     ......",\r
-"........... .               .......       .......",\r
-".............                .......     ........",\r
-".......... ..                 ....... ...........",\r
-".......... ..                  ..................",\r
-".......... ..                   .................",\r
-".......... ..                   .................",\r
-".......... ..                    ................",\r
-".......... ..                    ................",\r
-".......... ...                    ...............",\r
-"........... ..................... ...............",\r
+"...............  X               XX   ...........",\r
+"............... XX                XX  ...........",\r
+".............. XX                  X  ...........",\r
+".............. XX                      ..........",\r
+"............. XX                       ..........",\r
+"............. XX                        .........",\r
+"............  X          X               ........",\r
+"............ XX                          ........",\r
+"............ XX           .               .......",\r
+"............ X            ..              .......",\r
+"........... XX            ....         XX  ......",\r
+"........... XX             .....       XX  ......",\r
+"........... XX             ......       X  ......",\r
+"........... X               ......   X     ......",\r
+"........... X               .......       .......",\r
+"...........XX                .......     ........",\r
+".......... XX                 ....... ...........",\r
+".......... XX                  ..................",\r
+".......... XX                   .................",\r
+".......... XX                   .................",\r
+".......... XX                    ................",\r
+".......... XX                    ................",\r
+".......... XXX                    ...............",\r
+"........... XXXXXXXXXXXXXXXXXXXXX ...............",\r
 "...........                       ...............",\r
 "...........                       ...............",\r
 "........... XXXXXXXXXXXXXXXXXXXXX ...............",\r
index 841c801..58ce819 100644 (file)
@@ -14,22 +14,22 @@ static char *cvdl37[] = {
 "...............  XXX   XX  ..........",\r
 "..............  X           .........",\r
 ".............  X        XX  .........",\r
-"............  .           X  ........",\r
-"............ ..           X  ........",\r
-"...........  .                .......",\r
-"........... ..     X          .......",\r
-"........... .                  ......",\r
-".......... ..                  ......",\r
-".......... ..       ..          .....",\r
-".......... .        ....     XX .....",\r
-"............         ....     X .....",\r
-"......... ..          ....  X   .....",\r
-"......... ..          .....    ......",\r
-"......... ..           ..............",\r
-"......... ..            .............",\r
-"......... ..             ............",\r
-"......... ..              ...........",\r
-"......... .               ...........",\r
+"............  X           X  ........",\r
+"............ XX           X  ........",\r
+"...........  X                .......",\r
+"........... XX     X          .......",\r
+"........... X                  ......",\r
+".......... XX                  ......",\r
+".......... XX       ..          .....",\r
+".......... X        ....     XX .....",\r
+"..........XX         ....     X .....",\r
+"......... XX          ....  X   .....",\r
+"......... XX          .....    ......",\r
+"......... XX           ..............",\r
+"......... XX            .............",\r
+"......... XX             ............",\r
+"......... XX              ...........",\r
+"......... X               ...........",\r
 ".........                 ...........",\r
 ".......... XXXXXXXXXXXXXX ...........",\r
 ".........                  ..........",\r
index 63a169f..92e9061 100644 (file)
@@ -16,27 +16,27 @@ static char *cvdl45[] = {
 ".................  XX         X   ...........",\r
 "................  X               ...........",\r
 "...............  X            X    ..........",\r
-"..............  .             XX   ..........",\r
-".............. ..              XX  ..........",\r
-".............  .                    .........",\r
-"............. ..                    .........",\r
-"............  .                     .........",\r
-"............ ..        X             ........",\r
-"............ .                       ........",\r
-"..............          .             .......",\r
-"........... ..          ..             ......",\r
-"........... ..          ....        XX ......",\r
-"........... .            .....       X ......",\r
-".............            ......        ......",\r
-".............             ......  X    ......",\r
-".......... ..              .....      .......",\r
-".......... ..              ...... ...........",\r
-".......... ..               .................",\r
-".......... ..                ................",\r
-".......... ..                 ...............",\r
-".......... ..                 ...............",\r
-".......... ..                  ..............",\r
-".......... .                   ..............",\r
+"..............  X             XX   ..........",\r
+".............. XX              XX  ..........",\r
+".............  X                    .........",\r
+"............. XX                    .........",\r
+"............  X                     .........",\r
+"............ XX        X             ........",\r
+"............ X                       ........",\r
+"............XX          .             .......",\r
+"........... XX          ..             ......",\r
+"........... XX          ....        XX ......",\r
+"........... X            .....       X ......",\r
+"...........XX            ......        ......",\r
+"...........XX             ......  X    ......",\r
+".......... XX              .....      .......",\r
+".......... XX              ...... ...........",\r
+".......... XX               .................",\r
+".......... XX                ................",\r
+".......... XX                 ...............",\r
+".......... XX                 ...............",\r
+".......... XX                  ..............",\r
+".......... X                   ..............",\r
 "..........                     ..............",\r
 ".......... XXXXXXXXXXXXXXXXXXX ..............",\r
 ".........                       .............",\r
index 0b17004..8226e57 100644 (file)
@@ -16,30 +16,30 @@ static char *cvdl49[] = {
 "..................  XX               ............",\r
 ".................  X                 ............",\r
 "................  X             XX    ...........",\r
-"...............  .               XX   ...........",\r
-"............... ..                XX  ...........",\r
-".............. ..                  X  ...........",\r
-".............. ..                      ..........",\r
-"............. ..                       ..........",\r
-"............. ..                        .........",\r
-"............  .          X               ........",\r
-"............ ..                          ........",\r
-"............ ..           .               .......",\r
-"............ .            ..              .......",\r
-"........... ..            ....         XX  ......",\r
-"........... ..             .....       XX  ......",\r
-"........... ..             ......       X  ......",\r
-"........... .               ......   X     ......",\r
-"........... .               .......       .......",\r
-".............                .......     ........",\r
-".......... ..                 ....... ...........",\r
-".......... ..                  ..................",\r
-".......... ..                   .................",\r
-".......... ..                   .................",\r
-".......... ..                    ................",\r
-".......... ..                    ................",\r
-".......... ...                    ...............",\r
-"........... ..................... ...............",\r
+"...............  X               XX   ...........",\r
+"............... XX                XX  ...........",\r
+".............. XX                  X  ...........",\r
+".............. XX                      ..........",\r
+"............. XX                       ..........",\r
+"............. XX                        .........",\r
+"............  X          X               ........",\r
+"............ XX                          ........",\r
+"............ XX           .               .......",\r
+"............ X            ..              .......",\r
+"........... XX            ....         XX  ......",\r
+"........... XX             .....       XX  ......",\r
+"........... XX             ......       X  ......",\r
+"........... X               ......   X     ......",\r
+"........... X               .......       .......",\r
+"...........XX                .......     ........",\r
+".......... XX                 ....... ...........",\r
+".......... XX                  ..................",\r
+".......... XX                   .................",\r
+".......... XX                   .................",\r
+".......... XX                    ................",\r
+".......... XX                    ................",\r
+".......... XXX                    ...............",\r
+"........... XXXXXXXXXXXXXXXXXXXXX ...............",\r
 "...........                       ...............",\r
 "...........                       ...............",\r
 "........... XXXXXXXXXXXXXXXXXXXXX ...............",\r
index 4c46eac..9021925 100644 (file)
@@ -16,40 +16,40 @@ static char *hdd49[] = {
 "............     ..     .........................",\r
 "............       X   X    .....................",\r
 ".............   XX X   X XXX  ...................",\r
-"............   X            ... .................",\r
-"........... XX                ... ...............",\r
-".......... XXXX                 .. ..............",\r
+"............   X            XXX .................",\r
+"........... XX                XXX ...............",\r
+".......... XXXX                 XX ..............",\r
 ".......... XXXXXX                 X .............",\r
 "......... XXXXX XX                 X ............",\r
-"......... XXX  XXXX                 . ...........",\r
-"......... XXX XXXXXX                .............",\r
-"......... XX XXXXXX                  . ..........",\r
-"........  XXXXXXXX                   .. .........",\r
-"........   XXXXXX                     . .........",\r
-"........     XXX                      .. ........",\r
-".......       X           X            . ........",\r
-".......                   X            ..........",\r
-"......                                 .. .......",\r
-".....                   .               . .......",\r
-".....                  ...              .........",\r
-"....                  ....              .. ......",\r
-"....                ......               . ......",\r
-"...   XX           .......               . ......",\r
-"...   X          .......                 ........",\r
-"...             ........                 .. .....",\r
-"...       X    ........                  .. .....",\r
-"...      .    ........                   .. .....",\r
-"....     .   ........                     . .....",\r
-".....    .  ........                      . .....",\r
-"..........  .......                       .......",\r
-"..................                        .. ....",\r
-"..................                        .. ....",\r
-".................                         .. ....",\r
-"................                          .. ....",\r
-"...............                           .. ....",\r
-"...............                           .. ....",\r
-"..............                            .. ....",\r
-"..............                            .. ....",\r
+"......... XXX  XXXX                 X ...........",\r
+"......... XXX XXXXXX                XX...........",\r
+"......... XX XXXXXX                  X ..........",\r
+"........  XXXXXXXX                   XX .........",\r
+"........   XXXXXX                     X .........",\r
+"........     XXX                      XX ........",\r
+".......       X           X            X ........",\r
+".......                   X            XX........",\r
+"......                                 XX .......",\r
+".....                   .               X .......",\r
+".....                  ...              XX.......",\r
+"....                  ....              XX ......",\r
+"....                ......               X ......",\r
+"...   XX           .......               X ......",\r
+"...   X          .......                 XX......",\r
+"...             ........                 XX .....",\r
+"...       X    ........                  XX .....",\r
+"...      .    ........                   XX .....",\r
+"....     .   ........                     X .....",\r
+".....    .  ........                      X .....",\r
+"..........  .......                       XX.....",\r
+"..................                        XX ....",\r
+"..................                        XX ....",\r
+".................                         XX ....",\r
+"................                          XX ....",\r
+"...............                           XX ....",\r
+"...............                           XX ....",\r
+"..............                            XX ....",\r
+"..............                            XX ....",\r
 "..............                               ....",\r
 "..............                               ....",\r
 ".................................................",\r
index 9f37818..9f40644 100644 (file)
@@ -17,60 +17,60 @@ static char *hdd72[] = {
 "..................      .....      .....................................",\r
 "..................       ...        ....................................",\r
 "..................        ..        ....................................",\r
-"..................          X      ..     ..............................",\r
-"..................       XX X      ..        ...........................",\r
-"..................      XXXXX       .....      .........................",\r
-"..................     XXX          ........     .......................",\r
-".................     XXX                .....    ......................",\r
-"................   XX X                     ....    ....................",\r
-"...............   XXXX                        ...    ...................",\r
-"..............   XXXXXX                        ....   ..................",\r
-"..............  XXXXXXXXX                       ....   .................",\r
-".............  XXXXXXX  XX                       ....   ................",\r
-".............  XXXXX   XXXX                       ....   ...............",\r
-".............  XXXX    XXXXX                       ....  ...............",\r
-".............  XXX     XXXXXX                       ...   ..............",\r
-".............  XXX    XXXXXXX                       ....   .............",\r
-"............   XXX XXXXXXXXX                         ....  .............",\r
-"............    XXXXXXXXXXX                          ....   ............",\r
-"............     XXXXXXXXX                            ....  ............",\r
-"...........       XXXXXXX                             ....   ...........",\r
-"...........        XXXXX                               ....  ...........",\r
-"..........          XXX                X               ....  ...........",\r
-"..........           X                XX                ....  ..........",\r
-".........                            XX                 ....  ..........",\r
-"........                             XX                 ....  ..........",\r
-"........                             X                   ....  .........",\r
-".......                             XX                   ....  .........",\r
-"......                                                   ....  .........",\r
-"......                             .                      ....  ........",\r
-".....                            ...                      ....  ........",\r
-".....                          .....                      ....  ........",\r
-".....    XX                  .......                      ....   .......",\r
-"....    XXXX               ........                        ....  .......",\r
-"....    XXXX             ..........                        ....  .......",\r
-"....    XXX             ..........                         ....  .......",\r
-"....    XXX            ...........                         ....  .......",\r
-"....          ..      ...........                          ....  .......",\r
-"....          ..     ...........                            ....  ......",\r
-"....         ...    ............                            ....  ......",\r
-".....        ..     ...........                             ....  ......",\r
-"......      ...    ...........                              ....  ......",\r
-"........    .     ...........                               ....  ......",\r
-"..............   ...........                                ....  ......",\r
-"...........................                                 ....  ......",\r
-"...........................                                 ....  ......",\r
-"..........................                                  ....   .....",\r
-".........................                                   .....  .....",\r
-"........................                                     ....  .....",\r
-"........................                                     ....  .....",\r
-".......................                                      ....  .....",\r
-"......................                                       ....  .....",\r
-"......................                                       ....  .....",\r
-"......................                                       ....  .....",\r
-".....................                                        ....  .....",\r
-".....................                                        ....  .....",\r
-".....................                                         ...  .....",\r
+"..................          X      XX     ..............................",\r
+"..................       XX X      XX        ...........................",\r
+"..................      XXXXX       XXXXX      .........................",\r
+"..................     XXX          XXXXXXXX     .......................",\r
+".................     XXX                XXXXX    ......................",\r
+"................   XX X                     XXXX    ....................",\r
+"...............   XXXX                        XXX    ...................",\r
+"..............   XXXXXX                        XXXX   ..................",\r
+"..............  XXXXXXXXX                       XXXX   .................",\r
+".............  XXXXXXX  XX                       XXXX   ................",\r
+".............  XXXXX   XXXX                       XXXX   ...............",\r
+".............  XXXX    XXXXX                       XXXX  ...............",\r
+".............  XXX     XXXXXX                       XXX   ..............",\r
+".............  XXX    XXXXXXX                       XXXX   .............",\r
+"............   XXX XXXXXXXXX                         XXXX  .............",\r
+"............    XXXXXXXXXXX                          XXXX   ............",\r
+"............     XXXXXXXXX                            XXXX  ............",\r
+"...........       XXXXXXX                             XXXX   ...........",\r
+"...........        XXXXX                               XXXX  ...........",\r
+"..........          XXX                X               XXXX  ...........",\r
+"..........           X                XX                XXXX  ..........",\r
+".........                            XX                 XXXX  ..........",\r
+"........                             XX                 XXXX  ..........",\r
+"........                             X                   XXXX  .........",\r
+".......                             XX                   XXXX  .........",\r
+"......                                                   XXXX  .........",\r
+"......                             .                      XXXX  ........",\r
+".....                            ...                      XXXX  ........",\r
+".....                          .....                      XXXX  ........",\r
+".....    XX                  .......                      XXXX   .......",\r
+"....    XXXX               ........                        XXXX  .......",\r
+"....    XXXX             ..........                        XXXX  .......",\r
+"....    XXX             ..........                         XXXX  .......",\r
+"....    XXX            ...........                         XXXX  .......",\r
+"....          ..      ...........                          XXXX  .......",\r
+"....          ..     ...........                            XXXX  ......",\r
+"....         ...    ............                            XXXX  ......",\r
+".....        ..     ...........                             XXXX  ......",\r
+"......      ...    ...........                              XXXX  ......",\r
+"........    .     ...........                               XXXX  ......",\r
+"..............   ...........                                XXXX  ......",\r
+"...........................                                 XXXX  ......",\r
+"...........................                                 XXXX  ......",\r
+"..........................                                  XXXX   .....",\r
+".........................                                   XXXXX  .....",\r
+"........................                                     XXXX  .....",\r
+"........................                                     XXXX  .....",\r
+".......................                                      XXXX  .....",\r
+"......................                                       XXXX  .....",\r
+"......................                                       XXXX  .....",\r
+"......................                                       XXXX  .....",\r
+".....................                                        XXXX  .....",\r
+".....................                                        XXXX  .....",\r
+".....................                                         XXX  .....",\r
 ".....................                                              .....",\r
 ".....................                                              .....",\r
 "........................................................................",\r
index 9b4baf2..03dff1e 100644 (file)
@@ -16,40 +16,40 @@ static char *hdl49[] = {
 "............     ..     .........................",\r
 "............       X   X    .....................",\r
 ".............   XX X   X XXX  ...................",\r
-"............   X            ... .................",\r
-"........... XX                ... ...............",\r
-".......... XXXX                 .. ..............",\r
+"............   X            XXX .................",\r
+"........... XX                XXX ...............",\r
+".......... XXXX                 XX ..............",\r
 ".......... XXXXXX                 X .............",\r
 "......... XXXXX XX                 X ............",\r
-"......... XXX  XXXX                 . ...........",\r
-"......... XXX XXXXXX                .............",\r
-"......... XX XXXXXX                  . ..........",\r
-"........  XXXXXXXX                   .. .........",\r
-"........   XXXXXX                     . .........",\r
-"........     XXX                      .. ........",\r
-".......       X           X            . ........",\r
-".......                   X            ..........",\r
-"......                                 .. .......",\r
-".....                   .               . .......",\r
-".....                  ...              .........",\r
-"....                  ....              .. ......",\r
-"....                ......               . ......",\r
-"...   XX           .......               . ......",\r
-"...   X          .......                 ........",\r
-"...             ........                 .. .....",\r
-"...       X    ........                  .. .....",\r
-"...      .    ........                   .. .....",\r
-"....     .   ........                     . .....",\r
-".....    .  ........                      . .....",\r
-"..........  .......                       .......",\r
-"..................                        .. ....",\r
-"..................                        .. ....",\r
-".................                         .. ....",\r
-"................                          .. ....",\r
-"...............                           .. ....",\r
-"...............                           .. ....",\r
-"..............                            .. ....",\r
-"..............                            .. ....",\r
+"......... XXX  XXXX                 X ...........",\r
+"......... XXX XXXXXX                XX...........",\r
+"......... XX XXXXXX                  X ..........",\r
+"........  XXXXXXXX                   XX .........",\r
+"........   XXXXXX                     X .........",\r
+"........     XXX                      XX ........",\r
+".......       X           X            X ........",\r
+".......                   X            XX........",\r
+"......                                 XX .......",\r
+".....                   .               X .......",\r
+".....                  ...              XX.......",\r
+"....                  ....              XX ......",\r
+"....                ......               X ......",\r
+"...   XX           .......               X ......",\r
+"...   X          .......                 XX......",\r
+"...             ........                 XX .....",\r
+"...       X    ........                  XX .....",\r
+"...      .    ........                   XX .....",\r
+"....     .   ........                     X .....",\r
+".....    .  ........                      X .....",\r
+"..........  .......                       XX.....",\r
+"..................                        XX ....",\r
+"..................                        XX ....",\r
+".................                         XX ....",\r
+"................                          XX ....",\r
+"...............                           XX ....",\r
+"...............                           XX ....",\r
+"..............                            XX ....",\r
+"..............                            XX ....",\r
 "..............                               ....",\r
 "..............                               ....",\r
 ".................................................",\r
index 9cadf96..9e6c2b9 100644 (file)
@@ -17,60 +17,60 @@ static char *hdl72[] = {
 "..................      .....      .....................................",\r
 "..................       ...        ....................................",\r
 "..................        ..        ....................................",\r
-"..................          X      ..     ..............................",\r
-"..................       XX X      ..        ...........................",\r
-"..................      XXXXX       .....      .........................",\r
-"..................     XXX          ........     .......................",\r
-".................     XXX                .....    ......................",\r
-"................   XX X                     ....    ....................",\r
-"...............   XXXX                        ...    ...................",\r
-"..............   XXXXXX                        ....   ..................",\r
-"..............  XXXXXXXXX                       ....   .................",\r
-".............  XXXXXXX  XX                       ....   ................",\r
-".............  XXXXX   XXXX                       ....   ...............",\r
-".............  XXXX    XXXXX                       ....  ...............",\r
-".............  XXX     XXXXXX                       ...   ..............",\r
-".............  XXX    XXXXXXX                       ....   .............",\r
-"............   XXX XXXXXXXXX                         ....  .............",\r
-"............    XXXXXXXXXXX                          ....   ............",\r
-"............     XXXXXXXXX                            ....  ............",\r
-"...........       XXXXXXX                             ....   ...........",\r
-"...........        XXXXX                               ....  ...........",\r
-"..........          XXX                X               ....  ...........",\r
-"..........           X                XX                ....  ..........",\r
-".........                            XX                 ....  ..........",\r
-"........                             XX                 ....  ..........",\r
-"........                             X                   ....  .........",\r
-".......                             XX                   ....  .........",\r
-"......                                                   ....  .........",\r
-"......                             .                      ....  ........",\r
-".....                            ...                      ....  ........",\r
-".....                          .....                      ....  ........",\r
-".....    XX                  .......                      ....   .......",\r
-"....    XXXX               ........                        ....  .......",\r
-"....    XXXX             ..........                        ....  .......",\r
-"....    XXX             ..........                         ....  .......",\r
-"....    XXX            ...........                         ....  .......",\r
-"....          ..      ...........                          ....  .......",\r
-"....          ..     ...........                            ....  ......",\r
-"....         ...    ............                            ....  ......",\r
-".....        ..     ...........                             ....  ......",\r
-"......      ...    ...........                              ....  ......",\r
-"........    .     ...........                               ....  ......",\r
-"..............   ...........                                ....  ......",\r
-"...........................                                 ....  ......",\r
-"...........................                                 ....  ......",\r
-"..........................                                  ....   .....",\r
-".........................                                   .....  .....",\r
-"........................                                     ....  .....",\r
-"........................                                     ....  .....",\r
-".......................                                      ....  .....",\r
-"......................                                       ....  .....",\r
-"......................                                       ....  .....",\r
-"......................                                       ....  .....",\r
-".....................                                        ....  .....",\r
-".....................                                        ....  .....",\r
-".....................                                         ...  .....",\r
+"..................          X      XX     ..............................",\r
+"..................       XX X      XX        ...........................",\r
+"..................      XXXXX       XXXXX      .........................",\r
+"..................     XXX          XXXXXXXX     .......................",\r
+".................     XXX                XXXXX    ......................",\r
+"................   XX X                     XXXX    ....................",\r
+"...............   XXXX                        XXX    ...................",\r
+"..............   XXXXXX                        XXXX   ..................",\r
+"..............  XXXXXXXXX                       XXXX   .................",\r
+".............  XXXXXXX  XX                       XXXX   ................",\r
+".............  XXXXX   XXXX                       XXXX   ...............",\r
+".............  XXXX    XXXXX                       XXXX  ...............",\r
+".............  XXX     XXXXXX                       XXX   ..............",\r
+".............  XXX    XXXXXXX                       XXXX   .............",\r
+"............   XXX XXXXXXXXX                         XXXX  .............",\r
+"............    XXXXXXXXXXX                          XXXX   ............",\r
+"............     XXXXXXXXX                            XXXX  ............",\r
+"...........       XXXXXXX                             XXXX   ...........",\r
+"...........        XXXXX                               XXXX  ...........",\r
+"..........          XXX                X               XXXX  ...........",\r
+"..........           X                XX                XXXX  ..........",\r
+".........                            XX                 XXXX  ..........",\r
+"........                             XX                 XXXX  ..........",\r
+"........                             X                   XXXX  .........",\r
+".......                             XX                   XXXX  .........",\r
+"......                                                   XXXX  .........",\r
+"......                             .                      XXXX  ........",\r
+".....                            ...                      XXXX  ........",\r
+".....                          .....                      XXXX  ........",\r
+".....    XX                  .......                      XXXX   .......",\r
+"....    XXXX               ........                        XXXX  .......",\r
+"....    XXXX             ..........                        XXXX  .......",\r
+"....    XXX             ..........                         XXXX  .......",\r
+"....    XXX            ...........                         XXXX  .......",\r
+"....          ..      ...........                          XXXX  .......",\r
+"....          ..     ...........                            XXXX  ......",\r
+"....         ...    ............                            XXXX  ......",\r
+".....        ..     ...........                             XXXX  ......",\r
+"......      ...    ...........                              XXXX  ......",\r
+"........    .     ...........                               XXXX  ......",\r
+"..............   ...........                                XXXX  ......",\r
+"...........................                                 XXXX  ......",\r
+"...........................                                 XXXX  ......",\r
+"..........................                                  XXXX   .....",\r
+".........................                                   XXXXX  .....",\r
+"........................                                     XXXX  .....",\r
+"........................                                     XXXX  .....",\r
+".......................                                      XXXX  .....",\r
+"......................                                       XXXX  .....",\r
+"......................                                       XXXX  .....",\r
+"......................                                       XXXX  .....",\r
+".....................                                        XXXX  .....",\r
+".....................                                        XXXX  .....",\r
+".....................                                         XXX  .....",\r
 ".....................                                              .....",\r
 ".....................                                              .....",\r
 "........................................................................",\r
diff --git a/uci.c b/uci.c
index d0f76c4..0885ee0 100644 (file)
--- a/uci.c
+++ b/uci.c
   #include <malloc.h>
 #endif
 
-#ifdef WIN32
-// [HGM] this was probably a Windows-specific constant. Needs to be defined here now I
-//       threw out the Windows-specific includes (winboard.h etc.). 100 seems enough.
-#include <windows.h>
-#define SLASH_CHAR "\\"
-#else
-#define MAX_PATH 100
-#define SLASH_CHAR "/"
-#endif
-
 #include "common.h"
 #include "backend.h"
 
-#define INIFILE_PREFIX      "polyglot_"
-#define INIFILE_SUFFIX_1ST  "1st"
-#define INIFILE_SUFFIX_2ND  "2nd"
-#define INIFILE_EXT         ".ini"
-
-
-static const char * GetIniFilename( ChessProgramState * cps )
-{
-    return cps == &first ? INIFILE_PREFIX INIFILE_SUFFIX_1ST INIFILE_EXT : INIFILE_PREFIX INIFILE_SUFFIX_2ND INIFILE_EXT;
- }
 
 void InitEngineUCI( const char * iniDir, ChessProgramState * cps )
-{
+{   // replace engine command line by adapter command with expanded meta-symbols
     if( cps->isUCI ) {
-        const char * iniFileName = GetIniFilename( cps );
-        char polyglotIniFile[ MAX_PATH ];
-        FILE * f;
-
-        /* Build name of initialization file */
-        if( strchr( iniDir, ' ' ) != NULL ) {
-            char iniDirShort[ MAX_PATH ];
-#ifdef WIN32
-            GetShortPathName( iniDir, iniDirShort, sizeof(iniDirShort) );
-
-            strcpy( polyglotIniFile, iniDirShort );
-#else
-           // [HGM] UCI: not sure if this works, but GetShortPathName seems Windows pecific
-           // and names with spaces in it do not work in xboard in many places, so ignore
-            strcpy( polyglotIniFile, iniDir );
-#endif
-        }
-        else {
-            strcpy( polyglotIniFile, iniDir );
-        }
-        
-        strcat( polyglotIniFile, SLASH_CHAR );
-        strcat( polyglotIniFile, iniFileName );
-
-        /* Create initialization file */
-        f = fopen( polyglotIniFile, "w" );
-
-        if( f != NULL ) {
-            fprintf( f, "[Polyglot]\n" );
-
-            if( cps->dir != 0 && strlen(cps->dir) > 0 ) {
-                fprintf( f, "EngineDir = %s\n", cps->dir );
+        char *p, *q;
+        char polyglotCommand[MSG_SIZ];
+
+        p = appData.adapterCommand;
+        q = polyglotCommand;
+        while(*p) {
+          if(*p == '\\') p++; else
+          if(*p == '%') { // substitute marker
+            char argName[MSG_SIZ], *s = argName;
+            if(*++p == '%') { // second %, expand as f or s in option name (e.g. %%cp -> fcp)
+              *s++ = cps == &first ? 'f' : 's';
+              p++;
             }
-
-            if( cps->program != 0 && strlen(cps->program) > 0 ) {
-                fprintf( f, "EngineCommand = %s\n", cps->program );
-            }
-
-            fprintf( f, "Book = %s\n", appData.usePolyglotBook ? "true" : "false" );
-            fprintf( f, "BookFile = %s\n", appData.polyglotBook );
-        
-            fprintf( f, "[Engine]\n" );
-            fprintf( f, "Hash = %d\n", appData.defaultHashSize );
-
-            fprintf( f, "NalimovPath = %s\n", appData.defaultPathEGTB );
-            fprintf( f, "NalimovCache = %d\n", appData.defaultCacheSizeEGTB );
-
-            fprintf( f, "OwnBook = %s\n", cps->hasOwnBookUCI ? "true" : "false" );
-
-            fclose( f );
-
-            /* Replace program with properly configured Polyglot */
-            cps->dir = appData.polyglotDir;
-            cps->program = (char *) malloc( strlen(polyglotIniFile) + 32 );
-            strcpy( cps->program, "polyglot " );
-            strcat( cps->program, polyglotIniFile );
+            while(*p != ' ' && *p) *s++ = *p++; // copy option name
+            *s = NULLCHAR;
+            if(GetArgValue(argName)) { // look up value of option with this name
+              s = argName;
+              while(*s) *q++ = *s++;
+            } else DisplayFatalError("Bad adapter command", 0, 1);
+            continue;
+          }
+          if(*p) *q++ = *p++;
         }
+        *q = NULLCHAR;
+        cps->program = StrSave(polyglotCommand);
+        cps->dir = appData.polyglotDir;
     }
 }
index 3a31412..64cb013 100644 (file)
@@ -1,7 +1,7 @@
 [Project]\r
 FileName=WB4Jaws.dev\r
 Name=Winboard\r
-UnitCount=24\r
+UnitCount=26\r
 Type=0\r
 Ver=1\r
 ObjFiles=\r
@@ -70,7 +70,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit5]\r
-FileName=wengineo.c\r
+FileName=wevalgraph.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -80,7 +80,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit6]\r
-FileName=wevalgraph.c\r
+FileName=wgamelist.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -90,7 +90,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit7]\r
-FileName=wgamelist.c\r
+FileName=whistory.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -100,7 +100,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit8]\r
-FileName=whistory.c\r
+FileName=winboard.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -110,7 +110,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit9]\r
-FileName=winboard.c\r
+FileName=wlayout.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -120,7 +120,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit10]\r
-FileName=wlayout.c\r
+FileName=woptions.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -130,7 +130,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit11]\r
-FileName=woptions.c\r
+FileName=wsnap.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -140,7 +140,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit12]\r
-FileName=wsnap.c\r
+FileName=..\uci.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -150,7 +150,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit13]\r
-FileName=..\uci.c\r
+FileName=..\backend.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -160,7 +160,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit14]\r
-FileName=..\backend.c\r
+FileName=..\book.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -170,7 +170,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit15]\r
-FileName=..\book.c\r
+FileName=..\gamelist.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -180,7 +180,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit16]\r
-FileName=..\gamelist.c\r
+FileName=..\lists.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -190,7 +190,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit17]\r
-FileName=..\lists.c\r
+FileName=..\moves.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -200,7 +200,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit18]\r
-FileName=..\moves.c\r
+FileName=..\pgntags.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -210,26 +210,27 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit19]\r
-FileName=..\pgntags.c\r
+FileName=winboard.rc\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
-Link=1\r
+Link=0\r
 Priority=1000\r
 OverrideBuildCmd=0\r
 BuildCmd=\r
 \r
 [Unit20]\r
-FileName=winboard.rc\r
+FileName=..\zippy.c\r
 Folder=Winboard\r
 Compile=1\r
-Link=0\r
+Link=1\r
 Priority=1000\r
 OverrideBuildCmd=0\r
 BuildCmd=\r
+CompileCpp=0\r
 \r
 [Unit21]\r
-FileName=..\zippy.c\r
+FileName=help.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -239,7 +240,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit22]\r
-FileName=help.c\r
+FileName=wsettings.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -249,7 +250,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit23]\r
-FileName=wsettings.c\r
+FileName=wchat.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -259,7 +260,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit24]\r
-FileName=wchat.c\r
+FileName=..\engineoutput.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -268,21 +269,23 @@ Priority=1000
 OverrideBuildCmd=0\r
 BuildCmd=\r
 \r
-[VersionInfo]\r
-Major=0\r
-Minor=1\r
-Release=1\r
-Build=1\r
-LanguageID=1033\r
-CharsetID=1252\r
-CompanyName=\r
-FileVersion=0.1\r
-FileDescription=Developed using the Dev-C++ IDE\r
-InternalName=\r
-LegalCopyright=\r
-LegalTrademarks=\r
-OriginalFilename=Winboard.exe\r
-ProductName=Winboard\r
-ProductVersion=0.1\r
-AutoIncBuildNr=0\r
+[Unit25]\r
+FileName=..\evalgraph.c\r
+CompileCpp=0\r
+Folder=Winboard\r
+Compile=1\r
+Link=1\r
+Priority=1000\r
+OverrideBuildCmd=0\r
+BuildCmd=\r
+\r
+[Unit26]\r
+FileName=wengineoutput.c\r
+CompileCpp=0\r
+Folder=Winboard\r
+Compile=1\r
+Link=1\r
+Priority=1000\r
+OverrideBuildCmd=0\r
+BuildCmd=\r
 \r
index 80f271e..1821b2f 100644 (file)
@@ -1,7 +1,7 @@
 [Project]\r
 FileName=Winboard.dev\r
 Name=Winboard\r
-UnitCount=24\r
+UnitCount=26\r
 Type=0\r
 Ver=1\r
 ObjFiles=\r
@@ -70,7 +70,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit5]\r
-FileName=wengineo.c\r
+FileName=wevalgraph.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -80,7 +80,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit6]\r
-FileName=wevalgraph.c\r
+FileName=wgamelist.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -90,7 +90,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit7]\r
-FileName=wgamelist.c\r
+FileName=whistory.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -100,7 +100,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit8]\r
-FileName=whistory.c\r
+FileName=winboard.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -110,7 +110,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit9]\r
-FileName=winboard.c\r
+FileName=wlayout.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -120,7 +120,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit10]\r
-FileName=wlayout.c\r
+FileName=woptions.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -130,7 +130,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit11]\r
-FileName=woptions.c\r
+FileName=wsnap.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -140,7 +140,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit12]\r
-FileName=wsnap.c\r
+FileName=..\uci.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -150,7 +150,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit13]\r
-FileName=..\uci.c\r
+FileName=..\backend.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -160,7 +160,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit14]\r
-FileName=..\backend.c\r
+FileName=..\book.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -170,7 +170,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit15]\r
-FileName=..\book.c\r
+FileName=..\gamelist.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -180,7 +180,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit16]\r
-FileName=..\gamelist.c\r
+FileName=..\lists.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -190,7 +190,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit17]\r
-FileName=..\lists.c\r
+FileName=..\moves.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -200,7 +200,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit18]\r
-FileName=..\moves.c\r
+FileName=..\pgntags.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -210,26 +210,27 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit19]\r
-FileName=..\pgntags.c\r
+FileName=winboard.rc\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
-Link=1\r
+Link=0\r
 Priority=1000\r
 OverrideBuildCmd=0\r
 BuildCmd=\r
 \r
 [Unit20]\r
-FileName=winboard.rc\r
+FileName=..\zippy.c\r
 Folder=Winboard\r
 Compile=1\r
-Link=0\r
+Link=1\r
 Priority=1000\r
 OverrideBuildCmd=0\r
 BuildCmd=\r
+CompileCpp=0\r
 \r
 [Unit21]\r
-FileName=..\zippy.c\r
+FileName=help.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -239,7 +240,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit22]\r
-FileName=help.c\r
+FileName=wsettings.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -249,7 +250,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit23]\r
-FileName=wsettings.c\r
+FileName=wchat.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -259,7 +260,7 @@ OverrideBuildCmd=0
 BuildCmd=\r
 \r
 [Unit24]\r
-FileName=wchat.c\r
+FileName=wengineoutput.c\r
 CompileCpp=0\r
 Folder=Winboard\r
 Compile=1\r
@@ -268,21 +269,23 @@ Priority=1000
 OverrideBuildCmd=0\r
 BuildCmd=\r
 \r
-[VersionInfo]\r
-Major=0\r
-Minor=1\r
-Release=1\r
-Build=1\r
-LanguageID=1033\r
-CharsetID=1252\r
-CompanyName=\r
-FileVersion=0.1\r
-FileDescription=Developed using the Dev-C++ IDE\r
-InternalName=\r
-LegalCopyright=\r
-LegalTrademarks=\r
-OriginalFilename=Winboard.exe\r
-ProductName=Winboard\r
-ProductVersion=0.1\r
-AutoIncBuildNr=0\r
+[Unit25]\r
+FileName=..\evalgraph.c\r
+CompileCpp=0\r
+Folder=Winboard\r
+Compile=1\r
+Link=1\r
+Priority=1000\r
+OverrideBuildCmd=0\r
+BuildCmd=\r
+\r
+[Unit26]\r
+FileName=..\engineoutput.c\r
+CompileCpp=0\r
+Folder=Winboard\r
+Compile=1\r
+Link=1\r
+Priority=1000\r
+OverrideBuildCmd=0\r
+BuildCmd=\r
 \r
index 76750fa..f0e6b33 100644 (file)
@@ -46,7 +46,7 @@
 #define PACKAGE_NAME "WinBoard"\r
 \r
 /* Define to the full name and version of this package. */\r
-#define PACKAGE_STRING "WinBoard master-200911122"\r
+#define PACKAGE_STRING "WinBoard master-20091122"\r
 \r
 /* Define to the one symbol short name of this package. */\r
 #define PACKAGE_TARNAME "winboard"\r
index 4c73c8d..27cebc0 100644 (file)
@@ -70,7 +70,7 @@ $(PROJ).hlp : $(PROJ).rtf
 \r
 \r
 # Update the resource if necessary\r
-wbres.o: $(PROJ).rc $(PROJ).h resource.h\r
+wbres.o: $(PROJ).rc $(PROJ).h resource.h config.h\r
        windres $(DEFS) --use-temp-file --include-dir .. $< -O coff -o $@\r
 \r
 \r
@@ -87,7 +87,7 @@ $(PROJ).exe: $(OBJS) $(PROJ).hlp
 \r
 winboard.o: winboard.c config.h winboard.h ../common.h ../frontend.h ../backend.h \\r
        ../moves.h defaults.h resource.h wclipbrd.h \\r
-       wsockerr.h woptions.h wsnap.h ../lists.h help.h\r
+       wsockerr.h woptions.h wsnap.h ../lists.h help.h ../args.h\r
        $(call compile, $<)\r
 \r
 backend.o: ../backend.c config.h ../common.h ../frontend.h ../backend.h \\r
index e81f17a..4a26ca6 100644 (file)
@@ -31,7 +31,7 @@ RC = @rc
 LINK = link\r
 HC="c:\program files\help workshop\hcrtf.exe" -xn\r
 FLEX = "c:/mingw/mingw32/bin/flex.exe"\r
-DEFS = -D_WIN32_IE=0x300 -DWIN32 -DWINVER=0x0500 -D_WIN32_WINDOWS=0x500\r
+DEFS = -D_WIN32_IE=0x300 -DWIN32 -DWINVER=0x0500 -D_WIN32_WINDOWS=0x500 -D YY_NO_UNISTD_H\r
 !if $(JAWS) == 1\r
 DEFS = -DJAWS $(DEFS)\r
 !endif\r
@@ -84,15 +84,15 @@ $(PROJ).hlp : $(PROJ).rtf
 \r
 \r
 # Update the resource if necessary\r
-$(PROJ).res: $(PROJ).rc $(PROJ).h resource.h\r
+$(PROJ).res: $(PROJ).rc $(PROJ).h resource.h config.h\r
     $(RC) $(CF) -r -fo $(PROJ).res $(PROJ).rc\r
 \r
 parser.c: ../parser.l\r
     $(FLEX) -oparser.c -L ../parser.l\r
 \r
 winboard.obj: winboard.c config.h winboard.h ../common.h ../frontend.h \\r
-        ../backend.h ../moves.h wgamelist.h defaults.h resource.h wclipbrd.h \\r
-        wedittags.h wsockerr.h woptions.h wsnap.h ../lists.h help.h\r
+        ../backend.h ../moves.h defaults.h resource.h wclipbrd.h \\r
+        wsockerr.h woptions.h wsnap.h ../lists.h help.h ../args.h\r
         $(CC) $(CFLAGS) winboard.c\r
 \r
 backend.obj: ../backend.c config.h ../common.h ../frontend.h ../backend.h \\r
index 08d0755..af4d31b 100644 (file)
-/* A lexical scanner generated by flex */
 
-/* Scanner skeleton version:
- * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
- */
+#line 3 "parser.c"
+
+#define  YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
 
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
+#define YY_FLEX_SUBMINOR_VERSION 35
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+/* First, we deal with  platform-specific or compiler-specific issues. */
 
+/* begin standard C headers. */
 #include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
 
+/* end standard C headers. */
 
-/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
-#ifdef c_plusplus
-#ifndef __cplusplus
-#define __cplusplus
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types. 
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
+#endif
+
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t; 
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN               (-128)
 #endif
+#ifndef INT16_MIN
+#define INT16_MIN              (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN              (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX               (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX              (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX              (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX              (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX             (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX             (4294967295U)
 #endif
 
+#endif /* ! FLEXINT_H */
 
 #ifdef __cplusplus
 
-#include <stdlib.h>
-#include <unistd.h>
-
-/* Use prototypes in function declarations. */
-#define YY_USE_PROTOS
-
 /* The "const" storage-class-modifier is valid. */
 #define YY_USE_CONST
 
 #else  /* ! __cplusplus */
 
-#if __STDC__
+/* C99 requires __STDC__ to be defined as 1. */
+#if defined (__STDC__)
 
-#define YY_USE_PROTOS
 #define YY_USE_CONST
 
-#endif /* __STDC__ */
+#endif /* defined (__STDC__) */
 #endif /* ! __cplusplus */
 
-#ifdef __TURBOC__
- #pragma warn -rch
- #pragma warn -use
-#include <io.h>
-#include <stdlib.h>
-#define YY_USE_CONST
-#define YY_USE_PROTOS
-#endif
-
 #ifdef YY_USE_CONST
 #define yyconst const
 #else
 #define yyconst
 #endif
 
-
-#ifdef YY_USE_PROTOS
-#define YY_PROTO(proto) proto
-#else
-#define YY_PROTO(proto) ()
-#endif
-
 /* Returned upon end-of-file. */
 #define YY_NULL 0
 
  * but we do it the disgusting crufty way forced on us by the ()-less
  * definition of BEGIN.
  */
-#define BEGIN yy_start = 1 + 2 *
+#define BEGIN (yy_start) = 1 + 2 *
 
 /* Translate the current start state into a value that can be later handed
  * to BEGIN to return to the state.  The YYSTATE alias is for lex
  * compatibility.
  */
-#define YY_START ((yy_start - 1) / 2)
+#define YY_START (((yy_start) - 1) / 2)
 #define YYSTATE YY_START
 
 /* Action number for EOF rule of a given start state. */
 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
 
 /* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart( yyin )
+#define YY_NEW_FILE yyrestart(yyin  )
 
 #define YY_END_OF_BUFFER_CHAR 0
 
 /* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
 #define YY_BUF_SIZE 16384
+#endif
 
+/* The state buf must be large enough to hold one state per character in the main buffer.
+ */
+#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
 
 extern int yyleng;
+
 extern FILE *yyin, *yyout;
 
 #define EOB_ACT_CONTINUE_SCAN 0
 #define EOB_ACT_END_OF_FILE 1
 #define EOB_ACT_LAST_MATCH 2
 
-/* The funky do-while in the following #define is used to turn the definition
- * int a single C statement (which needs a semi-colon terminator).  This
- * avoids problems with code like:
- *
- *     if ( condition_holds )
- *             yyless( 5 );
- *     else
- *             do_something_else();
- *
- * Prior to using the do-while the compiler would get upset at the
- * "else" because it interpreted the "if" statement as being all
- * done when it reached the ';' after the yyless() call.
- */
-
-/* Return all but the first 'n' matched characters back to the input stream. */
-
+    #define YY_LESS_LINENO(n)
+    
+/* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
        do \
                { \
                /* Undo effects of setting up yytext. */ \
-               *yy_cp = yy_hold_char; \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+               *yy_cp = (yy_hold_char); \
                YY_RESTORE_YY_MORE_OFFSET \
-               yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
+               (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
                YY_DO_BEFORE_ACTION; /* set up yytext again */ \
                } \
        while ( 0 )
 
-#define unput(c) yyunput( c, yytext_ptr )
-
-/* The following is because we cannot portably get our hands on size_t
- * (without autoconf's help, which isn't available because we want
- * flex-generated scanners to compile on their own).
- */
-typedef unsigned int yy_size_t;
+#define unput(c) yyunput( c, (yytext_ptr)  )
 
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
 
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
        {
        FILE *yy_input_file;
@@ -177,12 +221,16 @@ struct yy_buffer_state
         */
        int yy_at_bol;
 
+    int yy_bs_lineno; /**< The line count. */
+    int yy_bs_column; /**< The column count. */
+    
        /* Whether to try to fill the input buffer when we reach the
         * end of it.
         */
        int yy_fill_buffer;
 
        int yy_buffer_status;
+
 #define YY_BUFFER_NEW 0
 #define YY_BUFFER_NORMAL 1
        /* When an EOF's been seen but there's still some text to process
@@ -196,28 +244,38 @@ struct yy_buffer_state
         * just pointing yyin at a new input file.
         */
 #define YY_BUFFER_EOF_PENDING 2
+
        };
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
 
-static YY_BUFFER_STATE yy_current_buffer = 0;
+/* Stack of input buffers. */
+static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
+static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
+static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
 
 /* We provide macros for accessing buffer states in case in the
  * future we want to put the buffer states in a more general
  * "scanner state".
+ *
+ * Returns the top of the stack, or NULL.
  */
-#define YY_CURRENT_BUFFER yy_current_buffer
+#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
+                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
+                          : NULL)
 
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
 
 /* yy_hold_char holds the character lost when yytext is formed. */
 static char yy_hold_char;
-
 static int yy_n_chars;         /* number of characters read into yy_ch_buf */
-
-
 int yyleng;
 
 /* Points to current character in buffer. */
 static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 1;                /* whether we need to initialize */
+static int yy_init = 0;                /* whether we need to initialize */
 static int yy_start = 0;       /* start state number */
 
 /* Flag which is used to allow yywrap()'s to do buffer switches
@@ -225,68 +283,92 @@ static int yy_start = 0;  /* start state number */
  */
 static int yy_did_buffer_switch_on_eof;
 
-void yyrestart YY_PROTO(( FILE *input_file ));
+void yyrestart (FILE *input_file  );
+void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
+YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
+void yy_delete_buffer (YY_BUFFER_STATE b  );
+void yy_flush_buffer (YY_BUFFER_STATE b  );
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
+void yypop_buffer_state (void );
 
-void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
-void yy_load_buffer_state YY_PROTO(( void ));
-YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
-void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
-void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
+static void yyensure_buffer_stack (void );
+static void yy_load_buffer_state (void );
+static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
 
-YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
-YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
-YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
+#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
 
-static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
-static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
-static void yy_flex_free YY_PROTO(( void * ));
+YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
+YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
+YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len  );
+
+void *yyalloc (yy_size_t  );
+void *yyrealloc (void *,yy_size_t  );
+void yyfree (void *  );
 
 #define yy_new_buffer yy_create_buffer
 
 #define yy_set_interactive(is_interactive) \
        { \
-       if ( ! yy_current_buffer ) \
-               yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
-       yy_current_buffer->yy_is_interactive = is_interactive; \
+       if ( ! YY_CURRENT_BUFFER ){ \
+        yyensure_buffer_stack (); \
+               YY_CURRENT_BUFFER_LVALUE =    \
+            yy_create_buffer(yyin,YY_BUF_SIZE ); \
+       } \
+       YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
        }
 
 #define yy_set_bol(at_bol) \
        { \
-       if ( ! yy_current_buffer ) \
-               yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
-       yy_current_buffer->yy_at_bol = at_bol; \
+       if ( ! YY_CURRENT_BUFFER ){\
+        yyensure_buffer_stack (); \
+               YY_CURRENT_BUFFER_LVALUE =    \
+            yy_create_buffer(yyin,YY_BUF_SIZE ); \
+       } \
+       YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
        }
 
-#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
 
+/* Begin user sect3 */
 
-#define YY_USES_REJECT
 typedef unsigned char YY_CHAR;
+
 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+
 typedef int yy_state_type;
+
+extern int yylineno;
+
+int yylineno = 1;
+
 extern char *yytext;
 #define yytext_ptr yytext
 
-static yy_state_type yy_get_previous_state YY_PROTO(( void ));
-static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
-static int yy_get_next_buffer YY_PROTO(( void ));
-static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
+static yy_state_type yy_get_previous_state (void );
+static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
+static int yy_get_next_buffer (void );
+static void yy_fatal_error (yyconst char msg[]  );
 
 /* Done after the current pattern has been matched and before the
  * corresponding action - sets up yytext.
  */
 #define YY_DO_BEFORE_ACTION \
-       yytext_ptr = yy_bp; \
-       yyleng = (int) (yy_cp - yy_bp); \
-       yy_hold_char = *yy_cp; \
+       (yytext_ptr) = yy_bp; \
+       yyleng = (size_t) (yy_cp - yy_bp); \
+       (yy_hold_char) = *yy_cp; \
        *yy_cp = '\0'; \
-       yy_c_buf_p = yy_cp;
+       (yy_c_buf_p) = yy_cp;
 
 #define YY_NUM_RULES 42
 #define YY_END_OF_BUFFER 43
-static yyconst short int yy_acclist[650] =
+/* This struct is not used in this scanner,
+   but its presence is necessary. */
+struct yy_trans_info
+       {
+       flex_int32_t yy_verify;
+       flex_int32_t yy_nxt;
+       };
+static yyconst flex_int16_t yy_acclist[602] =
     {   0,
        43,   41,   42,   41,   42,   41,   42,   40,   41,   42,
        41,   42,   25,   41,   42,   41,   42,   40,   41,   42,
@@ -294,15 +376,15 @@ static yyconst short int yy_acclist[650] =
        40,   41,   42,   40,   41,   42,   40,   41,   42,   40,
        41,   42,   40,   41,   42,   40,   41,   42,   40,   41,
        42,   40,   41,   42,   40,   41,   42,   40,   41,   42,
-       40,   41,   42,   41,   42,   40,   41,   42,   40,   41,
+       41,   42,   40,   41,   42,   40,   41,   42,   40,   41,
        42,   40,   41,   42,   40,   41,   42,   40,   41,   42,
        40,   41,   42,   40,   41,   42,   40,   41,   42,   40,
        41,   42,   40,   41,   42,   40,   41,   42,   40,   41,
 
        42,   40,   41,   42,   40,   41,   42,   40,   41,   42,
-       40,   41,   42,   40,   41,   42,   41,   42,   41,   42,
-       40,   41,   42,   40,   41,   42,   40,   41,   42,16410,
-       40,   41,   42,16410,   41,   42,   40,   41,   42,   40,
+       40,   41,   42,   41,   42,   41,   42,   40,   41,   42,
+       40,   41,   42,   40,   41,   42,16410,   40,   41,   42,
+    16410,   41,   42,   40,   41,   42,   40,   41,   42,   40,
        41,   42,   40,   41,   42,   40,   41,   42,   40,   41,
        42,   40,   41,   42,   40,   41,   42,   40,   41,   42,
        40,   41,   42,   40,   41,   42,   40,   41,   42,   40,
@@ -311,138 +393,132 @@ static yyconst short int yy_acclist[650] =
        40,   41,   42,   40,   41,   42,   40,   41,   42,   40,
 
        41,   42,   40,   41,   42,   40,   41,   42,   40,   41,
-       42,   40,   41,   42,   40,   41,   42,   40,   41,   42,
-       41,   42,   33,   40,   17,   40,    9,   40,   40,   40,
-    16410, 8218,   40,   35,   40,   40,   40,   40,   40,   40,
-       40,   40,   40,   40,   40,    9,   40,   40,   40,   40,
-       40,   40,   36,   40,    3,   40,   40,    4,   40,   40,
-       40,   40,   40,   40,    9,   40,   40,   40,   34,   40,
-       40,    9,   40,   40,   40,16410, 8218,   40,   40,   40,
+       42,   40,   41,   42,   41,   42,   33,   40,   17,   40,
+        9,   40,   40,   40,16410, 8218,   40,   35,   40,   40,
+       40,   40,   40,   40,   40,   40,   40,   40,    9,   40,
+       40,   40,   40,   36,   40,    3,   40,   40,    4,   40,
+       40,   40,   40,   40,   40,    9,   40,   40,   40,   34,
+       40,   40,    9,   40,   40,   40,16410, 8218,   40,   40,
        40,   40,   40,   40,   40,   40,   40,   40,   40,    9,
-       40,   40,   40,   40,   40,   40,   40,    3,   40,   40,
-
-        4,   40,   40,   40,   40,   40,   40,    9,   40,   40,
-       40,   15,    9,   40,   23,   40,   23,    8,   40, 8218,
-       22,   40,   22,   24,   40,   40,   40,    6,   40,   40,
-       40,   40,   40,   40,   40,    9,   40,   40,   40,   40,
-       20,   40,    4,   40,   40,    3,    3,   40,    3,   40,
-       40,    4,    5,   40,    4,    4,   40,   40,   40,   40,
-        9,   40,   40,   34,   39,    9,   40,   23,   40,    8,
-       40,   22,   40,   35,   40,   40,   40,    6,   40,   40,
-       40,   40,   40,   40,   40,    9,   40,   40,   40,   40,
-       20,   40,    4,   40,   40,    3,   40,    3,   40,   40,
-
-        5,   40,    4,   40,   40,   40,   40,    9,   40,   40,
-       38,   38,   37,   25,   25,    6,   40,   10,    6,   40,
-        7,   40,    6,   40,    6,   40,   40,   40,   19,   40,
-       40,   21,   40,   16,   40,   40,   40,   40,   40,   20,
-       20,   40,   20,   40,   36,    3,    3,    2,   40,    5,
-        4,    5,    5,   40,   40,    4,    4,   40,   40,   25,
-       39,   40,    6,   40,    7,   40,   40,   40,   40,   40,
-       19,   40,   40,   21,   40,   16,   40,   40,   40,   40,
-       40,   20,   40,   20,   20,   40,    2,   40,    5,   40,
-       40,    4,   40,   40,    7,    7,    1,   40,   40,   40,
-
-       19,   40,   40,   40,   21,   21,   40,   21,   40,   40,
-       40,   40,   30,   36,    2,    2,    2,   40,    5,    5,
-        5,   40,   39,    1,   40,   40,   40,   19,   40,   40,
-       40,   21,   40,   21,   21,   40,   40,   40,   40,   20,
-       39,    2,   40,    5,   40,   27,   38,    1,   23,   23,
-       22,   22,   24,   24,    1,    1,   40,   20,   21,   40,
-       40,   40,   11,   40,   40,   28,   36,   30,    2,    2,
-       27,   34,   39,   39,    1,   40,   40,   40,   40,   21,
-       39,   11,   40,   40,   20,   39,   18,    1,   24,    1,
-       20,   21,   19,   40,   40,   40,   11,   40,   40,   40,
-
-       40,   21,   39,   40,   11,   40,   40,   12,   40,   40,
-       40,   40,   12,   40,   40,   14,   40,   40,   40,   14,
-       40,   40,   40,   39,   40,   40,   40,   40,   39,   39,
-       40,   40,   31,   40,   39,   39,   31,   40,   13,   31,
-       32,   32,   35,   39,   39,   31,   39,   34,   29
+       40,   40,   40,   40,   40,    3,   40,   40,    4,   40,
+       40,   40,   40,   40,   40,    9,   40,   40,   40,   15,
+
+        9,   40,   23,   40,   23,    8,   40, 8218,   22,   40,
+       22,   24,   40,   40,   40,    6,   40,   40,   40,   40,
+       40,   40,    9,   40,   40,   40,   40,    4,   40,   40,
+        3,    3,   40,    3,   40,   40,    4,    5,   40,    4,
+        4,   40,   40,   40,   40,    9,   40,   40,   34,   39,
+        9,   40,   23,   40,    8,   40,   22,   40,   35,   40,
+       40,   40,    6,   40,   40,   40,   40,   40,   40,    9,
+       40,   40,   40,   40,    4,   40,   40,    3,   40,    3,
+       40,   40,    5,   40,    4,   40,   40,   40,   40,    9,
+       40,   40,   38,   38,   38,   37,   25,   25,    6,   40,
+
+       10,    6,   40,    7,   40,    6,   40,    6,   40,   40,
+       40,   19,   40,   40,   16,   40,   40,   40,   40,   40,
+       36,    3,    3,    2,   40,    5,    4,    5,    5,   40,
+       40,    4,    4,   40,   40,   25,   39,   40,    6,   40,
+        7,   40,   40,   40,   40,   40,   19,   40,   40,   16,
+       40,   40,   40,   40,   40,    2,   40,    5,   40,   40,
+        4,   40,   40,   38,    7,    7,    1,   40,   20,   40,
+       40,   19,   40,   40,   40,   40,   40,   40,   30,   36,
+        2,    2,    2,   40,    5,    5,    5,   40,   39,    1,
+       40,   40,   40,   19,   40,   40,   40,   40,   40,   40,
+
+        2,   40,    5,   40,   27,   38,    1,   23,   23,   22,
+       22,   24,   24,    1,    1,   40,   21,   20,   40,   40,
+       40,   11,   40,   40,   28,   36,   30,    2,    2,   27,
+       34,   39,   39,    1,   40,   40,   40,   40,   11,   40,
+       40,   18,    1,   24,    1,   21,   19,   40,   40,   40,
+       11,   40,   40,   40,   40,   40,   11,   40,   40,   12,
+       40,   40,   40,   40,   12,   40,   40,   14,   40,   40,
+       40,   14,   40,   40,   40,   39,   40,   40,   40,   40,
+       39,   39,   40,   40,   31,   40,   39,   39,   31,   40,
+       13,   31,   32,   32,   35,   39,   39,   31,   39,   34,
+
+       29
     } ;
 
-static yyconst short int yy_accept[698] =
+static yyconst flex_int16_t yy_accept[689] =
     {   0,
         1,    1,    1,    2,    4,    6,    8,   11,   13,   16,
        18,   21,   25,   29,   31,   34,   37,   40,   43,   46,
-       49,   52,   55,   58,   61,   64,   66,   69,   72,   75,
+       49,   52,   55,   58,   61,   63,   66,   69,   72,   75,
        78,   81,   84,   87,   90,   93,   96,   99,  102,  105,
-      108,  111,  114,  117,  119,  121,  124,  127,  131,  135,
+      108,  111,  114,  116,  118,  121,  124,  128,  132,  134,
       137,  140,  143,  146,  149,  152,  155,  158,  161,  164,
       167,  170,  173,  176,  179,  182,  185,  188,  191,  194,
-      197,  200,  203,  206,  209,  212,  215,  218,  221,  223,
-      223,  224,  225,  225,  225,  225,  225,  226,  226,  226,
-      226,  227,  227,  229,  229,  229,  229,  230,  230,  230,
-
-      232,  232,  234,  234,  235,  235,  236,  236,  237,  237,
-      238,  238,  239,  240,  241,  242,  243,  244,  245,  246,
-      248,  249,  250,  251,  252,  253,  253,  253,  253,  253,
-      254,  255,  257,  257,  258,  260,  261,  262,  263,  264,
-      265,  267,  268,  269,  269,  269,  269,  270,  270,  271,
-      271,  272,  274,  274,  275,  277,  277,  279,  279,  280,
-      281,  281,  282,  283,  284,  285,  286,  287,  288,  289,
-      290,  292,  293,  294,  295,  296,  297,  298,  300,  300,
-      301,  303,  304,  305,  306,  307,  308,  310,  311,  312,
-      312,  312,  312,  312,  312,  312,  312,  312,  312,  312,
-
-      312,  313,  313,  313,  313,  313,  313,  315,  317,  318,
-      320,  321,  321,  321,  321,  323,  324,  325,  325,  326,
-      326,  327,  327,  328,  328,  330,  330,  330,  330,  330,
-      331,  332,  333,  334,  335,  336,  338,  339,  340,  341,
-      343,  343,  343,  343,  343,  345,  345,  346,  346,  347,
-      349,  351,  352,  353,  353,  355,  356,  358,  359,  360,
-      361,  363,  364,  365,  365,  365,  365,  365,  366,  368,
-      370,  372,  374,  374,  375,  375,  376,  377,  377,  378,
-      380,  381,  382,  383,  384,  385,  386,  388,  389,  390,
-      391,  393,  395,  396,  396,  398,  400,  401,  403,  405,
-
-      406,  407,  408,  410,  411,  411,  411,  412,  413,  413,
-      413,  414,  414,  414,  415,  415,  416,  416,  417,  417,
-      417,  417,  418,  418,  418,  418,  418,  418,  418,  418,
-      419,  421,  421,  423,  424,  425,  425,  426,  427,  427,
-      427,  427,  427,  428,  429,  431,  431,  432,  434,  436,
-      437,  438,  439,  440,  441,  443,  445,  445,  445,  445,
-      445,  446,  447,  447,  448,  450,  451,  452,  452,  452,
-      453,  455,  456,  457,  457,  459,  460,  460,  461,  461,
-      461,  461,  461,  462,  462,  463,  463,  463,  465,  467,
-      468,  468,  469,  470,  471,  473,  474,  476,  478,  479,
-
-      480,  481,  482,  484,  485,  487,  489,  491,  492,  494,
-      495,  495,  495,  495,  495,  496,  496,  496,  496,  496,
-      496,  496,  496,  496,  496,  497,  499,  499,  499,  499,
-      499,  500,  501,  501,  503,  503,  504,  505,  506,  508,
-      510,  511,  512,  513,  513,  513,  515,  515,  515,  516,
-      516,  517,  519,  520,  520,  521,  521,  523,  523,  523,
-      523,  523,  523,  523,  523,  524,  524,  524,  526,  527,
-      528,  530,  531,  532,  534,  535,  537,  538,  539,  540,
-      542,  544,  546,  546,  546,  548,  548,  549,  549,  550,
-      550,  551,  551,  552,  552,  553,  553,  554,  554,  555,
-
-      555,  555,  555,  556,  558,  558,  558,  560,  560,  561,
-      561,  561,  561,  561,  561,  562,  563,  565,  566,  568,
-      568,  569,  570,  571,  571,  571,  573,  573,  573,  574,
-      575,  575,  575,  577,  578,  579,  580,  582,  584,  585,
-      587,  587,  588,  588,  588,  589,  589,  590,  591,  591,
-      591,  591,  593,  593,  593,  594,  594,  594,  594,  594,
-      595,  596,  597,  599,  600,  600,  600,  600,  600,  600,
-      601,  602,  604,  605,  607,  608,  608,  608,  608,  608,
-      608,  608,  609,  609,  609,  609,  609,  610,  611,  611,
-      611,  611,  611,  612,  613,  613,  613,  613,  613,  614,
-
-      614,  614,  614,  615,  616,  618,  618,  618,  618,  618,
-      619,  619,  620,  622,  622,  622,  622,  622,  623,  624,
-      624,  624,  624,  624,  625,  626,  627,  627,  627,  627,
-      627,  627,  628,  629,  629,  629,  629,  629,  630,  631,
-      632,  633,  633,  633,  633,  633,  633,  635,  635,  635,
-      635,  635,  636,  637,  639,  639,  639,  640,  640,  641,
-      641,  642,  642,  642,  644,  644,  645,  646,  646,  646,
-      646,  646,  648,  648,  648,  648,  648,  648,  648,  648,
-      648,  648,  648,  648,  648,  648,  648,  648,  648,  648,
-      648,  648,  648,  648,  649,  650,  650
-
+      197,  200,  203,  206,  209,  212,  215,  217,  217,  218,
+      219,  219,  219,  219,  219,  220,  220,  220,  220,  221,
+      221,  223,  223,  223,  223,  224,  224,  224,  226,  226,
+
+      228,  228,  229,  229,  230,  230,  231,  231,  232,  232,
+      233,  234,  235,  236,  237,  238,  239,  241,  242,  243,
+      244,  244,  244,  244,  244,  245,  246,  248,  248,  249,
+      251,  252,  253,  254,  255,  256,  258,  259,  260,  260,
+      260,  260,  261,  261,  262,  262,  263,  265,  265,  266,
+      268,  268,  270,  270,  271,  272,  272,  273,  274,  275,
+      276,  277,  278,  279,  280,  282,  283,  284,  285,  286,
+      288,  288,  289,  291,  292,  293,  294,  295,  296,  298,
+      299,  300,  300,  300,  300,  300,  300,  300,  300,  300,
+      300,  300,  300,  301,  301,  301,  301,  301,  301,  303,
+
+      305,  306,  308,  309,  309,  309,  309,  311,  312,  313,
+      313,  314,  314,  315,  315,  316,  316,  318,  318,  318,
+      318,  318,  318,  318,  319,  320,  321,  322,  323,  325,
+      326,  327,  328,  328,  328,  328,  328,  330,  330,  331,
+      331,  332,  334,  336,  337,  338,  338,  340,  341,  343,
+      344,  345,  346,  348,  349,  350,  350,  350,  350,  350,
+      351,  353,  355,  357,  359,  359,  360,  360,  361,  362,
+      362,  363,  365,  366,  367,  368,  369,  370,  372,  373,
+      374,  375,  377,  378,  378,  380,  382,  383,  385,  387,
+      388,  389,  390,  392,  393,  393,  393,  394,  395,  395,
+
+      395,  396,  396,  396,  397,  397,  397,  398,  398,  399,
+      399,  400,  400,  400,  400,  401,  401,  401,  401,  401,
+      401,  401,  401,  402,  404,  404,  406,  407,  408,  408,
+      409,  410,  410,  410,  410,  410,  410,  410,  411,  412,
+      414,  414,  415,  417,  418,  419,  420,  421,  421,  421,
+      421,  421,  422,  423,  423,  424,  426,  427,  428,  428,
+      428,  429,  431,  432,  433,  433,  435,  436,  436,  437,
+      437,  437,  437,  437,  438,  438,  439,  439,  439,  441,
+      443,  444,  444,  445,  446,  447,  449,  450,  452,  453,
+      454,  455,  456,  458,  460,  461,  463,  464,  464,  464,
+
+      464,  464,  465,  465,  465,  465,  465,  466,  466,  466,
+      466,  466,  466,  466,  466,  466,  466,  467,  469,  469,
+      469,  469,  469,  469,  470,  471,  472,  472,  474,  474,
+      475,  476,  477,  478,  479,  479,  479,  481,  481,  481,
+      482,  482,  483,  485,  486,  486,  487,  487,  489,  489,
+      489,  489,  489,  489,  489,  489,  490,  490,  490,  492,
+      493,  494,  496,  497,  498,  499,  500,  501,  503,  505,
+      505,  505,  505,  505,  505,  505,  507,  507,  508,  508,
+      509,  509,  510,  510,  511,  511,  512,  512,  513,  513,
+      514,  514,  514,  514,  515,  517,  517,  517,  518,  518,
+
+      518,  519,  520,  520,  520,  520,  520,  520,  521,  522,
+      524,  525,  527,  527,  528,  529,  530,  530,  530,  532,
+      532,  532,  533,  534,  534,  534,  536,  537,  538,  539,
+      541,  542,  542,  543,  543,  543,  543,  543,  544,  544,
+      545,  546,  546,  546,  547,  547,  547,  548,  548,  548,
+      548,  548,  549,  550,  551,  553,  554,  554,  554,  554,
+      554,  554,  555,  556,  557,  559,  560,  560,  560,  560,
+      560,  560,  560,  561,  561,  561,  561,  561,  562,  563,
+      563,  563,  563,  563,  564,  565,  565,  565,  565,  565,
+      566,  566,  566,  566,  567,  568,  570,  570,  570,  570,
+
+      570,  571,  571,  572,  574,  574,  574,  574,  574,  575,
+      576,  576,  576,  576,  576,  577,  578,  579,  579,  579,
+      579,  579,  579,  580,  581,  581,  581,  581,  581,  582,
+      583,  584,  585,  585,  585,  585,  585,  585,  587,  587,
+      587,  587,  587,  588,  589,  591,  591,  591,  592,  592,
+      593,  593,  594,  594,  594,  596,  596,  597,  598,  598,
+      598,  598,  598,  600,  600,  600,  600,  600,  600,  600,
+      600,  600,  600,  600,  600,  600,  600,  600,  600,  600,
+      600,  600,  600,  600,  600,  601,  602,  602
     } ;
 
-static yyconst int yy_ec[256] =
+static yyconst flex_int32_t yy_ec[256] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
@@ -474,7 +550,7 @@ static yyconst int yy_ec[256] =
         1,    1,    1,    1,    1
     } ;
 
-static yyconst int yy_meta[74] =
+static yyconst flex_int32_t yy_meta[74] =
     {   0,
         1,    2,    3,    2,    1,    1,    1,    1,    4,    5,
         6,    1,    7,    8,    1,    1,    9,    9,    9,    9,
@@ -486,695 +562,614 @@ static yyconst int yy_meta[74] =
        17,    1,    1
     } ;
 
-static yyconst short int yy_base[784] =
+static yyconst flex_int16_t yy_base[767] =
     {   0,
-        0,   73, 2729, 4517,  122,  131,    0,  142, 2724,  140,
-      151,  171,  162, 2724,  231,  159, 2672, 2661,  119, 2660,
-     2673,  143, 2668, 2652,  211,  301,  361,  212,  209,  279,
-      243,  284,  301,  286,  221,  303,  309,  329, 2670,  239,
-     2665, 2649,  338,  403, 2710,  149,  380,  475,  348,  190,
-      538,  240, 2659, 2648,  236, 2650, 2663,  157, 2658, 2642,
-      379,  600,  314,  353,  377,  395,  401,  413,  382,  408,
-      513,  424,  516,  423,  562,  448,  544,  607,  612, 2654,
-      468,    0, 2696,  309,  617,  174, 4517, 2692,  672,  246,
-      353, 2686, 2686, 2680,  517,  661, 2680,  576,  280,  655,
-
-     2679,    0, 2692, 4517,    0,  696,    0,  741,    0,  580,
-      644,  586,  622, 2645, 2640, 2592, 2592,  692, 2617, 2616,
-      714, 2606,  680,  720, 2592, 2606,  811,  537,  884, 4517,
-      911,  961,    0,  986, 1035,  687,  753,  757, 2584, 2588,
-     2587, 2582, 2591,  318, 2568,  825, 2636, 2635,  430, 2634,
-      747,  820,  253,  830, 1085,  160,  563,  455, 1148, 1193,
-     2633,  784,  843,  850,  760,  603,  692,  844,  854, 2596,
-      657,  858,  893,  862,  893,  658, 1217, 1267, 2629, 1292,
-     1342,  913,  926, 1157,  831,  894,  915,  918,  895,  845,
-     2568,  464,  487,  538, 2620,  556, 1162, 1073, 2619, 2556,
-
-     4517, 1146, 1209, 2624, 2623, 2622, 2611, 2620, 2619,    0,
-     4517, 2618, 2616, 2615, 2614, 2613,  384, 1029, 1062, 1078,
-     1367, 1147, 1145, 1167, 1412, 2558, 2551, 2564, 2559, 1240,
-     1422, 2540,  756,  651, 2557, 2593, 2551, 2547, 1214, 1482,
-      722, 1208,  761, 1555, 1619,    0, 1624,    0, 2594, 2592,
-     2591, 1174, 1426, 1490, 1673, 2591, 2589,  560, 2550, 2549,
-     2583, 2530, 4517, 1499, 1039, 2591,  725, 2587,  928,  845,
-      592,  917,  642, 2585, 1156, 1503, 1716, 2584, 1516, 1761,
-     1531, 1564, 1470, 1565, 1464, 1429, 1580, 1490, 1566, 1598,
-     1831, 1896, 1901, 2583, 1582, 2573, 1613, 1950, 1587, 1676,
-
-     1588, 1614, 1581, 1149, 1539, 2528, 4517,  775,  799, 2562,
-     4517, 1709, 2557, 2556, 2493, 2492, 1202, 1709, 2546, 2545,
-     2544, 2544,  615, 2543,  744, 2542, 1099, 1674,  832, 4517,
-     2535, 1719, 2534, 2533, 1955, 1622, 4517, 1410, 2490, 2490,
-     2487, 2487, 2494, 2493,  778,  892,  920, 2013,    0, 2511,
-     2495, 2496, 2495,    0, 2086, 2159,  940, 1210, 1233, 1309,
-     2540, 2533, 1434, 4517, 1776, 1424, 2529,  910, 1615, 1616,
-     2528, 1173, 4517, 2476,    0, 2476, 1842, 2532, 1727, 1735,
-     2488, 2473, 2530, 1003, 1736,  904,  599, 1216, 1523, 2186,
-     2528, 1847, 1726, 1767, 1880, 1771, 2244, 1522, 1813, 1849,
-
-     1848, 1862, 2317, 2527, 2390, 2029, 1869, 1879, 1713, 2021,
-     1747, 2479, 2517, 1595, 2500, 1809, 2511, 2443, 2504, 2441,
-     2500, 2433, 2460, 1869, 4517, 2454, 2427, 2423, 2423, 2418,
-     2468, 1049, 2006, 2467, 1075, 2440, 2410,    0, 2497, 2570,
-     2400, 2394, 2448, 1341, 1756, 4517, 2446, 1803, 1343, 1491,
-     1768, 2439, 2438, 1416, 4517, 2386,    0, 2425, 1871, 2421,
-     1240, 2416, 2373, 2366, 1454, 1718, 1473, 2635, 1888, 2044,
-     1889, 2042, 2023, 2678, 2425, 1990, 1886, 2052, 2063, 2425,
-     1870, 1899, 1958, 1000, 4517, 2095, 1777, 2416, 2415, 2351,
-     2350, 2411, 2410, 2347, 2346, 2407, 2406, 2343, 2342, 2393,
-
-     2388, 1840, 2017, 2382, 2320, 2326, 2011, 2298, 2303, 2338,
-     2296, 2275, 2316, 2293, 2302, 2270, 2018, 2264, 4517, 2117,
-     4517, 2296, 4517, 2290, 2119, 2300, 2251, 2231, 2282, 1960,
-     1445,  289, 2107, 2108, 2114, 2068, 2281, 2125, 2131, 2280,
-     2139, 4517, 2227, 2176, 2262, 2267, 2258, 4517, 2187, 2173,
-     2177, 4517, 2166, 2214, 2211, 2157, 2198, 2148, 2103, 2111,
-     2085, 2098,    0, 2077, 2196, 2071, 2002,  827, 1575, 2168,
-     2135, 2063, 2170, 2136, 2164, 2203, 2000, 2014, 1683, 1939,
-     1931, 2030, 1944, 1630, 1954, 1906, 2751, 1919, 1917, 1913,
-     1385, 1565, 2824, 2249, 2204, 1850, 1863, 1832, 4517, 1806,
-
-     1637, 1912, 2897, 1920,    0, 1775, 1762, 1585,  945, 2970,
-     2096, 1949, 2188, 2207, 1772, 1743, 2250, 1745, 1677, 1563,
-     1551, 1686,  681, 2260, 1568, 1502, 2258, 1408, 1406, 2243,
-     2170, 1358, 1313, 1240, 1258, 1751, 1127, 2261, 2312, 1072,
-      926, 2279, 2133,  809, 1969, 2073,    0,  855,  705,  711,
-     1429, 2317, 2305,    0, 2284,  631, 4517,  546, 2094,  480,
-     4517,  413,  392, 4517, 1794, 2351, 2357, 2298,  325,  206,
-     1884, 2303, 2352,  203, 1915,  365, 2138, 2221, 2364, 2365,
-     2369, 2370, 2371, 2372, 2373, 2427, 2444, 2451, 2452, 2453,
-     2454, 2456, 2296,  179, 4517, 4517, 3040, 3059, 3072, 3086,
-
-     3105, 3124, 3140, 3159, 3178, 3196, 1267, 1342, 1671, 3214,
-     3233, 1702, 3252, 3271, 3290, 3309, 3328, 3347, 3366, 3385,
-     3404, 3416, 3435, 3454, 3473, 3492, 3511, 3519, 1896, 3529,
-     3545, 3564, 3580, 3599, 3618, 3637, 3656, 3675, 3694, 3713,
-     3732, 3744, 3763, 3782, 3801, 3820, 3839, 3858, 3877, 3893,
-     3908, 3924, 3943, 3962, 3981, 3997, 4016, 4035, 4054, 4073,
-     4092, 4111, 4130, 4149, 4168, 4187, 4206, 4225, 4244, 4259,
-     4278, 4297, 4316, 4331, 4345, 4364, 4383, 4402, 4421, 4440,
-     4459, 4478, 4497
+        0,   73, 3814, 3815,  122,  131,    0,  142, 3809,  140,
+      151,  171,  162, 3809,  231,  159, 3757, 3746,  119, 3762,
+      143, 3757, 3741,  190,  301,  361,  211,  207,  279,  215,
+      224,  284,  243,  286,  301,  303,  305, 3759,  232, 3754,
+     3738,  264,  351, 3799,  149,  379,  430,  351,  255,  493,
+      212, 3748, 3737,  327, 3753,  157, 3748, 3732,  331,  555,
+      372,  245,  378,  351,  468,  530,  475,  477,  505,  523,
+      508,  576,  578,  385,  579,  610,  615, 3744,  372,    0,
+     3786,  309,  630,  431, 3815, 3782,  675,  575,  405, 3776,
+     3776, 3774,  450,  639, 3774,  472,  165,  640, 3773,    0,
+
+     3786, 3815,    0,  699,    0,  744,    0,  648,  787,  652,
+      656, 3649, 3636, 3591,  693, 3601, 3594,  697, 3584,  664,
+     3585,  856,  352,  929, 3815,  956, 1006,    0, 1031, 1080,
+      660,  717,  721, 3563, 3567, 3551, 3514, 3523,  435, 3504,
+      757, 3572, 3571,  497, 3496,  517,  607,  550,  681, 1130,
+      160,  518,  554, 1193, 1238, 3477,  686,  762,  787,  764,
+      617,  676,  750, 3424,  803,  816,  864,  835, 1262, 1312,
+     3439, 1337, 1387,  874,  888,  895,  700,  823,  865,  762,
+      866,  885, 3360,  583,  610,  626,  652,  676,  944,  949,
+     3394, 3260, 3815,  882, 1190, 3328, 3286, 3281, 3270, 3279,
+
+     3278,    0, 3815, 3277, 3266, 3263, 3262, 3182,  799,  830,
+      900,  958, 1412,  928,  962,  966, 1457, 3130, 3120, 3119,
+     3130, 3108,  382,  970, 1075, 3071,  759, 2895, 2927, 2884,
+     2880, 1108,  572, 1213,  739, 1527, 1591,    0, 1596,    0,
+     2927, 2844, 2843,  974, 1202, 1246, 1645, 2840, 2838,  238,
+     2799, 2797, 2814, 2743, 3815, 1210, 1084, 2630,  211, 2628,
+     1121, 1132,  606, 1253,  697, 2626,  895, 1217, 1688, 2624,
+     1258, 1733, 1467, 1472,  901, 1536, 1252, 1532, 1535, 1538,
+     1549, 1795, 1800, 2623,  810, 2615, 1556, 1849, 1259, 1573,
+     1473, 1474, 1541, 1543, 1583, 2574, 3815,  778,  832,  913,
+
+      985,  989, 1007, 3815, 1593, 2613, 2612, 2549, 2548, 1281,
+     1646, 2568, 2554, 2550, 2550,  585, 2549,  367, 2487,  636,
+     1680, 1125, 3815, 2480, 1679, 2479, 2463, 1854, 1678, 3815,
+     1287, 2407, 2407, 2403, 2401, 2401, 2402, 2404, 2403,  968,
+      510,  598,    0, 2421, 2405, 2406, 2405, 1007, 1161, 1046,
+     1354, 2450, 2443, 1455, 3815, 1694, 1510, 2442, 1161, 1585,
+     1700, 2441, 1209, 3815, 2389,    0, 2389, 1789, 2445, 1577,
+     1711, 2401, 2386, 2443,  403, 1709, 1281,  374, 1131, 1710,
+     1866, 2441, 1741,  819, 1744, 1921, 1746, 1315, 1686, 1789,
+     1748, 1793, 1754, 1852, 1917, 1571, 1919, 1930, 2392, 1127,
+
+     2431, 1221, 1244, 1392, 1421, 1486, 2418, 1620, 2429, 2366,
+     2427, 2361, 2422, 2359, 2413, 1923, 3815, 1994, 2381, 2377,
+     1452, 2377, 2372, 2361, 2421, 1266, 1919, 2420,  688, 2394,
+     2370, 2359, 2358, 2412, 1684, 1660, 3815, 2406, 1891,  933,
+     1388, 1579, 2399, 2398, 1462, 3815, 2346,    0, 2379, 1928,
+     2371, 1645, 2371, 2328, 2321, 1603, 1495, 1269, 2029, 1941,
+     1925, 1943, 1928, 1939, 1932, 1947, 1950, 1954, 1957, 1971,
+     1350, 1515, 2374, 1568, 1573, 3815, 1976, 1756, 2373, 2372,
+     2309, 2308, 2369, 2368, 2305, 2304, 2365, 2357, 2287, 2285,
+     2341, 2337, 1959, 1966, 2344, 2293, 2302, 1746,  760, 2299,
+
+     3815, 2304, 2334, 2293, 2267, 2308, 2285, 2292, 2262, 1655,
+     2274, 3815, 1995, 3815, 2301, 3815, 2294, 2070, 2297, 2243,
+     2232, 2279, 1791, 1814, 1812, 1991, 2032, 2065, 2071, 2072,
+     2073, 1974, 3815, 2230, 2269, 1647, 2089, 2268, 2274, 2271,
+     3815, 2214, 2215, 3815, 2181, 2228, 2221, 2169, 2225, 2188,
+     2161, 2184, 2156, 2164,    0, 2141, 2093, 2197, 2133, 1836,
+     1662, 2074, 2076, 2082, 2095, 2106, 2002, 2130, 2146, 1724,
+     2016, 1985, 2033, 1997,  958, 2003, 1946, 2172, 1919, 1903,
+     1880, 1767, 1842, 2245, 2108, 2004, 1805, 1815, 1814, 3815,
+     1794, 1920, 1960, 2318, 2077,    0, 1788, 1630, 2046,  598,
+
+     2391, 2114, 2097, 2110, 2125, 1592, 1532, 2109, 1524, 1460,
+     1444, 1439, 1810,  758, 2118, 1443, 1374, 2132, 1261, 1257,
+     2094, 2095, 1253, 1188, 1154, 1199, 2130, 1866, 2139, 2166,
+     1117, 1053, 2147, 2087,  995, 2122, 2155,    0, 1027,  895,
+      924, 2152, 2206, 2212,    0, 2154,  839, 3815,  821, 2158,
+      787, 3815,  567,  501, 3815, 2155, 2209, 2232, 2219,  380,
+      362, 1838, 2233, 2220,  288, 2197, 1969, 2005, 2157, 2270,
+     2274, 2292, 2293, 2294, 2296, 2297, 2299, 2300, 2301, 2302,
+     2332, 2345, 2347, 2199,  190, 3815, 3815, 2461, 2480, 2493,
+     2507, 2526, 2545, 2561, 2580, 2599, 2617, 1883, 1994, 1999,
+
+     2635, 2654, 2030, 2673, 2692, 2711, 2730, 2749, 2768, 2787,
+     2806, 2825, 2837, 2856, 2875, 2894, 2913, 2921, 2148, 2931,
+     2947, 2966, 2985, 3004, 3023, 3042, 3061, 3080, 3099, 3118,
+     3137, 3156, 3168, 3187, 3206, 3225, 3244, 3260, 3275, 3291,
+     3310, 3326, 3345, 3364, 3383, 3402, 3421, 3440, 3459, 3478,
+     3497, 3516, 3535, 3554, 3569, 3588, 3607, 3622, 3636, 3655,
+     3674, 3693, 3712, 3731, 3750, 3769
     } ;
 
-static yyconst short int yy_def[784] =
+static yyconst flex_int16_t yy_def[767] =
     {   0,
-      696,  696,  696,  696,  696,  696,  697,  698,  696,  699,
-      697,  696,   12,  700,  697,   15,   15,   15,   15,   15,
-       15,   15,   15,   15,   15,  701,  697,   27,   27,   27,
-       27,   27,   27,   27,   27,   27,   27,   27,  697,  697,
-      697,  697,  697,  702,  696,  703,  703,  696,   48,  700,
-      703,   51,   51,   51,   51,   51,   51,   51,   51,   51,
-       51,  703,   62,   62,   62,   62,   62,   62,   62,   62,
-       62,   62,   62,  703,  703,  703,  703,  703,  702,  696,
-      696,  697,  704,  705,  704,  696,  696,  696,  696,  696,
-      697,  696,  697,  696,  706,  706,  697,  706,  696,   12,
-
-      696,  697,  700,  696,  707,  697,  708,  697,  709,  108,
-      696,  108,  108,  697,  697,  697,  697,  108,  106,  697,
-      108,  697,  108,  108,  697,  710,  701,  710,  711,  696,
-      697,  696,  712,  697,  697,  697,  697,  697,  697,  697,
-      697,  697,  697,  702,  713,  702,  696,  714,  703,  696,
-      703,  703,  696,  703,  696,  696,  703,  715,  703,  159,
-      709,  160,  160,  160,  703,  703,  703,  703,  160,  159,
-      703,  160,  703,  160,  160,  703,  159,  696,  712,  159,
-      696,  703,  703,  703,  703,  703,  703,  703,  703,  702,
-      696,  716,  717,  717,  718,  719,  716,  716,  720,  721,
-
-      696,  722,  722,  696,  696,  696,  697,  697,  696,  697,
-      696,  696,  696,  696,  697,  696,  696,  696,  697,  696,
-      697,  722,  697,  696,  697,  696,  696,  696,  696,  697,
-      697,  697,  697,  697,  697,  697,  697,  697,  697,  723,
-      724,  725,  726,  727,  697,  728,  697,  729,  728,  697,
-      247,  697,  730,  730,  697,  254,  697,  697,  697,  697,
-      697,  697,  696,  702,  696,  731,  696,  732,  733,  733,
-      733,  733,  734,  731,  735,  733,  733,  222,  733,  277,
-      733,  733,  733,  733,  733,  733,  733,  733,  733,  733,
-      736,  733,  277,  729,  733,  293,  733,  292,  733,  733,
-
-      733,  733,  733,  733,  702,  696,  696,  737,  737,  738,
-      696,  739,  740,  740,  741,  741,  696,  742,  696,  696,
-      696,  697,  696,  696,  696,  696,  696,  696,  696,  696,
-      697,  742,  697,  696,  697,  332,  696,  697,  696,  696,
-      696,  696,  697,  697,  697,  696,  697,  743,  697,  697,
-      697,  697,  697,  744,  745,  745,  746,  746,  747,  748,
-      749,  696,  696,  696,  750,  751,  696,  696,  751,  751,
-      697,  697,  696,  696,  697,  697,  702,  696,  696,  696,
-      696,  696,  752,  696,  733,  753,  753,  733,  733,  293,
-      336,  733,  733,  733,  733,  733,  754,  733,  733,  733,
-
-      733,  733,  755,  744,  755,  756,  733,  733,  733,  733,
-      702,  696,  757,  758,  696,  696,  759,  760,  761,  762,
-      763,  764,  696,  696,  696,  697,  696,  696,  696,  696,
-      697,  697,  696,  697,  696,  697,  697,  765,  766,  766,
-      697,  697,  697,  767,  768,  696,  769,  696,  770,  770,
-      770,  697,  696,  696,  696,  696,  697,  696,  702,  696,
-      696,  696,  696,  696,  771,  772,  772,  733,  733,  733,
-      733,  733,  733,  754,  765,  474,  733,  733,  733,  773,
-      733,  733,  702,  696,  696,  758,  774,  759,  759,  760,
-      760,  761,  761,  762,  762,  763,  763,  764,  764,  696,
-
-      696,  774,  774,  697,  696,  696,  696,  696,  697,  775,
-      696,  696,  696,  696,  697,  697,  697,  697,  696,  696,
-      696,  696,  696,  696,  702,  696,  696,  696,  771,  771,
-      772,  772,  733,  733,  733,  733,  776,  733,  733,  773,
-      702,  696,  696,  758,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  775,  775,  696,  696,  696,  696,  697,
-      697,  697,  697,  697,  702,  696,  696,  772,  772,  733,
-      733,  776,  733,  733,  733,  702,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  777,  697,  696,  696,
-      772,  772,  778,  733,  702,  696,  696,  696,  696,  696,
-
-      779,  779,  777,  603,  697,  696,  696,  772,  772,  778,
-      779,  610,  733,  702,  696,  696,  779,  603,  603,  696,
-      696,  772,  772,  780,  610,  610,  702,  696,  696,  779,
-      779,  603,  603,  696,  696,  772,  772,  780,  780,  610,
-      610,  702,  696,  696,  779,  779,  603,  781,  696,  782,
-      772,  780,  780,  610,  702,  696,  696,  696,  779,  781,
-      696,  696,  782,  696,  772,  780,  780,  702,  696,  696,
-      772,  780,  702,  696,  772,  702,  783,  783,  783,  783,
-      783,  783,  783,  783,  783,  783,  783,  783,  783,  783,
-      783,  783,  783,  696,  696,    0,  696,  696,  696,  696,
-
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696
+      687,  687,  687,  687,  687,  687,  688,  689,  687,  690,
+      688,  687,   12,  691,  688,   15,   15,   15,   15,   15,
+       15,   15,   15,   15,  692,  688,   26,   26,   26,   26,
+       26,   26,   26,   26,   26,   26,   26,  688,  688,  688,
+      688,  688,  693,  687,  694,  694,  687,   47,  691,  694,
+       50,   50,   50,   50,   50,   50,   50,   50,   50,  694,
+       60,   60,   60,   60,   60,   60,   60,   60,   60,   60,
+       60,  694,  694,  694,  694,  694,  693,  687,  687,  688,
+      695,  696,  695,  687,  687,  687,  687,  687,  688,  687,
+      688,  687,  697,  697,  688,  697,  687,   12,  687,  688,
+
+      691,  687,  698,  688,  699,  688,  700,  106,  687,  106,
+      106,  688,  688,  688,  106,  104,  688,  106,  688,  106,
+      701,  692,  701,  702,  687,  688,  687,  703,  688,  688,
+      688,  688,  688,  688,  688,  688,  688,  688,  693,  704,
+      693,  687,  705,  694,  687,  694,  694,  687,  694,  687,
+      687,  694,  706,  694,  154,  700,  155,  155,  155,  694,
+      694,  694,  155,  154,  694,  155,  694,  155,  154,  687,
+      703,  154,  687,  694,  694,  694,  694,  694,  694,  694,
+      694,  693,  687,  707,  708,  708,  709,  710,  707,  707,
+      711,  712,  687,  713,  713,  687,  687,  687,  688,  688,
+
+      687,  688,  687,  687,  687,  687,  688,  687,  687,  687,
+      688,  687,  688,  713,  688,  687,  688,  687,  687,  687,
+      687,  687,  687,  688,  688,  688,  688,  688,  688,  688,
+      688,  688,  714,  715,  716,  717,  688,  718,  688,  719,
+      718,  688,  239,  688,  720,  720,  688,  246,  688,  688,
+      688,  688,  688,  688,  687,  693,  687,  721,  687,  722,
+      694,  694,  694,  694,  723,  721,  724,  694,  694,  214,
+      694,  269,  694,  694,  694,  694,  694,  694,  694,  694,
+      694,  694,  269,  719,  694,  283,  694,  282,  694,  694,
+      694,  694,  694,  694,  693,  687,  687,  725,  726,  727,
+
+      728,  725,  729,  687,  730,  731,  731,  732,  732,  687,
+      733,  687,  687,  687,  688,  687,  687,  687,  687,  687,
+      687,  687,  687,  688,  733,  688,  687,  688,  325,  687,
+      688,  687,  687,  687,  687,  687,  687,  688,  688,  688,
+      687,  688,  688,  688,  688,  688,  688,  734,  734,  735,
+      736,  737,  687,  687,  687,  738,  739,  687,  687,  739,
+      739,  688,  688,  687,  687,  688,  688,  693,  687,  687,
+      687,  687,  687,  740,  687,  694,  741,  741,  694,  694,
+      283,  329,  694,  694,  694,  694,  694,  694,  694,  694,
+      694,  694,  742,  694,  694,  694,  694,  693,  687,  727,
+
+      743,  744,  728,  745,  729,  730,  687,  687,  746,  747,
+      748,  749,  750,  751,  687,  687,  687,  688,  687,  687,
+      687,  687,  687,  687,  688,  688,  687,  688,  687,  688,
+      688,  688,  688,  688,  752,  753,  687,  754,  687,  755,
+      755,  755,  688,  687,  687,  687,  687,  688,  687,  693,
+      687,  687,  687,  687,  687,  756,  741,  741,  694,  694,
+      694,  694,  694,  694,  694,  694,  694,  694,  694,  693,
+      687,  744,  757,  728,  745,  687,  730,  758,  746,  746,
+      747,  747,  748,  748,  749,  749,  750,  750,  751,  751,
+      687,  687,  758,  758,  688,  687,  687,  687,  687,  687,
+
+      687,  688,  759,  687,  687,  687,  687,  688,  688,  688,
+      688,  687,  687,  687,  687,  687,  687,  693,  687,  687,
+      687,  756,  756,  741,  741,  694,  694,  694,  694,  694,
+      694,  693,  687,  687,  757,  744,  730,  687,  687,  687,
+      687,  687,  687,  687,  687,  759,  759,  687,  687,  687,
+      687,  688,  688,  688,  688,  688,  693,  687,  687,  741,
+      741,  694,  694,  694,  694,  694,  693,  687,  687,  687,
+      687,  687,  687,  687,  687,  687,  687,  760,  688,  687,
+      687,  741,  741,  761,  694,  693,  687,  687,  687,  687,
+      687,  762,  762,  760,  594,  688,  687,  687,  741,  741,
+
+      761,  762,  601,  694,  693,  687,  687,  762,  594,  594,
+      687,  687,  741,  741,  763,  601,  601,  693,  687,  687,
+      762,  762,  594,  594,  687,  687,  741,  741,  763,  763,
+      601,  601,  693,  687,  687,  762,  762,  594,  764,  687,
+      765,  741,  763,  763,  601,  693,  687,  687,  687,  762,
+      764,  687,  687,  765,  687,  741,  763,  763,  693,  687,
+      687,  741,  763,  693,  687,  741,  693,  766,  766,  766,
+      766,  766,  766,  766,  766,  766,  766,  766,  766,  766,
+      766,  766,  766,  766,  687,  687,    0,  687,  687,  687,
+      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
+
+      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
+      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
+      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
+      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
+      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
+      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
+      687,  687,  687,  687,  687,  687
     } ;
 
-static yyconst short int yy_nxt[4591] =
+static yyconst flex_int16_t yy_nxt[3889] =
     {   0,
         4,    4,    4,    5,    4,    4,    6,    4,    7,    8,
         4,    9,   10,    7,    4,    4,   11,   12,   13,   13,
         4,   14,    4,    4,   15,   16,   17,   18,   15,   15,
-       19,   15,   15,   15,   20,   21,   15,   22,   23,   24,
-       15,   25,   15,   26,    4,    4,   27,   28,   29,   30,
-       31,   32,   33,   34,   35,   36,   37,   38,   39,    7,
-       40,    7,    7,   41,   42,    7,    7,    7,   43,    7,
-        7,   44,    4,    4,    4,    4,    5,    4,   45,    6,
-       45,    7,    8,    4,    9,   10,   46,    4,    4,   47,
-       48,   49,   49,    4,   50,    4,    4,   51,   52,   53,
-
-       54,   51,   51,   55,   51,   51,   51,   56,   57,   51,
-       58,   59,   60,   51,   61,   51,   26,    4,    4,   62,
-       63,   64,   65,   66,   67,   68,   69,   70,   71,   72,
-       73,   74,   46,   75,   46,   46,   76,   77,   46,   46,
-       46,   78,   46,   46,   79,    4,   80,   81,   81,   81,
-       81,   84,   87,   88,   90,  115,  119,   82,   85,   85,
-       85,   85,  111,  268,   91,   95,   92,   93,   80,  150,
-      170,   94,   95,   95,   96,   82,  216,  696,  116,   82,
-      120,  695,  696,  199,   97,   98,   99,  100,  100,  100,
-      100,  101,  104,  158,  171,  102,  102,  102,  102,  102,
-
-      102,  102,  102,   82,  102,   82,   82,  102,  102,  102,
-       82,   82,  102,   82,  111,  111,  112,  102,  102,  102,
-      102,  102,  102,  102,  102,  102,  102,  102,  102,   82,
-      102,  102,  102,  102,  102,   82,   82,   82,   82,   82,
-       82,   82,  105,  111,  106,  200,  107,  108,  108,  108,
-      108,  109,  140,  648,  105,  136,  268,  135,  135,  204,
-      135,  205,  138,  674,  123,  124,  206,  136,  136,  137,
-      209,  125,  166,  106,  135,  135,  135,  110,  110,  110,
-      110,  110,  110,  110,  110,  110,  110,  110,  110,  136,
-      136,  104,  135,  135,  135,  167,  216,  163,  217,  141,
-
-      106,  126,  127,  127,  127,  126,  126,  126,  126,  126,
-      126,  126,  126,  126,  128,  126,  126,  111,  195,  196,
-      145,  126,  126,  126,  126,  136,  136,  135,  135,  135,
-      136,  136,  136,  136,  135,  135,  135,  115,  135,  135,
-      135,  111,  114,  569,  126,  130,  126,  136,  136,  136,
-      136,   95,  135,  135,  135,  136,  136,  135,  135,  135,
-      116,  149,  181,  696,  135,  135,  135,  677,  150,  207,
-      208,  183,  126,  126,  131,  136,  136,  132,  132,  132,
-      132,  133,  111,   90,  542,  135,  135,  328,   82,  117,
-      147,  143,  125,  151,  664,   92,  152,  329,  125,  182,
-
-      153,  181,  181,  134,  329,  145,  184,  135,  135,  136,
-      136,  136,  136,  136,  136,  136,  136,  136,  136,  146,
-      146,  146,  146,  182,  182,  181,  181,  181,  182,  182,
-      134,   82,  174,  175,  181,  181,  181,  147,   82,  176,
-      165,  182,  182,  150,  181,  181,  181,  182,  182,  166,
-      150,  181,  181,  181,  182,  182,   82,  274,  275,  182,
-      182,  181,  181,  181,  181,  181,  181,  670,  150,  185,
-      182,  182,  167,  193,  307,  147,   95,   95,   96,  181,
-      181,  181,  661,   82,   81,   81,   81,   81,  154,   98,
-       99,  155,  155,  155,  155,  156,  195,  308,  188,  157,
-
-      157,  157,  157,  157,  157,  157,  157,  149,  157,  149,
-      149,  157,  157,  157,  149,  149,  157,  149,   95,   95,
-       95,  157,  157,  157,  157,  157,  157,  157,  157,  157,
-      157,  157,  157,  149,  157,  157,  157,  157,  157,  149,
-      149,  149,  149,  149,  149,  149,   82,  195,  308,  105,
-      241,  159,   82,  107,  160,  160,  160,  160,  161,  182,
-      182,  105,  182,  182,  150,  310,  311,  181,  181,  181,
-       82,   82,  181,  181,  374,  186,  168,   95,   95,   95,
-      159,  130,  150,  150,  162,  162,  162,  162,  162,  162,
-      162,  162,  162,  162,  162,  162,  225,  225,  225,  225,
-
-       82,  104,  225,  225,  225,  225,  669,  159,   82,  173,
-      111,   82,  150,  177,  145,   82,  178,  178,  178,  178,
-      179,  375,  187,  150,  417,  190,  193,  150,  146,  146,
-      146,  146,  230,  197,  197,  197,  197,  198,  225,  225,
-      225,  225,  180,  284,  274,  275,  181,  181,  182,  182,
-      182,  182,  182,  182,  182,  182,  182,  182,   95,  467,
-      189,  176,   95,   95,   95,   82,   82,  176,   82,  180,
-      696,  226,  231,  227,  212,  696,  213,  150,  150,  228,
-      657,  214,  229,  104,  147,  109,  418,  107,  202,  202,
-      202,  202,  109,  226,  271,  227,  225,  225,  225,  225,
-
-       82,  348,  228,  255,  255,  255,  255,  229,  225,  225,
-      225,  225,  150,  664,  109,  348,  348,  291,  203,  203,
-      203,  203,  203,  203,  203,  203,  203,  203,  203,  203,
-      225,  225,  225,  225,  239,  358,  225,  225,  225,  225,
-      637,  109,  219,  219,  219,  219,  219,  219,  219,  219,
-      219,  219,  219,  219,  221,   82,  662,  235,  284,  346,
-      216,  222,  217,  269,  270,  360,  130,  150,   82,  255,
-      255,  255,  255,  255,  255,  255,  255,  381,  237,  240,
-      150,  433,  347,  221,  310,  311,  382,  223,  223,  223,
-      223,  223,  223,  223,  223,  223,  223,  223,  223,  259,
-
-      280,  280,  280,  280,  347,  361,  283,  260,  310,  311,
-      221,  126,  127,  127,  127,  126,  126,  126,  126,  126,
-      126,  126,  126,  126,  126,  126,  126,  145,   82,  104,
-      591,  126,  126,  126,  126,  423,  271,  434,   82,   82,
-      150,  146,  146,  146,  146,  264,  272,  145,  323,  424,
-      150,  150,   82,   82,  126,  130,  126,  661,  305,  280,
-      280,  280,  280,  658,  150,  150,  280,  280,  280,  280,
-      280,  280,  280,  280,  280,  280,  280,  280,  280,  280,
-      280,  280,  126,  126,  126,  242,  242,  242,  243,  281,
-      126,  126,  126,  126,  126,  126,  286,  147,  126,  126,
-
-      282,   82,   82,   82,  126,  126,  104,  126,  285,  280,
-      280,  280,  280,  150,  150,  150,  290,  147,  435,  286,
-      327,   82,  288,   82,  374,   82,   82,  126,  130,  298,
-      298,  298,  298,  150,   82,  150,   82,  150,  150,  289,
-      435,  385,  298,  298,  298,  298,  150,  104,  150,  304,
-      466,  436,  291,  358,  303,  126,  126,  245,  245,  245,
-      245,  245,  245,  245,  245,  245,  245,  245,  245,   82,
-      246,  373,  301,  437,  247,  271,  654,   82,   82,   82,
-       82,  248,  288,  249,  130,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-
-      250,  250,  250,  251,  465,  623,  465,  252,  252,  252,
-      252,  252,  252,  252,  252,  252,  252,  252,  252,   82,
-       82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
-      247,   82,  135,  135,  135,  135,  135,  135,  135,  135,
-      135,  135,  135,  135,  254,  330,  330,  330,  330,  542,
-      378,  255,  255,  255,  255,  379,  380,  256,  543,  257,
-      257,  257,  257,  257,  257,  257,  257,  257,  257,  257,
-      257,  257,  257,  257,  257,  257,  257,  257,  331,  331,
-      331,  331,  193,  307,  509,  258,   95,   95,   95,  312,
-      312,  312,  312,   82,  332,  332,  332,  332,  149,   98,
-
-      654,  155,  155,  155,  155,  150,  513,  509,  419,  157,
-      157,  157,  157,  157,  157,  157,  157,  149,  157,  149,
-      149,  157,  157,  157,  149,  149,  157,  149,  514,  104,
-      651,  157,  157,  157,  157,  157,  157,  157,  157,  157,
-      157,  157,  157,  149,  157,  157,  157,  157,  157,  149,
-      149,  149,  149,  149,  149,  149,   82,   82,  104,  222,
-      696,  333,  333,  333,  333,   82,  222,  696,  150,  150,
-      420,  193,  307,  298,  298,  298,  298,  150,  197,  197,
-      197,  197,  198,  334,  334,  334,  334,  456,  222,  696,
-      365,  365,  365,  365,  276,  276,  276,  276,  276,  276,
-
-      276,  276,  276,  276,  276,  276,  277,  302,  386,  242,
-      242,  242,  243,  278,  402,  222,  696,  387,  415,  415,
-      415,  415,  222,  444,   82,  318,  318,  318,  318,  222,
-      333,  333,  333,  333,  457,  277,  150,  360,  337,  279,
-      279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
-      279,  222,  130,  212,  130,  213,  333,  333,  333,  333,
-      214,  649,  277,  292,  292,  292,  292,  292,  292,  292,
-      292,  292,  292,  292,  292,   82,  246,  361,  222,  353,
-      293,  218,  218,  149,  149,  149,  149,  294,  343,  249,
-      648,  295,  295,  295,  295,  295,  295,  295,  295,  295,
-
-      295,  295,  295,  295,  295,  295,  295,  295,  295,  296,
-      445,  445,  445,  297,  297,  297,  297,  297,  297,  297,
-      297,  297,  297,  297,  297,  149,  149,  149,  149,  149,
-      149,  149,  149,  149,  149,  149,  293,  149,  181,  181,
-      181,  181,  181,  181,  181,  181,  181,  181,  181,  181,
-       82,  254,  450,  446,  444,  149,  220,  220,  298,  298,
-      298,  298,  150,  647,  256,  451,  299,  299,  299,  299,
-      299,  299,  299,  299,  299,  299,  299,  299,  299,  299,
-      299,  299,  299,  299,  299,  519,  647,  104,  149,  149,
-      149,  149,  300,  149,  149,  149,  149,  149,  149,  149,
-
-      149,  149,  149,  149,  149,  149,  149,  149,  149,  149,
-      149,  149,  149,  223,  223,  223,  223,  223,  223,  223,
-      223,  223,  223,  223,  223,  335,  426,  426,  426,  426,
-      456,  104,  336,  369,  337,  254,  608,   82,  333,  333,
-      333,  333,  366,  366,  366,  366,  370,  104,  256,  150,
-      449,  449,  449,  449,  335,  530,  384,  530,  338,  338,
-      338,  338,  338,  338,  338,  338,  338,  338,  338,  338,
-      344,  644,   82,  643,  454,  104,  368,  455,   82,  398,
-      665,  335,  354,  354,  150,  354,  354,  354,  354,  354,
-      150,  354,  354,  354,  354,  568,  354,  354,   82,  696,
-
-      696,  145,  354,  354,  354,  354,  696,  696,  696,  696,
-      150,   82,  696,  696,  397,  377,  377,  377,  377,  388,
-      388,  388,  388,  150,   82,  354,  354,  354,  397,  397,
-       82,   82,  389,  389,  389,  389,  150,  532,  395,   82,
-      696,  145,  150,  150,  400,  425,  356,  389,  389,  389,
-      389,  150,  411,  354,  354,  126,  242,  242,  242,  243,
-      641,  126,  126,  126,  126,  126,  126,  104,  346,  126,
-      126,  147,   82,   82,   82,  126,  126,  104,  126,  393,
-      389,  389,  389,  389,  150,  150,  150,  104,   82,   82,
-       82,  396,  364,  399,  410,   82,   82,  373,  126,  130,
-
-      150,  150,  150,  640,  193,  485,   82,  150,  150,  486,
-      635,  147,  394,  396,  389,  389,  389,  389,  150,  609,
-      634,   82,   82,  401,  696,  369,  126,  126,  254,  406,
-      406,  406,  406,  150,  150,  696,  393,  696,  696,  622,
-      592,  256,  696,  257,  257,  257,  257,  257,  257,  257,
-      257,  257,  257,  257,  257,  257,  257,  257,  257,  257,
-      257,  257,  394,  402,  696,  696,  696,  617,  511,  258,
-      252,  252,  252,  252,  252,  252,  252,  252,  252,  252,
-      252,  252,  369,  421,   82,  224,  224,  329,  104,  617,
-      374,  696,  421,  511,  329,  370,  150,  371,  371,  371,
-
-      371,  371,  371,  371,  371,  371,  371,  371,  371,  371,
-      371,  371,  371,  371,  371,  371,  253,  253,  193,  307,
-      104,   82,  336,  372,   82,  414,  414,  414,  414,  336,
-       90,  337,  336,  150,   82,  633,  150,  409,  461,  336,
-      460,  696,   92,  636,   82,  422,  150,   94,  462,  145,
-       99,  336,  271,  104,  422,  101,  150,  445,  445,  445,
-      483,  336,  279,  279,  279,  279,  279,  279,  279,  279,
-      279,  279,  279,  279,  390,   82,  531,  450,  336,   82,
-      632,  391,  469,  337,   82,  450,  502,  150,  336,   82,
-      696,  150,   82,   82,   82,   82,  104,  629,  451,  503,
-
-      446,  650,  472,  390,  520,  520,  520,  392,  392,  392,
-      392,  392,  392,  392,  392,  392,  392,  392,  392,  147,
-      628,   82,  621,  470,  473,  487,  487,  487,  487,  620,
-      390,  354,  354,  150,  354,  354,  354,  354,  354,  355,
-      354,  354,  354,  354,  145,  354,  354,  521,  671,  696,
-      271,  404,  354,  354,  354,   82,   82,   82,  459,  459,
-      459,  459,  696,  468,  468,  468,  468,  150,  150,  150,
-       82,  616,  500,  145,  354,  354,  354,   82,   82,  455,
-      523,  599,  150,  433,  501,  525,  104,   82,   82,  150,
-      150,  111,  433,  456,   82,  405,   82,   82,  478,  150,
-
-      150,  477,  354,  354,   82,  254,  150,   82,  150,  150,
-      363,  363,  479,  615,  147,  542,  150,  104,  256,  150,
-      299,  299,  299,  299,  299,  299,  299,  299,  299,  299,
-      299,  299,  299,  299,  299,  299,  299,  299,  299,  471,
-      482,  675,  617,  526,  618,  538,  300,  297,  297,  297,
-      297,  297,  297,  297,  297,  297,  297,  297,  297,  369,
-      145,  530,  384,  530,  617,  650,  619,  607,  606,  605,
-      601,  541,  370,  625,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  601,  600,  626,  582,  659,  597,  617,
-
-      408,  338,  338,  338,  338,  338,  338,  338,  338,  338,
-      338,  338,  338,  438,  438,  510,  438,  438,  438,  438,
-      438,  617,  438,  438,  438,  438,  502,  438,  438,   82,
-      147,   82,  547,  438,  438,  438,  438,   82,  450,  696,
-      476,  150,  149,  150,  511,  149,  149,  149,  149,  150,
-       82,  451,   82,  512,  476,  476,  438,  438,  438,  596,
-       82,  551,  150,  440,  150,  384,  111,  590,  562,  511,
-      535,   82,  150,  536,  589,  552,   82,  440,  440,  534,
-      598,  271,  563,  150,  438,  438,  354,  354,  150,  354,
-      354,  354,  354,  354,  599,  354,  354,  354,  354,  624,
-
-      354,  354,  534,  617,  193,  307,  354,  354,  354,  354,
-      539,  544,  544,  544,  544,   82,   82,  548,  520,  520,
-      520,  145,   82,  659,  617,  617,  617,  150,  150,  354,
-      354,  354,  571,   82,  150,  565,  565,  565,  565,   82,
-      679,  145,  588,   82,   82,  150,  617,  563,  617,  587,
-      587,  150,  576,  570,  185,  150,  150,  354,  354,  354,
-      354,  521,  354,  354,  354,  354,  354,  586,  354,  354,
-      354,  354,   82,  354,  354,  573,   82,  575,   82,  354,
-      354,  354,  354,  656,  150,  193,  485,  585,  150,  574,
-      150,  147,  544,  544,  544,  544,   82,  657,  145,  593,
-
-      617,  584,  354,  354,  354,  145,  145,  593,  150,  145,
-      263,  147,  565,  565,  565,  565,  595,  614,  583,  574,
-      627,  555,  617,  679,  555,  582,  552,  581,  646,  594,
-      354,  354,  392,  392,  392,  392,  392,  392,  392,  392,
-      392,  392,  392,  392,  438,  438,  580,  438,  438,  438,
-      438,  438,  439,  438,  438,  438,  438,   82,  438,  438,
-      145,  579,  384,  384,  475,  438,  438,  438,  526,  150,
-      578,  642,  548,  617,  630,  147,  147,  577,  645,  147,
-      617,  145,  384,  384,  384,  567,  145,  438,  438,  438,
-      639,  639,  655,  263,  476,  617,  631,  668,  679,  613,
-
-      145,  566,  617,  265,  455,  384,  523,  384,  476,  476,
-      564,  673,  639,  639,  384,  438,  438,  354,  354,  384,
-      354,  354,  354,  354,  354,  355,  354,  354,  354,  354,
-      147,  354,  354,  639,  561,  639,  652,  404,  354,  354,
-      354,  560,  639,  559,  558,  557,  556,  639,  555,  139,
-      553,  147,  666,  384,  145,  639,  147,  639,  653,  384,
-      354,  354,  354,  667,  639,  676,  679,  679,  694,  639,
-      147,  679,  679,  679,  679,  679,  550,  680,  681,  672,
-      549,  639,  682,  683,  684,  685,  686,  639,  354,  354,
-      354,  354,  548,  354,  354,  354,  354,  354,  355,  354,
-
-      354,  354,  354,  639,  354,  354,  547,  672,  546,  639,
-      404,  354,  354,  354,  499,  499,  497,  497,  495,  495,
-      493,  493,  491,  491,  147,  489,  489,  384,  537,  679,
-      528,  527,  216,  354,  354,  354,  263,  263,  209,  373,
-      687,  263,  263,  263,  263,  263,  679,  524,  455,  523,
-      448,  111,  518,  679,  679,  679,  679,  688,  679,  517,
-      516,  354,  354,  502,  689,  690,  691,  692,  515,  693,
-      433,  111,  508,  507,  506,  505,  503,  424,  504,  504,
-      504,  504,  504,  504,  504,  504,  504,  504,  504,  504,
-      504,  504,  504,  504,  504,  504,  504,  438,  438,  263,
-
-      438,  438,  438,  438,  438,  499,  438,  438,  438,  438,
-      497,  438,  438,  495,  493,  491,  263,  438,  438,  438,
-      438,  489,  425,  263,  263,  263,  263,  196,  263,  484,
-      480,  268,  384,  464,  463,   86,  210,  458,  455,  373,
-      438,  438,  438,  364,  448,  443,  442,  441,  210,  432,
-      431,  430,  429,  428,  427,  337,  425,  337,  216,  216,
-      210,  209,  209,  209,  316,  316,  314,  314,  438,  438,
-      438,  438,  196,  438,  438,  438,  438,  438,  412,  438,
-      438,  438,  438,  364,  438,  438,  268,  268,  267,  384,
-      438,  438,  438,  438,  267,  353,  376,  344,  343,  373,
-
-      254,  364,  364,  246,  352,  351,  350,  349,  345,  342,
-      341,  340,  339,  438,  438,  438,  327,  327,  326,  325,
-      440,  324,  323,  323,  322,  321,  320,  319,  316,  314,
-      307,  306,  268,  287,  440,  440,  268,  268,  267,  265,
-      263,  438,  438,   82,  502,  262,  237,  210,  261,  235,
-      130,  240,  238,  210,  236,  150,  234,  503,  233,  533,
-      533,  533,  533,  533,  533,  533,  533,  533,  533,  533,
-      533,  533,  533,  533,  533,  533,  533,  533,  438,  438,
-      233,  438,  438,  438,  438,  438,  439,  438,  438,  438,
-      438,  232,  438,  438,  104,  216,  215,  209,  475,  438,
-
-      438,  438,  210,  209,  201,  193,  191,  173,  172,  169,
-      168,  165,  164,  148,  122,  142,  139,  122,  121,  118,
-      117,  438,  438,  438,  114,  113,  104,   86,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  438,
-      438,  602,  602,  696,  602,  602,  602,  602,  602,  696,
-      602,  602,  602,  602,  696,  602,  602,  696,  696,  696,
-      696,  602,  602,  602,  602,  696,  696,  696,  696,  696,
-      696,  604,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  602,  602,  602,  696,  696,  696,
-
-      696,  696,  696,  604,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  602,  602,  602,  602,  696,  602,  602,  602,
-      602,  602,  603,  602,  602,  602,  602,  696,  602,  602,
-      696,  696,  696,  696,  611,  602,  602,  602,  696,  696,
-      696,  696,  696,  696,  612,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  602,  602,  602,
-      696,  696,  696,  696,  696,  696,  612,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  602,  602,  602,  602,  696,
-
-      602,  602,  602,  602,  602,  696,  602,  602,  602,  602,
-      696,  602,  602,  696,  696,  696,  696,  602,  602,  602,
-      602,  696,  696,  696,  696,  696,  696,  604,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      602,  602,  602,  696,  696,  696,  696,  696,  696,  604,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  602,  602,
-      602,  602,  696,  602,  602,  602,  602,  602,  603,  602,
-      602,  602,  602,  696,  602,  602,  696,  696,  696,  696,
-      611,  602,  602,  602,  696,  696,  696,  696,  696,  696,
-
-      612,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  602,  602,  602,  696,  696,  696,  696,
-      696,  696,  612,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  602,  602,   82,  696,  696,  696,   82,   82,  696,
-      696,   82,   82,   82,   82,   82,   82,   82,   82,   83,
-       83,   83,   83,   83,  696,   83,   83,   83,   83,   83,
-       83,   83,   83,   83,   83,   83,   83,   83,   89,   89,
-      696,  696,  696,   89,   89,   89,  103,  103,  103,  103,
-      103,  103,  103,  103,  103,  103,  103,  103,  103,  103,
-
-      103,  103,  103,  103,  103,  129,  129,  129,  129,  129,
-      129,  129,  129,  129,  129,  129,  129,  129,  129,  129,
-      129,  129,  129,  129,  144,  144,  144,  144,  144,  144,
+       19,   15,   15,   15,   15,   20,   15,   21,   22,   23,
+       15,   24,   15,   25,    4,    4,   26,   27,   28,   29,
+       30,   31,   32,   33,   34,   35,   36,   37,   38,    7,
+       39,    7,    7,   40,   41,    7,    7,    7,   42,    7,
+        7,   43,    4,    4,    4,    4,    5,    4,   44,    6,
+       44,    7,    8,    4,    9,   10,   45,    4,    4,   46,
+       47,   48,   48,    4,   49,    4,    4,   50,   51,   52,
+
+       53,   50,   50,   54,   50,   50,   50,   50,   55,   50,
+       56,   57,   58,   50,   59,   50,   25,    4,    4,   60,
+       61,   62,   63,   64,   65,   66,   67,   68,   69,   70,
+       71,   72,   45,   73,   45,   45,   74,   75,   45,   45,
+       45,   76,   45,   45,   77,    4,   78,   79,   79,   79,
+       79,   82,   85,   86,   88,  113,  116,   80,   83,   83,
+       83,   83,  109,  260,   89,   93,   90,   91,   78,  145,
+      164,   92,   93,   93,   94,   80,  208,  687,  114,   80,
+      117,  208,  687,  209,   95,   96,   97,   98,   98,   98,
+       98,   99,  686,  109,  165,  100,  100,  100,  100,  100,
+
+      100,  100,  100,   80,  100,   80,   80,  100,  100,  100,
+       80,   80,  100,   80,  109,  109,  110,  100,  100,  100,
+      100,  100,  100,  100,  100,  100,  100,  100,  100,   80,
+      100,  100,  100,  100,  100,   80,   80,   80,   80,   80,
+       80,   80,  103,  120,  104,  135,  105,  106,  106,  106,
+      106,  107,  365,  131,  103,  130,  130,  102,  153,  130,
+      133,  131,  131,  372,  130,  130,  130,  109,  132,  158,
+      131,  131,  373,  104,  130,  130,  130,  108,  108,  108,
+      108,  108,  108,  108,  108,  108,  108,  108,  108,  131,
+      131,  174,  136,  173,  173,  130,  130,  130,  176,  366,
+
+      104,  121,  122,  122,  122,  121,  121,  121,  121,  121,
+      121,  121,  121,  121,  123,  121,  121,  138,  187,  188,
+      113,  121,  121,  121,  121,  131,  131,  130,  130,  130,
+      131,  131,  131,  131,  109,  130,  130,  130,  639,  130,
+      130,  130,  112,  114,  121,  125,  121,  131,  131,  131,
+      131,  131,  131,  140,   93,  130,  130,  130,  130,  130,
+      130,  130,  130,  161,  144,  233,  687,  141,  141,  141,
+      141,  145,  121,  121,  126,  109,  102,  127,  127,  127,
+      127,  128,   88,  208,  168,  209,  162,   80,   79,   79,
+       79,   79,  146,   80,   90,  147,  125,  174,  174,  148,
+
+      173,  173,  173,  129,  456,  145,  456,  130,  130,  131,
+      131,  131,  131,  131,  131,  131,  131,  131,  131,  665,
+      173,  199,  200,  142,  174,  174,  173,  173,  173,  175,
+      129,   93,   93,   94,  458,  180,  337,  140,   80,  533,
+      191,  160,  337,  149,   96,   97,  150,  150,  150,  150,
+      151,   93,   93,   93,  152,  152,  152,  152,  152,  152,
+      152,  152,  144,  152,  144,  144,  152,  152,  152,  144,
+      144,  152,  144,   93,   93,   93,  152,  152,  152,  152,
+      152,  152,  152,  152,  152,  152,  152,  152,  144,  152,
+      152,  152,  152,  152,  144,  144,  144,  144,  144,  144,
+
+      144,   80,  192,  655,  103,   80,  154,  142,  105,  155,
+      155,  155,  155,  156,  174,  174,  103,  145,  173,  173,
+      173,  174,  174,  174,  174,   80,   80,  173,  173,  173,
+      173,  173,  173,  261,  262,  154,  429,  145,  145,  157,
+      157,  157,  157,  157,  157,  157,  157,  157,  157,  157,
+      157,  174,  174,  260,  174,  174,  266,  267,  429,  173,
+      173,  173,  154,   80,  173,  173,  161,  201,  169,  174,
+      174,  170,  170,  170,  170,  171,  174,  174,  173,  173,
+      173,  173,  173,  173,   80,  349,   80,   80,  196,  162,
+      197,  178,  185,  297,  409,  198,  145,  172,  145,  145,
+
+      102,  173,  173,  174,  174,  174,  174,  174,  174,  174,
+      174,  174,  174,  109,   80,   80,  125,  140,   80,  187,
+      298,  661,  177,  263,  172,   80,  145,  145,  182,  430,
+      145,  141,  141,  141,  141,  187,  298,  145,  179,  185,
+       93,   93,   93,   93,  167,  411,  189,  189,  189,  189,
+      190,  431,  204,   80,  205,  687,  410,  276,  614,  206,
+      687,  300,  301,  181,  217,  217,  217,  217,  217,  217,
+      217,  217,  217,  217,  217,  217,  247,  247,  247,  247,
+      217,  217,  217,  217,   80,  303,  304,  142,  107,   80,
+      105,  194,  194,  194,  194,  107,  145,  264,  224,  266,
+
+      267,  145,  272,  272,  272,  272,  225,  412,   80,  217,
+      217,  217,  217,  217,  217,  217,  217,  107,  232,  506,
+      145,  195,  195,  195,  195,  195,  195,  195,  195,  195,
+      195,  195,  195,  247,  247,  247,  247,  247,  247,  247,
+      247,  507,  276,  351,  107,  211,  211,  211,  211,  211,
+      211,  211,  211,  211,  211,  211,  211,  213,  228,  140,
+      102,  230,  341,  251,  214,  277,  272,  272,  272,  272,
+       80,  252,   80,  141,  141,  141,  141,  256,  272,  272,
+      272,  272,  145,  352,  145,  342,  213,  303,  304,  652,
+      215,  215,  215,  215,  215,  215,  215,  215,  215,  215,
+
+      215,  215,  321,  272,  272,  272,  272,  342,  273,  544,
+      275,   80,  322,  213,  218,  277,  219,  628,   80,  322,
+      355,  220,  221,  145,  501,  222,  279,   80,  223,  142,
+      145,   80,  272,  272,  272,  272,  218,  274,  219,  145,
+      263,  300,  301,  145,  220,  221,  323,  323,  323,  323,
+      222,  272,  272,  272,  272,  223,  121,  122,  122,  122,
+      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
+      121,  121,   80,   80,   80,  460,  121,  121,  121,  121,
+      279,  660,   80,  293,  145,  145,  145,  140,  648,  281,
+      288,  288,  288,  288,  145,  214,   80,  102,  295,  121,
+
+      125,  121,  214,   80,  288,  288,  288,  288,  145,   80,
+      280,  288,  288,  288,  288,  145,  324,  324,  324,  324,
+      294,  145,  401,  402,  214,  263,  655,  121,  121,  121,
+      234,  234,  234,  235,  291,  121,  121,  121,  121,  121,
+      121,  687,  441,  121,  121,  292,  653,  377,  687,  121,
+      121,  214,  121,  185,  297,  442,  378,  142,  185,  297,
+      189,  189,  189,  189,  190,  305,  305,  305,  305,  386,
+      687,  427,  121,  125,  325,  325,  325,  325,  326,  326,
+      326,  326,  327,  327,  327,  327,  326,  326,  326,  326,
+      356,  356,  356,  356,  404,  188,  504,  687,  303,  304,
+
+      121,  121,  237,  237,  237,  237,  237,  237,  237,  237,
+      237,  237,  237,  237,   80,  238,  404,  188,  338,  239,
+      349,  504,   80,   80,   80,   80,  240,  428,  241,  652,
+      242,  242,  242,  242,  242,  242,  242,  242,  242,  242,
+      242,  242,  242,  242,  242,  242,  242,  242,  243,  649,
+      351,  125,  244,  244,  244,  244,  244,  244,  244,  244,
+      244,  244,  244,  244,   80,   80,   80,   80,   80,   80,
+       80,   80,   80,   80,   80,  239,   80,  130,  130,  130,
+      130,  130,  130,  130,  130,  130,  130,  130,  130,  246,
+      352,  326,  326,  326,  326,  369,  247,  247,  247,  247,
+
+      370,  371,  248,  645,  249,  249,  249,  249,  249,  249,
+      249,  249,  249,  249,  249,  249,  249,  249,  249,  249,
+      249,  249,  249,  339,  326,  326,  326,  326,  415,   80,
+      250,   93,   93,   93,  376,  316,  401,  402,   80,   80,
+       80,  145,  416,  144,   96,  645,  150,  150,  150,  150,
+      145,  145,  145,  330,  152,  152,  152,  152,  152,  152,
+      152,  152,  144,  152,  144,  144,  152,  152,  152,  144,
+      144,  152,  144,  347,  435,  365,  152,  152,  152,  152,
+      152,  152,  152,  152,  152,  152,  152,  152,  144,  152,
+      152,  152,  152,  152,  144,  144,  144,  144,  144,  144,
+
+      144,   80,  640,  214,  639,  125,  311,  311,  311,  311,
+      214,  246,  140,  145,  234,  234,  234,  235,  357,  357,
+      357,  357,  364,  447,  248,   80,  368,  368,  368,  368,
+      473,  474,  214,  379,  379,  379,  379,  145,  638,  268,
+      268,  268,  268,  268,  268,  268,  268,  268,  268,  268,
+      268,  269,  359,  404,  188,  687,  320,  125,  270,  214,
+       80,   80,  687,  687,  687,  687,   80,   80,  687,  364,
+      448,  102,  145,  145,  380,  380,  380,  380,  145,  145,
+      269,  638,  142,  102,  271,  271,  271,  271,  271,  271,
+      271,  271,  271,  271,  271,  271,  687,  407,  407,  407,
+
+      407,  502,  388,  418,  418,  418,  418,  269,  282,  282,
+      282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
+       80,  238,  635,   80,  502,  283,  634,  457,  144,  144,
+      144,  144,  284,  525,  241,  145,  285,  285,  285,  285,
+      285,  285,  285,  285,  285,  285,  285,  285,  285,  285,
+      285,  285,  285,  285,  286,  436,  436,  436,  287,  287,
+      287,  287,  287,  287,  287,  287,  287,  287,  287,  287,
       144,  144,  144,  144,  144,  144,  144,  144,  144,  144,
-      144,  144,  144,  149,  696,  696,  696,  149,  149,  149,
-      696,  149,  149,  149,  149,  149,  149,  149,  149,  192,
-      192,  192,  192,  192,  696,  192,  192,  192,  192,  192,
-      192,  192,  192,  192,  192,  192,  192,  192,  194,  194,
-      194,  194,  194,  194,  194,  194,  194,  194,  194,  194,
-      194,  194,  194,  194,  194,  194,  194,  211,  211,  696,
-
-      696,  696,  696,  696,  696,  696,  696,  211,  696,  696,
-      211,  211,  696,  211,  126,  126,  126,  126,  126,  126,
-      126,  126,  126,  126,  126,  126,  126,  126,  126,  126,
-      126,  126,  126,  244,  244,  244,  244,  244,  244,  244,
-      244,  244,  244,  244,  244,  244,  244,  244,  244,  244,
-      244,  244,  145,  145,  145,  145,  145,  145,  145,  145,
-      145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
-      145,  266,  266,  266,  266,  266,  266,  266,  266,  266,
-      266,  266,  266,  266,  266,  266,  266,  266,  266,  266,
-      273,  273,  273,  273,  273,  273,  273,  273,  273,  273,
-
-      273,  273,  273,  273,  273,  273,  273,  273,  273,  192,
-      192,  192,  192,  192,  192,  192,  192,  192,  192,  192,
-      192,  192,  192,  192,  192,  192,  192,  192,  194,  194,
-      194,  194,  194,  194,  194,  194,  194,  194,  194,  194,
-      194,  194,  194,  194,  194,  194,  194,  195,  195,  195,
-      195,  195,  195,  195,  195,  195,  195,  195,  195,  195,
-      195,  195,  195,  195,  195,  195,  309,  309,  309,  309,
-      309,  309,  309,  309,  309,  309,  309,  309,  309,  309,
-      309,  309,  309,  309,  309,  313,  313,  696,  313,  313,
-      313,  313,  313,  313,  313,  313,  313,  313,  313,  313,
-
-      313,  313,  313,  313,  315,  315,  696,  315,  315,  315,
-      315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
-      315,  315,  315,  317,  696,  317,  696,  696,  696,  317,
-      317,  317,  696,  696,  317,  355,  355,  696,  355,  355,
-      355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
-      355,  355,  355,  355,  357,  357,  357,  357,  357,  357,
-      357,  357,  357,  357,  357,  357,  357,  357,  357,  357,
-      357,  357,  357,  126,  126,  126,  126,  126,  126,  126,
-      126,  126,  126,  126,  126,  126,  126,  126,  126,  126,
-      126,  126,  359,  359,  359,  359,  359,  359,  359,  359,
-
-      359,  359,  359,  359,  359,  359,  359,  359,  359,  359,
-      359,  244,  244,  244,  244,  244,  244,  244,  244,  244,
-      244,  244,  244,  244,  244,  244,  244,  244,  244,  244,
-      362,  362,  362,  367,  696,  696,  696,  367,  696,  367,
-      367,  367,  367,  696,  367,  266,  266,  266,  266,  266,
-      266,  266,  266,  266,  266,  266,  266,  266,  266,  266,
-      266,  266,  266,  266,  383,  383,  383,  383,  383,  383,
-      383,  383,  383,  383,  383,  383,  383,  383,  383,  383,
-      383,  383,  383,  149,  696,  696,  696,  149,  149,  149,
-      696,  149,  149,  149,  149,  149,  149,  149,  149,  273,
+      144,  283,  144,  173,  173,  173,  173,  173,  173,  173,
+      173,  173,  173,  173,  173,   80,  246,  687,  437,  533,
 
-      273,  273,  273,  273,  273,  273,  273,  273,  273,  273,
-      273,  273,  273,  273,  273,  273,  273,  273,  103,  103,
-      103,  103,  103,  103,  103,  103,  103,  103,  103,  103,
-      103,  103,  103,  103,  103,  103,  103,  403,  403,  696,
-      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
-      403,  403,  403,  403,  403,  403,  309,  309,  309,  309,
-      309,  309,  309,  309,  309,  309,  309,  309,  309,  309,
-      309,  309,  309,  309,  309,  413,  413,  413,  413,  696,
-      413,  413,  413,  413,  413,  413,  413,  413,  413,  413,
-      413,  413,  413,  413,  192,  192,  192,  192,  192,  192,
-
-      192,  192,  192,  192,  192,  192,  192,  192,  192,  192,
-      192,  192,  192,  313,  313,  696,  313,  313,  313,  313,
-      313,  313,  313,  313,  313,  313,  313,  313,  313,  313,
-      313,  313,  315,  315,  696,  315,  315,  315,  315,  315,
-      315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
-      315,  416,  696,  416,  416,  696,  696,  416,  416,  416,
-      696,  696,  416,  439,  439,  696,  439,  439,  439,  439,
-      439,  439,  439,  439,  439,  439,  439,  439,  439,  439,
-      439,  439,  354,  354,  696,  354,  354,  354,  354,  354,
-      354,  354,  354,  354,  354,  354,  354,  354,  354,  354,
-
-      354,  355,  355,  696,  355,  355,  355,  355,  355,  355,
-      355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
-      357,  357,  357,  357,  357,  357,  357,  357,  357,  357,
-      357,  357,  357,  357,  357,  357,  357,  357,  357,  359,
-      359,  359,  359,  359,  359,  359,  359,  359,  359,  359,
-      359,  359,  359,  359,  359,  359,  359,  359,  126,  126,
-      126,  126,  126,  126,  126,  126,  126,  126,  126,  126,
-      126,  126,  126,  126,  126,  126,  126,  447,  447,  447,
-      447,  447,  447,  447,  447,  447,  447,  447,  447,  447,
-      447,  447,  447,  447,  447,  447,  452,  452,  696,  696,
-
-      452,  452,  696,  452,  452,  452,  452,  452,  452,  452,
-      452,  452,  453,  696,  696,  696,  696,  696,  453,  453,
-      453,  453,  696,  453,  383,  383,  383,  383,  383,  383,
+      144,  473,  474,  288,  288,  288,  288,  145,  534,  248,
+      687,  289,  289,  289,  289,  289,  289,  289,  289,  289,
+      289,  289,  289,  289,  289,  289,  289,  289,  289,  289,
+      404,  188,  632,  144,  144,  144,  144,  290,  144,  144,
+      144,  144,  144,  144,  144,  144,  144,  144,  144,  144,
+      144,  144,  144,  144,  144,  144,  144,  144,  215,  215,
+      215,  215,  215,  215,  215,  215,  215,  215,  215,  215,
+      328,  440,  440,  440,  440,   80,  447,  329,  631,  330,
+       80,   80,   80,  380,  380,  380,  380,  145,  380,  380,
+      380,  380,  145,  145,  145,  185,  476,  102,  626,  328,
+
+      477,  625,  498,  331,  331,  331,  331,  331,  331,  331,
+      331,  331,  331,  331,  331,  384,  498,  498,  624,  360,
+      385,  384,  385,  446,  473,  474,  328,  121,  234,  234,
+      234,  235,  361,  121,  121,  121,  121,  121,  121,  341,
+       80,  121,  121,   80,   80,  389,   80,  121,  121,   80,
+      121,   80,  145,  524,  397,  145,  145,   80,  145,  623,
+      445,  145,  387,  145,   80,  380,  380,  380,  380,  145,
+      121,  125,  393,  393,  393,  393,  145,  404,  188,   80,
+       88,   80,  473,  474,  387,  140,  620,  365,  441,  390,
+      451,  145,   90,  145,  687,  391,  398,   92,  121,  121,
+
+      246,  687,  185,  297,  523,  375,  523,  687,  392,  406,
+      406,  406,  406,  248,  392,  249,  249,  249,  249,  249,
+      249,  249,  249,  249,  249,  249,  249,  249,  249,  249,
+      249,  249,  249,  249,  396,  687,  478,  478,  478,  478,
+      619,  250,  244,  244,  244,  244,  244,  244,  244,  244,
+      244,  244,  244,  244,  360,  142,  473,  474,  204,  329,
+      205,  436,  436,  436,  102,  206,  329,  361,  330,  362,
+      362,  362,  362,  362,  362,  362,  362,  362,  362,  362,
+      362,  362,  362,  362,  362,  362,  362,  362,  329,  413,
+      612,  687,  329,  322,   80,  363,   80,  435,  687,  329,
+
+      322,  687,   80,  441,  437,  554,  145,   80,  145,  360,
+       80,   80,   80,   80,  452,  329,  442,   80,   80,  555,
+      687,  329,  687,  263,  453,  263,   97,  583,  512,  145,
+      145,   99,  417,  413,  271,  271,  271,  271,  271,  271,
+      271,  271,  271,  271,  271,  271,  381,  687,  329,   80,
+      687,  414,   80,  382,   80,  330,   80,  459,  459,  459,
+      459,  145,   80,  441,  145,  493,  145,  144,  145,  102,
+      144,  144,  144,  144,  145,  381,  442,  463,  494,  383,
       383,  383,  383,  383,  383,  383,  383,  383,  383,  383,
-      383,  383,  383,  103,  103,  103,  103,  103,  103,  103,
-      103,  103,  103,  103,  103,  103,  103,  103,  103,  103,
-      103,  103,  474,  474,  696,  474,  474,  474,  474,  474,
-      474,  474,  474,  474,  474,  474,  474,  474,  474,  474,
-      474,  403,  403,  696,  403,  403,  403,  403,  403,  403,
+      383,  140,  523,  375,  523,  414,  498,   80,  466,  464,
+
+      461,   80,  381,   80,  246,  450,  450,  450,  450,  145,
+      498,  498,  102,  145,  102,  145,  102,  248,  599,  289,
+      289,  289,  289,  289,  289,  289,  289,  289,  289,  289,
+      289,  289,  289,  289,  289,  289,  289,  289,  102,  582,
+      102,  465,  611,  467,  102,  290,  287,  287,  287,  287,
+      287,  287,  287,  287,  287,  287,  287,  287,  360,  607,
+       80,  142,  446,  590,  560,  606,  561,  627,  102,  642,
+      533,  361,  145,  394,  394,  394,  394,  394,  394,  394,
+      394,  394,  394,  394,  394,  394,  394,  394,  394,  394,
+      394,  394,  513,  513,  513,  666,  600,  210,  210,  395,
+
+      331,  331,  331,  331,  331,  331,  331,  331,  331,  331,
+      331,  331,  383,  383,  383,  383,  383,  383,  383,  383,
+      383,  383,  383,  383,  427,   80,  491,   80,  503,   80,
+      140,  447,  140,   80,  598,  514,   80,  145,  492,  145,
+       80,  145,  518,  470,  109,  145,  427,   80,  145,   80,
+      608,   80,  145,  109,  597,   80,  528,  504,   80,  145,
+      527,  145,   80,  145,  516,   80,  505,  145,  687,  596,
+      145,  668,  608,  140,  145,  493,  140,  145,  469,  263,
+      462,  687,  504,  527,  532,  185,  297,  567,  687,  529,
+      608,  530,  537,  537,  537,  537,  513,  513,  513,   80,
+
+      519,  541,  142,  493,  140,  531,  140,  670,  212,  212,
+      592,  145,  608,  216,  216,  586,  494,  605,  495,  495,
+      495,  495,  495,  495,  495,  495,  495,  495,  495,  495,
+      495,  495,  495,  495,  495,  495,  495,   80,  493,  514,
+       80,  142,  592,  142,  245,  245,  142,  591,  102,  145,
+      573,  494,  145,  526,  526,  526,  526,  526,  526,  526,
+      526,  526,  526,  526,  526,  526,  526,  526,  526,  526,
+      526,  526,  140,   80,  142,  588,  142,  255,  177,   80,
+       80,   80,   80,  589,   80,  145,  557,  557,  557,  557,
+       80,  145,  145,  145,  145,  140,  145,  590,  185,  476,
+
+      613,  609,  145,   80,  562,  537,  537,  537,  537,  557,
+      557,  557,  557,  584,   80,  145,   80,  615,   80,  566,
+      375,  616,  564,  610,  608,  608,  145,  140,  145,  636,
+      145,  565,  102,  621,  140,  563,  565,  647,  618,  608,
+      584,  375,  142,  617,  608,  633,  608,  608,  630,  140,
+      650,  648,  608,  637,  102,  622,  140,  102,  604,  670,
+      646,  608,  354,  354,  540,  519,  608,  659,  375,  630,
+      630,  585,  593,  593,  608,  593,  593,  593,  593,  593,
+      641,  593,  593,  593,  593,  608,  593,  593,  608,  587,
+      643,  630,  593,  593,  593,  593,  630,  142,  581,  102,
+
+      580,  670,  595,  656,  142,  650,  579,  608,  375,  662,
+      608,  375,  644,  555,  375,  593,  593,  593,  630,  142,
+      578,  140,  140,  578,  595,  577,  142,  576,  575,  255,
+      574,  547,  664,  667,  375,  375,  630,  663,  547,  630,
+      573,  657,  630,  593,  593,  593,  593,  641,  593,  593,
+      593,  593,  593,  594,  593,  593,  593,  593,  630,  593,
+      593,  630,  630,  630,  630,  602,  593,  593,  593,  572,
+      658,  685,  670,  571,  570,  603,  670,  569,  541,  536,
+      568,  375,  663,  671,  630,  630,  559,  672,  593,  593,
+      593,  142,  142,  558,  670,  670,  670,  603,  670,  670,
+
+      257,  670,  670,  670,  670,  673,  674,  675,  446,  676,
+      677,  516,  678,  679,  680,  681,  593,  593,  593,  593,
+      556,  593,  593,  593,  593,  593,  553,  593,  593,  593,
+      593,  552,  593,  593,  670,  551,  550,  549,  593,  593,
+      593,  593,  255,  548,  547,  682,  255,  670,  595,  670,
+      134,  545,  543,  542,  541,  540,  539,  490,  683,  490,
+      684,  593,  593,  593,  255,  255,  255,  488,  255,  255,
+      595,  255,  255,  255,  255,  488,  486,  486,  484,  484,
+      482,  482,  480,  480,  536,  521,  520,  208,  201,  593,
+      593,  593,  593,  364,  593,  593,  593,  593,  593,  594,
+
+      593,  593,  593,  593,  255,  593,  593,  517,  446,  516,
+      439,  602,  593,  593,  593,  109,  511,  255,  510,  255,
+      509,  603,  508,  427,  109,  501,  500,  499,  497,  496,
+      416,  490,  488,  486,  593,  593,  593,  484,  482,  480,
+      417,  297,  471,  603,  260,  375,  455,  454,   84,  202,
+      449,  446,  364,  355,  439,  434,  433,  432,  202,  426,
+      425,  424,  593,  593,   80,  423,  422,  421,   80,   80,
+      420,  419,   80,   80,   80,   80,   80,   80,   80,   80,
+       81,   81,   81,   81,   81,  330,   81,   81,   81,   81,
+       81,   81,   81,   81,   81,   81,   81,   81,   81,   87,
+
+       87,  417,  330,  208,   87,   87,   87,  101,  101,  101,
+      101,  101,  101,  101,  101,  101,  101,  101,  101,  101,
+      101,  101,  101,  101,  101,  101,  124,  124,  124,  124,
+      124,  124,  124,  124,  124,  124,  124,  124,  124,  124,
+      124,  124,  124,  124,  124,  139,  139,  139,  139,  139,
+      139,  139,  139,  139,  139,  139,  139,  139,  139,  139,
+      139,  139,  139,  139,  144,  208,  202,  201,  144,  144,
+      144,  201,  144,  144,  144,  144,  144,  144,  144,  144,
+      184,  184,  184,  184,  184,  201,  184,  184,  184,  184,
+      184,  184,  184,  184,  184,  184,  184,  184,  184,  186,
+
+      186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
+      186,  186,  186,  186,  186,  186,  186,  186,  203,  203,
+      309,  309,  307,  307,  399,  355,  260,  260,  203,  259,
+      375,  203,  203,  259,  203,  121,  121,  121,  121,  121,
+      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
+      121,  121,  121,  121,  236,  236,  236,  236,  236,  236,
+      236,  236,  236,  236,  236,  236,  236,  236,  236,  236,
+      236,  236,  236,  140,  140,  140,  140,  140,  140,  140,
+      140,  140,  140,  140,  140,  140,  140,  140,  140,  140,
+      140,  140,  258,  258,  258,  258,  258,  258,  258,  258,
+
+      258,  258,  258,  258,  258,  258,  258,  258,  258,  258,
+      258,  265,  265,  265,  265,  265,  265,  265,  265,  265,
+      265,  265,  265,  265,  265,  265,  265,  265,  265,  265,
+      184,  184,  184,  184,  184,  184,  184,  184,  184,  184,
+      184,  184,  184,  184,  184,  184,  184,  184,  184,  186,
+      186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
+      186,  186,  186,  186,  186,  186,  186,  186,  299,  299,
+      299,  299,  299,  299,  299,  299,  299,  299,  299,  299,
+      299,  299,  299,  299,  299,  299,  299,  302,  302,  302,
+      302,  302,  302,  302,  302,  302,  302,  302,  302,  302,
+
+      302,  302,  302,  302,  302,  302,  306,  306,  347,  306,
+      306,  306,  306,  306,  306,  306,  306,  306,  306,  306,
+      306,  306,  306,  306,  306,  308,  308,  367,  308,  308,
+      308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
+      308,  308,  308,  308,  310,  339,  310,  338,  364,  246,
+      310,  310,  310,  355,  355,  310,  348,  348,  348,  348,
+      348,  348,  348,  348,  348,  348,  348,  348,  348,  348,
+      348,  348,  348,  348,  348,  121,  121,  121,  121,  121,
+      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
+      121,  121,  121,  121,  350,  350,  350,  350,  350,  350,
+
+      350,  350,  350,  350,  350,  350,  350,  350,  350,  350,
+      350,  350,  350,  236,  236,  236,  236,  236,  236,  236,
+      236,  236,  236,  236,  236,  236,  236,  236,  236,  236,
+      236,  236,  353,  353,  353,  358,  238,  346,  345,  358,
+      344,  358,  358,  358,  358,  343,  358,  258,  258,  258,
+      258,  258,  258,  258,  258,  258,  258,  258,  258,  258,
+      258,  258,  258,  258,  258,  258,  374,  374,  374,  374,
+      374,  374,  374,  374,  374,  374,  374,  374,  374,  374,
+      374,  374,  374,  374,  374,  265,  265,  265,  265,  265,
+      265,  265,  265,  265,  265,  265,  265,  265,  265,  265,
+
+      265,  265,  265,  265,  101,  101,  101,  101,  101,  101,
+      101,  101,  101,  101,  101,  101,  101,  101,  101,  101,
+      101,  101,  101,  302,  302,  302,  302,  302,  302,  302,
+      302,  302,  302,  302,  302,  302,  302,  302,  302,  302,
+      302,  302,  299,  299,  299,  299,  299,  299,  299,  299,
+      299,  299,  299,  299,  299,  299,  299,  299,  299,  299,
+      299,  400,  400,  400,  400,  400,  400,  400,  400,  400,
+      400,  400,  400,  400,  400,  400,  400,  400,  400,  400,
       403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
-
-      481,  481,  696,  696,  481,  481,  481,  481,  481,  481,
-      481,  481,  481,  481,  481,  481,  413,  413,  413,  413,
-      696,  413,  413,  413,  413,  413,  413,  413,  413,  413,
-      413,  413,  413,  413,  413,  192,  192,  192,  192,  192,
-      192,  192,  192,  192,  192,  192,  192,  192,  192,  192,
-      192,  192,  192,  192,  488,  488,  696,  488,  488,  488,
-      488,  488,  488,  488,  488,  488,  488,  488,  488,  488,
-      488,  488,  488,  490,  490,  696,  490,  490,  490,  490,
-      490,  490,  490,  490,  490,  490,  490,  490,  490,  490,
-      490,  490,  492,  492,  696,  492,  492,  492,  492,  492,
-
-      492,  492,  492,  492,  492,  492,  492,  492,  492,  492,
-      492,  494,  494,  696,  494,  494,  494,  494,  494,  494,
-      494,  494,  494,  494,  494,  494,  494,  494,  494,  494,
-      496,  496,  696,  496,  496,  496,  496,  496,  496,  496,
-      496,  496,  496,  496,  496,  496,  496,  496,  496,  498,
-      498,  696,  498,  498,  498,  498,  498,  498,  498,  498,
-      498,  498,  498,  498,  498,  498,  498,  498,  438,  438,
-      696,  438,  438,  438,  438,  438,  438,  438,  438,  438,
-      438,  438,  438,  438,  438,  438,  438,  439,  439,  696,
-      439,  439,  439,  439,  439,  439,  439,  439,  439,  439,
-
-      439,  439,  439,  439,  439,  439,  357,  357,  357,  357,
-      357,  357,  357,  357,  357,  357,  357,  357,  357,  357,
-      357,  357,  357,  357,  357,  126,  126,  126,  126,  126,
-      126,  126,  126,  126,  126,  126,  126,  126,  126,  126,
-      126,  126,  126,  126,  447,  447,  447,  447,  447,  447,
-      447,  447,  447,  447,  447,  447,  447,  447,  447,  447,
-      447,  447,  447,  522,  696,  696,  696,  696,  696,  522,
-      522,  522,  522,  522,  522,  522,  522,  522,  529,  529,
-      529,  529,  529,  529,  529,  529,  529,  529,  529,  529,
-      529,  529,  529,  529,  529,  529,  529,  103,  103,  103,
-
-      103,  103,  103,  103,  103,  103,  103,  103,  103,  103,
-      103,  103,  103,  103,  103,  103,  540,  540,  540,  540,
-      540,  540,  540,  540,  540,  540,  540,  540,  540,  540,
-      540,  540,  540,  540,  540,  545,  696,  696,  696,  696,
-      696,  545,  545,  545,  545,  554,  554,  696,  554,  554,
-      554,  554,  554,  554,  554,  554,  554,  554,  554,  554,
-      554,  554,  554,  554,  572,  572,  572,  572,  572,  572,
-      572,  572,  572,  572,  572,  572,  572,  572,  572,  572,
-      572,  572,  572,  603,  603,  696,  603,  603,  603,  603,
-      603,  603,  603,  603,  603,  603,  603,  603,  603,  603,
-
-      603,  603,  610,  610,  696,  610,  610,  610,  610,  610,
-      610,  610,  610,  610,  610,  610,  610,  610,  610,  610,
-      610,  602,  602,  696,  602,  602,  602,  602,  602,  602,
-      602,  602,  602,  602,  602,  602,  602,  602,  602,  602,
-      638,  638,  638,  638,  638,  638,  638,  638,  638,  638,
-      638,  638,  638,  638,  638,  638,  638,  638,  638,  660,
-      660,  660,  660,  660,  660,  660,  660,  660,  660,  660,
-      660,  660,  660,  660,  660,  660,  660,  660,  663,  663,
-      663,  663,  663,  663,  663,  663,  663,  663,  663,  663,
-      663,  663,  663,  663,  663,  663,  663,  678,  678,  678,
-
-      678,  678,  678,  678,  678,  678,  678,  678,  678,  678,
-      678,  678,  678,  678,  678,  678,    3,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696
+      403,  403,  403,  403,  403,  403,  403,  403,  403,  405,
+
+      405,  405,  405,  405,  405,  405,  405,  405,  405,  405,
+      405,  405,  405,  405,  405,  405,  405,  405,  184,  184,
+      184,  184,  184,  184,  184,  184,  184,  184,  184,  184,
+      184,  184,  184,  184,  184,  184,  184,  306,  306,  340,
+      306,  306,  306,  306,  306,  306,  306,  306,  306,  306,
+      306,  306,  306,  306,  306,  306,  308,  308,  336,  308,
+      308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
+      308,  308,  308,  308,  308,  408,  335,  408,  408,  334,
+      333,  408,  408,  408,  332,  320,  408,  348,  348,  348,
+      348,  348,  348,  348,  348,  348,  348,  348,  348,  348,
+
+      348,  348,  348,  348,  348,  348,  350,  350,  350,  350,
+      350,  350,  350,  350,  350,  350,  350,  350,  350,  350,
+      350,  350,  350,  350,  350,  121,  121,  121,  121,  121,
+      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
+      121,  121,  121,  121,  438,  438,  438,  438,  438,  438,
+      438,  438,  438,  438,  438,  438,  438,  438,  438,  438,
+      438,  438,  438,  443,  443,  320,  319,  443,  443,  318,
+      443,  443,  443,  443,  443,  443,  443,  443,  443,  444,
+      317,  316,  316,  315,  314,  444,  444,  444,  444,  313,
+      444,  374,  374,  374,  374,  374,  374,  374,  374,  374,
+
+      374,  374,  374,  374,  374,  374,  374,  374,  374,  374,
+      101,  101,  101,  101,  101,  101,  101,  101,  101,  101,
+      101,  101,  101,  101,  101,  101,  101,  101,  101,  468,
+      468,  312,  309,  468,  468,  468,  468,  468,  468,  468,
+      468,  468,  468,  468,  468,  401,  401,  401,  401,  401,
+      401,  401,  401,  401,  401,  401,  401,  401,  401,  401,
+      401,  401,  401,  401,  472,  472,  472,  472,  472,  472,
+      472,  472,  472,  472,  472,  472,  472,  472,  472,  472,
+      472,  472,  472,  475,  475,  475,  475,  475,  475,  475,
+      475,  475,  475,  475,  475,  475,  475,  475,  475,  475,
+
+      475,  475,  479,  479,  307,  479,  479,  479,  479,  479,
+      479,  479,  479,  479,  479,  479,  479,  479,  479,  479,
+      479,  481,  481,  296,  481,  481,  481,  481,  481,  481,
+      481,  481,  481,  481,  481,  481,  481,  481,  481,  481,
+      483,  483,  260,  483,  483,  483,  483,  483,  483,  483,
+      483,  483,  483,  483,  483,  483,  483,  483,  483,  485,
+      485,  278,  485,  485,  485,  485,  485,  485,  485,  485,
+      485,  485,  485,  485,  485,  485,  485,  485,  487,  487,
+      260,  487,  487,  487,  487,  487,  487,  487,  487,  487,
+      487,  487,  487,  487,  487,  487,  487,  489,  489,  260,
+
+      489,  489,  489,  489,  489,  489,  489,  489,  489,  489,
+      489,  489,  489,  489,  489,  489,  348,  348,  348,  348,
+      348,  348,  348,  348,  348,  348,  348,  348,  348,  348,
+      348,  348,  348,  348,  348,  121,  121,  121,  121,  121,
+      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
+      121,  121,  121,  121,  438,  438,  438,  438,  438,  438,
+      438,  438,  438,  438,  438,  438,  438,  438,  438,  438,
+      438,  438,  438,  515,  259,  257,  255,  254,  230,  515,
+      515,  515,  515,  515,  515,  515,  515,  515,  522,  522,
+      522,  522,  522,  522,  522,  522,  522,  522,  522,  522,
+
+      522,  522,  522,  522,  522,  522,  522,  535,  535,  535,
+      535,  202,  535,  535,  535,  535,  535,  535,  535,  535,
+      535,  535,  535,  535,  535,  535,  538,  253,  228,  125,
+      231,  202,  538,  538,  538,  538,  546,  546,  229,  546,
+      546,  546,  546,  546,  546,  546,  546,  546,  546,  546,
+      546,  546,  546,  546,  546,  594,  594,  227,  594,  594,
+      594,  594,  594,  594,  594,  594,  594,  594,  594,  594,
+      594,  594,  594,  594,  601,  601,  227,  601,  601,  601,
+      601,  601,  601,  601,  601,  601,  601,  601,  601,  601,
+      601,  601,  601,  593,  593,  226,  593,  593,  593,  593,
+
+      593,  593,  593,  593,  593,  593,  593,  593,  593,  593,
+      593,  593,  629,  629,  629,  629,  629,  629,  629,  629,
+      629,  629,  629,  629,  629,  629,  629,  629,  629,  629,
+      629,  651,  651,  651,  651,  651,  651,  651,  651,  651,
+      651,  651,  651,  651,  651,  651,  651,  651,  651,  651,
+      654,  654,  654,  654,  654,  654,  654,  654,  654,  654,
+      654,  654,  654,  654,  654,  654,  654,  654,  654,  669,
+      669,  669,  669,  669,  669,  669,  669,  669,  669,  669,
+      669,  669,  669,  669,  669,  669,  669,  669,  102,  208,
+      207,  201,  202,  201,  193,  185,  183,  167,  166,  163,
+
+      160,  159,  143,  119,  137,  134,  119,  118,  115,  112,
+      111,  102,   84,  687,    3,  687,  687,  687,  687,  687,
+      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
+      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
+      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
+      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
+      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
+      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
+      687,  687,  687,  687,  687,  687,  687,  687
     } ;
 
-static yyconst short int yy_chk[4591] =
+static yyconst flex_int16_t yy_chk[3889] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
@@ -1192,497 +1187,423 @@ static yyconst short int yy_chk[4591] =
         2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
         2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
         2,    2,    2,    2,    2,    2,    5,    6,    6,    6,
-        6,    8,   10,   10,   11,   19,   22,   46,    8,    8,
-        8,    8,   16,  156,   11,   13,   11,   11,    5,   46,
-       58,   11,   12,   12,   12,   13,  156,   13,   19,   12,
-       22,  694,   13,   86,   12,   12,   12,   12,   12,   12,
-       12,   12,   50,   50,   58,   12,   12,   12,   12,   12,
+        6,    8,   10,   10,   11,   19,   21,   45,    8,    8,
+        8,    8,   16,  151,   11,   13,   11,   11,    5,   45,
+       56,   11,   12,   12,   12,   13,  151,   13,   19,   12,
+       21,   97,   13,   97,   12,   12,   12,   12,   12,   12,
+       12,   12,  685,   24,   56,   12,   12,   12,   12,   12,
 
        12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
-       12,   12,   12,   12,   25,   28,   16,   12,   12,   12,
+       12,   12,   12,   12,   27,   51,   16,   12,   12,   12,
        12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
        12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
-       12,   12,   15,   52,   15,   86,   15,   15,   15,   15,
-       15,   15,   40,  674,   15,   29,  153,   29,   29,   90,
-       28,   90,   29,  670,   25,   25,   90,   35,   35,   28,
-      153,   25,   55,   15,   35,   35,   35,   15,   15,   15,
-       15,   15,   15,   15,   15,   15,   15,   15,   15,   31,
-       31,  532,   31,   31,   31,   55,   99,   52,   99,   40,
-
-       15,   26,   26,   26,   26,   26,   26,   26,   26,   26,
-       26,   26,   26,   26,   26,   26,   26,   63,   84,   84,
-      144,   26,   26,   26,   26,   30,   30,   30,   30,   30,
-       32,   32,   34,   34,   32,   32,   32,   33,   34,   34,
-       34,   43,   30,  532,   26,   26,   26,   33,   33,   36,
-       36,   49,   33,   33,   33,   37,   37,   36,   36,   36,
-       33,   49,   63,   49,   37,   37,   37,  676,   49,   91,
-       91,   63,   26,   26,   27,   38,   38,   27,   27,   27,
-       27,   27,   61,   47,  669,   38,   38,  217,   47,   38,
-      144,   43,   43,   47,  663,   47,   47,  217,   43,   64,
-
-       47,   64,   64,   27,  217,   44,   64,   27,   27,   27,
-       27,   27,   27,   27,   27,   27,   27,   27,   27,   44,
-       44,   44,   44,   65,   65,   65,   65,   65,   69,   69,
-       27,   74,   61,   61,   69,   69,   69,  676,  149,   61,
-       65,   66,   66,   74,   66,   66,   66,   67,   67,   68,
-      149,   67,   67,   67,   70,   70,   76,  158,  158,   68,
-       68,   70,   70,   70,   68,   68,   68,  662,   76,   74,
-       72,   72,   68,  192,  192,   44,   48,   48,   48,   72,
-       72,   72,  660,   48,   81,   81,   81,   81,   48,   48,
-       48,   48,   48,   48,   48,   48,  193,  193,   76,   48,
-
-       48,   48,   48,   48,   48,   48,   48,   48,   48,   48,
-       48,   48,   48,   48,   48,   48,   48,   48,   95,   95,
-       95,   48,   48,   48,   48,   48,   48,   48,   48,   48,
-       48,   48,   48,   48,   48,   48,   48,   48,   48,   48,
-       48,   48,   48,   48,   48,   48,   51,  194,  194,   51,
-      128,   51,   77,   51,   51,   51,   51,   51,   51,   71,
-       71,   51,   73,   73,   77,  196,  196,   71,   71,   71,
-       75,  157,   73,   73,  258,   75,   73,   98,   98,   98,
-       51,  128,   75,  157,   51,   51,   51,   51,   51,   51,
-       51,   51,   51,   51,   51,   51,  110,  110,  110,  110,
-
-      271,  387,  112,  112,  112,  112,  658,   51,   62,   77,
-       78,  166,  271,   62,   79,   78,   62,   62,   62,   62,
-       62,  258,   75,  166,  323,   79,   85,   78,   79,   79,
-       79,   79,  112,   85,   85,   85,   85,   85,  113,  113,
-      113,  113,   62,  166,  273,  273,   62,   62,   62,   62,
-       62,   62,   62,   62,   62,   62,   62,   62,  100,  387,
-       78,   78,   96,   96,   96,  171,  176,   78,  100,   62,
-      100,  111,  113,  111,   96,  100,   96,  171,  176,  111,
-      656,   96,  111,  623,   79,   89,  323,   89,   89,   89,
-       89,   89,   89,  111,  171,  111,  123,  123,  123,  123,
-
-      167,  234,  111,  136,  136,  136,  136,  111,  118,  118,
-      118,  118,  167,  650,   89,  234,  234,  176,   89,   89,
-       89,   89,   89,   89,   89,   89,   89,   89,   89,   89,
-      121,  121,  121,  121,  123,  241,  124,  124,  124,  124,
-      623,   89,  106,  106,  106,  106,  106,  106,  106,  106,
-      106,  106,  106,  106,  108,  151,  649,  118,  167,  233,
-      325,  108,  325,  151,  151,  243,  241,  151,  165,  137,
-      137,  137,  137,  138,  138,  138,  138,  267,  121,  124,
-      165,  345,  233,  108,  308,  308,  267,  108,  108,  108,
-      108,  108,  108,  108,  108,  108,  108,  108,  108,  137,
-
-      162,  162,  162,  162,  233,  243,  165,  138,  309,  309,
-      108,  127,  127,  127,  127,  127,  127,  127,  127,  127,
-      127,  127,  127,  127,  127,  127,  127,  146,  152,  568,
-      568,  127,  127,  127,  127,  329,  152,  345,  154,  185,
-      152,  146,  146,  146,  146,  146,  154,  190,  270,  329,
-      154,  185,  168,  270,  127,  127,  127,  648,  190,  163,
-      163,  163,  163,  644,  168,  270,  164,  164,  164,  164,
-      169,  169,  169,  169,  172,  172,  172,  172,  174,  174,
-      174,  174,  127,  127,  129,  129,  129,  129,  129,  163,
-      129,  129,  129,  129,  129,  129,  185,  146,  129,  129,
-
-      164,  173,  186,  189,  129,  129,  386,  129,  168,  175,
-      175,  175,  175,  173,  186,  189,  174,  190,  346,  169,
-      272,  182,  172,  187,  368,  272,  188,  129,  129,  182,
-      182,  182,  182,  182,  183,  187,  269,  272,  188,  173,
-      346,  269,  183,  183,  183,  183,  183,  609,  269,  189,
-      386,  347,  175,  357,  186,  129,  129,  131,  131,  131,
-      131,  131,  131,  131,  131,  131,  131,  131,  131,  132,
-      132,  368,  183,  347,  132,  187,  641,  132,  132,  132,
-      132,  132,  188,  132,  357,  132,  132,  132,  132,  132,
-      132,  132,  132,  132,  132,  132,  132,  132,  132,  132,
-
-      132,  132,  132,  132,  384,  609,  384,  132,  132,  132,
-      132,  132,  132,  132,  132,  132,  132,  132,  132,  132,
-      132,  132,  132,  132,  132,  132,  132,  132,  132,  132,
-      132,  132,  134,  134,  134,  134,  134,  134,  134,  134,
-      134,  134,  134,  134,  135,  218,  218,  218,  218,  484,
-      265,  135,  135,  135,  135,  265,  265,  135,  484,  135,
-      135,  135,  135,  135,  135,  135,  135,  135,  135,  135,
-      135,  135,  135,  135,  135,  135,  135,  135,  219,  219,
-      219,  219,  198,  198,  432,  135,  155,  155,  155,  198,
-      198,  198,  198,  155,  220,  220,  220,  220,  155,  155,
-
-      640,  155,  155,  155,  155,  155,  435,  432,  327,  155,
-      155,  155,  155,  155,  155,  155,  155,  155,  155,  155,
-      155,  155,  155,  155,  155,  155,  155,  155,  435,  637,
-      637,  155,  155,  155,  155,  155,  155,  155,  155,  155,
-      155,  155,  155,  155,  155,  155,  155,  155,  155,  155,
-      155,  155,  155,  155,  155,  155,  159,  304,  275,  202,
-      222,  223,  223,  223,  223,  184,  202,  222,  159,  304,
-      327,  197,  197,  184,  184,  184,  184,  184,  197,  197,
-      197,  197,  197,  224,  224,  224,  224,  372,  202,  222,
-      252,  252,  252,  252,  159,  159,  159,  159,  159,  159,
-
-      159,  159,  159,  159,  159,  159,  160,  184,  275,  242,
-      242,  242,  242,  160,  304,  202,  222,  275,  317,  317,
-      317,  317,  203,  358,  388,  203,  203,  203,  203,  203,
-      239,  239,  239,  239,  372,  160,  388,  359,  388,  160,
-      160,  160,  160,  160,  160,  160,  160,  160,  160,  160,
-      160,  203,  242,  461,  358,  461,  230,  230,  230,  230,
-      461,  635,  160,  177,  177,  177,  177,  177,  177,  177,
-      177,  177,  177,  177,  177,  178,  178,  359,  203,  239,
-      178,  707,  707,  178,  178,  178,  178,  178,  230,  178,
-      634,  178,  178,  178,  178,  178,  178,  178,  178,  178,
-
-      178,  178,  178,  178,  178,  178,  178,  178,  178,  178,
-      360,  360,  360,  178,  178,  178,  178,  178,  178,  178,
-      178,  178,  178,  178,  178,  178,  178,  178,  178,  178,
-      178,  178,  178,  178,  178,  178,  178,  178,  180,  180,
-      180,  180,  180,  180,  180,  180,  180,  180,  180,  180,
-      181,  181,  449,  360,  444,  181,  708,  708,  181,  181,
-      181,  181,  181,  633,  181,  449,  181,  181,  181,  181,
-      181,  181,  181,  181,  181,  181,  181,  181,  181,  181,
-      181,  181,  181,  181,  181,  444,  632,  591,  181,  181,
-      181,  181,  181,  181,  181,  181,  181,  181,  181,  181,
-
-      181,  181,  181,  181,  181,  181,  181,  181,  181,  181,
-      181,  181,  181,  221,  221,  221,  221,  221,  221,  221,
-      221,  221,  221,  221,  221,  225,  338,  338,  338,  338,
-      454,  651,  225,  366,  225,  253,  591,  286,  231,  231,
-      231,  231,  253,  253,  253,  253,  366,  531,  253,  286,
-      363,  363,  363,  363,  225,  465,  465,  465,  225,  225,
-      225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
-      231,  629,  285,  628,  366,  467,  253,  454,  283,  286,
-      651,  225,  240,  240,  285,  240,  240,  240,  240,  240,
-      283,  240,  240,  240,  240,  531,  240,  240,  288,  254,
-
-      450,  264,  240,  240,  240,  240,  254,  254,  254,  254,
-      288,  276,  254,  450,  285,  264,  264,  264,  264,  276,
-      276,  276,  276,  276,  279,  240,  240,  240,  285,  285,
-      398,  389,  279,  279,  279,  279,  279,  467,  283,  281,
-      254,  305,  398,  389,  288,  389,  240,  281,  281,  281,
-      281,  281,  305,  240,  240,  244,  244,  244,  244,  244,
-      626,  244,  244,  244,  244,  244,  244,  592,  284,  244,
-      244,  264,  282,  284,  289,  244,  244,  569,  244,  281,
-      282,  282,  282,  282,  282,  284,  289,  608,  287,  303,
-      295,  284,  295,  287,  303,  299,  301,  299,  244,  244,
-
-      287,  303,  295,  625,  414,  414,  290,  299,  301,  414,
-      621,  305,  282,  284,  290,  290,  290,  290,  290,  592,
-      620,  297,  302,  289,  369,  370,  244,  244,  245,  297,
-      297,  297,  297,  297,  302,  336,  301,  369,  370,  608,
-      569,  245,  336,  245,  245,  245,  245,  245,  245,  245,
-      245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
-      245,  245,  302,  290,  336,  369,  370,  601,  584,  245,
+       12,   12,   15,   24,   15,   39,   15,   15,   15,   15,
+       15,   15,  250,   28,   15,   28,   28,   49,   49,   27,
+       28,   30,   30,  259,   30,   30,   30,   42,   27,   51,
+       31,   31,  259,   15,   31,   31,   31,   15,   15,   15,
+       15,   15,   15,   15,   15,   15,   15,   15,   15,   33,
+       33,   62,   39,   62,   62,   33,   33,   33,   62,  250,
+
+       15,   25,   25,   25,   25,   25,   25,   25,   25,   25,
+       25,   25,   25,   25,   25,   25,   25,   42,   82,   82,
+       32,   25,   25,   25,   25,   29,   29,   29,   29,   29,
+       32,   32,   34,   34,   59,   32,   32,   32,  665,   34,
+       34,   34,   29,   32,   25,   25,   25,   35,   35,   36,
+       36,   37,   37,   43,   48,   35,   35,   35,   36,   36,
+       36,   37,   37,   54,   48,  123,   48,   43,   43,   43,
+       43,   48,   25,   25,   26,   61,  378,   26,   26,   26,
+       26,   26,   46,  318,   59,  318,   54,   46,   79,   79,
+       79,   79,   46,   74,   46,   46,  123,   64,   64,   46,
+
+       64,   64,   64,   26,  375,   74,  375,   26,   26,   26,
+       26,   26,   26,   26,   26,   26,   26,   26,   26,  661,
+       61,   89,   89,   43,   63,   63,   63,   63,   63,   61,
+       26,   47,   47,   47,  378,   74,  223,  139,   47,  660,
+       84,   63,  223,   47,   47,   47,   47,   47,   47,   47,
+       47,   93,   93,   93,   47,   47,   47,   47,   47,   47,
+       47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
+       47,   47,   47,   96,   96,   96,   47,   47,   47,   47,
+       47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
+       47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
+
+       47,   50,   84,  654,   50,  144,   50,  139,   50,   50,
+       50,   50,   50,   50,   65,   65,   50,  144,   65,   65,
+       65,   67,   67,   68,   68,  146,  152,   67,   67,   67,
+       68,   68,   68,  146,  146,   50,  341,  146,  152,   50,
+       50,   50,   50,   50,   50,   50,   50,   50,   50,   50,
+       50,   69,   69,  148,   71,   71,  153,  153,  341,   69,
+       69,   69,   50,   60,   71,   71,   66,  148,   60,   70,
+       70,   60,   60,   60,   60,   60,   66,   66,   70,   70,
+       70,   66,   66,   66,   72,  233,   73,   75,   88,   66,
+       88,   73,  184,  184,  316,   88,   72,   60,   73,   75,
+
+      600,   60,   60,   60,   60,   60,   60,   60,   60,   60,
+       60,   60,   60,   76,  263,  147,  233,   77,   76,  185,
+      185,  653,   72,  147,   60,  161,  263,  147,   77,  342,
+       76,   77,   77,   77,   77,  186,  186,  161,   73,   83,
+       94,   94,   94,   98,   75,  320,   83,   83,   83,   83,
+       83,  342,   94,   98,   94,   98,  316,  161,  600,   94,
+       98,  187,  187,   76,  108,  108,  108,  108,  110,  110,
+      110,  110,  111,  111,  111,  111,  131,  131,  131,  131,
+      120,  120,  120,  120,  162,  188,  188,   77,   87,  149,
+       87,   87,   87,   87,   87,   87,  162,  149,  110,  265,
+
+      265,  149,  157,  157,  157,  157,  111,  320,  177,  115,
+      115,  115,  115,  118,  118,  118,  118,   87,  120,  429,
+      177,   87,   87,   87,   87,   87,   87,   87,   87,   87,
+       87,   87,   87,  132,  132,  132,  132,  133,  133,  133,
+      133,  429,  162,  235,   87,  104,  104,  104,  104,  104,
+      104,  104,  104,  104,  104,  104,  104,  106,  115,  141,
+      614,  118,  227,  132,  106,  177,  163,  163,  163,  163,
+      180,  133,  160,  141,  141,  141,  141,  141,  158,  158,
+      158,  158,  180,  235,  160,  227,  106,  298,  298,  651,
+      106,  106,  106,  106,  106,  106,  106,  106,  106,  106,
+
+      106,  106,  209,  159,  159,  159,  159,  227,  158,  499,
+      160,  165,  209,  106,  109,  163,  109,  614,  285,  209,
+      285,  109,  109,  165,  499,  109,  180,  384,  109,  141,
+      285,  178,  166,  166,  166,  166,  109,  159,  109,  384,
+      165,  299,  299,  178,  109,  109,  210,  210,  210,  210,
+      109,  168,  168,  168,  168,  109,  122,  122,  122,  122,
+      122,  122,  122,  122,  122,  122,  122,  122,  122,  122,
+      122,  122,  167,  179,  181,  384,  122,  122,  122,  122,
+      166,  649,  174,  178,  167,  179,  181,  182,  647,  168,
+      174,  174,  174,  174,  174,  194,  175,  267,  182,  122,
+
+      122,  122,  194,  176,  175,  175,  175,  175,  175,  275,
+      167,  176,  176,  176,  176,  176,  211,  211,  211,  211,
+      181,  275,  300,  300,  194,  179,  641,  122,  122,  124,
+      124,  124,  124,  124,  175,  124,  124,  124,  124,  124,
+      124,  214,  440,  124,  124,  176,  640,  267,  214,  124,
+      124,  194,  124,  189,  189,  440,  267,  182,  190,  190,
+      189,  189,  189,  189,  189,  190,  190,  190,  190,  275,
+      214,  340,  124,  124,  212,  212,  212,  212,  215,  215,
+      215,  215,  216,  216,  216,  216,  224,  224,  224,  224,
+      244,  244,  244,  244,  301,  301,  575,  214,  302,  302,
+
+      124,  124,  126,  126,  126,  126,  126,  126,  126,  126,
+      126,  126,  126,  126,  127,  127,  303,  303,  224,  127,
+      348,  575,  127,  127,  127,  127,  127,  340,  127,  639,
+      127,  127,  127,  127,  127,  127,  127,  127,  127,  127,
+      127,  127,  127,  127,  127,  127,  127,  127,  127,  635,
+      350,  348,  127,  127,  127,  127,  127,  127,  127,  127,
+      127,  127,  127,  127,  127,  127,  127,  127,  127,  127,
+      127,  127,  127,  127,  127,  127,  127,  129,  129,  129,
+      129,  129,  129,  129,  129,  129,  129,  129,  129,  130,
+      350,  225,  225,  225,  225,  257,  130,  130,  130,  130,
+
+      257,  257,  130,  632,  130,  130,  130,  130,  130,  130,
+      130,  130,  130,  130,  130,  130,  130,  130,  130,  130,
+      130,  130,  130,  225,  232,  232,  232,  232,  322,  261,
+      130,  150,  150,  150,  261,  262,  400,  400,  150,  379,
+      262,  261,  322,  150,  150,  631,  150,  150,  150,  150,
+      150,  379,  262,  379,  150,  150,  150,  150,  150,  150,
+      150,  150,  150,  150,  150,  150,  150,  150,  150,  150,
+      150,  150,  150,  232,  349,  359,  150,  150,  150,  150,
+      150,  150,  150,  150,  150,  150,  150,  150,  150,  150,
+      150,  150,  150,  150,  150,  150,  150,  150,  150,  150,
+
+      150,  154,  626,  195,  625,  349,  195,  195,  195,  195,
+      195,  245,  256,  154,  234,  234,  234,  234,  245,  245,
+      245,  245,  359,  363,  245,  268,  256,  256,  256,  256,
+      402,  402,  195,  268,  268,  268,  268,  268,  624,  154,
+      154,  154,  154,  154,  154,  154,  154,  154,  154,  154,
+      154,  155,  245,  403,  403,  246,  264,  234,  155,  195,
+      277,  264,  246,  246,  246,  246,  271,  289,  246,  289,
+      363,  458,  277,  264,  271,  271,  271,  271,  271,  289,
+      155,  623,  256,  377,  155,  155,  155,  155,  155,  155,
+      155,  155,  155,  155,  155,  155,  246,  310,  310,  310,
+
+      310,  426,  277,  331,  331,  331,  331,  155,  169,  169,
+      169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
+      170,  170,  620,  388,  426,  170,  619,  377,  170,  170,
+      170,  170,  170,  458,  170,  388,  170,  170,  170,  170,
+      170,  170,  170,  170,  170,  170,  170,  170,  170,  170,
+      170,  170,  170,  170,  170,  351,  351,  351,  170,  170,
+      170,  170,  170,  170,  170,  170,  170,  170,  170,  170,
+      170,  170,  170,  170,  170,  170,  170,  170,  170,  170,
+      170,  170,  170,  172,  172,  172,  172,  172,  172,  172,
+      172,  172,  172,  172,  172,  173,  173,  441,  351,  471,
+
+      173,  404,  404,  173,  173,  173,  173,  173,  471,  173,
+      441,  173,  173,  173,  173,  173,  173,  173,  173,  173,
+      173,  173,  173,  173,  173,  173,  173,  173,  173,  173,
+      405,  405,  617,  173,  173,  173,  173,  173,  173,  173,
+      173,  173,  173,  173,  173,  173,  173,  173,  173,  173,
+      173,  173,  173,  173,  173,  173,  173,  173,  213,  213,
+      213,  213,  213,  213,  213,  213,  213,  213,  213,  213,
+      217,  354,  354,  354,  354,  273,  445,  217,  616,  217,
+      274,  291,  292,  273,  273,  273,  273,  273,  274,  274,
+      274,  274,  274,  291,  292,  406,  406,  457,  612,  217,
+
+      406,  611,  421,  217,  217,  217,  217,  217,  217,  217,
+      217,  217,  217,  217,  217,  273,  421,  421,  610,  357,
+      274,  291,  292,  445,  472,  472,  217,  236,  236,  236,
+      236,  236,  357,  236,  236,  236,  236,  236,  236,  276,
+      278,  236,  236,  279,  276,  278,  280,  236,  236,  293,
+      236,  294,  278,  457,  293,  279,  276,  281,  280,  609,
+      357,  293,  276,  294,  287,  281,  281,  281,  281,  281,
+      236,  236,  287,  287,  287,  287,  287,  474,  474,  396,
+      370,  290,  475,  475,  276,  295,  607,  290,  442,  279,
+      370,  396,  370,  290,  360,  280,  295,  370,  236,  236,
+
+      237,  442,  305,  305,  456,  456,  456,  360,  294,  305,
+      305,  305,  305,  237,  281,  237,  237,  237,  237,  237,
+      237,  237,  237,  237,  237,  237,  237,  237,  237,  237,
+      237,  237,  237,  237,  290,  360,  408,  408,  408,  408,
+      606,  237,  239,  239,  239,  239,  239,  239,  239,  239,
+      239,  239,  239,  239,  247,  295,  536,  536,  452,  311,
+      452,  436,  436,  436,  561,  452,  311,  247,  311,  247,
       247,  247,  247,  247,  247,  247,  247,  247,  247,  247,
-      247,  247,  255,  328,  300,  709,  709,  328,  622,  601,
-      300,  336,  579,  584,  328,  255,  300,  255,  255,  255,
-
-      255,  255,  255,  255,  255,  255,  255,  255,  255,  255,
-      255,  255,  255,  255,  255,  255,  712,  712,  312,  312,
-      466,  409,  318,  255,  277,  312,  312,  312,  312,  318,
-      379,  318,  332,  409,  393,  619,  277,  300,  380,  332,
-      379,  332,  379,  622,  385,  328,  393,  379,  380,  411,
-      380,  318,  385,  636,  579,  380,  385,  445,  445,  445,
-      411,  332,  277,  277,  277,  277,  277,  277,  277,  277,
-      277,  277,  277,  277,  280,  394,  466,  451,  318,  396,
-      618,  280,  393,  280,  365,  365,  487,  394,  332,  365,
-      451,  396,  365,  365,  365,  365,  665,  616,  365,  487,
-
-      445,  636,  396,  280,  448,  448,  448,  280,  280,  280,
-      280,  280,  280,  280,  280,  280,  280,  280,  280,  411,
-      615,  399,  607,  394,  396,  416,  416,  416,  416,  606,
-      280,  291,  291,  399,  291,  291,  291,  291,  291,  291,
-      291,  291,  291,  291,  377,  291,  291,  448,  665,  502,
-      399,  291,  291,  291,  291,  392,  401,  400,  377,  377,
-      377,  377,  502,  392,  392,  392,  392,  392,  401,  400,
-      402,  600,  424,  459,  291,  291,  291,  407,  481,  407,
-      481,  598,  402,  395,  424,  459,  671,  408,  395,  407,
-      481,  469,  471,  408,  477,  291,  469,  471,  401,  408,
-
-      395,  400,  291,  291,  292,  292,  477,  482,  469,  471,
-      729,  729,  402,  597,  377,  596,  292,  675,  292,  482,
-      292,  292,  292,  292,  292,  292,  292,  292,  292,  292,
-      292,  292,  292,  292,  292,  292,  292,  292,  292,  395,
-      408,  671,  602,  459,  604,  477,  292,  293,  293,  293,
-      293,  293,  293,  293,  293,  293,  293,  293,  293,  298,
-      483,  530,  530,  530,  602,  675,  604,  590,  589,  588,
-      586,  483,  298,  612,  298,  298,  298,  298,  298,  298,
-      298,  298,  298,  298,  298,  298,  298,  298,  298,  298,
-      298,  298,  298,  585,  583,  612,  581,  645,  580,  645,
-
-      298,  335,  335,  335,  335,  335,  335,  335,  335,  335,
-      335,  335,  335,  348,  348,  433,  348,  348,  348,  348,
-      348,  645,  348,  348,  348,  348,  503,  348,  348,  410,
-      483,  473,  578,  348,  348,  348,  348,  406,  406,  503,
-      476,  410,  406,  473,  433,  406,  406,  406,  406,  406,
-      472,  406,  470,  433,  476,  476,  348,  348,  348,  577,
-      478,  507,  472,  348,  470,  572,  479,  567,  517,  433,
-      472,  479,  478,  473,  566,  507,  536,  348,  348,  470,
-      582,  410,  517,  479,  348,  348,  355,  355,  536,  355,
-      355,  355,  355,  355,  582,  355,  355,  355,  355,  611,
-
-      355,  355,  470,  646,  486,  486,  355,  355,  355,  355,
-      478,  486,  486,  486,  486,  533,  534,  533,  520,  520,
-      520,  525,  535,  646,  659,  646,  611,  533,  534,  355,
-      355,  355,  536,  538,  535,  525,  525,  525,  525,  539,
-      677,  541,  564,  571,  574,  538,  659,  562,  611,  561,
-      560,  539,  541,  535,  534,  571,  574,  355,  355,  356,
-      356,  520,  356,  356,  356,  356,  356,  559,  356,  356,
-      356,  356,  575,  356,  356,  538,  570,  539,  573,  356,
-      356,  356,  356,  643,  575,  544,  544,  558,  570,  538,
-      573,  525,  544,  544,  544,  544,  613,  643,  565,  571,
-
-      631,  557,  356,  356,  356,  576,  595,  570,  613,  614,
-      677,  541,  565,  565,  565,  565,  576,  595,  556,  573,
-      614,  555,  631,  678,  554,  553,  551,  550,  631,  575,
-      356,  356,  390,  390,  390,  390,  390,  390,  390,  390,
-      390,  390,  390,  390,  397,  397,  549,  397,  397,  397,
-      397,  397,  397,  397,  397,  397,  397,  594,  397,  397,
-      627,  547,  624,  638,  397,  397,  397,  397,  565,  594,
-      546,  627,  545,  630,  617,  576,  595,  543,  630,  614,
-      617,  642,  540,  537,  529,  528,  655,  397,  397,  397,
-      624,  638,  642,  678,  397,  630,  617,  655,  693,  594,
-
-      668,  527,  617,  526,  524,  672,  522,  653,  397,  397,
-      518,  668,  624,  638,  639,  397,  397,  403,  403,  652,
-      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
-      627,  403,  403,  672,  516,  653,  639,  403,  403,  403,
-      403,  515,  639,  514,  513,  512,  511,  652,  510,  509,
-      508,  642,  652,  666,  673,  672,  655,  653,  639,  667,
-      403,  403,  403,  653,  639,  673,  679,  680,  693,  652,
-      668,  681,  682,  683,  684,  685,  506,  679,  680,  666,
-      505,  666,  681,  682,  683,  684,  685,  667,  403,  403,
-      405,  405,  504,  405,  405,  405,  405,  405,  405,  405,
-
-      405,  405,  405,  666,  405,  405,  501,  667,  500,  667,
-      405,  405,  405,  405,  499,  498,  497,  496,  495,  494,
-      493,  492,  491,  490,  673,  489,  488,  480,  475,  686,
-      464,  463,  462,  405,  405,  405,  679,  680,  460,  458,
-      686,  681,  682,  683,  684,  685,  687,  456,  453,  452,
-      447,  443,  442,  688,  689,  690,  691,  687,  692,  441,
-      437,  405,  405,  426,  688,  689,  690,  691,  436,  692,
-      434,  431,  430,  429,  428,  427,  426,  423,  426,  426,
-      426,  426,  426,  426,  426,  426,  426,  426,  426,  426,
-      426,  426,  426,  426,  426,  426,  426,  439,  439,  686,
-
-      439,  439,  439,  439,  439,  422,  439,  439,  439,  439,
-      421,  439,  439,  420,  419,  418,  687,  439,  439,  439,
-      439,  417,  415,  688,  689,  690,  691,  413,  692,  412,
-      404,  391,  383,  382,  381,  378,  376,  374,  371,  367,
-      439,  439,  439,  362,  361,  353,  352,  351,  350,  344,
-      343,  342,  341,  340,  339,  334,  333,  331,  326,  324,
-      322,  321,  320,  319,  316,  315,  314,  313,  439,  439,
-      440,  440,  310,  440,  440,  440,  440,  440,  306,  440,
-      440,  440,  440,  296,  440,  440,  294,  278,  274,  268,
-      440,  440,  440,  440,  266,  262,  261,  260,  259,  257,
-
-      256,  251,  250,  249,  238,  237,  236,  235,  232,  229,
-      228,  227,  226,  440,  440,  440,  216,  215,  214,  213,
-      440,  212,  209,  208,  207,  206,  205,  204,  200,  199,
-      195,  191,  179,  170,  440,  440,  161,  150,  148,  147,
-      145,  440,  440,  468,  468,  143,  142,  141,  140,  139,
-      126,  125,  122,  120,  119,  468,  117,  468,  116,  468,
-      468,  468,  468,  468,  468,  468,  468,  468,  468,  468,
-      468,  468,  468,  468,  468,  468,  468,  468,  474,  474,
-      115,  474,  474,  474,  474,  474,  474,  474,  474,  474,
-      474,  114,  474,  474,  103,  101,   97,   94,  474,  474,
-
-      474,  474,   93,   92,   88,   83,   80,   60,   59,   57,
-       56,   54,   53,   45,   42,   41,   39,   24,   23,   21,
-       20,  474,  474,  474,   18,   17,   14,    9,    3,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,  474,
-      474,  587,  587,    0,  587,  587,  587,  587,  587,    0,
-      587,  587,  587,  587,    0,  587,  587,    0,    0,    0,
-        0,  587,  587,  587,  587,    0,    0,    0,    0,    0,
-        0,  587,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,  587,  587,  587,    0,    0,    0,
-
-        0,    0,    0,  587,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,  587,  587,  593,  593,    0,  593,  593,  593,
-      593,  593,  593,  593,  593,  593,  593,    0,  593,  593,
-        0,    0,    0,    0,  593,  593,  593,  593,    0,    0,
-        0,    0,    0,    0,  593,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,  593,  593,  593,
-        0,    0,    0,    0,    0,    0,  593,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,  593,  593,  603,  603,    0,
-
-      603,  603,  603,  603,  603,    0,  603,  603,  603,  603,
-        0,  603,  603,    0,    0,    0,    0,  603,  603,  603,
-      603,    0,    0,    0,    0,    0,    0,  603,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-      603,  603,  603,    0,    0,    0,    0,    0,    0,  603,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,  603,  603,
-      610,  610,    0,  610,  610,  610,  610,  610,  610,  610,
-      610,  610,  610,    0,  610,  610,    0,    0,    0,    0,
-      610,  610,  610,  610,    0,    0,    0,    0,    0,    0,
-
-      610,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,  610,  610,  610,    0,    0,    0,    0,
-        0,    0,  610,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,  610,  610,  697,    0,    0,    0,  697,  697,    0,
-        0,  697,  697,  697,  697,  697,  697,  697,  697,  698,
-      698,  698,  698,  698,    0,  698,  698,  698,  698,  698,
-      698,  698,  698,  698,  698,  698,  698,  698,  699,  699,
-        0,    0,    0,  699,  699,  699,  700,  700,  700,  700,
-      700,  700,  700,  700,  700,  700,  700,  700,  700,  700,
-
-      700,  700,  700,  700,  700,  701,  701,  701,  701,  701,
+      247,  247,  247,  247,  247,  247,  247,  247,  311,  321,
+      598,  329,  325,  321,  389,  247,  269,  435,  329,  325,
+
+      321,  325,  356,  356,  436,  510,  389,  356,  269,  361,
+      356,  356,  356,  356,  371,  311,  356,  376,  380,  510,
+      329,  325,  361,  389,  371,  376,  371,  561,  435,  376,
+      380,  371,  380,  570,  269,  269,  269,  269,  269,  269,
+      269,  269,  269,  269,  269,  269,  272,  329,  325,  383,
+      361,  321,  385,  272,  387,  272,  391,  383,  383,  383,
+      383,  383,  393,  393,  385,  478,  387,  393,  391,  582,
+      393,  393,  393,  393,  393,  272,  393,  387,  478,  272,
+      272,  272,  272,  272,  272,  272,  272,  272,  272,  272,
+      272,  368,  523,  523,  523,  570,  498,  390,  391,  387,
+
+      385,  392,  272,  282,  282,  368,  368,  368,  368,  390,
+      498,  498,  613,  392,  525,  282,  524,  282,  582,  282,
+      282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
+      282,  282,  282,  282,  282,  282,  282,  282,  560,  560,
+      662,  390,  597,  392,  583,  282,  283,  283,  283,  283,
+      283,  283,  283,  283,  283,  283,  283,  283,  288,  591,
+      394,  368,  394,  589,  524,  588,  525,  613,  628,  628,
+      587,  288,  394,  288,  288,  288,  288,  288,  288,  288,
+      288,  288,  288,  288,  288,  288,  288,  288,  288,  288,
+      288,  288,  439,  439,  439,  662,  583,  698,  698,  288,
+
+      328,  328,  328,  328,  328,  328,  328,  328,  328,  328,
+      328,  328,  381,  381,  381,  381,  381,  381,  381,  381,
+      381,  381,  381,  381,  386,  395,  416,  397,  427,  386,
+      450,  395,  398,  461,  581,  439,  463,  395,  416,  397,
+      465,  386,  450,  398,  460,  461,  462,  464,  463,  460,
+      592,  462,  465,  467,  580,  466,  463,  427,  467,  464,
+      461,  460,  468,  462,  468,  469,  427,  466,  493,  579,
+      467,  667,  592,  470,  468,  494,  532,  469,  395,  397,
+      386,  493,  427,  461,  470,  477,  477,  532,  494,  464,
+      593,  465,  477,  477,  477,  477,  513,  513,  513,  526,
+
+      450,  526,  398,  418,  567,  466,  586,  668,  699,  699,
+      577,  526,  593,  700,  700,  567,  418,  586,  418,  418,
+      418,  418,  418,  418,  418,  418,  418,  418,  418,  418,
+      418,  418,  418,  418,  418,  418,  418,  459,  459,  513,
+      527,  667,  576,  470,  703,  703,  532,  574,  599,  459,
+      572,  459,  527,  459,  459,  459,  459,  459,  459,  459,
+      459,  459,  459,  459,  459,  459,  459,  459,  459,  459,
+      459,  459,  518,  528,  567,  571,  586,  668,  527,  529,
+      530,  531,  562,  573,  563,  528,  518,  518,  518,  518,
+      564,  529,  530,  531,  562,  557,  563,  573,  537,  537,
+
+      599,  595,  564,  565,  528,  537,  537,  537,  537,  557,
+      557,  557,  557,  562,  566,  565,  585,  602,  604,  531,
+      615,  603,  530,  595,  621,  622,  566,  605,  585,  621,
+      604,  564,  627,  608,  618,  529,  530,  634,  605,  608,
+      563,  629,  518,  603,  602,  618,  621,  622,  615,  633,
+      636,  634,  636,  622,  642,  608,  646,  656,  585,  669,
+      633,  608,  719,  719,  569,  557,  602,  646,  630,  629,
+      615,  566,  578,  578,  636,  578,  578,  578,  578,  578,
+      627,  578,  578,  578,  578,  637,  578,  578,  650,  568,
+      630,  629,  578,  578,  578,  578,  630,  605,  559,  666,
+
+      558,  684,  578,  642,  618,  637,  556,  637,  643,  656,
+      650,  657,  630,  554,  644,  578,  578,  578,  630,  633,
+      553,  659,  664,  552,  578,  551,  646,  550,  549,  669,
+      548,  547,  659,  664,  658,  663,  643,  657,  546,  657,
+      545,  643,  644,  578,  578,  584,  584,  666,  584,  584,
+      584,  584,  584,  584,  584,  584,  584,  584,  643,  584,
+      584,  657,  658,  663,  644,  584,  584,  584,  584,  543,
+      644,  684,  670,  542,  540,  584,  671,  539,  538,  535,
+      534,  522,  658,  670,  658,  663,  521,  671,  584,  584,
+      584,  659,  664,  520,  672,  673,  674,  584,  675,  676,
+
+      519,  677,  678,  679,  680,  672,  673,  674,  517,  675,
+      676,  515,  677,  678,  679,  680,  584,  584,  594,  594,
+      511,  594,  594,  594,  594,  594,  509,  594,  594,  594,
+      594,  508,  594,  594,  681,  507,  506,  505,  594,  594,
+      594,  594,  670,  504,  503,  681,  671,  682,  594,  683,
+      502,  500,  497,  496,  495,  492,  491,  490,  682,  489,
+      683,  594,  594,  594,  672,  673,  674,  488,  675,  676,
+      594,  677,  678,  679,  680,  487,  486,  485,  484,  483,
+      482,  481,  480,  479,  473,  455,  454,  453,  451,  594,
+      594,  601,  601,  449,  601,  601,  601,  601,  601,  601,
+
+      601,  601,  601,  601,  681,  601,  601,  447,  444,  443,
+      438,  601,  601,  601,  601,  434,  433,  682,  432,  683,
+      431,  601,  430,  428,  425,  424,  423,  422,  420,  419,
+      415,  414,  413,  412,  601,  601,  601,  411,  410,  409,
+      407,  401,  399,  601,  382,  374,  373,  372,  369,  367,
+      365,  362,  358,  353,  352,  347,  346,  345,  344,  339,
+      338,  337,  601,  601,  688,  336,  335,  334,  688,  688,
+      333,  332,  688,  688,  688,  688,  688,  688,  688,  688,
+      689,  689,  689,  689,  689,  327,  689,  689,  689,  689,
+      689,  689,  689,  689,  689,  689,  689,  689,  689,  690,
+
+      690,  326,  324,  319,  690,  690,  690,  691,  691,  691,
+      691,  691,  691,  691,  691,  691,  691,  691,  691,  691,
+      691,  691,  691,  691,  691,  691,  692,  692,  692,  692,
+      692,  692,  692,  692,  692,  692,  692,  692,  692,  692,
+      692,  692,  692,  692,  692,  693,  693,  693,  693,  693,
+      693,  693,  693,  693,  693,  693,  693,  693,  693,  693,
+      693,  693,  693,  693,  694,  317,  315,  314,  694,  694,
+      694,  313,  694,  694,  694,  694,  694,  694,  694,  694,
+      695,  695,  695,  695,  695,  312,  695,  695,  695,  695,
+      695,  695,  695,  695,  695,  695,  695,  695,  695,  696,
+
+      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
+      696,  696,  696,  696,  696,  696,  696,  696,  697,  697,
+      309,  308,  307,  306,  296,  286,  284,  270,  697,  266,
+      260,  697,  697,  258,  697,  701,  701,  701,  701,  701,
       701,  701,  701,  701,  701,  701,  701,  701,  701,  701,
       701,  701,  701,  701,  702,  702,  702,  702,  702,  702,
       702,  702,  702,  702,  702,  702,  702,  702,  702,  702,
-      702,  702,  702,  703,    0,    0,    0,  703,  703,  703,
-        0,  703,  703,  703,  703,  703,  703,  703,  703,  704,
-      704,  704,  704,  704,    0,  704,  704,  704,  704,  704,
-      704,  704,  704,  704,  704,  704,  704,  704,  705,  705,
-      705,  705,  705,  705,  705,  705,  705,  705,  705,  705,
-      705,  705,  705,  705,  705,  705,  705,  706,  706,    0,
+      702,  702,  702,  704,  704,  704,  704,  704,  704,  704,
+      704,  704,  704,  704,  704,  704,  704,  704,  704,  704,
+      704,  704,  705,  705,  705,  705,  705,  705,  705,  705,
 
-        0,    0,    0,    0,    0,    0,    0,  706,    0,    0,
-      706,  706,    0,  706,  710,  710,  710,  710,  710,  710,
+      705,  705,  705,  705,  705,  705,  705,  705,  705,  705,
+      705,  706,  706,  706,  706,  706,  706,  706,  706,  706,
+      706,  706,  706,  706,  706,  706,  706,  706,  706,  706,
+      707,  707,  707,  707,  707,  707,  707,  707,  707,  707,
+      707,  707,  707,  707,  707,  707,  707,  707,  707,  708,
+      708,  708,  708,  708,  708,  708,  708,  708,  708,  708,
+      708,  708,  708,  708,  708,  708,  708,  708,  709,  709,
+      709,  709,  709,  709,  709,  709,  709,  709,  709,  709,
+      709,  709,  709,  709,  709,  709,  709,  710,  710,  710,
       710,  710,  710,  710,  710,  710,  710,  710,  710,  710,
-      710,  710,  710,  711,  711,  711,  711,  711,  711,  711,
+
+      710,  710,  710,  710,  710,  710,  711,  711,  254,  711,
       711,  711,  711,  711,  711,  711,  711,  711,  711,  711,
-      711,  711,  713,  713,  713,  713,  713,  713,  713,  713,
-      713,  713,  713,  713,  713,  713,  713,  713,  713,  713,
-      713,  714,  714,  714,  714,  714,  714,  714,  714,  714,
+      711,  711,  711,  711,  711,  712,  712,  253,  712,  712,
+      712,  712,  712,  712,  712,  712,  712,  712,  712,  712,
+      712,  712,  712,  712,  713,  252,  713,  251,  249,  248,
+      713,  713,  713,  243,  242,  713,  714,  714,  714,  714,
       714,  714,  714,  714,  714,  714,  714,  714,  714,  714,
+      714,  714,  714,  714,  714,  715,  715,  715,  715,  715,
       715,  715,  715,  715,  715,  715,  715,  715,  715,  715,
+      715,  715,  715,  715,  716,  716,  716,  716,  716,  716,
 
-      715,  715,  715,  715,  715,  715,  715,  715,  715,  716,
       716,  716,  716,  716,  716,  716,  716,  716,  716,  716,
-      716,  716,  716,  716,  716,  716,  716,  716,  717,  717,
+      716,  716,  716,  717,  717,  717,  717,  717,  717,  717,
       717,  717,  717,  717,  717,  717,  717,  717,  717,  717,
-      717,  717,  717,  717,  717,  717,  717,  718,  718,  718,
-      718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
-      718,  718,  718,  718,  718,  718,  719,  719,  719,  719,
-      719,  719,  719,  719,  719,  719,  719,  719,  719,  719,
-      719,  719,  719,  719,  719,  720,  720,    0,  720,  720,
-      720,  720,  720,  720,  720,  720,  720,  720,  720,  720,
-
-      720,  720,  720,  720,  721,  721,    0,  721,  721,  721,
+      717,  717,  718,  718,  718,  720,  241,  231,  230,  720,
+      229,  720,  720,  720,  720,  228,  720,  721,  721,  721,
       721,  721,  721,  721,  721,  721,  721,  721,  721,  721,
-      721,  721,  721,  722,    0,  722,    0,    0,    0,  722,
-      722,  722,    0,    0,  722,  723,  723,    0,  723,  723,
+      721,  721,  721,  721,  721,  721,  722,  722,  722,  722,
+      722,  722,  722,  722,  722,  722,  722,  722,  722,  722,
+      722,  722,  722,  722,  722,  723,  723,  723,  723,  723,
       723,  723,  723,  723,  723,  723,  723,  723,  723,  723,
+
       723,  723,  723,  723,  724,  724,  724,  724,  724,  724,
       724,  724,  724,  724,  724,  724,  724,  724,  724,  724,
       724,  724,  724,  725,  725,  725,  725,  725,  725,  725,
       725,  725,  725,  725,  725,  725,  725,  725,  725,  725,
       725,  725,  726,  726,  726,  726,  726,  726,  726,  726,
-
       726,  726,  726,  726,  726,  726,  726,  726,  726,  726,
       726,  727,  727,  727,  727,  727,  727,  727,  727,  727,
       727,  727,  727,  727,  727,  727,  727,  727,  727,  727,
-      728,  728,  728,  730,    0,    0,    0,  730,    0,  730,
-      730,  730,  730,    0,  730,  731,  731,  731,  731,  731,
+      728,  728,  728,  728,  728,  728,  728,  728,  728,  728,
+      728,  728,  728,  728,  728,  728,  728,  728,  728,  729,
+
+      729,  729,  729,  729,  729,  729,  729,  729,  729,  729,
+      729,  729,  729,  729,  729,  729,  729,  729,  730,  730,
+      730,  730,  730,  730,  730,  730,  730,  730,  730,  730,
+      730,  730,  730,  730,  730,  730,  730,  731,  731,  226,
       731,  731,  731,  731,  731,  731,  731,  731,  731,  731,
-      731,  731,  731,  731,  732,  732,  732,  732,  732,  732,
+      731,  731,  731,  731,  731,  731,  732,  732,  222,  732,
       732,  732,  732,  732,  732,  732,  732,  732,  732,  732,
-      732,  732,  732,  733,    0,    0,    0,  733,  733,  733,
-        0,  733,  733,  733,  733,  733,  733,  733,  733,  734,
-
+      732,  732,  732,  732,  732,  733,  221,  733,  733,  220,
+      219,  733,  733,  733,  218,  208,  733,  734,  734,  734,
       734,  734,  734,  734,  734,  734,  734,  734,  734,  734,
-      734,  734,  734,  734,  734,  734,  734,  734,  735,  735,
+
+      734,  734,  734,  734,  734,  734,  735,  735,  735,  735,
       735,  735,  735,  735,  735,  735,  735,  735,  735,  735,
-      735,  735,  735,  735,  735,  735,  735,  736,  736,    0,
+      735,  735,  735,  735,  735,  736,  736,  736,  736,  736,
       736,  736,  736,  736,  736,  736,  736,  736,  736,  736,
-      736,  736,  736,  736,  736,  736,  737,  737,  737,  737,
+      736,  736,  736,  736,  737,  737,  737,  737,  737,  737,
       737,  737,  737,  737,  737,  737,  737,  737,  737,  737,
-      737,  737,  737,  737,  737,  738,  738,  738,  738,    0,
-      738,  738,  738,  738,  738,  738,  738,  738,  738,  738,
-      738,  738,  738,  738,  739,  739,  739,  739,  739,  739,
+      737,  737,  737,  738,  738,  207,  206,  738,  738,  205,
+      738,  738,  738,  738,  738,  738,  738,  738,  738,  739,
+      204,  201,  200,  199,  198,  739,  739,  739,  739,  197,
+      739,  740,  740,  740,  740,  740,  740,  740,  740,  740,
 
-      739,  739,  739,  739,  739,  739,  739,  739,  739,  739,
-      739,  739,  739,  740,  740,    0,  740,  740,  740,  740,
       740,  740,  740,  740,  740,  740,  740,  740,  740,  740,
-      740,  740,  741,  741,    0,  741,  741,  741,  741,  741,
       741,  741,  741,  741,  741,  741,  741,  741,  741,  741,
-      741,  742,    0,  742,  742,    0,    0,  742,  742,  742,
-        0,    0,  742,  743,  743,    0,  743,  743,  743,  743,
+      741,  741,  741,  741,  741,  741,  741,  741,  741,  742,
+      742,  196,  192,  742,  742,  742,  742,  742,  742,  742,
+      742,  742,  742,  742,  742,  743,  743,  743,  743,  743,
       743,  743,  743,  743,  743,  743,  743,  743,  743,  743,
-      743,  743,  744,  744,    0,  744,  744,  744,  744,  744,
+      743,  743,  743,  743,  744,  744,  744,  744,  744,  744,
       744,  744,  744,  744,  744,  744,  744,  744,  744,  744,
-
-      744,  745,  745,    0,  745,  745,  745,  745,  745,  745,
+      744,  744,  744,  745,  745,  745,  745,  745,  745,  745,
       745,  745,  745,  745,  745,  745,  745,  745,  745,  745,
+
+      745,  745,  746,  746,  191,  746,  746,  746,  746,  746,
       746,  746,  746,  746,  746,  746,  746,  746,  746,  746,
-      746,  746,  746,  746,  746,  746,  746,  746,  746,  747,
+      746,  747,  747,  183,  747,  747,  747,  747,  747,  747,
       747,  747,  747,  747,  747,  747,  747,  747,  747,  747,
-      747,  747,  747,  747,  747,  747,  747,  747,  748,  748,
-      748,  748,  748,  748,  748,  748,  748,  748,  748,  748,
-      748,  748,  748,  748,  748,  748,  748,  749,  749,  749,
-      749,  749,  749,  749,  749,  749,  749,  749,  749,  749,
-      749,  749,  749,  749,  749,  749,  750,  750,    0,    0,
-
-      750,  750,    0,  750,  750,  750,  750,  750,  750,  750,
-      750,  750,  751,    0,    0,    0,    0,    0,  751,  751,
-      751,  751,    0,  751,  752,  752,  752,  752,  752,  752,
+      748,  748,  171,  748,  748,  748,  748,  748,  748,  748,
+      748,  748,  748,  748,  748,  748,  748,  748,  748,  749,
+      749,  164,  749,  749,  749,  749,  749,  749,  749,  749,
+      749,  749,  749,  749,  749,  749,  749,  749,  750,  750,
+      156,  750,  750,  750,  750,  750,  750,  750,  750,  750,
+      750,  750,  750,  750,  750,  750,  750,  751,  751,  145,
+
+      751,  751,  751,  751,  751,  751,  751,  751,  751,  751,
+      751,  751,  751,  751,  751,  751,  752,  752,  752,  752,
       752,  752,  752,  752,  752,  752,  752,  752,  752,  752,
-      752,  752,  752,  753,  753,  753,  753,  753,  753,  753,
+      752,  752,  752,  752,  752,  753,  753,  753,  753,  753,
       753,  753,  753,  753,  753,  753,  753,  753,  753,  753,
-      753,  753,  754,  754,    0,  754,  754,  754,  754,  754,
+      753,  753,  753,  753,  754,  754,  754,  754,  754,  754,
       754,  754,  754,  754,  754,  754,  754,  754,  754,  754,
-      754,  755,  755,    0,  755,  755,  755,  755,  755,  755,
-      755,  755,  755,  755,  755,  755,  755,  755,  755,  755,
-
-      756,  756,    0,    0,  756,  756,  756,  756,  756,  756,
-      756,  756,  756,  756,  756,  756,  757,  757,  757,  757,
-        0,  757,  757,  757,  757,  757,  757,  757,  757,  757,
-      757,  757,  757,  757,  757,  758,  758,  758,  758,  758,
-      758,  758,  758,  758,  758,  758,  758,  758,  758,  758,
-      758,  758,  758,  758,  759,  759,    0,  759,  759,  759,
+      754,  754,  754,  755,  143,  142,  140,  138,  137,  755,
+      755,  755,  755,  755,  755,  755,  755,  755,  756,  756,
+      756,  756,  756,  756,  756,  756,  756,  756,  756,  756,
+
+      756,  756,  756,  756,  756,  756,  756,  757,  757,  757,
+      757,  136,  757,  757,  757,  757,  757,  757,  757,  757,
+      757,  757,  757,  757,  757,  757,  758,  135,  134,  121,
+      119,  117,  758,  758,  758,  758,  759,  759,  116,  759,
       759,  759,  759,  759,  759,  759,  759,  759,  759,  759,
-      759,  759,  759,  760,  760,    0,  760,  760,  760,  760,
+      759,  759,  759,  759,  759,  760,  760,  114,  760,  760,
       760,  760,  760,  760,  760,  760,  760,  760,  760,  760,
-      760,  760,  761,  761,    0,  761,  761,  761,  761,  761,
-
+      760,  760,  760,  760,  761,  761,  113,  761,  761,  761,
       761,  761,  761,  761,  761,  761,  761,  761,  761,  761,
-      761,  762,  762,    0,  762,  762,  762,  762,  762,  762,
+      761,  761,  761,  762,  762,  112,  762,  762,  762,  762,
+
       762,  762,  762,  762,  762,  762,  762,  762,  762,  762,
-      763,  763,    0,  763,  763,  763,  763,  763,  763,  763,
-      763,  763,  763,  763,  763,  763,  763,  763,  763,  764,
-      764,    0,  764,  764,  764,  764,  764,  764,  764,  764,
-      764,  764,  764,  764,  764,  764,  764,  764,  765,  765,
-        0,  765,  765,  765,  765,  765,  765,  765,  765,  765,
-      765,  765,  765,  765,  765,  765,  765,  766,  766,    0,
+      762,  762,  763,  763,  763,  763,  763,  763,  763,  763,
+      763,  763,  763,  763,  763,  763,  763,  763,  763,  763,
+      763,  764,  764,  764,  764,  764,  764,  764,  764,  764,
+      764,  764,  764,  764,  764,  764,  764,  764,  764,  764,
+      765,  765,  765,  765,  765,  765,  765,  765,  765,  765,
+      765,  765,  765,  765,  765,  765,  765,  765,  765,  766,
       766,  766,  766,  766,  766,  766,  766,  766,  766,  766,
-
-      766,  766,  766,  766,  766,  766,  767,  767,  767,  767,
-      767,  767,  767,  767,  767,  767,  767,  767,  767,  767,
-      767,  767,  767,  767,  767,  768,  768,  768,  768,  768,
-      768,  768,  768,  768,  768,  768,  768,  768,  768,  768,
-      768,  768,  768,  768,  769,  769,  769,  769,  769,  769,
-      769,  769,  769,  769,  769,  769,  769,  769,  769,  769,
-      769,  769,  769,  770,    0,    0,    0,    0,    0,  770,
-      770,  770,  770,  770,  770,  770,  770,  770,  771,  771,
-      771,  771,  771,  771,  771,  771,  771,  771,  771,  771,
-      771,  771,  771,  771,  771,  771,  771,  772,  772,  772,
-
-      772,  772,  772,  772,  772,  772,  772,  772,  772,  772,
-      772,  772,  772,  772,  772,  772,  773,  773,  773,  773,
-      773,  773,  773,  773,  773,  773,  773,  773,  773,  773,
-      773,  773,  773,  773,  773,  774,    0,    0,    0,    0,
-        0,  774,  774,  774,  774,  775,  775,    0,  775,  775,
-      775,  775,  775,  775,  775,  775,  775,  775,  775,  775,
-      775,  775,  775,  775,  776,  776,  776,  776,  776,  776,
-      776,  776,  776,  776,  776,  776,  776,  776,  776,  776,
-      776,  776,  776,  777,  777,    0,  777,  777,  777,  777,
-      777,  777,  777,  777,  777,  777,  777,  777,  777,  777,
-
-      777,  777,  778,  778,    0,  778,  778,  778,  778,  778,
-      778,  778,  778,  778,  778,  778,  778,  778,  778,  778,
-      778,  779,  779,    0,  779,  779,  779,  779,  779,  779,
-      779,  779,  779,  779,  779,  779,  779,  779,  779,  779,
-      780,  780,  780,  780,  780,  780,  780,  780,  780,  780,
-      780,  780,  780,  780,  780,  780,  780,  780,  780,  781,
-      781,  781,  781,  781,  781,  781,  781,  781,  781,  781,
-      781,  781,  781,  781,  781,  781,  781,  781,  782,  782,
-      782,  782,  782,  782,  782,  782,  782,  782,  782,  782,
-      782,  782,  782,  782,  782,  782,  782,  783,  783,  783,
-
-      783,  783,  783,  783,  783,  783,  783,  783,  783,  783,
-      783,  783,  783,  783,  783,  783,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696,
-      696,  696,  696,  696,  696,  696,  696,  696,  696,  696
+      766,  766,  766,  766,  766,  766,  766,  766,  101,   99,
+       95,   92,   91,   90,   86,   81,   78,   58,   57,   55,
+
+       53,   52,   44,   41,   40,   38,   23,   22,   20,   18,
+       17,   14,    9,    3,  687,  687,  687,  687,  687,  687,
+      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
+      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
+      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
+      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
+      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
+      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
+      687,  687,  687,  687,  687,  687,  687,  687
     } ;
 
-static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
+extern int yy_flex_debug;
+int yy_flex_debug = 0;
+
+static yy_state_type *yy_state_buf=0, *yy_state_ptr=0;
 static char *yy_full_match;
 static int yy_lp;
 static int yy_looking_for_trail_begin = 0;
@@ -1692,27 +1613,27 @@ static int *yy_full_state;
 #define YY_TRAILING_HEAD_MASK 0x4000
 #define REJECT \
 { \
-*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
-yy_cp = yy_full_match; /* restore poss. backed-over text */ \
-yy_lp = yy_full_lp; /* restore orig. accepting pos. */ \
-yy_state_ptr = yy_full_state; /* restore orig. state */ \
-yy_current_state = *yy_state_ptr; /* restore curr. state */ \
-++yy_lp; \
+*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ \
+yy_cp = (yy_full_match); /* restore poss. backed-over text */ \
+(yy_lp) = (yy_full_lp); /* restore orig. accepting pos. */ \
+(yy_state_ptr) = (yy_full_state); /* restore orig. state */ \
+yy_current_state = *(yy_state_ptr); /* restore curr. state */ \
+++(yy_lp); \
 goto find_rule; \
 }
+
 #define yymore() yymore_used_but_not_detected
 #define YY_MORE_ADJ 0
 #define YY_RESTORE_YY_MORE_OFFSET
 char *yytext;
-#define INITIAL 0
 /*
  * parser.l -- lex parser of algebraic chess moves for XBoard
  *
  * Copyright 1991 by Digital Equipment Corporation, Maynard,
  * Massachusetts.
  *
- * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006,
- * 2007, 2008, 2009 Free Software Foundation, Inc.
+ * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005,
+ * 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
  *
  * The following terms apply to Digital Equipment Corporation's copyright
  * interest in XBoard:
@@ -1875,6 +1796,50 @@ int yyback P((int *, int));
 int yywrap P((void));
 extern void CopyBoard P((Board to, Board from));
 
+#define INITIAL 0
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
+#ifndef YY_EXTRA_TYPE
+#define YY_EXTRA_TYPE void *
+#endif
+
+static int yy_init_globals (void );
+
+/* Accessor methods to globals.
+   These are made visible to non-reentrant scanners for convenience. */
+
+int yylex_destroy (void );
+
+int yyget_debug (void );
+
+void yyset_debug (int debug_flag  );
+
+YY_EXTRA_TYPE yyget_extra (void );
+
+void yyset_extra (YY_EXTRA_TYPE user_defined  );
+
+FILE *yyget_in (void );
+
+void yyset_in  (FILE * in_str  );
+
+FILE *yyget_out (void );
+
+void yyset_out  (FILE * out_str  );
+
+int yyget_leng (void );
+
+char *yyget_text (void );
+
+int yyget_lineno (void );
+
+void yyset_lineno (int line_number  );
 
 /* Macros after this point can all be overridden by user definitions in
  * section 1.
@@ -1882,65 +1847,30 @@ extern void CopyBoard P((Board to, Board from));
 
 #ifndef YY_SKIP_YYWRAP
 #ifdef __cplusplus
-extern "C" int yywrap YY_PROTO(( void ));
+extern "C" int yywrap (void );
 #else
-extern int yywrap YY_PROTO(( void ));
+extern int yywrap (void );
 #endif
 #endif
 
-#ifndef YY_NO_UNPUT
-static void yyunput YY_PROTO(( int c, char *buf_ptr ));
-#endif
-
+    static void yyunput (int c,char *buf_ptr  );
+    
 #ifndef yytext_ptr
-static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+static void yy_flex_strncpy (char *,yyconst char *,int );
 #endif
 
 #ifdef YY_NEED_STRLEN
-static int yy_flex_strlen YY_PROTO(( yyconst char * ));
+static int yy_flex_strlen (yyconst char * );
 #endif
 
 #ifndef YY_NO_INPUT
+
 #ifdef __cplusplus
-static int yyinput YY_PROTO(( void ));
+static int yyinput (void );
 #else
-static int input YY_PROTO(( void ));
-#endif
+static int input (void );
 #endif
 
-#if YY_STACK_USED
-static int yy_start_stack_ptr = 0;
-static int yy_start_stack_depth = 0;
-static int *yy_start_stack = 0;
-#ifndef YY_NO_PUSH_STATE
-static void yy_push_state YY_PROTO(( int new_state ));
-#endif
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state YY_PROTO(( void ));
-#endif
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state YY_PROTO(( void ));
-#endif
-
-#else
-#define YY_NO_PUSH_STATE 1
-#define YY_NO_POP_STATE 1
-#define YY_NO_TOP_STATE 1
-#endif
-
-#ifdef YY_MALLOC_DECL
-YY_MALLOC_DECL
-#else
-#if __STDC__
-#ifndef __cplusplus
-#include <stdlib.h>
-#endif
-#else
-/* Just try to get by without declaring the routines.  This will fail
- * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
- * or sizeof(void*) != sizeof(int).
- */
-#endif
 #endif
 
 /* Amount of stuff to slurp up with each read. */
@@ -1949,12 +1879,11 @@ YY_MALLOC_DECL
 #endif
 
 /* Copy whatever the last rule matched to the standard output. */
-
 #ifndef ECHO
 /* This used to be an fputs(), but since the string might contain NUL's,
  * we now use fwrite().
  */
-#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#define ECHO fwrite( yytext, yyleng, 1, yyout )
 #endif
 
 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
@@ -1962,9 +1891,10 @@ YY_MALLOC_DECL
  */
 #ifndef YY_INPUT
 #define YY_INPUT(buf,result,max_size) \
-       if ( yy_current_buffer->yy_is_interactive ) \
+       if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
                { \
-               int c = '*', n; \
+               int c = '*'; \
+               int n; \
                for ( n = 0; n < max_size && \
                             (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
                        buf[n] = (char) c; \
@@ -1974,9 +1904,22 @@ YY_MALLOC_DECL
                        YY_FATAL_ERROR( "input in flex scanner failed" ); \
                result = n; \
                } \
-       else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
-                 && ferror( yyin ) ) \
-               YY_FATAL_ERROR( "input in flex scanner failed" );
+       else \
+               { \
+               errno=0; \
+               while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+                       { \
+                       if( errno != EINTR) \
+                               { \
+                               YY_FATAL_ERROR( "input in flex scanner failed" ); \
+                               break; \
+                               } \
+                       errno=0; \
+                       clearerr(yyin); \
+                       } \
+               }\
+\
+
 #endif
 
 /* No semi-colon after return; correct usage is to write "yyterminate();" -
@@ -1997,12 +1940,18 @@ YY_MALLOC_DECL
 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
 #endif
 
+/* end tables serialization structures and prototypes */
+
 /* Default declaration of generated scanner - a define so the user can
  * easily add parameters.
  */
 #ifndef YY_DECL
-#define YY_DECL int yylex YY_PROTO(( void ))
-#endif
+#define YY_DECL_IS_OURS 1
+
+extern int yylex (void);
+
+#define YY_DECL int yylex (void)
+#endif /* !YY_DECL */
 
 /* Code executed at the beginning of each rule, after yytext and yyleng
  * have been set up.
@@ -2018,29 +1967,34 @@ YY_MALLOC_DECL
 
 #define YY_RULE_SETUP \
        if ( yyleng > 0 ) \
-               yy_current_buffer->yy_at_bol = \
+               YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
                                (yytext[yyleng - 1] == '\n'); \
        YY_USER_ACTION
 
+/** The main scanner function which does all the work.
+ */
 YY_DECL
-       {
+{
        register yy_state_type yy_current_state;
        register char *yy_cp, *yy_bp;
        register int yy_act;
-
-
-
-
-       if ( yy_init )
+    
+       if ( !(yy_init) )
                {
-               yy_init = 0;
+               (yy_init) = 1;
 
 #ifdef YY_USER_INIT
                YY_USER_INIT;
 #endif
 
-               if ( ! yy_start )
-                       yy_start = 1;   /* first start state */
+        /* Create the reject buffer large enough to save one state per allowed character. */
+        if ( ! (yy_state_buf) )
+            (yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE  );
+            if ( ! (yy_state_buf) )
+                YY_FATAL_ERROR( "out of dynamic memory in yylex()" );
+
+               if ( ! (yy_start) )
+                       (yy_start) = 1; /* first start state */
 
                if ( ! yyin )
                        yyin = stdin;
@@ -2048,29 +2002,33 @@ YY_DECL
                if ( ! yyout )
                        yyout = stdout;
 
-               if ( ! yy_current_buffer )
-                       yy_current_buffer =
-                               yy_create_buffer( yyin, YY_BUF_SIZE );
+               if ( ! YY_CURRENT_BUFFER ) {
+                       yyensure_buffer_stack ();
+                       YY_CURRENT_BUFFER_LVALUE =
+                               yy_create_buffer(yyin,YY_BUF_SIZE );
+               }
 
-               yy_load_buffer_state();
+               yy_load_buffer_state( );
                }
 
        while ( 1 )             /* loops until end-of-file is reached */
                {
-               yy_cp = yy_c_buf_p;
+               yy_cp = (yy_c_buf_p);
 
                /* Support of yytext. */
-               *yy_cp = yy_hold_char;
+               *yy_cp = (yy_hold_char);
 
                /* yy_bp points to the position in yy_ch_buf of the start of
                 * the current run.
                 */
                yy_bp = yy_cp;
 
-               yy_current_state = yy_start;
+               yy_current_state = (yy_start);
                yy_current_state += YY_AT_BOL();
-               yy_state_ptr = yy_state_buf;
-               *yy_state_ptr++ = yy_current_state;
+
+               (yy_state_ptr) = (yy_state_buf);
+               *(yy_state_ptr)++ = yy_current_state;
+
 yy_match:
                do
                        {
@@ -2078,60 +2036,58 @@ yy_match:
                        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
                                {
                                yy_current_state = (int) yy_def[yy_current_state];
-                               if ( yy_current_state >= 697 )
+                               if ( yy_current_state >= 688 )
                                        yy_c = yy_meta[(unsigned int) yy_c];
                                }
                        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-                       *yy_state_ptr++ = yy_current_state;
+                       *(yy_state_ptr)++ = yy_current_state;
                        ++yy_cp;
                        }
-               while ( yy_base[yy_current_state] != 4517 );
+               while ( yy_base[yy_current_state] != 3815 );
 
 yy_find_action:
-               yy_current_state = *--yy_state_ptr;
-               yy_lp = yy_accept[yy_current_state];
+               yy_current_state = *--(yy_state_ptr);
+               (yy_lp) = yy_accept[yy_current_state];
 find_rule: /* we branch to this label when backing up */
                for ( ; ; ) /* until we find what rule we matched */
                        {
-                       if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
+                       if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] )
                                {
-                               yy_act = yy_acclist[yy_lp];
+                               yy_act = yy_acclist[(yy_lp)];
                                if ( yy_act & YY_TRAILING_HEAD_MASK ||
-                                    yy_looking_for_trail_begin )
+                                    (yy_looking_for_trail_begin) )
                                        {
-                                       if ( yy_act == yy_looking_for_trail_begin )
+                                       if ( yy_act == (yy_looking_for_trail_begin) )
                                                {
-                                               yy_looking_for_trail_begin = 0;
+                                               (yy_looking_for_trail_begin) = 0;
                                                yy_act &= ~YY_TRAILING_HEAD_MASK;
                                                break;
                                                }
                                        }
                                else if ( yy_act & YY_TRAILING_MASK )
                                        {
-                                       yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK;
-                                       yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK;
+                                       (yy_looking_for_trail_begin) = yy_act & ~YY_TRAILING_MASK;
+                                       (yy_looking_for_trail_begin) |= YY_TRAILING_HEAD_MASK;
                                        }
                                else
                                        {
-                                       yy_full_match = yy_cp;
-                                       yy_full_state = yy_state_ptr;
-                                       yy_full_lp = yy_lp;
+                                       (yy_full_match) = yy_cp;
+                                       (yy_full_state) = (yy_state_ptr);
+                                       (yy_full_lp) = (yy_lp);
                                        break;
                                        }
-                               ++yy_lp;
+                               ++(yy_lp);
                                goto find_rule;
                                }
                        --yy_cp;
-                       yy_current_state = *--yy_state_ptr;
-                       yy_lp = yy_accept[yy_current_state];
+                       yy_current_state = *--(yy_state_ptr);
+                       (yy_lp) = yy_accept[yy_current_state];
                        }
 
                YY_DO_BEFORE_ACTION;
 
-
 do_action:     /* This label is used only to access EOF actions. */
 
-
                switch ( yy_act )
        { /* beginning of action switch */
 case 1:
@@ -2202,8 +2158,6 @@ YY_RULE_SETUP
 
     result = LegalityTest(boards[yyboardindex],
                          PosFlags(yyboardindex)&~F_MANDATORY_CAPTURE, // [HGM] losers: might think we can e.p.!
-                         EP_UNKNOWN,
-                          initialRights, /* [HGM] assume all castlings allowed */
                           currentMoveString[1] - ONE,
                           currentMoveString[0] - AAA,
                           currentMoveString[3] - ONE,
@@ -2266,8 +2220,6 @@ YY_RULE_SETUP
 
     result = LegalityTest(boards[yyboardindex],
                          PosFlags(yyboardindex)&~F_MANDATORY_CAPTURE, // [HGM] losers: might think we can e.p.!
-                         EP_UNKNOWN,
-                          initialRights, /* [HGM] assume all castlings allowed */
                           currentMoveString[1] - ONE,
                           currentMoveString[0] - AAA,
                           currentMoveString[3] - ONE,
@@ -2321,9 +2273,7 @@ YY_RULE_SETUP
     if(c != '=' && c != '+' && c != NULLCHAR && CharToPiece(c) == EmptySquare)
       return IllegalMove;
 
-
-    Disambiguate(boards[yyboardindex],
-                PosFlags(yyboardindex), EP_UNKNOWN, &cl);
+    Disambiguate(boards[yyboardindex], PosFlags(yyboardindex), &cl);
 
     currentMoveString[0] = cl.ff + AAA;
     currentMoveString[1] = cl.rf + ONE;
@@ -2378,8 +2328,7 @@ YY_RULE_SETUP
     if(c != '=' && c != '+' && c != NULLCHAR && CharToPiece(c) == EmptySquare)
       return IllegalMove;
 
-    Disambiguate(boards[yyboardindex],
-                PosFlags(yyboardindex), EP_UNKNOWN, &cl);
+    Disambiguate(boards[yyboardindex], PosFlags(yyboardindex), &cl);
 
     currentMoveString[0] = cl.ff + AAA;
     currentMoveString[1] = cl.rf + ONE;
@@ -2435,9 +2384,13 @@ YY_RULE_SETUP
     if (WhiteOnMove(yyboardindex)) {
         if (yytext[2+skip] == ONE) return (int) ImpossibleMove;
        currentMoveString[1] = yytext[2+skip] - 1;
+       if(boards[yyboardindex][currentMoveString[1]-ONE][currentMoveString[0]-AAA] != WhitePawn) 
+               return ImpossibleMove;
     } else {
         currentMoveString[1] = currentMoveString[3] + 1;
         if (currentMoveString[3] == ONE+BOARD_HEIGHT-1) return (int) ImpossibleMove;
+       if(boards[yyboardindex][currentMoveString[1]-ONE][currentMoveString[0]-AAA] != BlackPawn) 
+               return ImpossibleMove;
     }
     if (yyleng-skip > 3) {
        if (yytext[yyleng-1] == ')')
@@ -2453,8 +2406,6 @@ YY_RULE_SETUP
 
     result = LegalityTest(boards[yyboardindex],
                          PosFlags(yyboardindex)&~F_MANDATORY_CAPTURE, // [HGM] losers: might think we can e.p.!
-                         EP_UNKNOWN,
-                          initialRights, /* [HGM] assume all castlings allowed */
                           currentMoveString[1] - ONE,
                           currentMoveString[0] - AAA,
                           currentMoveString[3] - ONE,
@@ -2494,8 +2445,6 @@ YY_RULE_SETUP
 
     result = LegalityTest(boards[yyboardindex],
                          PosFlags(yyboardindex)&~F_MANDATORY_CAPTURE, // [HGM] losers: might think we can e.p.!
-                         EP_UNKNOWN,
-                          initialRights, /* [HGM] assume all castlings allowed */
                           currentMoveString[1] - ONE,
                           currentMoveString[0] - AAA,
                           currentMoveString[3] - ONE,
@@ -2554,8 +2503,7 @@ YY_RULE_SETUP
        cl.ftIn <  BOARD_LEFT     )
       return 0;
 
-    Disambiguate(boards[yyboardindex],
-                PosFlags(yyboardindex), EP_UNKNOWN, &cl);
+    Disambiguate(boards[yyboardindex], PosFlags(yyboardindex), &cl);
 
     currentMoveString[0] = cl.ff + AAA;
     currentMoveString[1] = cl.rf + ONE;
@@ -2617,8 +2565,7 @@ YY_RULE_SETUP
        cl.ftIn <  BOARD_LEFT     )
       return 0;
 
-    Disambiguate(boards[yyboardindex],
-                PosFlags(yyboardindex), EP_UNKNOWN, &cl);
+    Disambiguate(boards[yyboardindex], PosFlags(yyboardindex), &cl);
 
     currentMoveString[0] = cl.ff + AAA;
     currentMoveString[1] = cl.rf + ONE;
@@ -2673,7 +2620,10 @@ YY_RULE_SETUP
             ff = initialRights[5];
             ft = initialRights[4];
         }
-        fprintf(debugFP, "Parser FRC long %d %d\n", ff, ft);
+        if (appData.debugMode) 
+        {
+          fprintf(debugFP, "Parser FRC long %d %d\n", ff, ft);
+        };
         if(ff < 0 || ft < 0) return 0;
     }
     sprintf(currentMoveString, "%c%c%c%c",ff+AAA,rf+ONE,ft+AAA,rt+ONE);
@@ -2682,8 +2632,6 @@ YY_RULE_SETUP
     }
     return (int) LegalityTest(boards[yyboardindex],
                              PosFlags(yyboardindex)&~F_MANDATORY_CAPTURE, // [HGM] losers: e.p.!
-                             EP_UNKNOWN,
-                              castlingRights[yyboardindex], /* [HGM] use true castling rights */
                              rf, ff, rt, ft, NULLCHAR);
 }
        YY_BREAK
@@ -2741,8 +2689,6 @@ YY_RULE_SETUP
 
     return (int) LegalityTest(boards[yyboardindex],
                              PosFlags(yyboardindex)&~F_MANDATORY_CAPTURE, // [HGM] losers: e.p.!
-                             EP_UNKNOWN,
-                              castlingRights[yyboardindex], /* [HGM] use true castling rights */
                              rf, ff, rt, ft, NULLCHAR);
 }
        YY_BREAK
@@ -2837,13 +2783,13 @@ YY_RULE_SETUP
        YY_BREAK
 case 20:
 YY_RULE_SETUP
-{
+{ 
     return (int) (ToUpper(yytext[0]) == 'W' ? WhiteWins : BlackWins);
 }
        YY_BREAK
 case 21:
 YY_RULE_SETUP
-{
+{ 
     return (int) (ToUpper(yytext[0]) == 'W' ? BlackWins : WhiteWins);
 }
        YY_BREAK
@@ -2872,6 +2818,7 @@ YY_RULE_SETUP
 }
        YY_BREAK
 case 26:
+/* rule 26 can match eol */
 YY_RULE_SETUP
 {
     /* move numbers */
@@ -2887,6 +2834,7 @@ YY_RULE_SETUP
 }
        YY_BREAK
 case 28:
+/* rule 28 can match eol */
 YY_RULE_SETUP
 {
     /* position diagram enclosed in [-- --] */
@@ -2894,8 +2842,9 @@ YY_RULE_SETUP
 }
        YY_BREAK
 case 29:
-*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
-yy_c_buf_p = yy_cp -= 1;
+/* rule 29 can match eol */
+*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
+(yy_c_buf_p) = yy_cp -= 1;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
 {
@@ -2904,6 +2853,7 @@ YY_RULE_SETUP
 }
        YY_BREAK
 case 30:
+/* rule 30 can match eol */
 YY_RULE_SETUP
 {
     return (int) PGNTag;
@@ -2916,8 +2866,9 @@ YY_RULE_SETUP
 }
        YY_BREAK
 case 32:
-*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
-yy_c_buf_p = yy_cp -= 1;
+/* rule 32 can match eol */
+*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
+(yy_c_buf_p) = yy_cp -= 1;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
 {
@@ -2931,14 +2882,15 @@ YY_RULE_SETUP
 }
        YY_BREAK
 case 34:
+/* rule 34 can match eol */
 YY_RULE_SETUP
 {                              /* anything in {} */
     return (int) Comment; 
 }
        YY_BREAK
 case 35:
-*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
-yy_c_buf_p = yy_cp -= 1;
+*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
+(yy_c_buf_p) = yy_cp -= 1;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
 {                                          /* ; to end of line */
@@ -2946,24 +2898,28 @@ YY_RULE_SETUP
 }
        YY_BREAK
 case 36:
+/* rule 36 can match eol */
 YY_RULE_SETUP
 {                              /* anything in [] */
     return (int) Comment; 
 }
        YY_BREAK
 case 37:
+/* rule 37 can match eol */
 YY_RULE_SETUP
-{              /* nested () */
+{ /* very nested () */
     return (int) Comment; 
 }
        YY_BREAK
 case 38:
+/* rule 38 can match eol */
 YY_RULE_SETUP
 {                              /* >=2 chars in () */
     return (int) Comment; 
 }       
        YY_BREAK
 case 39:
+/* rule 39 can match eol */
 YY_RULE_SETUP
 {
         /* Skip mail headers */
@@ -2976,6 +2932,7 @@ YY_RULE_SETUP
 }
        YY_BREAK
 case 41:
+/* rule 41 can match eol */
 YY_RULE_SETUP
 {
         /* Skip everything else */
@@ -2991,26 +2948,26 @@ ECHO;
        case YY_END_OF_BUFFER:
                {
                /* Amount of text matched not including the EOB char. */
-               int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
+               int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
 
                /* Undo the effects of YY_DO_BEFORE_ACTION. */
-               *yy_cp = yy_hold_char;
+               *yy_cp = (yy_hold_char);
                YY_RESTORE_YY_MORE_OFFSET
 
-               if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+               if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
                        {
                        /* We're scanning a new file or input source.  It's
                         * possible that this happened because the user
                         * just pointed yyin at a new source and called
                         * yylex().  If so, then we have to assure
-                        * consistency between yy_current_buffer and our
+                        * consistency between YY_CURRENT_BUFFER and our
                         * globals.  Here is the right place to do so, because
                         * this is the first action (other than possibly a
                         * back-up) that will match for the new input source.
                         */
-                       yy_n_chars = yy_current_buffer->yy_n_chars;
-                       yy_current_buffer->yy_input_file = yyin;
-                       yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+                       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+                       YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
                        }
 
                /* Note that here we test for yy_c_buf_p "<=" to the position
@@ -3020,13 +2977,13 @@ ECHO;
                 * end-of-buffer state).  Contrast this with the test
                 * in input().
                 */
-               if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+               if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
                        { /* This was really a NUL. */
                        yy_state_type yy_next_state;
 
-                       yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
+                       (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
 
-                       yy_current_state = yy_get_previous_state();
+                       yy_current_state = yy_get_previous_state(  );
 
                        /* Okay, we're now positioned to make the NUL
                         * transition.  We couldn't have
@@ -3039,30 +2996,30 @@ ECHO;
 
                        yy_next_state = yy_try_NUL_trans( yy_current_state );
 
-                       yy_bp = yytext_ptr + YY_MORE_ADJ;
+                       yy_bp = (yytext_ptr) + YY_MORE_ADJ;
 
                        if ( yy_next_state )
                                {
                                /* Consume the NUL. */
-                               yy_cp = ++yy_c_buf_p;
+                               yy_cp = ++(yy_c_buf_p);
                                yy_current_state = yy_next_state;
                                goto yy_match;
                                }
 
                        else
                                {
-                               yy_cp = yy_c_buf_p;
+                               yy_cp = (yy_c_buf_p);
                                goto yy_find_action;
                                }
                        }
 
-               else switch ( yy_get_next_buffer() )
+               else switch ( yy_get_next_buffer(  ) )
                        {
                        case EOB_ACT_END_OF_FILE:
                                {
-                               yy_did_buffer_switch_on_eof = 0;
+                               (yy_did_buffer_switch_on_eof) = 0;
 
-                               if ( yywrap() )
+                               if ( yywrap( ) )
                                        {
                                        /* Note: because we've taken care in
                                         * yy_get_next_buffer() to have set up
@@ -3073,7 +3030,7 @@ ECHO;
                                         * YY_NULL, it'll still work - another
                                         * YY_NULL will get returned.
                                         */
-                                       yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+                                       (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
 
                                        yy_act = YY_STATE_EOF(YY_START);
                                        goto do_action;
@@ -3081,30 +3038,30 @@ ECHO;
 
                                else
                                        {
-                                       if ( ! yy_did_buffer_switch_on_eof )
+                                       if ( ! (yy_did_buffer_switch_on_eof) )
                                                YY_NEW_FILE;
                                        }
                                break;
                                }
 
                        case EOB_ACT_CONTINUE_SCAN:
-                               yy_c_buf_p =
-                                       yytext_ptr + yy_amount_of_matched_text;
+                               (yy_c_buf_p) =
+                                       (yytext_ptr) + yy_amount_of_matched_text;
 
-                               yy_current_state = yy_get_previous_state();
+                               yy_current_state = yy_get_previous_state(  );
 
-                               yy_cp = yy_c_buf_p;
-                               yy_bp = yytext_ptr + YY_MORE_ADJ;
+                               yy_cp = (yy_c_buf_p);
+                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
                                goto yy_match;
 
                        case EOB_ACT_LAST_MATCH:
-                               yy_c_buf_p =
-                               &yy_current_buffer->yy_ch_buf[yy_n_chars];
+                               (yy_c_buf_p) =
+                               &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
 
-                               yy_current_state = yy_get_previous_state();
+                               yy_current_state = yy_get_previous_state(  );
 
-                               yy_cp = yy_c_buf_p;
-                               yy_bp = yytext_ptr + YY_MORE_ADJ;
+                               yy_cp = (yy_c_buf_p);
+                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
                                goto yy_find_action;
                        }
                break;
@@ -3115,8 +3072,7 @@ ECHO;
                        "fatal flex scanner internal error--no action found" );
        } /* end of action switch */
                } /* end of scanning one token */
-       } /* end of yylex */
-
+} /* end of yylex */
 
 /* yy_get_next_buffer - try to read in a new buffer
  *
@@ -3125,21 +3081,20 @@ ECHO;
  *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  *     EOB_ACT_END_OF_FILE - end of file
  */
-
-static int yy_get_next_buffer()
-       {
-       register char *dest = yy_current_buffer->yy_ch_buf;
-       register char *source = yytext_ptr;
+static int yy_get_next_buffer (void)
+{
+       register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+       register char *source = (yytext_ptr);
        register int number_to_move, i;
        int ret_val;
 
-       if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+       if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
                YY_FATAL_ERROR(
                "fatal flex scanner internal error--end of buffer missed" );
 
-       if ( yy_current_buffer->yy_fill_buffer == 0 )
+       if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
                { /* Don't try to fill the buffer, so this is an EOF. */
-               if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
+               if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
                        {
                        /* We matched a single character, the EOB, so
                         * treat this as a final EOF.
@@ -3159,86 +3114,52 @@ static int yy_get_next_buffer()
        /* Try to read more data. */
 
        /* First move last chars to start of buffer. */
-       number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
+       number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
 
        for ( i = 0; i < number_to_move; ++i )
                *(dest++) = *(source++);
 
-       if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+       if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
                /* don't do the read, it's not guaranteed to return an EOF,
                 * just force an EOF
                 */
-               yy_current_buffer->yy_n_chars = yy_n_chars = 0;
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
 
        else
                {
-               int num_to_read =
-                       yy_current_buffer->yy_buf_size - number_to_move - 1;
+                       int num_to_read =
+                       YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
                while ( num_to_read <= 0 )
                        { /* Not enough room in the buffer - grow it. */
-#ifdef YY_USES_REJECT
+
                        YY_FATAL_ERROR(
 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
-#else
-
-                       /* just a shorter name for the current buffer */
-                       YY_BUFFER_STATE b = yy_current_buffer;
-
-                       int yy_c_buf_p_offset =
-                               (int) (yy_c_buf_p - b->yy_ch_buf);
-
-                       if ( b->yy_is_our_buffer )
-                               {
-                               int new_size = b->yy_buf_size * 2;
-
-                               if ( new_size <= 0 )
-                                       b->yy_buf_size += b->yy_buf_size / 8;
-                               else
-                                       b->yy_buf_size *= 2;
 
-                               b->yy_ch_buf = (char *)
-                                       /* Include room in for 2 EOB chars. */
-                                       yy_flex_realloc( (void *) b->yy_ch_buf,
-                                                        b->yy_buf_size + 2 );
-                               }
-                       else
-                               /* Can't grow it, we don't own it. */
-                               b->yy_ch_buf = 0;
-
-                       if ( ! b->yy_ch_buf )
-                               YY_FATAL_ERROR(
-                               "fatal error - scanner input buffer overflow" );
-
-                       yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
-
-                       num_to_read = yy_current_buffer->yy_buf_size -
-                                               number_to_move - 1;
-#endif
                        }
 
                if ( num_to_read > YY_READ_BUF_SIZE )
                        num_to_read = YY_READ_BUF_SIZE;
 
                /* Read in more data. */
-               YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
-                       yy_n_chars, num_to_read );
+               YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+                       (yy_n_chars), (size_t) num_to_read );
 
-               yy_current_buffer->yy_n_chars = yy_n_chars;
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
                }
 
-       if ( yy_n_chars == 0 )
+       if ( (yy_n_chars) == 0 )
                {
                if ( number_to_move == YY_MORE_ADJ )
                        {
                        ret_val = EOB_ACT_END_OF_FILE;
-                       yyrestart( yyin );
+                       yyrestart(yyin  );
                        }
 
                else
                        {
                        ret_val = EOB_ACT_LAST_MATCH;
-                       yy_current_buffer->yy_buffer_status =
+                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
                                YY_BUFFER_EOF_PENDING;
                        }
                }
@@ -3246,147 +3167,141 @@ static int yy_get_next_buffer()
        else
                ret_val = EOB_ACT_CONTINUE_SCAN;
 
-       yy_n_chars += number_to_move;
-       yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
-       yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+       if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+               /* Extend the array by 50%, plus the number we really need. */
+               yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+               YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
+               if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+                       YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+       }
 
-       yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+       (yy_n_chars) += number_to_move;
+       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
 
-       return ret_val;
-       }
+       (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
 
+       return ret_val;
+}
 
 /* yy_get_previous_state - get the state just before the EOB char was reached */
 
-static yy_state_type yy_get_previous_state()
-       {
+    static yy_state_type yy_get_previous_state (void)
+{
        register yy_state_type yy_current_state;
        register char *yy_cp;
-
-       yy_current_state = yy_start;
+    
+       yy_current_state = (yy_start);
        yy_current_state += YY_AT_BOL();
-       yy_state_ptr = yy_state_buf;
-       *yy_state_ptr++ = yy_current_state;
 
-       for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+       (yy_state_ptr) = (yy_state_buf);
+       *(yy_state_ptr)++ = yy_current_state;
+
+       for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
                {
                register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
                while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
                        {
                        yy_current_state = (int) yy_def[yy_current_state];
-                       if ( yy_current_state >= 697 )
+                       if ( yy_current_state >= 688 )
                                yy_c = yy_meta[(unsigned int) yy_c];
                        }
                yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-               *yy_state_ptr++ = yy_current_state;
+               *(yy_state_ptr)++ = yy_current_state;
                }
 
        return yy_current_state;
-       }
-
+}
 
 /* yy_try_NUL_trans - try to make a transition on the NUL character
  *
  * synopsis
  *     next_state = yy_try_NUL_trans( current_state );
  */
-
-#ifdef YY_USE_PROTOS
-static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
-#else
-static yy_state_type yy_try_NUL_trans( yy_current_state )
-yy_state_type yy_current_state;
-#endif
-       {
+    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
+{
        register int yy_is_jam;
-
+    
        register YY_CHAR yy_c = 1;
        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
                {
                yy_current_state = (int) yy_def[yy_current_state];
-               if ( yy_current_state >= 697 )
+               if ( yy_current_state >= 688 )
                        yy_c = yy_meta[(unsigned int) yy_c];
                }
        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-       yy_is_jam = (yy_current_state == 696);
+       yy_is_jam = (yy_current_state == 687);
        if ( ! yy_is_jam )
-               *yy_state_ptr++ = yy_current_state;
+               *(yy_state_ptr)++ = yy_current_state;
 
        return yy_is_jam ? 0 : yy_current_state;
-       }
-
+}
 
-#ifndef YY_NO_UNPUT
-#ifdef YY_USE_PROTOS
-static void yyunput( int c, register char *yy_bp )
-#else
-static void yyunput( c, yy_bp )
-int c;
-register char *yy_bp;
-#endif
-       {
-       register char *yy_cp = yy_c_buf_p;
+    static void yyunput (int c, register char * yy_bp )
+{
+       register char *yy_cp;
+    
+    yy_cp = (yy_c_buf_p);
 
        /* undo effects of setting up yytext */
-       *yy_cp = yy_hold_char;
+       *yy_cp = (yy_hold_char);
 
-       if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+       if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
                { /* need to shift things up to make room */
                /* +2 for EOB chars. */
-               register int number_to_move = yy_n_chars + 2;
-               register char *dest = &yy_current_buffer->yy_ch_buf[
-                                       yy_current_buffer->yy_buf_size + 2];
+               register int number_to_move = (yy_n_chars) + 2;
+               register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+                                       YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
                register char *source =
-                               &yy_current_buffer->yy_ch_buf[number_to_move];
+                               &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
 
-               while ( source > yy_current_buffer->yy_ch_buf )
+               while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
                        *--dest = *--source;
 
                yy_cp += (int) (dest - source);
                yy_bp += (int) (dest - source);
-               yy_current_buffer->yy_n_chars =
-                       yy_n_chars = yy_current_buffer->yy_buf_size;
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
+                       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
 
-               if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+               if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
                        YY_FATAL_ERROR( "flex scanner push-back overflow" );
                }
 
        *--yy_cp = (char) c;
 
+       (yytext_ptr) = yy_bp;
+       (yy_hold_char) = *yy_cp;
+       (yy_c_buf_p) = yy_cp;
+}
 
-       yytext_ptr = yy_bp;
-       yy_hold_char = *yy_cp;
-       yy_c_buf_p = yy_cp;
-       }
-#endif /* ifndef YY_NO_UNPUT */
-
-
+#ifndef YY_NO_INPUT
 #ifdef __cplusplus
-static int yyinput()
+    static int yyinput (void)
 #else
-static int input()
+    static int input  (void)
 #endif
-       {
-       int c;
 
-       *yy_c_buf_p = yy_hold_char;
+{
+       int c;
+    
+       *(yy_c_buf_p) = (yy_hold_char);
 
-       if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+       if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
                {
                /* yy_c_buf_p now points to the character we want to return.
                 * If this occurs *before* the EOB characters, then it's a
                 * valid NUL; if not, then we've hit the end of the buffer.
                 */
-               if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+               if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
                        /* This was really a NUL. */
-                       *yy_c_buf_p = '\0';
+                       *(yy_c_buf_p) = '\0';
 
                else
                        { /* need more input */
-                       int offset = yy_c_buf_p - yytext_ptr;
-                       ++yy_c_buf_p;
+                       int offset = (yy_c_buf_p) - (yytext_ptr);
+                       ++(yy_c_buf_p);
 
-                       switch ( yy_get_next_buffer() )
+                       switch ( yy_get_next_buffer(  ) )
                                {
                                case EOB_ACT_LAST_MATCH:
                                        /* This happens because yy_g_n_b()
@@ -3400,16 +3315,16 @@ static int input()
                                         */
 
                                        /* Reset buffer status. */
-                                       yyrestart( yyin );
+                                       yyrestart(yyin );
 
-                                       /* fall through */
+                                       /*FALLTHROUGH*/
 
                                case EOB_ACT_END_OF_FILE:
                                        {
-                                       if ( yywrap() )
+                                       if ( yywrap( ) )
                                                return EOF;
 
-                                       if ( ! yy_did_buffer_switch_on_eof )
+                                       if ( ! (yy_did_buffer_switch_on_eof) )
                                                YY_NEW_FILE;
 #ifdef __cplusplus
                                        return yyinput();
@@ -3419,91 +3334,94 @@ static int input()
                                        }
 
                                case EOB_ACT_CONTINUE_SCAN:
-                                       yy_c_buf_p = yytext_ptr + offset;
+                                       (yy_c_buf_p) = (yytext_ptr) + offset;
                                        break;
                                }
                        }
                }
 
-       c = *(unsigned char *) yy_c_buf_p;      /* cast for 8-bit char's */
-       *yy_c_buf_p = '\0';     /* preserve yytext */
-       yy_hold_char = *++yy_c_buf_p;
+       c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
+       *(yy_c_buf_p) = '\0';   /* preserve yytext */
+       (yy_hold_char) = *++(yy_c_buf_p);
 
-       yy_current_buffer->yy_at_bol = (c == '\n');
+       YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
 
        return c;
-       }
-
-
-#ifdef YY_USE_PROTOS
-void yyrestart( FILE *input_file )
-#else
-void yyrestart( input_file )
-FILE *input_file;
-#endif
-       {
-       if ( ! yy_current_buffer )
-               yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+}
+#endif /* ifndef YY_NO_INPUT */
 
-       yy_init_buffer( yy_current_buffer, input_file );
-       yy_load_buffer_state();
+/** Immediately switch to a different input stream.
+ * @param input_file A readable stream.
+ * 
+ * @note This function does not reset the start condition to @c INITIAL .
+ */
+    void yyrestart  (FILE * input_file )
+{
+    
+       if ( ! YY_CURRENT_BUFFER ){
+        yyensure_buffer_stack ();
+               YY_CURRENT_BUFFER_LVALUE =
+            yy_create_buffer(yyin,YY_BUF_SIZE );
        }
 
+       yy_init_buffer(YY_CURRENT_BUFFER,input_file );
+       yy_load_buffer_state( );
+}
 
-#ifdef YY_USE_PROTOS
-void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
-#else
-void yy_switch_to_buffer( new_buffer )
-YY_BUFFER_STATE new_buffer;
-#endif
-       {
-       if ( yy_current_buffer == new_buffer )
+/** Switch to a different input buffer.
+ * @param new_buffer The new input buffer.
+ * 
+ */
+    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
+{
+    
+       /* TODO. We should be able to replace this entire function body
+        * with
+        *              yypop_buffer_state();
+        *              yypush_buffer_state(new_buffer);
+     */
+       yyensure_buffer_stack ();
+       if ( YY_CURRENT_BUFFER == new_buffer )
                return;
 
-       if ( yy_current_buffer )
+       if ( YY_CURRENT_BUFFER )
                {
                /* Flush out information for old buffer. */
-               *yy_c_buf_p = yy_hold_char;
-               yy_current_buffer->yy_buf_pos = yy_c_buf_p;
-               yy_current_buffer->yy_n_chars = yy_n_chars;
+               *(yy_c_buf_p) = (yy_hold_char);
+               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
                }
 
-       yy_current_buffer = new_buffer;
-       yy_load_buffer_state();
+       YY_CURRENT_BUFFER_LVALUE = new_buffer;
+       yy_load_buffer_state( );
 
        /* We don't actually know whether we did this switch during
         * EOF (yywrap()) processing, but the only time this flag
         * is looked at is after yywrap() is called, so it's safe
         * to go ahead and always set it.
         */
-       yy_did_buffer_switch_on_eof = 1;
-       }
-
-
-#ifdef YY_USE_PROTOS
-void yy_load_buffer_state( void )
-#else
-void yy_load_buffer_state()
-#endif
-       {
-       yy_n_chars = yy_current_buffer->yy_n_chars;
-       yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
-       yyin = yy_current_buffer->yy_input_file;
-       yy_hold_char = *yy_c_buf_p;
-       }
+       (yy_did_buffer_switch_on_eof) = 1;
+}
 
+static void yy_load_buffer_state  (void)
+{
+       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+       (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+       yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+       (yy_hold_char) = *(yy_c_buf_p);
+}
 
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
-#else
-YY_BUFFER_STATE yy_create_buffer( file, size )
-FILE *file;
-int size;
-#endif
-       {
+/** Allocate and initialize an input buffer state.
+ * @param file A readable stream.
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+ * 
+ * @return the allocated buffer state.
+ */
+    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
+{
        YY_BUFFER_STATE b;
-
-       b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+    
+       b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
        if ( ! b )
                YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
 
@@ -3512,80 +3430,75 @@ int size;
        /* yy_ch_buf has to be 2 characters longer than the size given because
         * we need to put in 2 end-of-buffer characters.
         */
-       b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+       b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
        if ( ! b->yy_ch_buf )
                YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
 
        b->yy_is_our_buffer = 1;
 
-       yy_init_buffer( b, file );
+       yy_init_buffer(b,file );
 
        return b;
-       }
-
+}
 
-#ifdef YY_USE_PROTOS
-void yy_delete_buffer( YY_BUFFER_STATE b )
-#else
-void yy_delete_buffer( b )
-YY_BUFFER_STATE b;
-#endif
-       {
+/** Destroy the buffer.
+ * @param b a buffer created with yy_create_buffer()
+ * 
+ */
+    void yy_delete_buffer (YY_BUFFER_STATE  b )
+{
+    
        if ( ! b )
                return;
 
-       if ( b == yy_current_buffer )
-               yy_current_buffer = (YY_BUFFER_STATE) 0;
+       if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+               YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
 
        if ( b->yy_is_our_buffer )
-               yy_flex_free( (void *) b->yy_ch_buf );
+               yyfree((void *) b->yy_ch_buf  );
 
-       yy_flex_free( (void *) b );
-       }
-
-
-#ifndef YY_ALWAYS_INTERACTIVE
-#ifndef YY_NEVER_INTERACTIVE
-extern int isatty YY_PROTO(( int ));
-#endif
-#endif
-
-#ifdef YY_USE_PROTOS
-void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
-#else
-void yy_init_buffer( b, file )
-YY_BUFFER_STATE b;
-FILE *file;
-#endif
+       yyfree((void *) b  );
+}
 
+#ifndef __cplusplus
+extern int isatty (int );
+#endif /* __cplusplus */
+    
+/* Initializes or reinitializes a buffer.
+ * This function is sometimes called more than once on the same buffer,
+ * such as during a yyrestart() or at EOF.
+ */
+    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
 
-       {
-       yy_flush_buffer( b );
+{
+       int oerrno = errno;
+    
+       yy_flush_buffer(b );
 
        b->yy_input_file = file;
        b->yy_fill_buffer = 1;
 
-#if YY_ALWAYS_INTERACTIVE
-       b->yy_is_interactive = 1;
-#else
-#if YY_NEVER_INTERACTIVE
-       b->yy_is_interactive = 0;
-#else
-       b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-#endif
-#endif
-       }
-
+    /* If b is the current buffer, then yy_init_buffer was _probably_
+     * called from yyrestart() or through yy_get_next_buffer.
+     * In that case, we don't want to reset the lineno or column.
+     */
+    if (b != YY_CURRENT_BUFFER){
+        b->yy_bs_lineno = 1;
+        b->yy_bs_column = 0;
+    }
 
-#ifdef YY_USE_PROTOS
-void yy_flush_buffer( YY_BUFFER_STATE b )
-#else
-void yy_flush_buffer( b )
-YY_BUFFER_STATE b;
-#endif
+        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+    
+       errno = oerrno;
+}
 
-       {
-       if ( ! b )
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+ * 
+ */
+    void yy_flush_buffer (YY_BUFFER_STATE  b )
+{
+       if ( ! b )
                return;
 
        b->yy_n_chars = 0;
@@ -3602,29 +3515,125 @@ YY_BUFFER_STATE b;
        b->yy_at_bol = 1;
        b->yy_buffer_status = YY_BUFFER_NEW;
 
-       if ( b == yy_current_buffer )
-               yy_load_buffer_state();
+       if ( b == YY_CURRENT_BUFFER )
+               yy_load_buffer_state( );
+}
+
+/** Pushes the new state onto the stack. The new state becomes
+ *  the current state. This function will allocate the stack
+ *  if necessary.
+ *  @param new_buffer The new state.
+ *  
+ */
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
+{
+       if (new_buffer == NULL)
+               return;
+
+       yyensure_buffer_stack();
+
+       /* This block is copied from yy_switch_to_buffer. */
+       if ( YY_CURRENT_BUFFER )
+               {
+               /* Flush out information for old buffer. */
+               *(yy_c_buf_p) = (yy_hold_char);
+               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+               }
+
+       /* Only push if top exists. Otherwise, replace top. */
+       if (YY_CURRENT_BUFFER)
+               (yy_buffer_stack_top)++;
+       YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+       /* copied from yy_switch_to_buffer. */
+       yy_load_buffer_state( );
+       (yy_did_buffer_switch_on_eof) = 1;
+}
+
+/** Removes and deletes the top of the stack, if present.
+ *  The next element becomes the new top.
+ *  
+ */
+void yypop_buffer_state (void)
+{
+       if (!YY_CURRENT_BUFFER)
+               return;
+
+       yy_delete_buffer(YY_CURRENT_BUFFER );
+       YY_CURRENT_BUFFER_LVALUE = NULL;
+       if ((yy_buffer_stack_top) > 0)
+               --(yy_buffer_stack_top);
+
+       if (YY_CURRENT_BUFFER) {
+               yy_load_buffer_state( );
+               (yy_did_buffer_switch_on_eof) = 1;
        }
+}
 
+/* Allocates the stack if it does not exist.
+ *  Guarantees space for at least one push.
+ */
+static void yyensure_buffer_stack (void)
+{
+       int num_to_alloc;
+    
+       if (!(yy_buffer_stack)) {
+
+               /* First allocation is just for 2 elements, since we don't know if this
+                * scanner will even need a stack. We use 2 instead of 1 to avoid an
+                * immediate realloc on the next call.
+         */
+               num_to_alloc = 1;
+               (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
+                                                               (num_to_alloc * sizeof(struct yy_buffer_state*)
+                                                               );
+               if ( ! (yy_buffer_stack) )
+                       YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+                                                                 
+               memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+                               
+               (yy_buffer_stack_max) = num_to_alloc;
+               (yy_buffer_stack_top) = 0;
+               return;
+       }
 
-#ifndef YY_NO_SCAN_BUFFER
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
-#else
-YY_BUFFER_STATE yy_scan_buffer( base, size )
-char *base;
-yy_size_t size;
-#endif
-       {
-       YY_BUFFER_STATE b;
+       if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+               /* Increase the buffer to prepare for a possible push. */
+               int grow_size = 8 /* arbitrary grow size */;
 
+               num_to_alloc = (yy_buffer_stack_max) + grow_size;
+               (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
+                                                               ((yy_buffer_stack),
+                                                               num_to_alloc * sizeof(struct yy_buffer_state*)
+                                                               );
+               if ( ! (yy_buffer_stack) )
+                       YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+
+               /* zero only the new slots.*/
+               memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+               (yy_buffer_stack_max) = num_to_alloc;
+       }
+}
+
+/** Setup the input buffer state to scan directly from a user-specified character buffer.
+ * @param base the character buffer
+ * @param size the size in bytes of the character buffer
+ * 
+ * @return the newly allocated buffer state object. 
+ */
+YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
+{
+       YY_BUFFER_STATE b;
+    
        if ( size < 2 ||
             base[size-2] != YY_END_OF_BUFFER_CHAR ||
             base[size-1] != YY_END_OF_BUFFER_CHAR )
                /* They forgot to leave room for the EOB's. */
                return 0;
 
-       b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+       b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
        if ( ! b )
                YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
 
@@ -3638,56 +3647,51 @@ yy_size_t size;
        b->yy_fill_buffer = 0;
        b->yy_buffer_status = YY_BUFFER_NEW;
 
-       yy_switch_to_buffer( b );
+       yy_switch_to_buffer(b  );
 
        return b;
-       }
-#endif
-
-
-#ifndef YY_NO_SCAN_STRING
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
-#else
-YY_BUFFER_STATE yy_scan_string( yy_str )
-yyconst char *yy_str;
-#endif
-       {
-       int len;
-       for ( len = 0; yy_str[len]; ++len )
-               ;
-
-       return yy_scan_bytes( yy_str, len );
-       }
-#endif
+}
 
+/** Setup the input buffer state to scan a string. The next call to yylex() will
+ * scan from a @e copy of @a str.
+ * @param yystr a NUL-terminated string to scan
+ * 
+ * @return the newly allocated buffer state object.
+ * @note If you want to scan bytes that may contain NUL values, then use
+ *       yy_scan_bytes() instead.
+ */
+YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
+{
+    
+       return yy_scan_bytes(yystr,strlen(yystr) );
+}
 
-#ifndef YY_NO_SCAN_BYTES
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
-#else
-YY_BUFFER_STATE yy_scan_bytes( bytes, len )
-yyconst char *bytes;
-int len;
-#endif
-       {
+/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
+ * scan from a @e copy of @a bytes.
+ * @param bytes the byte buffer to scan
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * 
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
+{
        YY_BUFFER_STATE b;
        char *buf;
        yy_size_t n;
        int i;
-
+    
        /* Get memory for full buffer, including space for trailing EOB's. */
-       n = len + 2;
-       buf = (char *) yy_flex_alloc( n );
+       n = _yybytes_len + 2;
+       buf = (char *) yyalloc(n  );
        if ( ! buf )
                YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
 
-       for ( i = 0; i < len; ++i )
-               buf[i] = bytes[i];
+       for ( i = 0; i < _yybytes_len; ++i )
+               buf[i] = yybytes[i];
 
-       buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+       buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
 
-       b = yy_scan_buffer( buf, n );
+       b = yy_scan_buffer(buf,n );
        if ( ! b )
                YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
 
@@ -3697,148 +3701,204 @@ int len;
        b->yy_is_our_buffer = 1;
 
        return b;
-       }
+}
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
 #endif
 
+static void yy_fatal_error (yyconst char* msg )
+{
+       (void) fprintf( stderr, "%s\n", msg );
+       exit( YY_EXIT_FAILURE );
+}
 
-#ifndef YY_NO_PUSH_STATE
-#ifdef YY_USE_PROTOS
-static void yy_push_state( int new_state )
-#else
-static void yy_push_state( new_state )
-int new_state;
-#endif
-       {
-       if ( yy_start_stack_ptr >= yy_start_stack_depth )
-               {
-               yy_size_t new_size;
+/* Redefine yyless() so it works in section 3 code. */
 
-               yy_start_stack_depth += YY_START_STACK_INCR;
-               new_size = yy_start_stack_depth * sizeof( int );
+#undef yyless
+#define yyless(n) \
+       do \
+               { \
+               /* Undo effects of setting up yytext. */ \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+               yytext[yyleng] = (yy_hold_char); \
+               (yy_c_buf_p) = yytext + yyless_macro_arg; \
+               (yy_hold_char) = *(yy_c_buf_p); \
+               *(yy_c_buf_p) = '\0'; \
+               yyleng = yyless_macro_arg; \
+               } \
+       while ( 0 )
 
-               if ( ! yy_start_stack )
-                       yy_start_stack = (int *) yy_flex_alloc( new_size );
+/* Accessor  methods (get/set functions) to struct members. */
 
-               else
-                       yy_start_stack = (int *) yy_flex_realloc(
-                                       (void *) yy_start_stack, new_size );
+/** Get the current line number.
+ * 
+ */
+int yyget_lineno  (void)
+{
+        
+    return yylineno;
+}
 
-               if ( ! yy_start_stack )
-                       YY_FATAL_ERROR(
-                       "out of memory expanding start-condition stack" );
-               }
+/** Get the input stream.
+ * 
+ */
+FILE *yyget_in  (void)
+{
+        return yyin;
+}
 
-       yy_start_stack[yy_start_stack_ptr++] = YY_START;
+/** Get the output stream.
+ * 
+ */
+FILE *yyget_out  (void)
+{
+        return yyout;
+}
 
-       BEGIN(new_state);
-       }
-#endif
+/** Get the length of the current token.
+ * 
+ */
+int yyget_leng  (void)
+{
+        return yyleng;
+}
 
+/** Get the current token.
+ * 
+ */
 
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state()
-       {
-       if ( --yy_start_stack_ptr < 0 )
-               YY_FATAL_ERROR( "start-condition stack underflow" );
+char *yyget_text  (void)
+{
+        return yytext;
+}
 
-       BEGIN(yy_start_stack[yy_start_stack_ptr]);
-       }
-#endif
+/** Set the current line number.
+ * @param line_number
+ * 
+ */
+void yyset_lineno (int  line_number )
+{
+    
+    yylineno = line_number;
+}
 
+/** Set the input stream. This does not discard the current
+ * input buffer.
+ * @param in_str A readable stream.
+ * 
+ * @see yy_switch_to_buffer
+ */
+void yyset_in (FILE *  in_str )
+{
+        yyin = in_str ;
+}
 
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state()
-       {
-       return yy_start_stack[yy_start_stack_ptr - 1];
-       }
-#endif
+void yyset_out (FILE *  out_str )
+{
+        yyout = out_str ;
+}
 
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
+int yyget_debug  (void)
+{
+        return yy_flex_debug;
+}
 
-#ifdef YY_USE_PROTOS
-static void yy_fatal_error( yyconst char msg[] )
+void yyset_debug (int  bdebug )
+{
+        yy_flex_debug = bdebug ;
+}
+
+static int yy_init_globals (void)
+{
+        /* Initialization is the same as for the non-reentrant scanner.
+     * This function is called from yylex_destroy(), so don't allocate here.
+     */
+
+    (yy_buffer_stack) = 0;
+    (yy_buffer_stack_top) = 0;
+    (yy_buffer_stack_max) = 0;
+    (yy_c_buf_p) = (char *) 0;
+    (yy_init) = 0;
+    (yy_start) = 0;
+
+    (yy_state_buf) = 0;
+    (yy_state_ptr) = 0;
+    (yy_full_match) = 0;
+    (yy_lp) = 0;
+
+/* Defined in main.c */
+#ifdef YY_STDINIT
+    yyin = stdin;
+    yyout = stdout;
 #else
-static void yy_fatal_error( msg )
-char msg[];
+    yyin = (FILE *) 0;
+    yyout = (FILE *) 0;
 #endif
-       {
-       (void) fprintf( stderr, "%s\n", msg );
-       exit( YY_EXIT_FAILURE );
-       }
 
+    /* For future reference: Set errno on error, since we are called by
+     * yylex_init()
+     */
+    return 0;
+}
 
+/* yylex_destroy is for both reentrant and non-reentrant scanners. */
+int yylex_destroy  (void)
+{
+    
+    /* Pop the buffer stack, destroying each element. */
+       while(YY_CURRENT_BUFFER){
+               yy_delete_buffer(YY_CURRENT_BUFFER  );
+               YY_CURRENT_BUFFER_LVALUE = NULL;
+               yypop_buffer_state();
+       }
 
-/* Redefine yyless() so it works in section 3 code. */
+       /* Destroy the stack itself. */
+       yyfree((yy_buffer_stack) );
+       (yy_buffer_stack) = NULL;
 
-#undef yyless
-#define yyless(n) \
-       do \
-               { \
-               /* Undo effects of setting up yytext. */ \
-               yytext[yyleng] = yy_hold_char; \
-               yy_c_buf_p = yytext + n; \
-               yy_hold_char = *yy_c_buf_p; \
-               *yy_c_buf_p = '\0'; \
-               yyleng = n; \
-               } \
-       while ( 0 )
+    yyfree ( (yy_state_buf) );
+    (yy_state_buf)  = NULL;
 
+    /* Reset the globals. This is important in a non-reentrant scanner so the next time
+     * yylex() is called, initialization will occur. */
+    yy_init_globals( );
 
-/* Internal utility routines. */
+    return 0;
+}
+
+/*
+ * Internal utility routines.
+ */
 
 #ifndef yytext_ptr
-#ifdef YY_USE_PROTOS
-static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
-#else
-static void yy_flex_strncpy( s1, s2, n )
-char *s1;
-yyconst char *s2;
-int n;
-#endif
-       {
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
+{
        register int i;
        for ( i = 0; i < n; ++i )
                s1[i] = s2[i];
-       }
+}
 #endif
 
 #ifdef YY_NEED_STRLEN
-#ifdef YY_USE_PROTOS
-static int yy_flex_strlen( yyconst char *s )
-#else
-static int yy_flex_strlen( s )
-yyconst char *s;
-#endif
-       {
+static int yy_flex_strlen (yyconst char * s )
+{
        register int n;
        for ( n = 0; s[n]; ++n )
                ;
 
        return n;
-       }
+}
 #endif
 
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_alloc( yy_size_t size )
-#else
-static void *yy_flex_alloc( size )
-yy_size_t size;
-#endif
-       {
+void *yyalloc (yy_size_t  size )
+{
        return (void *) malloc( size );
-       }
+}
 
-#ifdef YY_USE_PROTOS
-static void *yy_flex_realloc( void *ptr, yy_size_t size )
-#else
-static void *yy_flex_realloc( ptr, size )
-void *ptr;
-yy_size_t size;
-#endif
-       {
+void *yyrealloc  (void * ptr, yy_size_t  size )
+{
        /* The cast to (char *) in the following accommodates both
         * implementations that use char* generic pointers, and those
         * that use void* generic pointers.  It works with the latter
@@ -3847,27 +3907,14 @@ yy_size_t size;
         * as though doing an assignment.
         */
        return (void *) realloc( (char *) ptr, size );
-       }
-
-#ifdef YY_USE_PROTOS
-static void yy_flex_free( void *ptr )
-#else
-static void yy_flex_free( ptr )
-void *ptr;
-#endif
-       {
-       free( ptr );
-       }
-
-#if YY_MAIN
-int main()
-       {
-       yylex();
-       return 0;
-       }
-#endif
+}
 
+void yyfree (void * ptr )
+{
+       free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
+}
 
+#define YYTABLES_NAME "yytables"
 
 static char *StringToLex;
 
@@ -3912,7 +3959,7 @@ int yyoffset()
 static void output(ch)
      int ch;
 {
-    fprintf(stderr, "PARSER BUG: unmatched character '%c' (0%o)\n",
+    if(appData.debugMode) fprintf(debugFP, "PARSER BUG: unmatched character '%c' (0%o)\n",
            ch, ch);
 }
 
@@ -3924,7 +3971,7 @@ static void unput(ch)
        StringToLex--;
     } else {
        if (unputCount >= UNPUT_BUF_SIZE)
-         fprintf(stderr, "PARSER BUG: unput buffer overflow '%c' (0%o)\n",
+         if(appData.debugMode) fprintf(debugFP, "PARSER BUG: unput buffer overflow '%c' (0%o)\n",
                  ch, ch);
        unputBuffer[unputCount++] = ch;
     }
@@ -3996,14 +4043,13 @@ int yyoffset()
          yy_n_chars + pos);
 }
 
-
 void yynewstr(s)
      char *s;
 {
     if (my_file_buffer != NULL)
       yy_delete_buffer(my_file_buffer);
     StringToLex = s;
-    my_file_buffer = yy_create_buffer(stdin, YY_BUF_SIZE);
+    my_file_buffer = yy_create_buffer(stdin,YY_BUF_SIZE);
     yy_switch_to_buffer(my_file_buffer);
 }
 
@@ -4013,7 +4059,7 @@ void yynewfile(f)
     if (my_file_buffer != NULL)
       yy_delete_buffer(my_file_buffer);
     StringToLex = NULL;
-    my_file_buffer = yy_create_buffer(f, YY_BUF_SIZE);
+    my_file_buffer = yy_create_buffer(f,YY_BUF_SIZE);
     yy_switch_to_buffer(my_file_buffer);
 }
 #endif /*FLEX_SCANNER*/
@@ -4039,7 +4085,7 @@ ChessMove yylexstr(boardIndex, s)
     oldStringToLex = StringToLex;
     StringToLex = s;
 #ifdef FLEX_SCANNER
-    buffer = yy_create_buffer(stdin, YY_BUF_SIZE);
+    buffer = yy_create_buffer(stdin,YY_BUF_SIZE);
     oldBuffer = YY_CURRENT_BUFFER;
     yy_switch_to_buffer(buffer);
 #endif /*FLEX_SCANNER*/
@@ -4055,3 +4101,4 @@ ChessMove yylexstr(boardIndex, s)
 
     return ret;
 }
+
index fbf3e15..363bebd 100644 (file)
@@ -47,7 +47,6 @@ void ChatPopUp();
 void ChatPopDown();\r
 \r
 /* Imports from backend.c */\r
-char * SavePart(char *str);\r
 extern int opponentKibitzes;\r
 \r
 /* Imports from winboard.c */\r
similarity index 100%
rename from winboard/wengineo.c
rename to winboard/wengineoutput.c
index ee5fa0c..7c8142c 100644 (file)
@@ -151,11 +151,11 @@ char szConsoleTitle[] = "I C S Interaction";
 \r
 char *programName;\r
 char *settingsFileName;\r
-BOOLEAN saveSettingsOnExit;\r
+Boolean saveSettingsOnExit;\r
 char installDir[MSG_SIZ];\r
 \r
 BoardSize boardSize;\r
-BOOLEAN chessProgram;\r
+Boolean chessProgram;\r
 //static int boardX, boardY;\r
 int  minX, minY; // [HGM] placement: volatile limits on upper-left corner\r
 static int squareSize, lineGap, minorSize;\r
@@ -174,12 +174,10 @@ char *icsNames;
 char *firstChessProgramNames;\r
 char *secondChessProgramNames;\r
 \r
-#define ARG_MAX 128*1024 /* [AS] For Roger Brown's very long list! */\r
-\r
 #define PALETTESIZE 256\r
 \r
 HINSTANCE hInst;          /* current instance */\r
-BOOLEAN alwaysOnTop = FALSE;\r
+Boolean alwaysOnTop = FALSE;\r
 RECT boardRect;\r
 COLORREF lightSquareColor, darkSquareColor, whitePieceColor, \r
   blackPieceColor, highlightSquareColor, premoveHighlightColor;\r
@@ -206,11 +204,6 @@ static int lastSizing = 0;
 static int prevStderrPort;\r
 static HBITMAP userLogo;\r
 \r
-/* [AS] Support for background textures */\r
-#define BACK_TEXTURE_MODE_DISABLED      0\r
-#define BACK_TEXTURE_MODE_PLAIN         1\r
-#define BACK_TEXTURE_MODE_FULL_RANDOM   2\r
-\r
 static HBITMAP liteBackTexture = NULL;\r
 static HBITMAP darkBackTexture = NULL;\r
 static int liteBackTextureMode = BACK_TEXTURE_MODE_PLAIN;\r
@@ -228,13 +221,6 @@ static struct { int x; int y; int mode; } backTextureSquareInfo[BOARD_RANKS][BOA
 #endif\r
 #endif\r
 \r
-char *defaultTextAttribs[] = \r
-{\r
-  COLOR_SHOUT, COLOR_SSHOUT, COLOR_CHANNEL1, COLOR_CHANNEL, COLOR_KIBITZ,\r
-  COLOR_TELL, COLOR_CHALLENGE, COLOR_REQUEST, COLOR_SEEK, COLOR_NORMAL,\r
-  COLOR_NONE\r
-};\r
-\r
 typedef struct {\r
   char *name;\r
   int squareSize;\r
@@ -712,6 +698,7 @@ InitInstance(HINSTANCE hInstance, int nCmdShow, LPSTR lpCmdLine)
   char *filepart;\r
 \r
   hInst = hInstance;   /* Store instance handle in our global variable */\r
+  programName = szAppName;\r
 \r
   if (SearchPath(NULL, "WinBoard.exe", NULL, MSG_SIZ, installDir, &filepart)) {\r
     *filepart = NULLCHAR;\r
@@ -721,6 +708,17 @@ InitInstance(HINSTANCE hInstance, int nCmdShow, LPSTR lpCmdLine)
   gameInfo.boardWidth = gameInfo.boardHeight = 8; // [HGM] won't have open window otherwise\r
   screenWidth = screenHeight = 1000; // [HGM] placement: kludge to allow calling EnsureOnScreen from InitAppData\r
   InitAppData(lpCmdLine);      /* Get run-time parameters */\r
+  /* xboard, and older WinBoards, controlled the move sound with the\r
+     appData.ringBellAfterMoves option.  In the current WinBoard, we\r
+     always turn the option on (so that the backend will call us),\r
+     then let the user turn the sound off by setting it to silence if\r
+     desired.  To accommodate old winboard.ini files saved by old\r
+     versions of WinBoard, we also turn off the sound if the option\r
+     was initially set to false. [HGM] taken out of InitAppData */\r
+  if (!appData.ringBellAfterMoves) {\r
+    sounds[(int)SoundMove].name = strdup("");\r
+    appData.ringBellAfterMoves = TRUE;\r
+  }\r
   if (appData.debugMode) {\r
     debugFP = fopen(appData.nameOfDebugFile, "w");\r
     setbuf(debugFP, NULL);\r
@@ -867,603 +865,81 @@ InitInstance(HINSTANCE hInstance, int nCmdShow, LPSTR lpCmdLine)
 \r
 }\r
 \r
+VOID\r
+InitMenuChecks()\r
+{\r
+  HMENU hmenu = GetMenu(hwndMain);\r
 \r
-typedef enum {\r
-  ArgString, ArgInt, ArgFloat, ArgBoolean, ArgTrue, ArgFalse, ArgNone, \r
-  ArgColor, ArgAttribs, ArgFilename, ArgBoardSize, ArgFont, ArgCommSettings,\r
-  ArgSettingsFilename,\r
-  ArgX, ArgY, ArgZ // [HGM] placement: for window-placement options stored relative to main window\r
-} ArgType;\r
-\r
-typedef void *ArgIniType;\r
-#define INVALID (ArgIniType) 6915 /* Some number unlikely to be needed as default for anything */\r
+  (void) EnableMenuItem(hmenu, IDM_CommPort,\r
+                       MF_BYCOMMAND|((appData.icsActive &&\r
+                                      *appData.icsCommPort != NULLCHAR) ?\r
+                                     MF_ENABLED : MF_GRAYED));\r
+  (void) CheckMenuItem(hmenu, IDM_SaveSettingsOnExit,\r
+                      MF_BYCOMMAND|(saveSettingsOnExit ?\r
+                                    MF_CHECKED : MF_UNCHECKED));\r
+}\r
 \r
-typedef struct {\r
-  char *argName;\r
-  ArgType argType;\r
-  /***\r
-  union {\r
-    String *pString;       // ArgString\r
-    int *pInt;             // ArgInt\r
-    float *pFloat;         // ArgFloat\r
-    Boolean *pBoolean;     // ArgBoolean\r
-    COLORREF *pColor;      // ArgColor\r
-    ColorClass cc;         // ArgAttribs\r
-    String *pFilename;     // ArgFilename\r
-    BoardSize *pBoardSize; // ArgBoardSize\r
-    int whichFont;         // ArgFont\r
-    DCB *pDCB;             // ArgCommSettings\r
-    String *pFilename;     // ArgSettingsFilename\r
-  } argLoc;\r
-  ***/\r
-  LPVOID argLoc;\r
-  BOOL save;\r
-  ArgIniType defaultValue;\r
-} ArgDescriptor;\r
-\r
-int junk;\r
+//---------------------------------------------------------------------------------------------------------\r
 \r
+#define ICS_TEXT_MENU_SIZE (IDM_CommandXLast - IDM_CommandX + 1)\r
 #define XBOARD FALSE\r
 \r
-ArgDescriptor argDescriptors[] = {\r
-  /* positional arguments */\r
-  { "loadGameFile", ArgFilename, (LPVOID) &appData.loadGameFile, FALSE, INVALID },\r
-  { "", ArgNone, NULL, FALSE, INVALID },\r
-  /* keyword arguments */\r
-  JAWS_ARGS\r
-  { "whitePieceColor", ArgColor, (LPVOID) &whitePieceColor, TRUE, INVALID },\r
-  { "wpc", ArgColor, (LPVOID) &whitePieceColor, FALSE, INVALID },\r
-  { "blackPieceColor", ArgColor, (LPVOID) &blackPieceColor, TRUE, INVALID },\r
-  { "bpc", ArgColor, (LPVOID) &blackPieceColor, FALSE, INVALID },\r
-  { "lightSquareColor", ArgColor, (LPVOID) &lightSquareColor, TRUE, INVALID },\r
-  { "lsc", ArgColor, (LPVOID) &lightSquareColor, FALSE, INVALID },\r
-  { "darkSquareColor", ArgColor, (LPVOID) &darkSquareColor, TRUE, INVALID },\r
-  { "dsc", ArgColor, (LPVOID) &darkSquareColor, FALSE, INVALID },\r
-  { "highlightSquareColor", ArgColor, (LPVOID) &highlightSquareColor, TRUE, INVALID },\r
-  { "hsc", ArgColor, (LPVOID) &highlightSquareColor, FALSE, INVALID },\r
-  { "premoveHighlightColor", ArgColor, (LPVOID) &premoveHighlightColor, TRUE, INVALID },\r
-  { "phc", ArgColor, (LPVOID) &premoveHighlightColor, FALSE, INVALID },\r
-  { "movesPerSession", ArgInt, (LPVOID) &appData.movesPerSession, TRUE, (ArgIniType) MOVES_PER_SESSION },\r
-  { "mps", ArgInt, (LPVOID) &appData.movesPerSession, FALSE, INVALID },\r
-  { "initString", ArgString, (LPVOID) &appData.initString, FALSE, INVALID },\r
-  { "firstInitString", ArgString, (LPVOID) &appData.initString, FALSE, (ArgIniType) INIT_STRING },\r
-  { "secondInitString", ArgString, (LPVOID) &appData.secondInitString, FALSE, (ArgIniType) INIT_STRING },\r
-  { "firstComputerString", ArgString, (LPVOID) &appData.firstComputerString,\r
-    FALSE, (ArgIniType) COMPUTER_STRING },\r
-  { "secondComputerString", ArgString, (LPVOID) &appData.secondComputerString,\r
-    FALSE, (ArgIniType) COMPUTER_STRING },\r
-  { "firstChessProgram", ArgFilename, (LPVOID) &appData.firstChessProgram,\r
-    FALSE, (ArgIniType) FIRST_CHESS_PROGRAM },\r
-  { "fcp", ArgFilename, (LPVOID) &appData.firstChessProgram, FALSE, INVALID },\r
-  { "secondChessProgram", ArgFilename, (LPVOID) &appData.secondChessProgram,\r
-    FALSE, (ArgIniType) SECOND_CHESS_PROGRAM },\r
-  { "scp", ArgFilename, (LPVOID) &appData.secondChessProgram, FALSE, INVALID },\r
-  { "firstPlaysBlack", ArgBoolean, (LPVOID) &appData.firstPlaysBlack, FALSE, FALSE },\r
-  { "fb", ArgTrue, (LPVOID) &appData.firstPlaysBlack, FALSE, FALSE },\r
-  { "xfb", ArgFalse, (LPVOID) &appData.firstPlaysBlack, FALSE, INVALID },\r
-  { "-fb", ArgFalse, (LPVOID) &appData.firstPlaysBlack, FALSE, INVALID },\r
-  { "noChessProgram", ArgBoolean, (LPVOID) &appData.noChessProgram, FALSE, FALSE },\r
-  { "ncp", ArgTrue, (LPVOID) &appData.noChessProgram, FALSE, INVALID },\r
-  { "xncp", ArgFalse, (LPVOID) &appData.noChessProgram, FALSE, INVALID },\r
-  { "-ncp", ArgFalse, (LPVOID) &appData.noChessProgram, FALSE, INVALID },\r
-  { "firstHost", ArgString, (LPVOID) &appData.firstHost, FALSE, (ArgIniType) FIRST_HOST },\r
-  { "fh", ArgString, (LPVOID) &appData.firstHost, FALSE, INVALID },\r
-  { "secondHost", ArgString, (LPVOID) &appData.secondHost, FALSE, (ArgIniType) SECOND_HOST },\r
-  { "sh", ArgString, (LPVOID) &appData.secondHost, FALSE, INVALID },\r
-  { "firstDirectory", ArgFilename, (LPVOID) &appData.firstDirectory, FALSE, (ArgIniType) FIRST_DIRECTORY },\r
-  { "fd", ArgFilename, (LPVOID) &appData.firstDirectory, FALSE, INVALID },\r
-  { "secondDirectory", ArgFilename, (LPVOID) &appData.secondDirectory, FALSE, (ArgIniType) SECOND_DIRECTORY },\r
-  { "sd", ArgFilename, (LPVOID) &appData.secondDirectory, FALSE, INVALID },\r
-\r
-  /* some options only used by the XBoard front end, and ignored in WinBoard         */\r
-  /* Their saving is controlled by XBOARD, which in WinBoard is defined as FALSE */\r
-  { "internetChessServerInputBox", ArgBoolean, (LPVOID) &appData.icsInputBox, XBOARD, (ArgIniType) FALSE },\r
-  { "icsinput", ArgTrue, (LPVOID) &appData.icsInputBox, FALSE, INVALID },\r
-  { "xicsinput", ArgFalse, (LPVOID) &appData.icsInputBox, FALSE, INVALID },\r
-  { "cmail", ArgString, (LPVOID) &appData.cmailGameName, FALSE, (ArgIniType) "" },\r
-  { "soundProgram", ArgFilename, (LPVOID) &appData.soundProgram, XBOARD, (ArgIniType) "play" },\r
-  { "fontSizeTolerance", ArgInt, (LPVOID) &appData.fontSizeTolerance, XBOARD, (ArgIniType) 4 },\r
-  { "lowTimeWarningColor", ArgColor, (LPVOID) &appData.lowTimeWarningColor, XBOARD, \r
-       (ArgIniType) LOWTIMEWARNING_COLOR },\r
-  { "lowTimeWarning", ArgBoolean, (LPVOID) &appData.lowTimeWarning, XBOARD, (ArgIniType) FALSE },\r
-  { "titleInWindow", ArgBoolean, (LPVOID) &appData.titleInWindow, XBOARD, (ArgIniType) FALSE },\r
-  { "title", ArgTrue, (LPVOID) &appData.titleInWindow, FALSE, INVALID },\r
-  { "xtitle", ArgFalse, (LPVOID) &appData.titleInWindow, FALSE, INVALID },\r
-  { "flashCount", ArgInt, (LPVOID) &appData.flashCount, XBOARD, (ArgIniType) FLASH_COUNT },\r
-  { "flashRate", ArgInt, (LPVOID) &appData.flashRate, XBOARD, (ArgIniType) FLASH_RATE },\r
-  { "pixmapDirectory", ArgFilename, (LPVOID) &appData.pixmapDirectory, XBOARD, (ArgIniType) "" },\r
-  { "pixmap", ArgFilename, (LPVOID) &appData.pixmapDirectory, FALSE, INVALID },\r
-  { "bitmapDirectory", ArgFilename, (LPVOID) &appData.bitmapDirectory, XBOARD, (ArgIniType) "" },\r
-  { "bm", ArgFilename, (LPVOID) &appData.bitmapDirectory, FALSE, INVALID },\r
-  { "msLoginDelay", ArgInt, (LPVOID) &appData.msLoginDelay, XBOARD, (ArgIniType) MS_LOGIN_DELAY },\r
-  { "pasteSelection", ArgBoolean, (LPVOID) &appData.pasteSelection, XBOARD, (ArgIniType) FALSE },\r
-\r
-  { "remoteShell", ArgFilename, (LPVOID) &appData.remoteShell, FALSE, (ArgIniType) REMOTE_SHELL },\r
-  { "rsh", ArgFilename, (LPVOID) &appData.remoteShell, FALSE, INVALID },\r
-  { "remoteUser", ArgString, (LPVOID) &appData.remoteUser, FALSE, INVALID },\r
-  { "ruser", ArgString, (LPVOID) &appData.remoteUser, FALSE, INVALID },\r
-  { "timeDelay", ArgFloat, (LPVOID) &appData.timeDelay, TRUE, INVALID },\r
-  { "td", ArgFloat, (LPVOID) &appData.timeDelay, FALSE, INVALID },\r
-  { "timeControl", ArgString, (LPVOID) &appData.timeControl, TRUE, (ArgIniType) TIME_CONTROL },\r
-  { "tc", ArgString, (LPVOID) &appData.timeControl, FALSE, INVALID },\r
-  { "timeIncrement", ArgInt, (LPVOID) &appData.timeIncrement, TRUE, (ArgIniType) TIME_INCREMENT },\r
-  { "inc", ArgInt, (LPVOID) &appData.timeIncrement, FALSE, INVALID },\r
-  { "internetChessServerMode", ArgBoolean, (LPVOID) &appData.icsActive, FALSE, INVALID },\r
-  { "ics", ArgTrue, (LPVOID) &appData.icsActive, FALSE, (ArgIniType) FALSE },\r
-  { "xics", ArgFalse, (LPVOID) &appData.icsActive, FALSE, INVALID },\r
-  { "-ics", ArgFalse, (LPVOID) &appData.icsActive, FALSE, INVALID },\r
-  { "internetChessServerHost", ArgString, (LPVOID) &appData.icsHost, FALSE, (ArgIniType) "" },\r
-  { "icshost", ArgString, (LPVOID) &appData.icsHost, FALSE, INVALID },\r
-  { "internetChessServerPort", ArgString, (LPVOID) &appData.icsPort, FALSE, (ArgIniType) ICS_PORT },\r
-  { "icsport", ArgString, (LPVOID) &appData.icsPort, FALSE, INVALID },\r
-  { "internetChessServerCommPort", ArgString, (LPVOID) &appData.icsCommPort, FALSE, (ArgIniType) ICS_COMM_PORT },\r
-  { "icscomm", ArgString, (LPVOID) &appData.icsCommPort, FALSE, INVALID },\r
-  { "internetChessServerComPort", ArgString, (LPVOID) &appData.icsCommPort, FALSE, INVALID },\r
-  { "icscom", ArgString, (LPVOID) &appData.icsCommPort, FALSE, INVALID },\r
-  { "internetChessServerLogonScript", ArgFilename, (LPVOID) &appData.icsLogon, FALSE, (ArgIniType) ICS_LOGON },\r
-  { "icslogon", ArgFilename, (LPVOID) &appData.icsLogon, FALSE, INVALID },\r
-  { "useTelnet", ArgBoolean, (LPVOID) &appData.useTelnet, FALSE, INVALID },\r
-  { "telnet", ArgTrue, (LPVOID) &appData.useTelnet, FALSE, INVALID },\r
-  { "xtelnet", ArgFalse, (LPVOID) &appData.useTelnet, FALSE, INVALID },\r
-  { "-telnet", ArgFalse, (LPVOID) &appData.useTelnet, FALSE, INVALID },\r
-  { "telnetProgram", ArgFilename, (LPVOID) &appData.telnetProgram, FALSE, (ArgIniType) TELNET_PROGRAM },\r
-  { "internetChessserverHelper", ArgFilename, (LPVOID) &appData.icsHelper, \r
-       FALSE, INVALID }, // for XB\r
-  { "icshelper", ArgFilename, (LPVOID) &appData.icsHelper, FALSE, (ArgIniType) "" },\r
-  { "gateway", ArgString, (LPVOID) &appData.gateway, FALSE, (ArgIniType) "" },\r
-  { "loadGameFile", ArgFilename, (LPVOID) &appData.loadGameFile, FALSE, (ArgIniType) "" },\r
-  { "lgf", ArgFilename, (LPVOID) &appData.loadGameFile, FALSE, INVALID },\r
-  { "loadGameIndex", ArgInt, (LPVOID) &appData.loadGameIndex, FALSE, (ArgIniType) 0 },\r
-  { "lgi", ArgInt, (LPVOID) &appData.loadGameIndex, FALSE, INVALID },\r
-  { "saveGameFile", ArgFilename, (LPVOID) &appData.saveGameFile, TRUE, (ArgIniType) "" },\r
-  { "sgf", ArgFilename, (LPVOID) &appData.saveGameFile, FALSE, INVALID },\r
-  { "autoSaveGames", ArgBoolean, (LPVOID) &appData.autoSaveGames, TRUE, (ArgIniType) FALSE },\r
-  { "autosave", ArgTrue, (LPVOID) &appData.autoSaveGames, FALSE, INVALID },\r
-  { "xautosave", ArgFalse, (LPVOID) &appData.autoSaveGames, FALSE, INVALID },\r
-  { "-autosave", ArgFalse, (LPVOID) &appData.autoSaveGames, FALSE, INVALID },\r
-  { "loadPositionFile", ArgFilename, (LPVOID) &appData.loadPositionFile, FALSE, (ArgIniType) "" },\r
-  { "lpf", ArgFilename, (LPVOID) &appData.loadPositionFile, FALSE, INVALID },\r
-  { "loadPositionIndex", ArgInt, (LPVOID) &appData.loadPositionIndex, FALSE, (ArgIniType) 1 },\r
-  { "lpi", ArgInt, (LPVOID) &appData.loadPositionIndex, FALSE, INVALID },\r
-  { "savePositionFile", ArgFilename, (LPVOID) &appData.savePositionFile, FALSE, (ArgIniType) "" },\r
-  { "spf", ArgFilename, (LPVOID) &appData.savePositionFile, FALSE, INVALID },\r
-  { "matchMode", ArgBoolean, (LPVOID) &appData.matchMode, FALSE, (ArgIniType) FALSE },\r
-  { "mm", ArgTrue, (LPVOID) &appData.matchMode, FALSE, INVALID },\r
-  { "xmm", ArgFalse, (LPVOID) &appData.matchMode, FALSE, INVALID },\r
-  { "-mm", ArgFalse, (LPVOID) &appData.matchMode, FALSE, INVALID },\r
-  { "matchGames", ArgInt, (LPVOID) &appData.matchGames, FALSE, (ArgIniType) 0 },\r
-  { "mg", ArgInt, (LPVOID) &appData.matchGames, FALSE, INVALID },\r
-  { "monoMode", ArgBoolean, (LPVOID) &appData.monoMode, TRUE, (ArgIniType) FALSE },\r
-  { "mono", ArgTrue, (LPVOID) &appData.monoMode, FALSE, INVALID },\r
-  { "xmono", ArgFalse, (LPVOID) &appData.monoMode, FALSE, INVALID },\r
-  { "-mono", ArgFalse, (LPVOID) &appData.monoMode, FALSE, INVALID },\r
-  { "debugMode", ArgBoolean, (LPVOID) &appData.debugMode, FALSE, (ArgIniType) FALSE },\r
-  { "debug", ArgTrue, (LPVOID) &appData.debugMode, FALSE, INVALID },\r
-  { "xdebug", ArgFalse, (LPVOID) &appData.debugMode, FALSE, INVALID },\r
-  { "-debug", ArgFalse, (LPVOID) &appData.debugMode, FALSE, INVALID },\r
-  { "clockMode", ArgBoolean, (LPVOID) &appData.clockMode, FALSE, (ArgIniType) TRUE },\r
-  { "clock", ArgTrue, (LPVOID) &appData.clockMode, FALSE, INVALID },\r
-  { "xclock", ArgFalse, (LPVOID) &appData.clockMode, FALSE, INVALID },\r
-  { "-clock", ArgFalse, (LPVOID) &appData.clockMode, FALSE, INVALID },\r
-  { "searchTime", ArgString, (LPVOID) &appData.searchTime, FALSE, (ArgIniType) "" },\r
-  { "st", ArgString, (LPVOID) &appData.searchTime, FALSE, INVALID },\r
-  { "searchDepth", ArgInt, (LPVOID) &appData.searchDepth, FALSE, (ArgIniType) 0 },\r
-  { "depth", ArgInt, (LPVOID) &appData.searchDepth, FALSE, INVALID },\r
-  { "showCoords", ArgBoolean, (LPVOID) &appData.showCoords, TRUE, (ArgIniType) FALSE },\r
-  { "coords", ArgTrue, (LPVOID) &appData.showCoords, FALSE, INVALID },\r
-  { "xcoords", ArgFalse, (LPVOID) &appData.showCoords, FALSE, INVALID },\r
-  { "-coords", ArgFalse, (LPVOID) &appData.showCoords, FALSE, INVALID },\r
-  { "showThinking", ArgBoolean, (LPVOID) &appData.showThinking, TRUE, (ArgIniType) FALSE },\r
-  { "thinking", ArgTrue, (LPVOID) &appData.showThinking, FALSE, INVALID },\r
-  { "xthinking", ArgFalse, (LPVOID) &appData.showThinking, FALSE, INVALID },\r
-  { "-thinking", ArgFalse, (LPVOID) &appData.showThinking, FALSE, INVALID },\r
-  { "ponderNextMove", ArgBoolean, (LPVOID) &appData.ponderNextMove, TRUE, (ArgIniType) TRUE },\r
-  { "ponder", ArgTrue, (LPVOID) &appData.ponderNextMove, FALSE, INVALID },\r
-  { "xponder", ArgFalse, (LPVOID) &appData.ponderNextMove, FALSE, INVALID },\r
-  { "-ponder", ArgFalse, (LPVOID) &appData.ponderNextMove, FALSE, INVALID },\r
-  { "periodicUpdates", ArgBoolean, (LPVOID) &appData.periodicUpdates, TRUE, (ArgIniType) TRUE },\r
-  { "periodic", ArgTrue, (LPVOID) &appData.periodicUpdates, FALSE, INVALID },\r
-  { "xperiodic", ArgFalse, (LPVOID) &appData.periodicUpdates, FALSE, INVALID },\r
-  { "-periodic", ArgFalse, (LPVOID) &appData.periodicUpdates, FALSE, INVALID },\r
-  { "popupExitMessage", ArgBoolean, (LPVOID) &appData.popupExitMessage, TRUE, (ArgIniType) TRUE },\r
-  { "exit", ArgTrue, (LPVOID) &appData.popupExitMessage, FALSE, INVALID },\r
-  { "xexit", ArgFalse, (LPVOID) &appData.popupExitMessage, FALSE, INVALID },\r
-  { "-exit", ArgFalse, (LPVOID) &appData.popupExitMessage, FALSE, INVALID },\r
-  { "popupMoveErrors", ArgBoolean, (LPVOID) &appData.popupMoveErrors, TRUE, (ArgIniType) FALSE },\r
-  { "popup", ArgTrue, (LPVOID) &appData.popupMoveErrors, FALSE, INVALID },\r
-  { "xpopup", ArgFalse, (LPVOID) &appData.popupMoveErrors, FALSE, INVALID },\r
-  { "-popup", ArgFalse, (LPVOID) &appData.popupMoveErrors, FALSE, INVALID },\r
-  { "popUpErrors", ArgBoolean, (LPVOID) &appData.popupMoveErrors, \r
-    FALSE, INVALID }, /* only so that old WinBoard.ini files from betas can be read */\r
-  { "clockFont", ArgFont, (LPVOID) CLOCK_FONT, TRUE, INVALID },\r
-  { "messageFont", ArgFont, (LPVOID) MESSAGE_FONT, TRUE, INVALID },\r
-  { "coordFont", ArgFont, (LPVOID) COORD_FONT, TRUE, INVALID },\r
-  { "tagsFont", ArgFont, (LPVOID) EDITTAGS_FONT, TRUE, INVALID },\r
-  { "commentFont", ArgFont, (LPVOID) COMMENT_FONT, TRUE, INVALID },\r
-  { "icsFont", ArgFont, (LPVOID) CONSOLE_FONT, TRUE, INVALID },\r
-  { "moveHistoryFont", ArgFont, (LPVOID) MOVEHISTORY_FONT, TRUE, INVALID }, /* [AS] */\r
-  { "boardSize", ArgBoardSize, (LPVOID) &boardSize,\r
-    TRUE, (ArgIniType) -1 }, /* must come after all fonts */\r
-  { "size", ArgBoardSize, (LPVOID) &boardSize, FALSE, INVALID },\r
-  { "ringBellAfterMoves", ArgBoolean, (LPVOID) &appData.ringBellAfterMoves,\r
-    FALSE, (ArgIniType) TRUE }, /* historical; kept only so old winboard.ini files will parse */\r
-  { "bell", ArgTrue, (LPVOID) &appData.ringBellAfterMoves, FALSE, INVALID }, // for XB\r
-  { "xbell", ArgFalse, (LPVOID) &appData.ringBellAfterMoves, FALSE, INVALID }, // for XB\r
-  { "movesound", ArgTrue, (LPVOID) &appData.ringBellAfterMoves, FALSE, INVALID }, // for XB\r
-  { "xmovesound", ArgFalse, (LPVOID) &appData.ringBellAfterMoves, FALSE, INVALID }, // for XB\r
-  { "alwaysOnTop", ArgBoolean, (LPVOID) &alwaysOnTop, TRUE, INVALID },\r
-  { "top", ArgTrue, (LPVOID) &alwaysOnTop, FALSE, INVALID },\r
-  { "xtop", ArgFalse, (LPVOID) &alwaysOnTop, FALSE, INVALID },\r
-  { "-top", ArgFalse, (LPVOID) &alwaysOnTop, FALSE, INVALID },\r
-  { "autoCallFlag", ArgBoolean, (LPVOID) &appData.autoCallFlag, TRUE, (ArgIniType) FALSE },\r
-  { "autoflag", ArgTrue, (LPVOID) &appData.autoCallFlag, FALSE, INVALID },\r
-  { "xautoflag", ArgFalse, (LPVOID) &appData.autoCallFlag, FALSE, INVALID },\r
-  { "-autoflag", ArgFalse, (LPVOID) &appData.autoCallFlag, FALSE, INVALID },\r
-  { "autoComment", ArgBoolean, (LPVOID) &appData.autoComment, TRUE, (ArgIniType) FALSE },\r
-  { "autocomm", ArgTrue, (LPVOID) &appData.autoComment, FALSE, INVALID },\r
-  { "xautocomm", ArgFalse, (LPVOID) &appData.autoComment, FALSE, INVALID },\r
-  { "-autocomm", ArgFalse, (LPVOID) &appData.autoComment, FALSE, INVALID },\r
-  { "autoObserve", ArgBoolean, (LPVOID) &appData.autoObserve, TRUE, (ArgIniType) FALSE },\r
-  { "autobs", ArgTrue, (LPVOID) &appData.autoObserve, FALSE, INVALID },\r
-  { "xautobs", ArgFalse, (LPVOID) &appData.autoObserve, FALSE, INVALID },\r
-  { "-autobs", ArgFalse, (LPVOID) &appData.autoObserve, FALSE, INVALID },\r
-  { "flipView", ArgBoolean, (LPVOID) &appData.flipView, FALSE, (ArgIniType) FALSE },\r
-  { "flip", ArgTrue, (LPVOID) &appData.flipView, FALSE, INVALID },\r
-  { "xflip", ArgFalse, (LPVOID) &appData.flipView, FALSE, INVALID },\r
-  { "-flip", ArgFalse, (LPVOID) &appData.flipView, FALSE, INVALID },\r
-  { "autoFlipView", ArgBoolean, (LPVOID) &appData.autoFlipView, TRUE, (ArgIniType) TRUE },\r
-  { "autoflip", ArgTrue, (LPVOID) &appData.autoFlipView, FALSE, INVALID },\r
-  { "xautoflip", ArgFalse, (LPVOID) &appData.autoFlipView, FALSE, INVALID },\r
-  { "-autoflip", ArgFalse, (LPVOID) &appData.autoFlipView, FALSE, INVALID },\r
-  { "autoRaiseBoard", ArgBoolean, (LPVOID) &appData.autoRaiseBoard, TRUE, (ArgIniType) TRUE },\r
-  { "autoraise", ArgTrue, (LPVOID) &appData.autoRaiseBoard, FALSE, INVALID },\r
-  { "xautoraise", ArgFalse, (LPVOID) &appData.autoRaiseBoard, FALSE, INVALID },\r
-  { "-autoraise", ArgFalse, (LPVOID) &appData.autoRaiseBoard, FALSE, INVALID },\r
-  { "alwaysPromoteToQueen", ArgBoolean, (LPVOID) &appData.alwaysPromoteToQueen, TRUE, (ArgIniType) FALSE },\r
-  { "queen", ArgTrue, (LPVOID) &appData.alwaysPromoteToQueen, FALSE, INVALID },\r
-  { "xqueen", ArgFalse, (LPVOID) &appData.alwaysPromoteToQueen, FALSE, INVALID },\r
-  { "-queen", ArgFalse, (LPVOID) &appData.alwaysPromoteToQueen, FALSE, INVALID },\r
-  { "oldSaveStyle", ArgBoolean, (LPVOID) &appData.oldSaveStyle, TRUE, (ArgIniType) FALSE },\r
-  { "oldsave", ArgTrue, (LPVOID) &appData.oldSaveStyle, FALSE, INVALID },\r
-  { "xoldsave", ArgFalse, (LPVOID) &appData.oldSaveStyle, FALSE, INVALID },\r
-  { "-oldsave", ArgFalse, (LPVOID) &appData.oldSaveStyle, FALSE, INVALID },\r
-  { "quietPlay", ArgBoolean, (LPVOID) &appData.quietPlay, TRUE, (ArgIniType) FALSE },\r
-  { "quiet", ArgTrue, (LPVOID) &appData.quietPlay, FALSE, INVALID },\r
-  { "xquiet", ArgFalse, (LPVOID) &appData.quietPlay, FALSE, INVALID },\r
-  { "-quiet", ArgFalse, (LPVOID) &appData.quietPlay, FALSE, INVALID },\r
-  { "getMoveList", ArgBoolean, (LPVOID) &appData.getMoveList, TRUE, (ArgIniType) TRUE },\r
-  { "moves", ArgTrue, (LPVOID) &appData.getMoveList, FALSE, INVALID },\r
-  { "xmoves", ArgFalse, (LPVOID) &appData.getMoveList, FALSE, INVALID },\r
-  { "-moves", ArgFalse, (LPVOID) &appData.getMoveList, FALSE, INVALID },\r
-  { "testLegality", ArgBoolean, (LPVOID) &appData.testLegality, TRUE, (ArgIniType) TRUE },\r
-  { "legal", ArgTrue, (LPVOID) &appData.testLegality, FALSE, INVALID },\r
-  { "xlegal", ArgFalse, (LPVOID) &appData.testLegality, FALSE, INVALID },\r
-  { "-legal", ArgFalse, (LPVOID) &appData.testLegality, FALSE, INVALID },\r
-  { "premove", ArgBoolean, (LPVOID) &appData.premove, TRUE, (ArgIniType) TRUE },\r
-  { "pre", ArgTrue, (LPVOID) &appData.premove, FALSE, INVALID },\r
-  { "xpre", ArgFalse, (LPVOID) &appData.premove, FALSE, INVALID },\r
-  { "-pre", ArgFalse, (LPVOID) &appData.premove, FALSE, INVALID },\r
-  { "premoveWhite", ArgBoolean, (LPVOID) &appData.premoveWhite, TRUE, (ArgIniType) FALSE },\r
-  { "prewhite", ArgTrue, (LPVOID) &appData.premoveWhite, FALSE, INVALID },\r
-  { "xprewhite", ArgFalse, (LPVOID) &appData.premoveWhite, FALSE, INVALID },\r
-  { "-prewhite", ArgFalse, (LPVOID) &appData.premoveWhite, FALSE, INVALID },\r
-  { "premoveWhiteText", ArgString, (LPVOID) &appData.premoveWhiteText, TRUE, (ArgIniType) "" },\r
-  { "premoveBlack", ArgBoolean, (LPVOID) &appData.premoveBlack, TRUE, (ArgIniType) FALSE },\r
-  { "preblack", ArgTrue, (LPVOID) &appData.premoveBlack, FALSE, INVALID },\r
-  { "xpreblack", ArgFalse, (LPVOID) &appData.premoveBlack, FALSE, INVALID },\r
-  { "-preblack", ArgFalse, (LPVOID) &appData.premoveBlack, FALSE, INVALID },\r
-  { "premoveBlackText", ArgString, (LPVOID) &appData.premoveBlackText, TRUE, (ArgIniType) "" },\r
-  { "icsAlarm", ArgBoolean, (LPVOID) &appData.icsAlarm, TRUE, (ArgIniType) TRUE},\r
-  { "alarm", ArgTrue, (LPVOID) &appData.icsAlarm, FALSE},\r
-  { "xalarm", ArgFalse, (LPVOID) &appData.icsAlarm, FALSE},\r
-  { "-alarm", ArgFalse, (LPVOID) &appData.icsAlarm, FALSE},\r
-  { "icsAlarmTime", ArgInt, (LPVOID) &appData.icsAlarmTime, TRUE, (ArgIniType) 5000},\r
-  { "localLineEditing", ArgBoolean, (LPVOID) &appData.localLineEditing, FALSE, (ArgIniType) TRUE},\r
-  { "edit", ArgTrue, (LPVOID) &appData.localLineEditing, FALSE, INVALID },\r
-  { "xedit", ArgFalse, (LPVOID) &appData.localLineEditing, FALSE, INVALID },\r
-  { "-edit", ArgFalse, (LPVOID) &appData.localLineEditing, FALSE, INVALID },\r
-  { "animateMoving", ArgBoolean, (LPVOID) &appData.animate, TRUE, (ArgIniType) TRUE },\r
-  { "animate", ArgTrue, (LPVOID) &appData.animate, FALSE, INVALID },\r
-  { "xanimate", ArgFalse, (LPVOID) &appData.animate, FALSE, INVALID },\r
-  { "-animate", ArgFalse, (LPVOID) &appData.animate, FALSE, INVALID },\r
-  { "animateSpeed", ArgInt, (LPVOID) &appData.animSpeed, TRUE, (ArgIniType) 10 },\r
-  { "animateDragging", ArgBoolean, (LPVOID) &appData.animateDragging, TRUE, (ArgIniType) TRUE },\r
-  { "drag", ArgTrue, (LPVOID) &appData.animateDragging, FALSE, INVALID },\r
-  { "xdrag", ArgFalse, (LPVOID) &appData.animateDragging, FALSE, INVALID },\r
-  { "-drag", ArgFalse, (LPVOID) &appData.animateDragging, FALSE, INVALID },\r
-  { "blindfold", ArgBoolean, (LPVOID) &appData.blindfold, TRUE, (ArgIniType) FALSE },\r
-  { "blind", ArgTrue, (LPVOID) &appData.blindfold, FALSE, INVALID },\r
-  { "xblind", ArgFalse, (LPVOID) &appData.blindfold, FALSE, INVALID },\r
-  { "-blind", ArgFalse, (LPVOID) &appData.blindfold, FALSE, INVALID },\r
-  { "highlightLastMove", ArgBoolean,\r
-    (LPVOID) &appData.highlightLastMove, TRUE, (ArgIniType) TRUE },\r
-  { "highlight", ArgTrue, (LPVOID) &appData.highlightLastMove, FALSE, INVALID },\r
-  { "xhighlight", ArgFalse, (LPVOID) &appData.highlightLastMove, FALSE, INVALID },\r
-  { "-highlight", ArgFalse, (LPVOID) &appData.highlightLastMove, FALSE, INVALID },\r
-  { "highlightDragging", ArgBoolean,\r
-    (LPVOID) &appData.highlightDragging, TRUE, INVALID },\r
-  { "highdrag", ArgTrue, (LPVOID) &appData.highlightDragging, FALSE, INVALID },\r
-  { "xhighdrag", ArgFalse, (LPVOID) &appData.highlightDragging, FALSE, INVALID },\r
-  { "-highdrag", ArgFalse, (LPVOID) &appData.highlightDragging, FALSE, INVALID },\r
-  { "colorizeMessages", ArgBoolean, (LPVOID) &appData.colorize, TRUE, (ArgIniType) TRUE },\r
-  { "colorize", ArgTrue, (LPVOID) &appData.colorize, FALSE, INVALID },\r
-  { "xcolorize", ArgFalse, (LPVOID) &appData.colorize, FALSE, INVALID },\r
-  { "-colorize", ArgFalse, (LPVOID) &appData.colorize, FALSE, INVALID },\r
-  { "colorShout", ArgAttribs, (LPVOID) ColorShout, TRUE, INVALID },\r
-  { "colorSShout", ArgAttribs, (LPVOID) ColorSShout, TRUE, INVALID },\r
-  { "colorChannel1", ArgAttribs, (LPVOID) ColorChannel1, TRUE, INVALID },\r
-  { "colorChannel", ArgAttribs, (LPVOID) ColorChannel, TRUE, INVALID },\r
-  { "colorKibitz", ArgAttribs, (LPVOID) ColorKibitz, TRUE, INVALID },\r
-  { "colorTell", ArgAttribs, (LPVOID) ColorTell, TRUE, INVALID },\r
-  { "colorChallenge", ArgAttribs, (LPVOID) ColorChallenge, TRUE, INVALID },\r
-  { "colorRequest", ArgAttribs, (LPVOID) ColorRequest, TRUE, INVALID },\r
-  { "colorSeek", ArgAttribs, (LPVOID) ColorSeek, TRUE, INVALID },\r
-  { "colorNormal", ArgAttribs, (LPVOID) ColorNormal, TRUE, INVALID },\r
-  { "colorBackground", ArgColor, (LPVOID) &consoleBackgroundColor, TRUE, INVALID },\r
-  { "soundShout", ArgFilename, (LPVOID) &appData.soundShout, TRUE, (ArgIniType) "" },\r
-  { "soundSShout", ArgFilename, (LPVOID) &appData.soundSShout, TRUE, (ArgIniType) "" },\r
-  { "soundCShout", ArgFilename, (LPVOID) &appData.soundSShout, TRUE, (ArgIniType) "" }, // for XB\r
-  { "soundChannel1", ArgFilename, (LPVOID) &appData.soundChannel1, TRUE, (ArgIniType) "" },\r
-  { "soundChannel", ArgFilename, (LPVOID) &appData.soundChannel, TRUE, (ArgIniType) "" },\r
-  { "soundKibitz", ArgFilename, (LPVOID) &appData.soundKibitz, TRUE, (ArgIniType) "" },\r
-  { "soundTell", ArgFilename, (LPVOID) &appData.soundTell, TRUE, (ArgIniType) "" },\r
-  { "soundChallenge", ArgFilename, (LPVOID) &appData.soundChallenge, TRUE, (ArgIniType) "" },\r
-  { "soundRequest", ArgFilename, (LPVOID) &appData.soundRequest, TRUE, (ArgIniType) "" },\r
-  { "soundSeek", ArgFilename, (LPVOID) &appData.soundSeek, TRUE, (ArgIniType) "" },\r
-  { "soundMove", ArgFilename, (LPVOID) &appData.soundMove, TRUE, (ArgIniType) "" },\r
-  { "soundBell", ArgFilename, (LPVOID) &appData.soundBell, TRUE, (ArgIniType) SOUND_BELL },\r
-  { "soundIcsWin", ArgFilename, (LPVOID) &appData.soundIcsWin, TRUE, (ArgIniType) "" },\r
-  { "soundIcsLoss", ArgFilename, (LPVOID) &appData.soundIcsLoss, TRUE, (ArgIniType) "" },\r
-  { "soundIcsDraw", ArgFilename, (LPVOID) &appData.soundIcsDraw, TRUE, (ArgIniType) "" },\r
-  { "soundIcsUnfinished", ArgFilename, (LPVOID) &appData.soundIcsUnfinished, TRUE, (ArgIniType) "" },\r
-  { "soundIcsAlarm", ArgFilename, (LPVOID) &appData.soundIcsAlarm, TRUE, (ArgIniType) "" },\r
-  { "reuseFirst", ArgBoolean, (LPVOID) &appData.reuseFirst, FALSE, (ArgIniType) TRUE },\r
-  { "reuse", ArgTrue, (LPVOID) &appData.reuseFirst, FALSE, INVALID },\r
-  { "xreuse", ArgFalse, (LPVOID) &appData.reuseFirst, FALSE, INVALID },\r
-  { "-reuse", ArgFalse, (LPVOID) &appData.reuseFirst, FALSE, INVALID },\r
-  { "reuseChessPrograms", ArgBoolean,\r
-    (LPVOID) &appData.reuseFirst, FALSE, INVALID }, /* backward compat only */\r
-  { "reuseSecond", ArgBoolean, (LPVOID) &appData.reuseSecond, FALSE, (ArgIniType) TRUE },\r
-  { "reuse2", ArgTrue, (LPVOID) &appData.reuseSecond, FALSE, INVALID },\r
-  { "xreuse2", ArgFalse, (LPVOID) &appData.reuseSecond, FALSE, INVALID },\r
-  { "-reuse2", ArgFalse, (LPVOID) &appData.reuseSecond, FALSE, INVALID },\r
-  { "comPortSettings", ArgCommSettings, (LPVOID) &dcb, TRUE, INVALID },\r
-  { "settingsFile", ArgSettingsFilename, (LPVOID) &settingsFileName, FALSE, (ArgIniType) SETTINGS_FILE },\r
-  { "ini", ArgSettingsFilename, (LPVOID) &settingsFileName, FALSE, INVALID },\r
-  { "saveSettingsOnExit", ArgBoolean, (LPVOID) &saveSettingsOnExit, TRUE, (ArgIniType) TRUE },\r
-  { "chessProgram", ArgBoolean, (LPVOID) &chessProgram, FALSE, (ArgIniType) FALSE },\r
-  { "cp", ArgTrue, (LPVOID) &chessProgram, FALSE, INVALID },\r
-  { "xcp", ArgFalse, (LPVOID) &chessProgram, FALSE, INVALID },\r
-  { "-cp", ArgFalse, (LPVOID) &chessProgram, FALSE, INVALID },\r
-  { "icsMenu", ArgString, (LPVOID) &icsTextMenuString, TRUE, (ArgIniType) ICS_TEXT_MENU_DEFAULT },\r
-  { "icsNames", ArgString, (LPVOID) &icsNames, TRUE, (ArgIniType) ICS_NAMES },\r
-  { "firstChessProgramNames", ArgString, (LPVOID) &firstChessProgramNames,\r
-    TRUE, (ArgIniType) FCP_NAMES },\r
-  { "secondChessProgramNames", ArgString, (LPVOID) &secondChessProgramNames,\r
-    TRUE, (ArgIniType) SCP_NAMES },\r
-  { "initialMode", ArgString, (LPVOID) &appData.initialMode, FALSE, (ArgIniType) "" },\r
-  { "mode", ArgString, (LPVOID) &appData.initialMode, FALSE, INVALID },\r
-  { "variant", ArgString, (LPVOID) &appData.variant, FALSE, (ArgIniType) "normal" },\r
-  { "firstProtocolVersion", ArgInt, (LPVOID) &appData.firstProtocolVersion, FALSE, (ArgIniType) PROTOVER },\r
-  { "secondProtocolVersion", ArgInt, (LPVOID) &appData.secondProtocolVersion,FALSE, (ArgIniType) PROTOVER },\r
-  { "showButtonBar", ArgBoolean, (LPVOID) &appData.showButtonBar, TRUE, (ArgIniType) TRUE },\r
-  { "buttons", ArgTrue, (LPVOID) &appData.showButtonBar, FALSE, INVALID },\r
-  { "xbuttons", ArgFalse, (LPVOID) &appData.showButtonBar, FALSE, INVALID },\r
-  { "-buttons", ArgFalse, (LPVOID) &appData.showButtonBar, FALSE, INVALID },\r
-\r
-  /* [AS] New features */\r
-  { "firstScoreAbs", ArgBoolean, (LPVOID) &appData.firstScoreIsAbsolute, FALSE, (ArgIniType) FALSE },\r
-  { "secondScoreAbs", ArgBoolean, (LPVOID) &appData.secondScoreIsAbsolute, FALSE, (ArgIniType) FALSE },\r
-  { "pgnExtendedInfo", ArgBoolean, (LPVOID) &appData.saveExtendedInfoInPGN, TRUE, (ArgIniType) FALSE },\r
-  { "hideThinkingFromHuman", ArgBoolean, (LPVOID) &appData.hideThinkingFromHuman, TRUE, (ArgIniType) FALSE },\r
-  { "liteBackTextureFile", ArgString, (LPVOID) &appData.liteBackTextureFile, TRUE, (ArgIniType) "" },\r
-  { "darkBackTextureFile", ArgString, (LPVOID) &appData.darkBackTextureFile, TRUE, (ArgIniType) "" },\r
-  { "liteBackTextureMode", ArgInt, (LPVOID) &appData.liteBackTextureMode, TRUE, (ArgIniType) BACK_TEXTURE_MODE_PLAIN },\r
-  { "darkBackTextureMode", ArgInt, (LPVOID) &appData.darkBackTextureMode, TRUE, (ArgIniType) BACK_TEXTURE_MODE_PLAIN },\r
-  { "renderPiecesWithFont", ArgString, (LPVOID) &appData.renderPiecesWithFont, TRUE, (ArgIniType) "" },\r
-  { "fontPieceToCharTable", ArgString, (LPVOID) &appData.fontToPieceTable, TRUE, (ArgIniType) "" },\r
-  { "fontPieceBackColorWhite", ArgColor, (LPVOID) &appData.fontBackColorWhite, TRUE, (ArgIniType) 0 },\r
-  { "fontPieceForeColorWhite", ArgColor, (LPVOID) &appData.fontForeColorWhite, TRUE, (ArgIniType) 0 },\r
-  { "fontPieceBackColorBlack", ArgColor, (LPVOID) &appData.fontBackColorBlack, TRUE, (ArgIniType) 0 },\r
-  { "fontPieceForeColorBlack", ArgColor, (LPVOID) &appData.fontForeColorBlack, TRUE, (ArgIniType) 0 },\r
-  { "fontPieceSize", ArgInt, (LPVOID) &appData.fontPieceSize, TRUE, (ArgIniType) 80 },\r
-  { "overrideLineGap", ArgInt, (LPVOID) &appData.overrideLineGap, TRUE, (ArgIniType) 1 },\r
-  { "adjudicateLossThreshold", ArgInt, (LPVOID) &appData.adjudicateLossThreshold, TRUE, (ArgIniType) 0 },\r
-  { "delayBeforeQuit", ArgInt, (LPVOID) &appData.delayBeforeQuit, TRUE, (ArgIniType) 0 },\r
-  { "delayAfterQuit", ArgInt, (LPVOID) &appData.delayAfterQuit, TRUE, (ArgIniType) 0 },\r
-  { "nameOfDebugFile", ArgFilename, (LPVOID) &appData.nameOfDebugFile, FALSE, (ArgIniType) "winboard.debug" },\r
-  { "debugfile", ArgFilename, (LPVOID) &appData.nameOfDebugFile, FALSE, INVALID },\r
-  { "pgnEventHeader", ArgString, (LPVOID) &appData.pgnEventHeader, TRUE, (ArgIniType) "Computer Chess Game" },\r
-  { "defaultFrcPosition", ArgInt, (LPVOID) &appData.defaultFrcPosition, TRUE, (ArgIniType) -1 },\r
-  { "gameListTags", ArgString, (LPVOID) &appData.gameListTags, TRUE, (ArgIniType) GLT_DEFAULT_TAGS },\r
-  { "saveOutOfBookInfo", ArgBoolean, (LPVOID) &appData.saveOutOfBookInfo, TRUE, (ArgIniType) TRUE },\r
-  { "showEvalInMoveHistory", ArgBoolean, (LPVOID) &appData.showEvalInMoveHistory, TRUE, (ArgIniType) TRUE },\r
-  { "evalHistColorWhite", ArgColor, (LPVOID) &appData.evalHistColorWhite, TRUE, INVALID },\r
-  { "evalHistColorBlack", ArgColor, (LPVOID) &appData.evalHistColorBlack, TRUE, INVALID },\r
-  { "highlightMoveWithArrow", ArgBoolean, (LPVOID) &appData.highlightMoveWithArrow, TRUE, (ArgIniType) FALSE },\r
-  { "highlightArrowColor", ArgColor, (LPVOID) &appData.highlightArrowColor, TRUE, INVALID },\r
-  { "stickyWindows", ArgBoolean, (LPVOID) &appData.useStickyWindows, TRUE, (ArgIniType) TRUE },\r
-  { "adjudicateDrawMoves", ArgInt, (LPVOID) &appData.adjudicateDrawMoves, TRUE, (ArgIniType) TRUE },\r
-  { "autoDisplayComment", ArgBoolean, (LPVOID) &appData.autoDisplayComment, TRUE, (ArgIniType) TRUE },\r
-  { "autoDisplayTags", ArgBoolean, (LPVOID) &appData.autoDisplayTags, TRUE, (ArgIniType) TRUE },\r
-  { "firstIsUCI", ArgBoolean, (LPVOID) &appData.firstIsUCI, FALSE, (ArgIniType) FALSE },\r
-  { "fUCI", ArgTrue, (LPVOID) &appData.firstIsUCI, FALSE, INVALID },\r
-  { "secondIsUCI", ArgBoolean, (LPVOID) &appData.secondIsUCI, FALSE, (ArgIniType) FALSE },\r
-  { "sUCI", ArgTrue, (LPVOID) &appData.secondIsUCI, FALSE, INVALID },\r
-  { "firstHasOwnBookUCI", ArgBoolean, (LPVOID) &appData.firstHasOwnBookUCI, FALSE, (ArgIniType) TRUE },\r
-  { "fNoOwnBookUCI", ArgFalse, (LPVOID) &appData.firstHasOwnBookUCI, FALSE, INVALID },\r
-  { "firstXBook", ArgFalse, (LPVOID) &appData.firstHasOwnBookUCI, FALSE, INVALID },\r
-  { "secondHasOwnBookUCI", ArgBoolean, (LPVOID) &appData.secondHasOwnBookUCI, FALSE, (ArgIniType) TRUE },\r
-  { "sNoOwnBookUCI", ArgFalse, (LPVOID) &appData.secondHasOwnBookUCI, FALSE, INVALID },\r
-  { "secondXBook", ArgFalse, (LPVOID) &appData.secondHasOwnBookUCI, FALSE, INVALID },\r
-  { "polyglotDir", ArgFilename, (LPVOID) &appData.polyglotDir, TRUE, (ArgIniType) "" },\r
-  { "usePolyglotBook", ArgBoolean, (LPVOID) &appData.usePolyglotBook, TRUE, (ArgIniType) FALSE },\r
-  { "polyglotBook", ArgFilename, (LPVOID) &appData.polyglotBook, TRUE, (ArgIniType) "" },\r
-  { "defaultHashSize", ArgInt, (LPVOID) &appData.defaultHashSize, TRUE, (ArgIniType) 64 }, \r
-  { "defaultCacheSizeEGTB", ArgInt, (LPVOID) &appData.defaultCacheSizeEGTB, TRUE, (ArgIniType) 4 },\r
-  { "defaultPathEGTB", ArgFilename, (LPVOID) &appData.defaultPathEGTB, TRUE, (ArgIniType) "c:\\egtb" },\r
-\r
-  /* [HGM] board-size, adjudication and misc. options */\r
-  { "boardWidth", ArgInt, (LPVOID) &appData.NrFiles, TRUE, (ArgIniType) -1 },\r
-  { "boardHeight", ArgInt, (LPVOID) &appData.NrRanks, TRUE, (ArgIniType) -1 },\r
-  { "holdingsSize", ArgInt, (LPVOID) &appData.holdingsSize, TRUE, (ArgIniType) -1 },\r
-  { "matchPause", ArgInt, (LPVOID) &appData.matchPause, TRUE, (ArgIniType) 10000 },\r
-  { "pieceToCharTable", ArgString, (LPVOID) &appData.pieceToCharTable, FALSE, INVALID },\r
-  { "flipBlack", ArgBoolean, (LPVOID) &appData.upsideDown, TRUE, (ArgIniType) FALSE },\r
-  { "allWhite", ArgBoolean, (LPVOID) &appData.allWhite, TRUE, (ArgIniType) FALSE },\r
-  { "alphaRank", ArgBoolean, (LPVOID) &appData.alphaRank, FALSE, (ArgIniType) FALSE },\r
-  { "firstAlphaRank", ArgBoolean, (LPVOID) &first.alphaRank, FALSE, (ArgIniType) FALSE },\r
-  { "secondAlphaRank", ArgBoolean, (LPVOID) &second.alphaRank, FALSE, (ArgIniType) FALSE },\r
-  { "testClaims", ArgBoolean, (LPVOID) &appData.testClaims, TRUE, (ArgIniType) FALSE },\r
-  { "checkMates", ArgBoolean, (LPVOID) &appData.checkMates, TRUE, (ArgIniType) FALSE },\r
-  { "materialDraws", ArgBoolean, (LPVOID) &appData.materialDraws, TRUE, (ArgIniType) FALSE },\r
-  { "trivialDraws", ArgBoolean, (LPVOID) &appData.trivialDraws, TRUE, (ArgIniType) FALSE },\r
-  { "ruleMoves", ArgInt, (LPVOID) &appData.ruleMoves, TRUE, (ArgIniType) 51 },\r
-  { "repeatsToDraw", ArgInt, (LPVOID) &appData.drawRepeats, TRUE, (ArgIniType) 6 },\r
-  { "autoKibitz", ArgTrue, (LPVOID) &appData.autoKibitz, FALSE, INVALID },\r
-  { "engineDebugOutput", ArgInt, (LPVOID) &appData.engineComments, FALSE, (ArgIniType) 1 },\r
-  { "userName", ArgString, (LPVOID) &appData.userName, FALSE, INVALID },\r
-  { "rewindIndex", ArgInt, (LPVOID) &appData.rewindIndex, FALSE, INVALID },\r
-  { "sameColorGames", ArgInt, (LPVOID) &appData.sameColorGames, FALSE, INVALID },\r
-  { "smpCores", ArgInt, (LPVOID) &appData.smpCores, TRUE, (ArgIniType) 1 },\r
-  { "egtFormats", ArgString, (LPVOID) &appData.egtFormats, TRUE, (ArgIniType) "" },\r
-  { "niceEngines", ArgInt, (LPVOID) &appData.niceEngines, TRUE, INVALID },\r
-  { "firstLogo", ArgFilename, (LPVOID) &appData.firstLogo, FALSE, INVALID },\r
-  { "secondLogo", ArgFilename, (LPVOID) &appData.secondLogo, FALSE, INVALID },\r
-  { "autoLogo", ArgBoolean, (LPVOID) &appData.autoLogo, TRUE, INVALID },\r
-  { "firstOptions", ArgString, (LPVOID) &appData.firstOptions, FALSE, (ArgIniType) "" },\r
-  { "secondOptions", ArgString, (LPVOID) &appData.secondOptions, FALSE, (ArgIniType) "" },\r
-  { "firstNeedsNoncompliantFEN", ArgString, (LPVOID) &appData.fenOverride1, FALSE, (ArgIniType) "" },\r
-  { "secondNeedsNoncompliantFEN", ArgString, (LPVOID) &appData.fenOverride2, FALSE, (ArgIniType) "" },\r
-  { "keepAlive", ArgInt, (LPVOID) &appData.keepAlive, FALSE, INVALID },\r
-  { "icstype", ArgInt, (LPVOID) &ics_type, FALSE, INVALID },\r
-  { "forceIllegalMoves", ArgTrue, (LPVOID) &appData.forceIllegal, FALSE, INVALID },\r
-\r
-#ifdef ZIPPY\r
-  { "zippyTalk", ArgBoolean, (LPVOID) &appData.zippyTalk, FALSE, (ArgIniType) ZIPPY_TALK },\r
-  { "zt", ArgTrue, (LPVOID) &appData.zippyTalk, FALSE, INVALID },\r
-  { "xzt", ArgFalse, (LPVOID) &appData.zippyTalk, FALSE, INVALID },\r
-  { "-zt", ArgFalse, (LPVOID) &appData.zippyTalk, FALSE, INVALID },\r
-  { "zippyPlay", ArgBoolean, (LPVOID) &appData.zippyPlay, FALSE, (ArgIniType) ZIPPY_PLAY },\r
-  { "zp", ArgTrue, (LPVOID) &appData.zippyPlay, FALSE, INVALID },\r
-  { "xzp", ArgFalse, (LPVOID) &appData.zippyPlay, FALSE, INVALID },\r
-  { "-zp", ArgFalse, (LPVOID) &appData.zippyPlay, FALSE, INVALID },\r
-  { "zippyLines", ArgFilename, (LPVOID) &appData.zippyLines, FALSE, (ArgIniType) ZIPPY_LINES },\r
-  { "zippyPinhead", ArgString, (LPVOID) &appData.zippyPinhead, FALSE, (ArgIniType) ZIPPY_PINHEAD },\r
-  { "zippyPassword", ArgString, (LPVOID) &appData.zippyPassword, FALSE, (ArgIniType) ZIPPY_PASSWORD },\r
-  { "zippyPassword2", ArgString, (LPVOID) &appData.zippyPassword2, FALSE, (ArgIniType) ZIPPY_PASSWORD2 },\r
-  { "zippyWrongPassword", ArgString, (LPVOID) &appData.zippyWrongPassword,\r
-    FALSE, (ArgIniType) ZIPPY_WRONG_PASSWORD },\r
-  { "zippyAcceptOnly", ArgString, (LPVOID) &appData.zippyAcceptOnly, FALSE, (ArgIniType) ZIPPY_ACCEPT_ONLY },\r
-  { "zippyUseI", ArgBoolean, (LPVOID) &appData.zippyUseI, FALSE, (ArgIniType) ZIPPY_USE_I },\r
-  { "zui", ArgTrue, (LPVOID) &appData.zippyUseI, FALSE, INVALID },\r
-  { "xzui", ArgFalse, (LPVOID) &appData.zippyUseI, FALSE, INVALID },\r
-  { "-zui", ArgFalse, (LPVOID) &appData.zippyUseI, FALSE, INVALID },\r
-  { "zippyBughouse", ArgInt, (LPVOID) &appData.zippyBughouse, FALSE, (ArgIniType) ZIPPY_BUGHOUSE },\r
-  { "zippyNoplayCrafty", ArgBoolean, (LPVOID) &appData.zippyNoplayCrafty,\r
-    FALSE, (ArgIniType) ZIPPY_NOPLAY_CRAFTY },\r
-  { "znc", ArgTrue, (LPVOID) &appData.zippyNoplayCrafty, FALSE, INVALID },\r
-  { "xznc", ArgFalse, (LPVOID) &appData.zippyNoplayCrafty, FALSE, INVALID },\r
-  { "-znc", ArgFalse, (LPVOID) &appData.zippyNoplayCrafty, FALSE, INVALID },\r
-  { "zippyGameEnd", ArgString, (LPVOID) &appData.zippyGameEnd, FALSE, (ArgIniType) ZIPPY_GAME_END },\r
-  { "zippyGameStart", ArgString, (LPVOID) &appData.zippyGameStart, FALSE, (ArgIniType) ZIPPY_GAME_START },\r
-  { "zippyAdjourn", ArgBoolean, (LPVOID) &appData.zippyAdjourn, FALSE, (ArgIniType) ZIPPY_ADJOURN },\r
-  { "zadj", ArgTrue, (LPVOID) &appData.zippyAdjourn, FALSE, INVALID },\r
-  { "xzadj", ArgFalse, (LPVOID) &appData.zippyAdjourn, FALSE, INVALID },\r
-  { "-zadj", ArgFalse, (LPVOID) &appData.zippyAdjourn, FALSE, INVALID },\r
-  { "zippyAbort", ArgBoolean, (LPVOID) &appData.zippyAbort, FALSE, (ArgIniType) ZIPPY_ABORT },\r
-  { "zab", ArgTrue, (LPVOID) &appData.zippyAbort, FALSE, INVALID },\r
-  { "xzab", ArgFalse, (LPVOID) &appData.zippyAbort, FALSE, INVALID },\r
-  { "-zab", ArgFalse, (LPVOID) &appData.zippyAbort, FALSE, INVALID },\r
-  { "zippyVariants", ArgString, (LPVOID) &appData.zippyVariants, FALSE, (ArgIniType) ZIPPY_VARIANTS },\r
-  { "zippyMaxGames", ArgInt, (LPVOID)&appData.zippyMaxGames, FALSE, (ArgIniType) ZIPPY_MAX_GAMES},\r
-  { "zippyReplayTimeout", ArgInt, (LPVOID)&appData.zippyReplayTimeout, FALSE, (ArgIniType) ZIPPY_REPLAY_TIMEOUT },\r
-  { "zippyShortGame", ArgInt, (LPVOID)&appData.zippyShortGame, FALSE, INVALID },\r
-  /* Kludge to allow winboard.ini files from buggy 4.0.4 to be read: */\r
-  { "zippyReplyTimeout", ArgInt, (LPVOID)&junk, FALSE, INVALID },\r
-#endif\r
-  /* [HGM] options for broadcasting and time odds */\r
-  { "serverMoves", ArgString, (LPVOID) &appData.serverMovesName, FALSE, (ArgIniType) NULL },\r
-  { "suppressLoadMoves", ArgBoolean, (LPVOID) &appData.suppressLoadMoves, FALSE, (ArgIniType) FALSE },\r
-  { "serverPause", ArgInt, (LPVOID) &appData.serverPause, FALSE, (ArgIniType) 15 },\r
-  { "firstTimeOdds", ArgInt, (LPVOID) &appData.firstTimeOdds, FALSE, (ArgIniType) 1 },\r
-  { "secondTimeOdds", ArgInt, (LPVOID) &appData.secondTimeOdds, FALSE, (ArgIniType) 1 },\r
-  { "timeOddsMode", ArgInt, (LPVOID) &appData.timeOddsMode, TRUE, INVALID },\r
-  { "firstAccumulateTC", ArgInt, (LPVOID) &appData.firstAccumulateTC, FALSE, (ArgIniType) 1 },\r
-  { "secondAccumulateTC", ArgInt, (LPVOID) &appData.secondAccumulateTC, FALSE, (ArgIniType) 1 },\r
-  { "firstNPS", ArgInt, (LPVOID) &appData.firstNPS, FALSE, (ArgIniType) -1 },\r
-  { "secondNPS", ArgInt, (LPVOID) &appData.secondNPS, FALSE, (ArgIniType) -1 },\r
-  { "noGUI", ArgTrue, (LPVOID) &appData.noGUI, FALSE, INVALID },\r
-  { "keepLineBreaksICS", ArgBoolean, (LPVOID) &appData.noJoin, TRUE, INVALID },\r
-  { "wrapContinuationSequence", ArgString, (LPVOID) &appData.wrapContSeq, FALSE, INVALID },\r
-  { "useInternalWrap", ArgTrue, (LPVOID) &appData.useInternalWrap, FALSE, INVALID }, /* noJoin usurps this if set */\r
-  \r
-  // [HGM] placement: put all window layouts last in ini file, but man X,Y before all others\r
-  { "minX", ArgZ, (LPVOID) &minX, FALSE, INVALID }, // [HGM] placement: to make suer auxialary windows can be placed\r
-  { "minY", ArgZ, (LPVOID) &minY, FALSE, INVALID },\r
-  { "winWidth",  ArgInt, (LPVOID) &wpMain.width,  TRUE, INVALID }, // [HGM] placement: dummies to remember right & bottom\r
-  { "winHeight", ArgInt, (LPVOID) &wpMain.height, TRUE, INVALID }, //       for attaching auxiliary windows to them\r
-  { "x", ArgInt, (LPVOID) &wpMain.x, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "y", ArgInt, (LPVOID) &wpMain.y, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "icsX", ArgX,   (LPVOID) &wpConsole.x, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "icsY", ArgY,   (LPVOID) &wpConsole.y, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "icsW", ArgInt, (LPVOID) &wpConsole.width, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "icsH", ArgInt, (LPVOID) &wpConsole.height, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "analysisX", ArgX,   (LPVOID) &dummy, FALSE, INVALID }, // [HGM] placement: analysis window no longer exists\r
-  { "analysisY", ArgY,   (LPVOID) &dummy, FALSE, INVALID }, //       provided for compatibility with old ini files\r
-  { "analysisW", ArgInt, (LPVOID) &dummy, FALSE, INVALID },\r
-  { "analysisH", ArgInt, (LPVOID) &dummy, FALSE, INVALID },\r
-  { "commentX", ArgX,   (LPVOID) &wpComment.x, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "commentY", ArgY,   (LPVOID) &wpComment.y, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "commentW", ArgInt, (LPVOID) &wpComment.width, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "commentH", ArgInt, (LPVOID) &wpComment.height, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "tagsX", ArgX,   (LPVOID) &wpTags.x, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "tagsY", ArgY,   (LPVOID) &wpTags.y, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "tagsW", ArgInt, (LPVOID) &wpTags.width, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "tagsH", ArgInt, (LPVOID) &wpTags.height, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "gameListX", ArgX,   (LPVOID) &wpGameList.x, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "gameListY", ArgY,   (LPVOID) &wpGameList.y, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "gameListW", ArgInt, (LPVOID) &wpGameList.width, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "gameListH", ArgInt, (LPVOID) &wpGameList.height, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  /* [AS] Layout stuff */\r
-  { "moveHistoryUp", ArgBoolean, (LPVOID) &wpMoveHistory.visible, TRUE, (ArgIniType) TRUE },\r
-  { "moveHistoryX", ArgX,   (LPVOID) &wpMoveHistory.x, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "moveHistoryY", ArgY,   (LPVOID) &wpMoveHistory.y, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "moveHistoryW", ArgInt, (LPVOID) &wpMoveHistory.width, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "moveHistoryH", ArgInt, (LPVOID) &wpMoveHistory.height, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-\r
-  { "evalGraphUp", ArgBoolean, (LPVOID) &wpEvalGraph.visible, TRUE, (ArgIniType) TRUE },\r
-  { "evalGraphX", ArgX,   (LPVOID) &wpEvalGraph.x, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "evalGraphY", ArgY,   (LPVOID) &wpEvalGraph.y, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "evalGraphW", ArgInt, (LPVOID) &wpEvalGraph.width, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "evalGraphH", ArgInt, (LPVOID) &wpEvalGraph.height, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-\r
-  { "engineOutputUp", ArgBoolean, (LPVOID) &wpEngineOutput.visible, TRUE, (ArgIniType) TRUE },\r
-  { "engineOutputX", ArgX,   (LPVOID) &wpEngineOutput.x, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "engineOutputY", ArgY,   (LPVOID) &wpEngineOutput.y, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "engineOutputW", ArgInt, (LPVOID) &wpEngineOutput.width, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-  { "engineOutputH", ArgInt, (LPVOID) &wpEngineOutput.height, TRUE, (ArgIniType) CW_USEDEFAULT },\r
-\r
-  { NULL, ArgNone, NULL, FALSE, INVALID }\r
-};\r
+#define OPTCHAR "/"\r
+#define SEPCHAR "="\r
 \r
+#include "args.h"\r
 \r
-/* Kludge for indirection files on command line */\r
-char* lastIndirectionFilename;\r
-ArgDescriptor argDescriptorIndirection =\r
-{ "", ArgSettingsFilename, (LPVOID) NULL, FALSE };\r
-\r
+// front-end part of option handling\r
 \r
 VOID\r
-ExitArgError(char *msg, char *badArg)\r
+LFfromMFP(LOGFONT* lf, MyFontParams *mfp)\r
 {\r
-  char buf[MSG_SIZ];\r
+  HDC hdc = CreateDC("DISPLAY", NULL, NULL, NULL);\r
+  lf->lfHeight = -(int)(mfp->pointSize * GetDeviceCaps(hdc, LOGPIXELSY) / 72.0 + 0.5);\r
+  DeleteDC(hdc);\r
+  lf->lfWidth = 0;\r
+  lf->lfEscapement = 0;\r
+  lf->lfOrientation = 0;\r
+  lf->lfWeight = mfp->bold ? FW_BOLD : FW_NORMAL;\r
+  lf->lfItalic = mfp->italic;\r
+  lf->lfUnderline = mfp->underline;\r
+  lf->lfStrikeOut = mfp->strikeout;\r
+  lf->lfCharSet = mfp->charset;\r
+  lf->lfOutPrecision = OUT_DEFAULT_PRECIS;\r
+  lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;\r
+  lf->lfQuality = DEFAULT_QUALITY;\r
+  lf->lfPitchAndFamily = DEFAULT_PITCH|FF_DONTCARE;\r
+  strcpy(lf->lfFaceName, mfp->faceName);\r
+}\r
 \r
-  sprintf(buf, "%s %s", msg, badArg);\r
-  DisplayFatalError(buf, 0, 2);\r
-  exit(2);\r
+void\r
+CreateFontInMF(MyFont *mf)\r
+{ \r
+  LFfromMFP(&mf->lf, &mf->mfp);\r
+  if (mf->hf) DeleteObject(mf->hf);\r
+  mf->hf = CreateFontIndirect(&mf->lf);\r
 }\r
 \r
+// [HGM] This platform-dependent table provides the location for storing the color info\r
+void *\r
+colorVariable[] = {\r
+  &whitePieceColor, \r
+  &blackPieceColor, \r
+  &lightSquareColor,\r
+  &darkSquareColor, \r
+  &highlightSquareColor,\r
+  &premoveHighlightColor,\r
+  NULL,\r
+  &consoleBackgroundColor,\r
+  &appData.fontForeColorWhite,\r
+  &appData.fontBackColorWhite,\r
+  &appData.fontForeColorBlack,\r
+  &appData.fontBackColorBlack,\r
+  &appData.evalHistColorWhite,\r
+  &appData.evalHistColorBlack,\r
+  &appData.highlightArrowColor,\r
+};\r
+\r
 /* Command line font name parser.  NULL name means do nothing.\r
    Syntax like "Courier New:10.0 bi" or "Arial:10" or "Arial:10b"\r
    For backward compatibility, syntax without the colon is also\r
@@ -1504,6 +980,36 @@ ParseFontName(char *name, MyFontParams *mfp)
     mfp->charset = (BYTE) atoi(q+1);\r
 }\r
 \r
+void\r
+ParseFont(char *name, int number)\r
+{ // wrapper to shield back-end from 'font'\r
+  ParseFontName(name, &font[boardSize][number]->mfp);\r
+}\r
+\r
+void\r
+SetFontDefaults()\r
+{ // in WB  we have a 2D array of fonts; this initializes their description\r
+  int i, j;\r
+  /* Point font array elements to structures and\r
+     parse default font names */\r
+  for (i=0; i<NUM_FONTS; i++) {\r
+    for (j=0; j<NUM_SIZES; j++) {\r
+      font[j][i] = &fontRec[j][i];\r
+      ParseFontName(font[j][i]->def, &font[j][i]->mfp);\r
+    }\r
+  }\r
+}\r
+\r
+void\r
+CreateFonts()\r
+{ // here we create the actual fonts from the selected descriptions\r
+  int i, j;\r
+  for (i=0; i<NUM_FONTS; i++) {\r
+    for (j=0; j<NUM_SIZES; j++) {\r
+      CreateFontInMF(font[j][i]);\r
+    }\r
+  }\r
+}\r
 /* Color name parser.\r
    X version accepts X color names, but this one\r
    handles only the #rrggbb form (hex) or rrr,ggg,bbb (decimal) */\r
@@ -1526,8 +1032,14 @@ ParseColorName(char *name)
   return PALETTERGB(red, green, blue);\r
 }\r
 \r
+void\r
+ParseColor(int n, char *name)\r
+{ // for WinBoard the color is an int, which needs to be derived from the string\r
+  if(colorVariable[n]) *(int*)colorVariable[n] = ParseColorName(name);\r
+}\r
 \r
-void ParseAttribs(COLORREF *color, int *effects, char* argValue)\r
+void\r
+ParseAttribs(COLORREF *color, int *effects, char* argValue)\r
 {\r
   char *e = argValue;\r
   int eff = 0;\r
@@ -1544,376 +1056,28 @@ void ParseAttribs(COLORREF *color, int *effects, char* argValue)
   *color   = ParseColorName(e);\r
 }\r
 \r
+void\r
+ParseTextAttribs(ColorClass cc, char *s)\r
+{   // [HGM] front-end wrapper that does the platform-dependent call\r
+    // for XBoard we would set (&appData.colorShout)[cc] = strdup(s);\r
+    ParseAttribs(&textAttribs[cc].color, &textAttribs[cc].effects, s);\r
+}\r
 \r
-BoardSize\r
-ParseBoardSize(char *name)\r
-{\r
+void\r
+ParseBoardSize(void *addr, char *name)\r
+{ // [HGM] rewritten with return-value ptr to shield back-end from BoardSize\r
   BoardSize bs = SizeTiny;\r
   while (sizeInfo[bs].name != NULL) {\r
-    if (StrCaseCmp(name, sizeInfo[bs].name) == 0) return bs;\r
+    if (StrCaseCmp(name, sizeInfo[bs].name) == 0) {\r
+       *(BoardSize *)addr = bs;\r
+       return;\r
+    }\r
     bs++;\r
   }\r
   ExitArgError("Unrecognized board size value", name);\r
-  return bs; /* not reached */\r
-}\r
-\r
-\r
-char\r
-StringGet(void *getClosure)\r
-{\r
-  char **p = (char **) getClosure;\r
-  return *((*p)++);\r
 }\r
 \r
-char\r
-FileGet(void *getClosure)\r
-{\r
-  int c;\r
-  FILE* f = (FILE*) getClosure;\r
-\r
-  c = getc(f);\r
-  if (c == '\r') c = getc(f); // work around DOS format files by bypassing the '\r' completely\r
-  if (c == EOF)\r
-    return NULLCHAR;\r
-  else\r
-    return (char) c;\r
-}\r
-\r
-/* Parse settings file named "name". If file found, return the\r
-   full name in fullname and return TRUE; else return FALSE */\r
-BOOLEAN\r
-ParseSettingsFile(char *name, char fullname[MSG_SIZ])\r
-{\r
-  char *dummy;\r
-  FILE *f;\r
-  int ok; char buf[MSG_SIZ];\r
-\r
-  ok = SearchPath(installDir, name, NULL, MSG_SIZ, fullname, &dummy);\r
-  if(!ok && strchr(name, '.') == NULL) { // [HGM] append default file-name extension '.ini' when needed\r
-    sprintf(buf, "%s.ini", name);\r
-    ok = SearchPath(installDir, buf, NULL, MSG_SIZ, fullname, &dummy);\r
-  }\r
-  if (ok) {\r
-    f = fopen(fullname, "r");\r
-    if (f != NULL) {\r
-      ParseArgs(FileGet, f);\r
-      fclose(f);\r
-      return TRUE;\r
-    }\r
-  }\r
-  return FALSE;\r
-}\r
-\r
-VOID\r
-ParseArgs(GetFunc get, void *cl)\r
-{\r
-  char argName[ARG_MAX];\r
-  char argValue[ARG_MAX];\r
-  ArgDescriptor *ad;\r
-  char start;\r
-  char *q;\r
-  int i, octval;\r
-  char ch;\r
-  int posarg = 0;\r
-\r
-  ch = get(cl);\r
-  for (;;) {\r
-    while (ch == ' ' || ch == '\n' || ch == '\t') ch = get(cl);\r
-    if (ch == NULLCHAR) break;\r
-    if (ch == ';') {\r
-      /* Comment to end of line */\r
-      ch = get(cl);\r
-      while (ch != '\n' && ch != NULLCHAR) ch = get(cl);\r
-      continue;\r
-    } else if (ch == '/' || ch == '-') {\r
-      /* Switch */\r
-      q = argName;\r
-      while (ch != ' ' && ch != '=' && ch != ':' && ch != NULLCHAR &&\r
-            ch != '\n' && ch != '\t') {\r
-       *q++ = ch;\r
-       ch = get(cl);\r
-      }\r
-      *q = NULLCHAR;\r
-\r
-      for (ad = argDescriptors; ad->argName != NULL; ad++)\r
-       if (strcmp(ad->argName, argName + 1) == 0) break;\r
-\r
-      if (ad->argName == NULL)\r
-       ExitArgError("Unrecognized argument", argName);\r
-\r
-    } else if (ch == '@') {\r
-      /* Indirection file */\r
-      ad = &argDescriptorIndirection;\r
-      ch = get(cl);\r
-    } else {\r
-      /* Positional argument */\r
-      ad = &argDescriptors[posarg++];\r
-      strcpy(argName, ad->argName);\r
-    }\r
-\r
-    if (ad->argType == ArgTrue) {\r
-      *(Boolean *) ad->argLoc = TRUE;\r
-      continue;\r
-    }\r
-    if (ad->argType == ArgFalse) {\r
-      *(Boolean *) ad->argLoc = FALSE;\r
-      continue;\r
-    }\r
-\r
-    while (ch == ' ' || ch == '=' || ch == ':' || ch == '\t') ch = get(cl);\r
-    if (ch == NULLCHAR || ch == '\n') {\r
-      ExitArgError("No value provided for argument", argName);\r
-    }\r
-    q = argValue;\r
-    if (ch == '{') {\r
-      // Quoting with { }.  No characters have to (or can) be escaped.\r
-      // Thus the string cannot contain a '}' character.\r
-      start = ch;\r
-      ch = get(cl);\r
-      while (start) {\r
-       switch (ch) {\r
-       case NULLCHAR:\r
-         start = NULLCHAR;\r
-         break;\r
-         \r
-       case '}':\r
-         ch = get(cl);\r
-         start = NULLCHAR;\r
-         break;\r
-\r
-       default:\r
-         *q++ = ch;\r
-         ch = get(cl);\r
-         break;\r
-       }\r
-      }          \r
-    } else if (ch == '\'' || ch == '"') {\r
-      // Quoting with ' ' or " ", with \ as escape character.\r
-      // Inconvenient for long strings that may contain Windows filenames.\r
-      start = ch;\r
-      ch = get(cl);\r
-      while (start) {\r
-       switch (ch) {\r
-       case NULLCHAR:\r
-         start = NULLCHAR;\r
-         break;\r
-\r
-       default:\r
-        not_special:\r
-         *q++ = ch;\r
-         ch = get(cl);\r
-         break;\r
-\r
-       case '\'':\r
-       case '\"':\r
-         if (ch == start) {\r
-           ch = get(cl);\r
-           start = NULLCHAR;\r
-           break;\r
-         } else {\r
-           goto not_special;\r
-         }\r
-\r
-       case '\\':\r
-          if (ad->argType == ArgFilename\r
-             || ad->argType == ArgSettingsFilename) {\r
-             goto not_special;\r
-         }\r
-         ch = get(cl);\r
-         switch (ch) {\r
-         case NULLCHAR:\r
-           ExitArgError("Incomplete \\ escape in value for", argName);\r
-           break;\r
-         case 'n':\r
-           *q++ = '\n';\r
-           ch = get(cl);\r
-           break;\r
-         case 'r':\r
-           *q++ = '\r';\r
-           ch = get(cl);\r
-           break;\r
-         case 't':\r
-           *q++ = '\t';\r
-           ch = get(cl);\r
-           break;\r
-         case 'b':\r
-           *q++ = '\b';\r
-           ch = get(cl);\r
-           break;\r
-         case 'f':\r
-           *q++ = '\f';\r
-           ch = get(cl);\r
-           break;\r
-         default:\r
-           octval = 0;\r
-           for (i = 0; i < 3; i++) {\r
-             if (ch >= '0' && ch <= '7') {\r
-               octval = octval*8 + (ch - '0');\r
-               ch = get(cl);\r
-             } else {\r
-               break;\r
-             }\r
-           }\r
-           if (i > 0) {\r
-             *q++ = (char) octval;\r
-           } else {\r
-             *q++ = ch;\r
-             ch = get(cl);\r
-           }\r
-           break;\r
-         }\r
-         break;\r
-       }\r
-      }\r
-    } else {\r
-      while (ch != ' ' && ch != NULLCHAR && ch != '\t' && ch != '\n') {\r
-       *q++ = ch;\r
-       ch = get(cl);\r
-      }\r
-    }\r
-    *q = NULLCHAR;\r
-\r
-    switch (ad->argType) {\r
-    case ArgInt:\r
-      *(int *) ad->argLoc = atoi(argValue);\r
-      break;\r
-\r
-    case ArgX:\r
-      *(int *) ad->argLoc = atoi(argValue) + wpMain.x; // [HGM] placement: translate stored relative to absolute \r
-      break;\r
-\r
-    case ArgY:\r
-      *(int *) ad->argLoc = atoi(argValue) + wpMain.y; // (this is really kludgey, it should be done where used...)\r
-      break;\r
-\r
-    case ArgZ:\r
-      *(int *) ad->argLoc = atoi(argValue);\r
-      EnsureOnScreen(&wpMain.x, &wpMain.y, minX, minY); \r
-      break;\r
-\r
-    case ArgFloat:\r
-      *(float *) ad->argLoc = (float) atof(argValue);\r
-      break;\r
-\r
-    case ArgString:\r
-    case ArgFilename:\r
-      *(char **) ad->argLoc = strdup(argValue);\r
-      break;\r
-\r
-    case ArgSettingsFilename:\r
-      {\r
-       char fullname[MSG_SIZ];\r
-       if (ParseSettingsFile(argValue, fullname)) {\r
-         if (ad->argLoc != NULL) {\r
-           *(char **) ad->argLoc = strdup(fullname);\r
-         }\r
-       } else {\r
-         if (ad->argLoc != NULL) {\r
-         } else {\r
-           ExitArgError("Failed to open indirection file", argValue);\r
-         }\r
-       }\r
-      }\r
-      break;\r
-\r
-    case ArgBoolean:\r
-      switch (argValue[0]) {\r
-      case 't':\r
-      case 'T':\r
-       *(Boolean *) ad->argLoc = TRUE;\r
-       break;\r
-      case 'f':\r
-      case 'F':\r
-       *(Boolean *) ad->argLoc = FALSE;\r
-       break;\r
-      default:\r
-       ExitArgError("Unrecognized boolean argument value", argValue);\r
-       break;\r
-      }\r
-      break;\r
-\r
-    case ArgColor:\r
-      *(COLORREF *)ad->argLoc = ParseColorName(argValue);\r
-      break;\r
-\r
-    case ArgAttribs: {\r
-      ColorClass cc = (ColorClass)ad->argLoc;\r
-      ParseAttribs(&textAttribs[cc].color, &textAttribs[cc].effects, argValue);\r
-      }\r
-      break;\r
-      \r
-    case ArgBoardSize:\r
-      *(BoardSize *)ad->argLoc = ParseBoardSize(argValue);\r
-      break;\r
-\r
-    case ArgFont:\r
-      ParseFontName(argValue, &font[boardSize][(int)ad->argLoc]->mfp);\r
-      break;\r
-\r
-    case ArgCommSettings:\r
-      ParseCommSettings(argValue, &dcb);\r
-      break;\r
-\r
-    case ArgNone:\r
-      ExitArgError("Unrecognized argument", argValue);\r
-      break;\r
-    case ArgTrue:\r
-    case ArgFalse: ;\r
-    }\r
-  }\r
-}\r
-\r
-VOID\r
-LFfromMFP(LOGFONT* lf, MyFontParams *mfp)\r
-{\r
-  HDC hdc = CreateDC("DISPLAY", NULL, NULL, NULL);\r
-  lf->lfHeight = -(int)(mfp->pointSize * GetDeviceCaps(hdc, LOGPIXELSY) / 72.0 + 0.5);\r
-  DeleteDC(hdc);\r
-  lf->lfWidth = 0;\r
-  lf->lfEscapement = 0;\r
-  lf->lfOrientation = 0;\r
-  lf->lfWeight = mfp->bold ? FW_BOLD : FW_NORMAL;\r
-  lf->lfItalic = mfp->italic;\r
-  lf->lfUnderline = mfp->underline;\r
-  lf->lfStrikeOut = mfp->strikeout;\r
-  lf->lfCharSet = mfp->charset;\r
-  lf->lfOutPrecision = OUT_DEFAULT_PRECIS;\r
-  lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;\r
-  lf->lfQuality = DEFAULT_QUALITY;\r
-  lf->lfPitchAndFamily = DEFAULT_PITCH|FF_DONTCARE;\r
-  strcpy(lf->lfFaceName, mfp->faceName);\r
-}\r
-\r
-VOID\r
-CreateFontInMF(MyFont *mf)\r
-{\r
-  LFfromMFP(&mf->lf, &mf->mfp);\r
-  if (mf->hf) DeleteObject(mf->hf);\r
-  mf->hf = CreateFontIndirect(&mf->lf);\r
-}\r
-\r
-VOID\r
-SetDefaultTextAttribs()\r
-{\r
-  ColorClass cc;\r
-  for (cc = (ColorClass)0; cc < NColorClasses; cc++) {\r
-    ParseAttribs(&textAttribs[cc].color, \r
-                &textAttribs[cc].effects, \r
-                defaultTextAttribs[cc]);\r
-  }\r
-}\r
-\r
-VOID\r
-SetDefaultSounds()\r
-{ // [HGM] only sounds for which no option exists\r
-  ColorClass cc;\r
-  for (cc = ColorNormal; cc < NColorClasses; cc++) {\r
-    textAttribs[cc].sound.name = strdup("");\r
-    textAttribs[cc].sound.data = NULL;\r
-  }\r
-}\r
-\r
-VOID\r
+void\r
 LoadAllSounds()\r
 { // [HGM] import name from appData first\r
   ColorClass cc;\r
@@ -1923,6 +1087,10 @@ LoadAllSounds()
     textAttribs[cc].sound.data = NULL;\r
     MyLoadSound(&textAttribs[cc].sound);\r
   }\r
+  for (cc = ColorNormal; cc < NColorClasses; cc++) {\r
+    textAttribs[cc].sound.name = strdup("");\r
+    textAttribs[cc].sound.data = NULL;\r
+  }\r
   for (sc = (SoundClass)0; sc < NSoundClasses; sc++) {\r
     sounds[sc].name = strdup((&appData.soundMove)[sc]);\r
     sounds[sc].data = NULL;\r
@@ -1931,77 +1099,9 @@ LoadAllSounds()
 }\r
 \r
 void\r
-SetDefaultsFromList()\r
-{ // [HGM] ini: take defaults from argDescriptor list\r
-  int i;\r
-\r
-  for(i=0; argDescriptors[i].argName != NULL; i++) {\r
-    if(argDescriptors[i].defaultValue != INVALID)\r
-      switch(argDescriptors[i].argType) {\r
-        case ArgBoolean:\r
-        case ArgTrue:\r
-        case ArgFalse:\r
-          *(Boolean *) argDescriptors[i].argLoc = (int)argDescriptors[i].defaultValue;\r
-          break;\r
-        case ArgInt:\r
-        case ArgX:\r
-        case ArgY:\r
-        case ArgZ:\r
-          *(int *) argDescriptors[i].argLoc = (int)argDescriptors[i].defaultValue;\r
-          break;\r
-        case ArgString:\r
-        case ArgFilename:\r
-        case ArgSettingsFilename:\r
-          *(char **) argDescriptors[i].argLoc = (char *)argDescriptors[i].defaultValue;\r
-          break;\r
-        case ArgBoardSize:\r
-          *(BoardSize *) argDescriptors[i].argLoc = (BoardSize)argDescriptors[i].defaultValue;\r
-          break;\r
-        case ArgFloat: // floats cannot be casted to int without precision loss\r
-        default: ; // some arg types cannot be initialized through table\r
-    }\r
-  }\r
-}\r
-\r
-VOID\r
-InitAppData(LPSTR lpCmdLine)\r
+SetCommPortDefaults()\r
 {\r
-  int i, j;\r
-  char buf[ARG_MAX], currDir[MSG_SIZ];\r
-  char *dummy, *p;\r
-\r
-  programName = szAppName;\r
-\r
-  /* Initialize to defaults */\r
-  SetDefaultsFromList(); // this sets most defaults\r
-\r
-  // some parameters for which there are no options!\r
-  appData.Iconic = FALSE; /*unused*/\r
-  appData.cmailGameName = "";\r
-  appData.icsEngineAnalyze = FALSE;\r
-\r
-  // float: casting to int is not harmless, so default cannot be contained in table\r
-  appData.timeDelay = TIME_DELAY;\r
-\r
-  // colors have platform-dependent option format and internal representation\r
-  // their setting and parsing must remain in front-end\r
-  lightSquareColor = ParseColorName(LIGHT_SQUARE_COLOR);\r
-  darkSquareColor = ParseColorName(DARK_SQUARE_COLOR);\r
-  whitePieceColor = ParseColorName(WHITE_PIECE_COLOR);\r
-  blackPieceColor = ParseColorName(BLACK_PIECE_COLOR);\r
-  highlightSquareColor = ParseColorName(HIGHLIGHT_SQUARE_COLOR);\r
-  premoveHighlightColor = ParseColorName(PREMOVE_HIGHLIGHT_COLOR);\r
-  consoleBackgroundColor = ParseColorName(COLOR_BKGD);\r
-  // the following must be moved out of appData to front-end variables\r
-  appData.evalHistColorWhite = ParseColorName( "#FFFFB0" );\r
-  appData.evalHistColorBlack = ParseColorName( "#AD5D3D" );\r
-  appData.highlightArrowColor = ParseColorName( "#FFFF80" );\r
-\r
-  // some complex, platform-dependent stuff\r
-  SetDefaultTextAttribs();\r
-  SetDefaultSounds();\r
-\r
-  memset(&dcb, 0, sizeof(DCB)); // required by VS 2002 +\r
+   memset(&dcb, 0, sizeof(DCB)); // required by VS 2002 +\r
   dcb.DCBlength = sizeof(DCB);\r
   dcb.BaudRate = 9600;\r
   dcb.fBinary = TRUE;\r
@@ -2019,134 +1119,6 @@ InitAppData(LPSTR lpCmdLine)
   dcb.ByteSize = 7;\r
   dcb.Parity = SPACEPARITY;\r
   dcb.StopBits = ONESTOPBIT;\r
-\r
-  /* Point font array elements to structures and\r
-     parse default font names */\r
-  for (i=0; i<NUM_FONTS; i++) {\r
-    for (j=0; j<NUM_SIZES; j++) {\r
-      font[j][i] = &fontRec[j][i];\r
-      ParseFontName(font[j][i]->def, &font[j][i]->mfp);\r
-    }\r
-  }\r
-  \r
-  /* Parse default settings file if any */\r
-  if (ParseSettingsFile(settingsFileName, buf)) {\r
-    settingsFileName = strdup(buf);\r
-  }\r
-\r
-  /* Parse command line */\r
-  ParseArgs(StringGet, &lpCmdLine);\r
-\r
-  /* [HGM] make sure board size is acceptable */\r
-  if(appData.NrFiles > BOARD_FILES ||\r
-     appData.NrRanks > BOARD_RANKS   )\r
-      DisplayFatalError("Recompile with BOARD_RANKS or BOARD_FILES, to support this size", 0, 2);\r
-\r
-  /* [HGM] After parsing the options from the .ini file, and overruling them\r
-   * with options from the command line, we now make an even higher priority\r
-   * overrule by WB options attached to the engine command line. This so that\r
-   * tournament managers can use WB options (such as /timeOdds) that follow\r
-   * the engines.\r
-   */\r
-  if(appData.firstChessProgram != NULL) {\r
-      char *p = StrStr(appData.firstChessProgram, "WBopt");\r
-      static char *f = "first";\r
-      char buf[MSG_SIZ], *q = buf;\r
-      if(p != NULL) { // engine command line contains WinBoard options\r
-          sprintf(buf, p+6, f, f, f, f, f, f, f, f, f, f); // replace %s in them by "first"\r
-          ParseArgs(StringGet, &q);\r
-          p[-1] = 0; // cut them offengine command line\r
-      }\r
-  }\r
-  // now do same for second chess program\r
-  if(appData.secondChessProgram != NULL) {\r
-      char *p = StrStr(appData.secondChessProgram, "WBopt");\r
-      static char *s = "second";\r
-      char buf[MSG_SIZ], *q = buf;\r
-      if(p != NULL) { // engine command line contains WinBoard options\r
-          sprintf(buf, p+6, s, s, s, s, s, s, s, s, s, s); // replace %s in them by "first"\r
-          ParseArgs(StringGet, &q);\r
-          p[-1] = 0; // cut them offengine command line\r
-      }\r
-  }\r
-\r
-\r
-  /* Propagate options that affect others */\r
-  if (appData.matchMode || appData.matchGames) chessProgram = TRUE;\r
-  if (appData.icsActive || appData.noChessProgram) {\r
-     chessProgram = FALSE;  /* not local chess program mode */\r
-  }\r
-\r
-  /* Open startup dialog if needed */\r
-  if ((!appData.noChessProgram && !chessProgram && !appData.icsActive) ||\r
-      (appData.icsActive && *appData.icsHost == NULLCHAR) ||\r
-      (chessProgram && (*appData.firstChessProgram == NULLCHAR ||\r
-                        *appData.secondChessProgram == NULLCHAR))) {\r
-    FARPROC lpProc;\r
-    \r
-    lpProc = MakeProcInstance((FARPROC)StartupDialog, hInst);\r
-    DialogBox(hInst, MAKEINTRESOURCE(DLG_Startup), NULL, (DLGPROC)lpProc);\r
-    FreeProcInstance(lpProc);\r
-  }\r
-\r
-  /* Make sure save files land in the right (?) directory */\r
-  if (GetFullPathName(appData.saveGameFile, MSG_SIZ, buf, &dummy)) {\r
-    appData.saveGameFile = strdup(buf);\r
-  }\r
-  if (GetFullPathName(appData.savePositionFile, MSG_SIZ, buf, &dummy)) {\r
-    appData.savePositionFile = strdup(buf);\r
-  }\r
-\r
-  /* Finish initialization for fonts and sounds */\r
-  for (i=0; i<NUM_FONTS; i++) {\r
-    for (j=0; j<NUM_SIZES; j++) {\r
-      CreateFontInMF(font[j][i]);\r
-    }\r
-  }\r
-  /* xboard, and older WinBoards, controlled the move sound with the\r
-     appData.ringBellAfterMoves option.  In the current WinBoard, we\r
-     always turn the option on (so that the backend will call us),\r
-     then let the user turn the sound off by setting it to silence if\r
-     desired.  To accommodate old winboard.ini files saved by old\r
-     versions of WinBoard, we also turn off the sound if the option\r
-     was initially set to false. */\r
-  if (!appData.ringBellAfterMoves) {\r
-    sounds[(int)SoundMove].name = strdup("");\r
-    appData.ringBellAfterMoves = TRUE;\r
-  }\r
-  GetCurrentDirectory(MSG_SIZ, currDir);\r
-  SetCurrentDirectory(installDir);\r
-  LoadAllSounds();\r
-  SetCurrentDirectory(currDir);\r
-\r
-  p = icsTextMenuString;\r
-  if (p[0] == '@') {\r
-    FILE* f = fopen(p + 1, "r");\r
-    if (f == NULL) {\r
-      DisplayFatalError(p + 1, errno, 2);\r
-      return;\r
-    }\r
-    i = fread(buf, 1, sizeof(buf)-1, f);\r
-    fclose(f);\r
-    buf[i] = NULLCHAR;\r
-    p = buf;\r
-  }\r
-  ParseIcsTextMenu(strdup(p));\r
-}\r
-\r
-\r
-VOID\r
-InitMenuChecks()\r
-{\r
-  HMENU hmenu = GetMenu(hwndMain);\r
-\r
-  (void) EnableMenuItem(hmenu, IDM_CommPort,\r
-                       MF_BYCOMMAND|((appData.icsActive &&\r
-                                      *appData.icsCommPort != NULLCHAR) ?\r
-                                     MF_ENABLED : MF_GRAYED));\r
-  (void) CheckMenuItem(hmenu, IDM_SaveSettingsOnExit,\r
-                      MF_BYCOMMAND|(saveSettingsOnExit ?\r
-                                    MF_CHECKED : MF_UNCHECKED));\r
 }\r
 \r
 // [HGM] args: these three cases taken out to stay in front-end\r
@@ -2170,7 +1142,7 @@ SaveFontArg(FILE *f, ArgDescriptor *ad)
        }\r
       }\r
 \r
-VOID\r
+void\r
 ExportSounds()\r
 { // [HGM] copy the names from the internal WB variables to appData\r
   ColorClass cc;\r
@@ -2197,144 +1169,71 @@ SaveAttribsArg(FILE *f, ArgDescriptor *ad)
 void\r
 SaveColor(FILE *f, ArgDescriptor *ad)\r
 {      // in WinBoard the color is an int and has to be converted to text. In X it would be a string already?\r
-       COLORREF color = *(COLORREF *)ad->argLoc;\r
+       COLORREF color = *(COLORREF *)colorVariable[(int)ad->argLoc];\r
        fprintf(f, "/%s=#%02lx%02lx%02lx\n", ad->argName, \r
          color&0xff, (color>>8)&0xff, (color>>16)&0xff);\r
 }\r
 \r
-int\r
-MainWindowUp()\r
-{ // [HGM] args: allows testing if main window is realized from back-end\r
-  return hwndMain != NULL;\r
+void\r
+SaveBoardSize(FILE *f, char *name, void *addr)\r
+{ // wrapper to shield back-end from BoardSize & sizeInfo\r
+  fprintf(f, "/%s=%s\n", name, sizeInfo[*(BoardSize *)addr].name);\r
 }\r
 \r
-VOID\r
-SaveSettings(char* name)\r
-{\r
-  FILE *f;\r
-  ArgDescriptor *ad;\r
-  char dir[MSG_SIZ];\r
-\r
-  if (!MainWindowUp()) return;\r
-\r
-  GetCurrentDirectory(MSG_SIZ, dir);\r
-  SetCurrentDirectory(installDir);\r
-  f = fopen(name, "w");\r
-  SetCurrentDirectory(dir);\r
-  if (f == NULL) {\r
-    DisplayError(name, errno);\r
-    return;\r
-  }\r
-  fprintf(f, ";\n");\r
-  fprintf(f, "; %s Save Settings file\n", PACKAGE_STRING);\r
-  fprintf(f, ";\n");\r
-  fprintf(f, "; You can edit the values of options that are already set in this file,\n");\r
-  fprintf(f, "; but if you add other options, the next Save Settings will not save them.\n");\r
-  fprintf(f, "; Use a shortcut, an @indirection file, or a .bat file instead.\n");\r
-  fprintf(f, ";\n");\r
+void\r
+ParseCommPortSettings(char *s)\r
+{ // wrapper to keep dcb from back-end\r
+  ParseCommSettings(s, &dcb);\r
+}\r
 \r
+void\r
+GetWindowCoords()\r
+{ // wrapper to shield use of window handles from back-end (make addressible by number?)\r
   GetActualPlacement(hwndMain, &wpMain);\r
   GetActualPlacement(hwndConsole, &wpConsole);\r
   GetActualPlacement(commentDialog, &wpComment);\r
   GetActualPlacement(editTagsDialog, &wpTags);\r
   GetActualPlacement(gameListDialog, &wpGameList);\r
-\r
-  /* [AS] Move history */\r
-  wpMoveHistory.visible = MoveHistoryIsUp();\r
   GetActualPlacement(moveHistoryDialog, &wpMoveHistory);\r
-\r
-  /* [AS] Eval graph */\r
-  wpEvalGraph.visible = EvalGraphIsUp();\r
   GetActualPlacement(evalGraphDialog, &wpEvalGraph);\r
-\r
-  /* [AS] Engine output */\r
-  wpEngineOutput.visible = EngineOutputIsUp();\r
   GetActualPlacement(engineOutputDialog, &wpEngineOutput);\r
+}\r
 \r
-  // [HGM] in WB we have to copy sound names to appData first\r
-  ExportSounds();\r
+void\r
+PrintCommPortSettings(FILE *f, char *name)\r
+{ // wrapper to shield back-end from DCB\r
+      PrintCommSettings(f, name, &dcb);\r
+}\r
 \r
-  for (ad = argDescriptors; ad->argName != NULL; ad++) {\r
-    if (!ad->save) continue;\r
-    switch (ad->argType) {\r
-    case ArgString:\r
-      {\r
-       char *p = *(char **)ad->argLoc;\r
-       if ((strchr(p, '\\') || strchr(p, '\n')) && !strchr(p, '}')) {\r
-         /* Quote multiline values or \-containing values\r
-            with { } if possible */\r
-         fprintf(f, "/%s={%s}\n", ad->argName, p);\r
-       } else {\r
-         /* Else quote with " " */\r
-         fprintf(f, "/%s=\"", ad->argName);\r
-         while (*p) {\r
-           if (*p == '\n') fprintf(f, "\n");\r
-           else if (*p == '\r') fprintf(f, "\\r");\r
-           else if (*p == '\t') fprintf(f, "\\t");\r
-           else if (*p == '\b') fprintf(f, "\\b");\r
-           else if (*p == '\f') fprintf(f, "\\f");\r
-           else if (*p < ' ') fprintf(f, "\\%03o", *p);\r
-           else if (*p == '\"') fprintf(f, "\\\"");\r
-           else if (*p == '\\') fprintf(f, "\\\\");\r
-           else putc(*p, f);\r
-           p++;\r
-         }\r
-         fprintf(f, "\"\n");\r
-       }\r
-      }\r
-      break;\r
-    case ArgInt:\r
-    case ArgZ:\r
-      fprintf(f, "/%s=%d\n", ad->argName, *(int *)ad->argLoc);\r
-      break;\r
-    case ArgX:\r
-      fprintf(f, "/%s=%d\n", ad->argName, *(int *)ad->argLoc - wpMain.x); // [HGM] placement: stor relative value\r
-      break;\r
-    case ArgY:\r
-      fprintf(f, "/%s=%d\n", ad->argName, *(int *)ad->argLoc - wpMain.y);\r
-      break;\r
-    case ArgFloat:\r
-      fprintf(f, "/%s=%g\n", ad->argName, *(float *)ad->argLoc);\r
-      break;\r
-    case ArgBoolean:\r
-      fprintf(f, "/%s=%s\n", ad->argName, \r
-       (*(Boolean *)ad->argLoc) ? "true" : "false");\r
-      break;\r
-    case ArgTrue:\r
-      if (*(Boolean *)ad->argLoc) fprintf(f, "/%s\n", ad->argName);\r
-      break;\r
-    case ArgFalse:\r
-      if (!*(Boolean *)ad->argLoc) fprintf(f, "/%s\n", ad->argName);\r
-      break;\r
-    case ArgColor:\r
-      SaveColor(f, ad);\r
-      break;\r
-    case ArgAttribs:\r
-      break;\r
-    case ArgFilename:\r
-      if (strchr(*(char **)ad->argLoc, '\"')) {\r
-       fprintf(f, "/%s='%s'\n", ad->argName, *(char **)ad->argLoc);\r
-      } else {\r
-       fprintf(f, "/%s=\"%s\"\n", ad->argName, *(char **)ad->argLoc);\r
-      }\r
-      break;\r
-    case ArgBoardSize:\r
-      fprintf(f, "/%s=%s\n", ad->argName,\r
-             sizeInfo[*(BoardSize *)ad->argLoc].name);\r
-      break;\r
-    case ArgFont:\r
-      SaveFontArg(f, ad);\r
-      break;\r
-    case ArgCommSettings:\r
-      PrintCommSettings(f, ad->argName, (DCB *)ad->argLoc);\r
-    case ArgNone:\r
-    case ArgSettingsFilename: ;\r
-    }\r
-  }\r
-  fclose(f);\r
+int\r
+MySearchPath(char *installDir, char *name, char *fullname)\r
+{\r
+  char *dummy;\r
+  return (int) SearchPath(installDir, name, NULL, MSG_SIZ, fullname, &dummy);\r
+}\r
+\r
+int\r
+MyGetFullPathName(char *name, char *fullname)\r
+{\r
+  char *dummy;\r
+  return (int) GetFullPathName(name, MSG_SIZ, fullname, &dummy);\r
 }\r
 \r
+int\r
+MainWindowUp()\r
+{ // [HGM] args: allows testing if main window is realized from back-end\r
+  return hwndMain != NULL;\r
+}\r
 \r
+void\r
+PopUpStartupDialog()\r
+{\r
+    FARPROC lpProc;\r
+    \r
+    lpProc = MakeProcInstance((FARPROC)StartupDialog, hInst);\r
+    DialogBox(hInst, MAKEINTRESOURCE(DLG_Startup), NULL, (DLGPROC)lpProc);\r
+    FreeProcInstance(lpProc);\r
+}\r
 \r
 /*---------------------------------------------------------------------------*\\r
  *\r
@@ -6581,7 +5480,7 @@ InitComboStrings(HANDLE hwndCombo, char **cd)
 void\r
 InitComboStringsFromOption(HANDLE hwndCombo, char *str)\r
 {\r
-  char buf1[ARG_MAX];\r
+  char buf1[MAX_ARG_LEN];\r
   int len;\r
 \r
   if (str[0] == '@') {\r
@@ -7328,76 +6227,7 @@ NextInHistory()
 {\r
   if (histP == histIn) return NULL;\r
   histP = (histP + 1) % HISTORY_SIZE;\r
-  return history[histP];\r
-}\r
-\r
-typedef struct {\r
-  char *item;\r
-  char *command;\r
-  BOOLEAN getname;\r
-  BOOLEAN immediate;\r
-} IcsTextMenuEntry;\r
-#define ICS_TEXT_MENU_SIZE (IDM_CommandXLast - IDM_CommandX + 1)\r
-IcsTextMenuEntry icsTextMenuEntry[ICS_TEXT_MENU_SIZE];\r
-\r
-void\r
-ParseIcsTextMenu(char *icsTextMenuString)\r
-{\r
-//  int flags = 0;\r
-  IcsTextMenuEntry *e = icsTextMenuEntry;\r
-  char *p = icsTextMenuString;\r
-  while (e->item != NULL && e < icsTextMenuEntry + ICS_TEXT_MENU_SIZE) {\r
-    free(e->item);\r
-    e->item = NULL;\r
-    if (e->command != NULL) {\r
-      free(e->command);\r
-      e->command = NULL;\r
-    }\r
-    e++;\r
-  }\r
-  e = icsTextMenuEntry;\r
-  while (*p && e < icsTextMenuEntry + ICS_TEXT_MENU_SIZE) {\r
-    if (*p == ';' || *p == '\n') {\r
-      e->item = strdup("-");\r
-      e->command = NULL;\r
-      p++;\r
-    } else if (*p == '-') {\r
-      e->item = strdup("-");\r
-      e->command = NULL;\r
-      p++;\r
-      if (*p) p++;\r
-    } else {\r
-      char *q, *r, *s, *t;\r
-      char c;\r
-      q = strchr(p, ',');\r
-      if (q == NULL) break;\r
-      *q = NULLCHAR;\r
-      r = strchr(q + 1, ',');\r
-      if (r == NULL) break;\r
-      *r = NULLCHAR;\r
-      s = strchr(r + 1, ',');\r
-      if (s == NULL) break;\r
-      *s = NULLCHAR;\r
-      c = ';';\r
-      t = strchr(s + 1, c);\r
-      if (t == NULL) {\r
-       c = '\n';\r
-       t = strchr(s + 1, c);\r
-      }\r
-      if (t != NULL) *t = NULLCHAR;\r
-      e->item = strdup(p);\r
-      e->command = strdup(q + 1);\r
-      e->getname = *(r + 1) != '0';\r
-      e->immediate = *(s + 1) != '0';\r
-      *q = ',';\r
-      *r = ',';\r
-      *s = ',';\r
-      if (t == NULL) break;\r
-      *t = c;\r
-      p = t + 1;\r
-    }\r
-    e++;\r
-  } \r
+  return history[histP];   \r
 }\r
 \r
 HMENU\r
index 3dcb79d..cc1dd9e 100755 (executable)
@@ -45,7 +45,7 @@ RSC=rc.exe
 # PROP Ignore_Export_Lib 0\r
 # PROP Target_Dir ""\r
 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c\r
-# ADD CPP /nologo /MD /W3 /GX /Og /Os /Oy /Gf /I "." /I ".." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D _WIN32_IE=0x300 /D WINVER=0x400 /D _WIN32_WINDOWS=0x500 /YX /Zl /FD /Gs /GA /c\r
+# ADD CPP /nologo /MD /W3 /GX /Og /Os /Oy /Gf /I "." /I ".." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D _WIN32_IE=0x300 /D WINVER=0x400 /D _WIN32_WINDOWS=0x500 /D "YY_NO_UNISTD_H" /YX /Zl /FD /Gs /GA /c\r
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
 # ADD BASE RSC /l 0x409 /d "NDEBUG"\r
@@ -71,7 +71,7 @@ LINK32=link.exe
 # PROP Ignore_Export_Lib 0\r
 # PROP Target_Dir ""\r
 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c\r
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I ".." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D _WIN32_IE=0x300 /D WINVER=0x400 /D _WIN32_WINDOWS=0x500 /YX /FD /GZ /c\r
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I ".." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D _WIN32_IE=0x300 /D WINVER=0x400 /D _WIN32_WINDOWS=0x500 /D "YY_NO_UNISTD_H" /YX /FD /GZ /c\r
 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
 # ADD BASE RSC /l 0x409 /d "_DEBUG"\r
@@ -98,7 +98,7 @@ LINK32=link.exe
 # PROP Ignore_Export_Lib 0\r
 # PROP Target_Dir ""\r
 # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I ".." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D _WIN32_IE=0x300 /D WINVER=0x400 /D _WIN32_WINDOWS=0x500 /YX /FD /GZ /c\r
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I ".." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D _WIN32_IE=0x300 /D WINVER=0x400 /D _WIN32_WINDOWS=0x500 /D "JAWS" /YX /FD /GZ /c\r
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I ".." /D "_DEBUG" /D "JAWS" /D "WIN32" /D "_WINDOWS" /D _WIN32_IE=0x300 /D WINVER=0x400 /D _WIN32_WINDOWS=0x500 /D "YY_NO_UNISTD_H" /YX /FD /GZ /c\r
 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
 # ADD BASE RSC /l 0x409 /i ".." /d "_DEBUG"\r
@@ -125,7 +125,7 @@ LINK32=link.exe
 # PROP Ignore_Export_Lib 0\r
 # PROP Target_Dir ""\r
 # ADD BASE CPP /nologo /MD /W3 /GX /Og /Os /Oy /Gf /I "." /I ".." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D _WIN32_IE=0x300 /D WINVER=0x400 /D _WIN32_WINDOWS=0x500 /YX /Zl /FD /Gs /GA /c\r
-# ADD CPP /nologo /MD /W3 /GX /Og /Os /Oy /Gf /I "." /I ".." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D _WIN32_IE=0x300 /D WINVER=0x400 /D _WIN32_WINDOWS=0x500 /D "JAWS" /YX /Zl /FD /Gs /GA /c\r
+# ADD CPP /nologo /MD /W3 /GX /Og /Os /Oy /Gf /I "." /I ".." /D "NDEBUG" /D "JAWS" /D "WIN32" /D "_WINDOWS" /D _WIN32_IE=0x300 /D WINVER=0x400 /D _WIN32_WINDOWS=0x500 /D "YY_NO_UNISTD_H" /YX /Zl /FD /Gs /GA /c\r
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
 # ADD BASE RSC /l 0x409 /i ".." /d "NDEBUG"\r
@@ -158,6 +158,14 @@ SOURCE=..\book.c
 # End Source File\r
 # Begin Source File\r
 \r
+SOURCE=..\engineoutput.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\evalgraph.c\r
+# End Source File\r
+# Begin Source File\r
+\r
 SOURCE=..\gamelist.c\r
 # End Source File\r
 # Begin Source File\r
@@ -198,7 +206,7 @@ SOURCE=.\wedittags.c
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=.\wengineo.c\r
+SOURCE=.\wengineoutput.c\r
 # End Source File\r
 # Begin Source File\r
 \r
index 443f728..163fb63 100644 (file)
@@ -121,8 +121,6 @@ VOID ChangeBoardSize(BoardSize newSize);
 BOOL APIENTRY MyCreateFont(HWND hwnd, MyFont *font);\r
 VOID ErrorPopDown(VOID);\r
 VOID EnsureOnScreen(int *x, int *y, int minX, int minY);\r
-typedef char GetFunc(void *getClosure);\r
-VOID ParseArgs(GetFunc get, void *cl);\r
 HBITMAP \r
 DoLoadBitmap(HINSTANCE hinst, char *piece, int squareSize, char *suffix);\r
 COLORREF ParseColorName(char *name);\r
@@ -134,6 +132,7 @@ void InitComboStrings(HANDLE hwndCombo, char **cd);
 BOOLEAN MyLoadSound(MySound *ms);\r
 BOOLEAN MyPlaySound(MySound *ms);\r
 VOID ExitArgError(char *msg, char *badArg);\r
+void SaveSettings(char* name);\r
 \r
 /* Constants */\r
 \r
@@ -183,18 +182,9 @@ extern BoardSize boardSize;
 \r
 typedef enum {\r
   W_Main, W_Console, W_Comment, W_Tags, W_GameList, \r
-  W_MoveHist, W_EngineOut, W_GameList, NUM_WINDOWS\r
+  W_MoveHist, W_EngineOut, NUM_WINDOWS\r
 } WindowID;\r
 \r
-/* [AS] Layout management */\r
-typedef struct {\r
-    Boolean visible;\r
-    int x;\r
-    int y;\r
-    int width;\r
-    int height;\r
-} WindowPlacement;\r
-\r
 extern WindowPlacement placementTab[NUM_WINDOWS];\r
 extern HWND hwndTab[NUM_WINDOWS]; // this remains pure front-end.\r
 \r
@@ -204,22 +194,14 @@ VOID ReattachAfterMove( LPRECT lprcOldPos, int new_x, int new_y, HWND hWndChild,
 VOID ReattachAfterSize( LPRECT lprcOldPos, int new_w, int new_h, HWND hWndChild, WindowPlacement * pwpChild );\r
 BOOL GetActualPlacement( HWND hWnd, WindowPlacement * wp );\r
 \r
-extern WindowPlacement wpEngineOutput;\r
-extern WindowPlacement wpEvalGraph;\r
-extern WindowPlacement wpMoveHistory;\r
-extern WindowPlacement wpGameList;\r
-extern WindowPlacement wpTags;\r
-\r
 VOID MoveHistoryPopUp();\r
 VOID MoveHistoryPopDown();\r
 VOID MoveHistorySet( char movelist[][2*MOVE_LEN], int first, int last, int current, ChessProgramStats_Move * pvInfo );\r
-BOOL MoveHistoryIsUp();\r
 extern HWND moveHistoryDialog;\r
 \r
 VOID EvalGraphSet( int first, int last, int current, ChessProgramStats_Move * pvInfo );\r
 VOID EvalGraphPopUp();\r
 VOID EvalGraphPopDown();\r
-Boolean EvalGraphIsUp();\r
 extern HWND evalGraphDialog;\r
 \r
 extern HWND engineOutputDialog;\r
old mode 100755 (executable)
new mode 100644 (file)
index dfc1bfb..09739e5
@@ -2793,8 +2793,8 @@ LRESULT CALLBACK EnginePlayOptionsDialog(HWND hDlg, UINT message, WPARAM wParam,
       appData.ruleMoves = GetDlgItemInt(hDlg, IDC_RuleMoves, NULL, FALSE );\r
       appData.drawRepeats = (int) GetDlgItemInt(hDlg, IDC_DrawRepeats, NULL, FALSE );\r
 \r
-      appData.firstScoreIsAbsolute  = IS_CHECKED(IDC_ScoreAbs1);\r
-      appData.secondScoreIsAbsolute = IS_CHECKED(IDC_ScoreAbs2);\r
+      first.scoreIsAbsolute  = appData.firstScoreIsAbsolute  = IS_CHECKED(IDC_ScoreAbs1);\r
+      second.scoreIsAbsolute = appData.secondScoreIsAbsolute = IS_CHECKED(IDC_ScoreAbs2);\r
 \r
       EndDialog(hDlg, TRUE);\r
       return TRUE;\r
index a3fda95..e0129a4 100644 (file)
--- a/xboard.c
+++ b/xboard.c
@@ -206,7 +206,9 @@ extern char *getenv();
 // must be moved to xengineoutput.h
 
 void EngineOutputProc P((Widget w, XEvent *event,
- String *prms, Cardinal *nprms));
+                        String *prms, Cardinal *nprms));
+void EvalGraphProc P((Widget w, XEvent *event,
+                     String *prms, Cardinal *nprms));
 
 
 #ifdef __EMX__
@@ -292,6 +294,8 @@ void EditCommentProc P((Widget w, XEvent *event,
 void IcsInputBoxProc P((Widget w, XEvent *event,
                        String *prms, Cardinal *nprms));
 void EnterKeyProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms));
+void SaveSettingsProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms));
+void SaveOnExitProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms));
 void AboutGameProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms));
 void DebugProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms));
 void NothingProc P((Widget w, XEvent *event, String *prms, Cardinal *nprms));
@@ -350,6 +354,7 @@ Widget shellWidget, layoutWidget, formWidget, boardWidget, messageWidget,
   menuBarWidget,  editShell, errorShell, analysisShell,
   ICSInputShell, fileNameShell, askQuestionShell;
 
+Widget historyShell, evalGraphShell, gameListShell;
 //XSegment gridSegments[BOARD_RANKS + BOARD_FILES + 2];
 //XSegment jailGridSegments[BOARD_RANKS + BOARD_FILES + 6];
 
@@ -365,7 +370,11 @@ char installDir[] = "."; // [HGM] UCI: needed for UCI; probably needs run-time i
 
 Position commentX = -1, commentY = -1;
 Dimension commentW, commentH;
+typedef unsigned int BoardSize;
+BoardSize boardSize;
+Boolean chessProgram;
 
+int  minX, minY; // [HGM] placement: volatile limits on upper-left corner
 int squareSize, smallLayout = 0, tinyLayout = 0,
   marginW, marginH, // [HGM] for run-time resizing
   fromX = -1, fromY = -1, toX, toY, commentUp = False, analysisUp = False,
@@ -376,6 +385,22 @@ Pixel timerForegroundPixel, timerBackgroundPixel;
 Pixel buttonForegroundPixel, buttonBackgroundPixel;
 char *chessDir, *programName, *programVersion,
   *gameCopyFilename, *gamePasteFilename;
+Boolean alwaysOnTop = False;
+Boolean saveSettingsOnExit;
+char *settingsFileName;
+char *icsTextMenuString;
+char *icsNames;
+char *firstChessProgramNames;
+char *secondChessProgramNames;
+
+WindowPlacement wpMain;
+WindowPlacement wpConsole;
+WindowPlacement wpComment;
+WindowPlacement wpMoveHistory;
+WindowPlacement wpEvalGraph;
+WindowPlacement wpEngineOutput;
+WindowPlacement wpGameList;
+WindowPlacement wpTags;
 
 #define SOLID 0
 #define OUTLINE 1
@@ -614,7 +639,7 @@ MenuItem modeMenu[] = {
   //    {N_("Training"), TrainingProc},
     //    {"----", NothingProc},
     {N_("Show Engine Output"), EngineOutputProc},
-    {N_("Show Evaluation Graph"), NothingProc}, // [HGM] evalgr: not functional yet
+    {N_("Show Evaluation Graph"), EvalGraphProc},
     {N_("Show Game List"), ShowGameListProc},
     //    {"Show Move History", HistoryShowProc}, // [HGM] hist: activate 4.2.7 code
     //    {"----", NothingProc},
@@ -660,6 +685,10 @@ MenuItem optionsMenu[] = {
     //    {N_("Quiet Play"), QuietPlayProc},
     //    {N_("Hide Thinking"), HideThinkingProc},
     //    {N_("Test Legality"), TestLegalityProc},
+    //    {N_("Show Coords"), ShowCoordsProc},
+    {"----", NothingProc},
+    {N_("Save Settings Now"), SaveSettingsProc},
+    {N_("Save Settings on Exit"), SaveOnExitProc},
     {NULL, NULL}
 };
 
@@ -733,1016 +762,15 @@ Arg boardArgs[] = {
 };
 
 XtResource clientResources[] = {
-    { "whitePieceColor", "whitePieceColor", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, whitePieceColor), XtRString,
-       WHITE_PIECE_COLOR },
-    { "blackPieceColor", "blackPieceColor", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, blackPieceColor), XtRString,
-       BLACK_PIECE_COLOR },
-    { "lightSquareColor", "lightSquareColor", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, lightSquareColor),
-       XtRString, LIGHT_SQUARE_COLOR },
-    { "darkSquareColor", "darkSquareColor", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, darkSquareColor), XtRString,
-       DARK_SQUARE_COLOR },
-    { "highlightSquareColor", "highlightSquareColor", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, highlightSquareColor),
-       XtRString, HIGHLIGHT_SQUARE_COLOR },
-    { "premoveHighlightColor", "premoveHighlightColor", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, premoveHighlightColor),
-       XtRString, PREMOVE_HIGHLIGHT_COLOR },
-    { "movesPerSession", "movesPerSession", XtRInt, sizeof(int),
-       XtOffset(AppDataPtr, movesPerSession), XtRImmediate,
-       (XtPointer) MOVES_PER_SESSION },
-    { "timeIncrement", "timeIncrement", XtRInt, sizeof(int),
-       XtOffset(AppDataPtr, timeIncrement), XtRImmediate,
-       (XtPointer) TIME_INCREMENT },
-    { "initString", "initString", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, initString), XtRString, INIT_STRING },
-    { "secondInitString", "secondInitString", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, secondInitString), XtRString, INIT_STRING },
-    { "firstComputerString", "firstComputerString", XtRString,
-        sizeof(String),        XtOffset(AppDataPtr, firstComputerString), XtRString,
-      COMPUTER_STRING },
-    { "secondComputerString", "secondComputerString", XtRString,
-        sizeof(String),        XtOffset(AppDataPtr, secondComputerString), XtRString,
-      COMPUTER_STRING },
-    { "firstChessProgram", "firstChessProgram", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, firstChessProgram),
-       XtRString, FIRST_CHESS_PROGRAM },
-    { "secondChessProgram", "secondChessProgram", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, secondChessProgram),
-       XtRString, SECOND_CHESS_PROGRAM },
-    { "firstPlaysBlack", "firstPlaysBlack", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, firstPlaysBlack),
-       XtRImmediate, (XtPointer) False },
-    { "noChessProgram", "noChessProgram", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, noChessProgram),
-       XtRImmediate, (XtPointer) False },
-    { "firstHost", "firstHost", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, firstHost), XtRString, FIRST_HOST },
-    { "secondHost", "secondHost", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, secondHost), XtRString, SECOND_HOST },
-    { "firstDirectory", "firstDirectory", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, firstDirectory), XtRString, "." },
-    { "secondDirectory", "secondDirectory", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, secondDirectory), XtRString, "." },
-    { "bitmapDirectory", "bitmapDirectory", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, bitmapDirectory),
-       XtRString, "" },
-    { "remoteShell", "remoteShell", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, remoteShell), XtRString, REMOTE_SHELL },
-    { "remoteUser", "remoteUser", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, remoteUser), XtRString, "" },
-    { "timeDelay", "timeDelay", XtRFloat, sizeof(float),
-       XtOffset(AppDataPtr, timeDelay), XtRString,
-       (XtPointer) TIME_DELAY_QUOTE },
-    { "timeControl", "timeControl", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, timeControl), XtRString,
-       (XtPointer) TIME_CONTROL },
-    { "internetChessServerMode", "internetChessServerMode",
-       XtRBoolean, sizeof(Boolean),
-       XtOffset(AppDataPtr, icsActive), XtRImmediate,
-       (XtPointer) False },
-    { "internetChessServerHost", "internetChessServerHost",
-       XtRString, sizeof(String),
-       XtOffset(AppDataPtr, icsHost),
-       XtRString, (XtPointer) ICS_HOST },
-    { "internetChessServerPort", "internetChessServerPort",
-       XtRString, sizeof(String),
-       XtOffset(AppDataPtr, icsPort), XtRString,
-       (XtPointer) ICS_PORT },
-    { "internetChessServerCommPort", "internetChessServerCommPort",
-       XtRString, sizeof(String),
-       XtOffset(AppDataPtr, icsCommPort), XtRString,
-       ICS_COMM_PORT },
-    { "internetChessServerLogonScript", "internetChessServerLogonScript",
-       XtRString, sizeof(String),
-       XtOffset(AppDataPtr, icsLogon), XtRString,
-       ICS_LOGON },
-    { "internetChessServerHelper", "internetChessServerHelper",
-       XtRString, sizeof(String),
-       XtOffset(AppDataPtr, icsHelper), XtRString, "" },
-    { "internetChessServerInputBox", "internetChessServerInputBox",
-       XtRBoolean, sizeof(Boolean),
-       XtOffset(AppDataPtr, icsInputBox), XtRImmediate,
-       (XtPointer) False },
-    { "icsAlarm", "icsAlarm",
-       XtRBoolean, sizeof(Boolean),
-       XtOffset(AppDataPtr, icsAlarm), XtRImmediate,
-       (XtPointer) True },
-    { "icsAlarmTime", "icsAlarmTime",
-       XtRInt, sizeof(int),
-       XtOffset(AppDataPtr, icsAlarmTime), XtRImmediate,
-       (XtPointer) 5000 },
-    { "useTelnet", "useTelnet", XtRBoolean, sizeof(Boolean),
-       XtOffset(AppDataPtr, useTelnet), XtRImmediate,
-       (XtPointer) False },
-    { "telnetProgram", "telnetProgram", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, telnetProgram), XtRString, TELNET_PROGRAM },
-    { "gateway", "gateway", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, gateway), XtRString, "" },
-    { "loadGameFile", "loadGameFile", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, loadGameFile), XtRString, "" },
-    { "loadGameIndex", "loadGameIndex",
-       XtRInt, sizeof(int),
-       XtOffset(AppDataPtr, loadGameIndex), XtRImmediate,
-       (XtPointer) 0 },
-    { "saveGameFile", "saveGameFile", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, saveGameFile), XtRString, "" },
-    { "autoRaiseBoard", "autoRaiseBoard", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, autoRaiseBoard),
-       XtRImmediate, (XtPointer) True },
-    { "autoSaveGames", "autoSaveGames", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, autoSaveGames),
-       XtRImmediate, (XtPointer) False },
-    { "blindfold", "blindfold", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, blindfold),
-       XtRImmediate, (XtPointer) False },
-    { "loadPositionFile", "loadPositionFile", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, loadPositionFile),
-       XtRString, "" },
-    { "loadPositionIndex", "loadPositionIndex",
-       XtRInt, sizeof(int),
-       XtOffset(AppDataPtr, loadPositionIndex), XtRImmediate,
-       (XtPointer) 1 },
-    { "savePositionFile", "savePositionFile", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, savePositionFile),
-       XtRString, "" },
-    { "matchMode", "matchMode", XtRBoolean, sizeof(Boolean),
-       XtOffset(AppDataPtr, matchMode), XtRImmediate, (XtPointer) False },
-    { "matchGames", "matchGames", XtRInt, sizeof(int),
-       XtOffset(AppDataPtr, matchGames), XtRImmediate,
-       (XtPointer) 0 },
-    { "monoMode", "monoMode", XtRBoolean, sizeof(Boolean),
-       XtOffset(AppDataPtr, monoMode), XtRImmediate,
-       (XtPointer) False },
-    { "debugMode", "debugMode", XtRBoolean, sizeof(Boolean),
-       XtOffset(AppDataPtr, debugMode), XtRImmediate,
-       (XtPointer) False },
-    { "clockMode", "clockMode", XtRBoolean, sizeof(Boolean),
-       XtOffset(AppDataPtr, clockMode), XtRImmediate,
-       (XtPointer) True },
-    { "boardSize", "boardSize", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, boardSize), XtRString, "" },
-    { "searchTime", "searchTime", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, searchTime), XtRString,
-       (XtPointer) "" },
-    { "searchDepth", "searchDepth", XtRInt, sizeof(int),
-       XtOffset(AppDataPtr, searchDepth), XtRImmediate,
-       (XtPointer) 0 },
-    { "showCoords", "showCoords", XtRBoolean, sizeof(Boolean),
-       XtOffset(AppDataPtr, showCoords), XtRImmediate,
-       (XtPointer) False },
-    { "showJail", "showJail", XtRInt, sizeof(int),
-       XtOffset(AppDataPtr, showJail), XtRImmediate,
-       (XtPointer) 0 },
-    { "showThinking", "showThinking", XtRBoolean, sizeof(Boolean),
-       XtOffset(AppDataPtr, showThinking), XtRImmediate,
-       (XtPointer) True },
-    { "ponderNextMove", "ponderNextMove", XtRBoolean, sizeof(Boolean),
-       XtOffset(AppDataPtr, ponderNextMove), XtRImmediate,
-       (XtPointer) True },
-    { "periodicUpdates", "periodicUpdates", XtRBoolean, sizeof(Boolean),
-       XtOffset(AppDataPtr, periodicUpdates), XtRImmediate,
-       (XtPointer) True },
-    { "clockFont", "clockFont", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, clockFont), XtRString, CLOCK_FONT },
-    { "coordFont", "coordFont", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, coordFont), XtRString, COORD_FONT },
-    { "font", "font", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, font), XtRString, DEFAULT_FONT },
-    { "ringBellAfterMoves", "ringBellAfterMoves",
-       XtRBoolean, sizeof(Boolean),
-       XtOffset(AppDataPtr, ringBellAfterMoves),
-       XtRImmediate, (XtPointer) False },
-    { "autoCallFlag", "autoCallFlag", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, autoCallFlag),
-       XtRImmediate, (XtPointer) False },
-    { "autoFlipView", "autoFlipView", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, autoFlipView),
-       XtRImmediate, (XtPointer) True },
-    { "autoObserve", "autoObserve", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, autoObserve),
-       XtRImmediate, (XtPointer) False },
-    { "autoComment", "autoComment", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, autoComment),
-       XtRImmediate, (XtPointer) False },
-    { "getMoveList", "getMoveList", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, getMoveList),
-       XtRImmediate, (XtPointer) True },
-#if HIGHDRAG
-    { "highlightDragging", "highlightDragging", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, highlightDragging),
-       XtRImmediate, (XtPointer) False },
-#endif
-    { "highlightLastMove", "highlightLastMove", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, highlightLastMove),
-       XtRImmediate, (XtPointer) False },
-    { "premove", "premove", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, premove),
-        XtRImmediate, (XtPointer) True },
-    { "testLegality", "testLegality", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, testLegality),
-       XtRImmediate, (XtPointer) True },
-    { "flipView", "flipView", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, flipView),
-       XtRImmediate, (XtPointer) False },
-    { "cmail", "cmailGameName", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, cmailGameName), XtRString, "" },
-    { "alwaysPromoteToQueen", "alwaysPromoteToQueen", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, alwaysPromoteToQueen),
-       XtRImmediate, (XtPointer) False },
-    { "oldSaveStyle", "oldSaveStyle", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, oldSaveStyle),
-       XtRImmediate, (XtPointer) False },
-    { "quietPlay", "quietPlay", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, quietPlay),
-       XtRImmediate, (XtPointer) False },
-    { "titleInWindow", "titleInWindow", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, titleInWindow),
-       XtRImmediate, (XtPointer) False },
-    { "localLineEditing", "localLineEditing", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, localLineEditing),
-       XtRImmediate, (XtPointer) True }, /* not implemented, must be True */
-#if ZIPPY
-    { "zippyTalk", "zippyTalk", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, zippyTalk),
-       XtRImmediate, (XtPointer) ZIPPY_TALK },
-    { "zippyPlay", "zippyPlay", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, zippyPlay),
-       XtRImmediate, (XtPointer) ZIPPY_PLAY },
-    { "zippyLines", "zippyLines", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, zippyLines), XtRString, ZIPPY_LINES },
-    { "zippyPinhead", "zippyPinhead", XtRString, sizeof(String),
-        XtOffset(AppDataPtr, zippyPinhead), XtRString, ZIPPY_PINHEAD },
-    { "zippyPassword", "zippyPassword", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, zippyPassword), XtRString, ZIPPY_PASSWORD },
-    { "zippyPassword2", "zippyPassword2", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, zippyPassword2), XtRString, ZIPPY_PASSWORD2 },
-    { "zippyWrongPassword", "zippyWrongPassword", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, zippyWrongPassword), XtRString,
-        ZIPPY_WRONG_PASSWORD },
-    { "zippyAcceptOnly", "zippyAcceptOnly", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, zippyAcceptOnly), XtRString, ZIPPY_ACCEPT_ONLY },
-    { "zippyUseI", "zippyUseI", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, zippyUseI),
-        XtRImmediate, (XtPointer) ZIPPY_USE_I },
-    { "zippyBughouse", "zippyBughouse", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, zippyBughouse),
-       XtRImmediate, (XtPointer) ZIPPY_BUGHOUSE },
-    { "zippyNoplayCrafty", "zippyNoplayCrafty", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, zippyNoplayCrafty),
-        XtRImmediate, (XtPointer) ZIPPY_NOPLAY_CRAFTY },
-    { "zippyGameEnd", "zippyGameEnd", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, zippyGameEnd), XtRString, ZIPPY_GAME_END },
-    { "zippyGameStart", "zippyGameStart", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, zippyGameStart), XtRString, ZIPPY_GAME_START },
-    { "zippyAdjourn", "zippyAdjourn", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, zippyAdjourn),
-       XtRImmediate, (XtPointer) ZIPPY_ADJOURN },
-    { "zippyAbort", "zippyAbort", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, zippyAbort),
-       XtRImmediate, (XtPointer) ZIPPY_ABORT },
-    { "zippyVariants", "zippyVariants", XtRString, sizeof(String),
-       XtOffset(AppDataPtr, zippyVariants), XtRString, ZIPPY_VARIANTS },
-    { "zippyMaxGames", "zippyMaxGames", XtRInt, sizeof(int),
-       XtOffset(AppDataPtr, zippyMaxGames), XtRImmediate,
-        (XtPointer) ZIPPY_MAX_GAMES },
-    { "zippyReplayTimeout", "zippyReplayTimeout", XtRInt, sizeof(int),
-       XtOffset(AppDataPtr, zippyReplayTimeout), XtRImmediate,
-        (XtPointer) ZIPPY_REPLAY_TIMEOUT },
-    { "zippyShortGame", "zippyShortGame", XtRInt, sizeof(int),
-       XtOffset(AppDataPtr, zippyShortGame), XtRImmediate,
-        (XtPointer) 0 },
-#endif
     { "flashCount", "flashCount", XtRInt, sizeof(int),
        XtOffset(AppDataPtr, flashCount), XtRImmediate,
        (XtPointer) FLASH_COUNT  },
-    { "flashRate", "flashRate", XtRInt, sizeof(int),
-       XtOffset(AppDataPtr, flashRate), XtRImmediate,
-       (XtPointer) FLASH_RATE },
-    { "pixmapDirectory", "pixmapDirectory", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, pixmapDirectory),
-       XtRString, "" },
-    { "msLoginDelay", "msLoginDelay", XtRInt, sizeof(int),
-       XtOffset(AppDataPtr, msLoginDelay), XtRImmediate,
-       (XtPointer) MS_LOGIN_DELAY },
-    { "colorizeMessages", "colorizeMessages", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, colorize),
-       XtRImmediate, (XtPointer) False },
-    { "colorShout", "colorShout", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, colorShout),
-       XtRString, COLOR_SHOUT },
-    { "colorSShout", "colorSShout", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, colorSShout),
-       XtRString, COLOR_SSHOUT },
-    { "colorChannel1", "colorChannel1", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, colorChannel1),
-       XtRString, COLOR_CHANNEL1 },
-    { "colorChannel", "colorChannel", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, colorChannel),
-       XtRString, COLOR_CHANNEL },
-    { "colorKibitz", "colorKibitz", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, colorKibitz),
-       XtRString, COLOR_KIBITZ },
-    { "colorTell", "colorTell", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, colorTell),
-       XtRString, COLOR_TELL },
-    { "colorChallenge", "colorChallenge", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, colorChallenge),
-       XtRString, COLOR_CHALLENGE },
-    { "colorRequest", "colorRequest", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, colorRequest),
-       XtRString, COLOR_REQUEST },
-    { "colorSeek", "colorSeek", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, colorSeek),
-       XtRString, COLOR_SEEK },
-    { "colorNormal", "colorNormal", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, colorNormal),
-       XtRString, COLOR_NORMAL },
-    { "soundProgram", "soundProgram", XtRString,
-      sizeof(String), XtOffset(AppDataPtr, soundProgram),
-      XtRString, "play" },
-    { "soundShout", "soundShout", XtRString,
-      sizeof(String), XtOffset(AppDataPtr, soundShout),
-      XtRString, "" },
-    { "soundSShout", "soundSShout", XtRString,
-      sizeof(String), XtOffset(AppDataPtr, soundSShout),
-      XtRString, "" },
-    { "soundChannel1", "soundChannel1", XtRString,
-      sizeof(String), XtOffset(AppDataPtr, soundChannel1),
-      XtRString, "" },
-    { "soundChannel", "soundChannel", XtRString,
-      sizeof(String), XtOffset(AppDataPtr, soundChannel),
-      XtRString, "" },
-    { "soundKibitz", "soundKibitz", XtRString,
-      sizeof(String), XtOffset(AppDataPtr, soundKibitz),
-      XtRString, "" },
-    { "soundTell", "soundTell", XtRString,
-      sizeof(String), XtOffset(AppDataPtr, soundTell),
-      XtRString, "" },
-    { "soundChallenge", "soundChallenge", XtRString,
-      sizeof(String), XtOffset(AppDataPtr, soundChallenge),
-      XtRString, "" },
-    { "soundRequest", "soundRequest", XtRString,
-      sizeof(String), XtOffset(AppDataPtr, soundRequest),
-      XtRString, "" },
-    { "soundSeek", "soundSeek", XtRString,
-      sizeof(String), XtOffset(AppDataPtr, soundSeek),
-      XtRString, "" },
-    { "soundMove", "soundMove", XtRString,
-      sizeof(String), XtOffset(AppDataPtr, soundMove),
-      XtRString, "$" },
-    { "soundIcsWin", "soundIcsWin", XtRString,
-      sizeof(String), XtOffset(AppDataPtr, soundIcsWin),
-      XtRString, "" },
-    { "soundIcsLoss", "soundIcsLoss", XtRString,
-      sizeof(String), XtOffset(AppDataPtr, soundIcsLoss),
-      XtRString, "" },
-    { "soundIcsDraw", "soundIcsDraw", XtRString,
-      sizeof(String), XtOffset(AppDataPtr, soundIcsDraw),
-      XtRString, "" },
-    { "soundIcsUnfinished", "soundIcsUnfinished", XtRString,
-      sizeof(String), XtOffset(AppDataPtr, soundIcsUnfinished),
-      XtRString, "" },
-    { "soundIcsAlarm", "soundIcsAlarm", XtRString,
-      sizeof(String), XtOffset(AppDataPtr, soundIcsAlarm),
-      XtRString, "$" },
-    { "reuseFirst", "reuseFirst", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, reuseFirst),
-       XtRImmediate, (XtPointer) True },
-    { "reuseSecond", "reuseSecond", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, reuseSecond),
-       XtRImmediate, (XtPointer) True },
-    { "animateDragging", "animateDragging", XtRBoolean,
-        sizeof(Boolean), XtOffset(AppDataPtr, animateDragging),
-       XtRImmediate, (XtPointer) True },
-    { "animateMoving", "animateMoving", XtRBoolean,
-        sizeof(Boolean), XtOffset(AppDataPtr, animate),
-       XtRImmediate, (XtPointer) True },
-    { "animateSpeed", "animateSpeed", XtRInt,
-        sizeof(int), XtOffset(AppDataPtr, animSpeed),
-       XtRImmediate, (XtPointer)10 },
-    { "popupExitMessage", "popupExitMessage", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, popupExitMessage),
-       XtRImmediate, (XtPointer) True },
-    { "popupMoveErrors", "popupMoveErrors", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, popupMoveErrors),
-       XtRImmediate, (XtPointer) False },
-    { "fontSizeTolerance", "fontSizeTolerance", XtRInt,
-        sizeof(int), XtOffset(AppDataPtr, fontSizeTolerance),
-       XtRImmediate, (XtPointer)4 },
-    { "initialMode", "initialMode", XtRString,
-        sizeof(String), XtOffset(AppDataPtr, initialMode),
-       XtRImmediate, (XtPointer) "" },
-    { "variant", "variant", XtRString,
-        sizeof(String), XtOffset(AppDataPtr, variant),
-       XtRImmediate, (XtPointer) "normal" },
-    { "firstProtocolVersion", "firstProtocolVersion", XtRInt,
-        sizeof(int), XtOffset(AppDataPtr, firstProtocolVersion),
-       XtRImmediate, (XtPointer)PROTOVER },
-    { "secondProtocolVersion", "secondProtocolVersion", XtRInt,
-        sizeof(int), XtOffset(AppDataPtr, secondProtocolVersion),
-       XtRImmediate, (XtPointer)PROTOVER },
-    { "showButtonBar", "showButtonBar", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, showButtonBar),
-       XtRImmediate, (XtPointer) True },
-    { "lowTimeWarningColor", "lowTimeWarningColor", XtRString,
-      sizeof(String), XtOffset(AppDataPtr, lowTimeWarningColor),
-      XtRString, COLOR_LOWTIMEWARNING },
-    { "lowTimeWarning", "lowTimeWarning", XtRBoolean,
-      sizeof(Boolean), XtOffset(AppDataPtr, lowTimeWarning),
-      XtRImmediate, (XtPointer) False },
-    {"icsEngineAnalyze", "icsEngineAnalyze", XtRBoolean,        /* [DM] icsEngineAnalyze */
-        sizeof(Boolean), XtOffset(AppDataPtr, icsEngineAnalyze),
-        XtRImmediate, (XtPointer) False },
-    { "firstScoreAbs", "firstScoreAbs", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, firstScoreIsAbsolute),
-       XtRImmediate, (XtPointer) False },
-    { "secondScoreAbs", "secondScoreAbs", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, secondScoreIsAbsolute),
-       XtRImmediate, (XtPointer) False },
-    { "pgnExtendedInfo", "pgnExtendedInfo", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, saveExtendedInfoInPGN),
-       XtRImmediate, (XtPointer) False },
-    { "hideThinkingFromHuman", "hideThinkingFromHuman", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, hideThinkingFromHuman),
-       XtRImmediate, (XtPointer) True },
-    { "adjudicateLossThreshold", "adjudicateLossThreshold", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, adjudicateLossThreshold),
-       XtRImmediate, (XtPointer) 0},
-    { "adjudicateDrawMoves", "adjudicateDrawMoves", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, adjudicateDrawMoves),
-       XtRImmediate, (XtPointer) 0},
-    { "pgnEventHeader", "pgnEventHeader", XtRString,
-        sizeof(String), XtOffset(AppDataPtr, pgnEventHeader),
-       XtRImmediate, (XtPointer) "Computer Chess Game" },
-    { "defaultFrcPosition", "defaultFrcPositon", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, defaultFrcPosition),
-       XtRImmediate, (XtPointer) -1},
-    { "gameListTags", "gameListTags", XtRString,
-        sizeof(String), XtOffset(AppDataPtr, gameListTags),
-       XtRImmediate, (XtPointer) GLT_DEFAULT_TAGS },
-
-    // [HGM] 4.3.xx options
-    { "boardWidth", "boardWidth", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, NrFiles),
-       XtRImmediate, (XtPointer) -1},
-    { "boardHeight", "boardHeight", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, NrRanks),
-       XtRImmediate, (XtPointer) -1},
-    { "matchPause", "matchPause", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, matchPause),
-       XtRImmediate, (XtPointer) 10000},
-    { "holdingsSize", "holdingsSize", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, holdingsSize),
-       XtRImmediate, (XtPointer) -1},
-    { "flipBlack", "flipBlack", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, upsideDown),
-       XtRImmediate, (XtPointer) False},
-    { "allWhite", "allWhite", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, allWhite),
-       XtRImmediate, (XtPointer) False},
-    { "pieceToCharTable", "pieceToCharTable", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, pieceToCharTable),
-       XtRImmediate, (XtPointer) 0},
-    { "alphaRank", "alphaRank", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, alphaRank),
-       XtRImmediate, (XtPointer) False},
-    { "testClaims", "testClaims", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, testClaims),
-       XtRImmediate, (XtPointer) True},
-    { "checkMates", "checkMates", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, checkMates),
-       XtRImmediate, (XtPointer) True},
-    { "materialDraws", "materialDraws", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, materialDraws),
-       XtRImmediate, (XtPointer) True},
-    { "trivialDraws", "trivialDraws", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, trivialDraws),
-       XtRImmediate, (XtPointer) False},
-    { "ruleMoves", "ruleMoves", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, ruleMoves),
-       XtRImmediate, (XtPointer) 51},
-    { "repeatsToDraw", "repeatsToDraw", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, drawRepeats),
-       XtRImmediate, (XtPointer) 6},
-    { "engineDebugOutput", "engineDebugOutput", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, engineComments),
-       XtRImmediate, (XtPointer) 1},
-    { "userName", "userName", XtRString,
-       sizeof(int), XtOffset(AppDataPtr, userName),
-       XtRImmediate, (XtPointer) 0},
-    { "autoKibitz", "autoKibitz", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, autoKibitz),
-       XtRImmediate, (XtPointer) False},
-    { "firstTimeOdds", "firstTimeOdds", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, firstTimeOdds),
-       XtRImmediate, (XtPointer) 1},
-    { "secondTimeOdds", "secondTimeOdds", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, secondTimeOdds),
-       XtRImmediate, (XtPointer) 1},
-    { "timeOddsMode", "timeOddsMode", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, timeOddsMode),
-       XtRImmediate, (XtPointer) 0},
-    { "firstAccumulateTC", "firstAccumulateTC", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, firstAccumulateTC),
-       XtRImmediate, (XtPointer) 1},
-    { "secondAccumulateTC", "secondAccumulateTC", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, secondAccumulateTC),
-       XtRImmediate, (XtPointer) 1},
-    { "firstNPS", "firstNPS", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, firstNPS),
-       XtRImmediate, (XtPointer) -1},
-    { "secondNPS", "secondNPS", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, secondNPS),
-       XtRImmediate, (XtPointer) -1},
-    { "serverMoves", "serverMoves", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, serverMovesName),
-       XtRImmediate, (XtPointer) 0},
-    { "serverPause", "serverPause", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, serverPause),
-       XtRImmediate, (XtPointer) 0},
-    { "suppressLoadMoves", "suppressLoadMoves", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, suppressLoadMoves),
-       XtRImmediate, (XtPointer) False},
-    { "userName", "userName", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, userName),
-       XtRImmediate, (XtPointer) 0},
-    { "egtFormats", "egtFormats", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, egtFormats),
-       XtRImmediate, (XtPointer) 0},
-    { "rewindIndex", "rewindIndex", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, rewindIndex),
-       XtRImmediate, (XtPointer) 0},
-    { "sameColorGames", "sameColorGames", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, sameColorGames),
-       XtRImmediate, (XtPointer) 0},
-    { "smpCores", "smpCores", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, smpCores),
-       XtRImmediate, (XtPointer) 1},
-    { "niceEngines", "niceEngines", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, niceEngines),
-       XtRImmediate, (XtPointer) 0},
-    { "nameOfDebugFile", "nameOfDebugFile", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, nameOfDebugFile),
-       XtRImmediate, (XtPointer) "xboard.debug"},
-    { "engineDebugOutput", "engineDebugOutput", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, engineComments),
-       XtRImmediate, (XtPointer) 1},
-    { "noGUI", "noGUI", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, noGUI),
-       XtRImmediate, (XtPointer) 0},
-    { "firstOptions", "firstOptions", XtRString,
-        sizeof(String), XtOffset(AppDataPtr, firstOptions),
-       XtRImmediate, (XtPointer) "" },
-    { "secondOptions", "secondOptions", XtRString,
-        sizeof(String), XtOffset(AppDataPtr, secondOptions),
-       XtRImmediate, (XtPointer) "" },
-    { "firstNeedsNoncompliantFEN", "firstNeedsNoncompliantFEN", XtRString,
-        sizeof(String), XtOffset(AppDataPtr, fenOverride1),
-       XtRImmediate, (XtPointer) 0 },
-    { "secondNeedsNoncompliantFEN", "secondNeedsNoncompliantFEN", XtRString,
-        sizeof(String), XtOffset(AppDataPtr, fenOverride2),
-       XtRImmediate, (XtPointer) 0 },
-
-    // [HGM] Winboard_x UCI options
-    { "firstIsUCI", "firstIsUCI", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, firstIsUCI),
-       XtRImmediate, (XtPointer) False},
-    { "secondIsUCI", "secondIsUCI", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, secondIsUCI),
-       XtRImmediate, (XtPointer) False},
-    { "firstHasOwnBookUCI", "firstHasOwnBookUCI", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, firstHasOwnBookUCI),
-       XtRImmediate, (XtPointer) True},
-    { "secondHasOwnBookUCI", "secondHasOwnBookUCI", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, secondHasOwnBookUCI),
-       XtRImmediate, (XtPointer) True},
-    { "usePolyglotBook", "usePolyglotBook", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, usePolyglotBook),
-       XtRImmediate, (XtPointer) False},
-    { "defaultHashSize", "defaultHashSize", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, defaultHashSize),
-       XtRImmediate, (XtPointer) 64},
-    { "defaultCacheSizeEGTB", "defaultCacheSizeEGTB", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, defaultCacheSizeEGTB),
-       XtRImmediate, (XtPointer) 4},
-    { "polyglotDir", "polyglotDir", XtRString,
-        sizeof(String), XtOffset(AppDataPtr, polyglotDir),
-       XtRImmediate, (XtPointer) "." },
-    { "polyglotBook", "polyglotBook", XtRString,
-        sizeof(String), XtOffset(AppDataPtr, polyglotBook),
-       XtRImmediate, (XtPointer) "" },
-    { "defaultPathEGTB", "defaultPathEGTB", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, defaultPathEGTB),
-       XtRImmediate, (XtPointer) "/usr/local/share/egtb"},
-    { "delayBeforeQuit", "delayBeforeQuit", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, delayBeforeQuit),
-       XtRImmediate, (XtPointer) 0},
-    { "delayAfterQuit", "delayAfterQuit", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, delayAfterQuit),
-       XtRImmediate, (XtPointer) 0},
-    { "keepAlive", "keepAlive", XtRInt,
-       sizeof(int), XtOffset(AppDataPtr, keepAlive),
-       XtRImmediate, (XtPointer) 0},
-    { "forceIllegalMoves", "forceIllegalMoves", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, forceIllegal),
-       XtRImmediate, (XtPointer) False},
-    { "keepLineBreaksICS", "keepLineBreaksICS", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, noJoin),
-       XtRImmediate, (XtPointer) False},
-    { "wrapContinuationSequence", "wrapContinuationSequence", XtRString,
-       sizeof(String), XtOffset(AppDataPtr, wrapContSeq),
-       XtRString, ""},
-    { "useInternalWrap", "useInternalWrap", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, useInternalWrap),
-       XtRImmediate, (XtPointer) True},
-    { "autoDisplayTags", "autoDisplayTags", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, autoDisplayTags),
-       XtRImmediate, (XtPointer) True},
-    { "autoDisplayComment", "autoDisplayComment", XtRBoolean,
-       sizeof(Boolean), XtOffset(AppDataPtr, autoDisplayComment),
-       XtRImmediate, (XtPointer) True},
-    { "pasteSelection", "pasteSelection", XtRBoolean,
-        sizeof(Boolean), XtOffset(AppDataPtr, pasteSelection),
-        XtRImmediate, (XtPointer) False},
 };
 
 XrmOptionDescRec shellOptions[] = {
-    { "-whitePieceColor", "whitePieceColor", XrmoptionSepArg, NULL },
-    { "-blackPieceColor", "blackPieceColor", XrmoptionSepArg, NULL },
-    { "-lightSquareColor", "lightSquareColor", XrmoptionSepArg, NULL },
-    { "-darkSquareColor", "darkSquareColor", XrmoptionSepArg, NULL },
-    { "-highlightSquareColor", "highlightSquareColor", XrmoptionSepArg, NULL },
-    { "-premoveHighlightColor", "premoveHighlightColor", XrmoptionSepArg,NULL},
-    { "-movesPerSession", "movesPerSession", XrmoptionSepArg, NULL },
-    { "-mps", "movesPerSession", XrmoptionSepArg, NULL },
-    { "-timeIncrement", "timeIncrement", XrmoptionSepArg, NULL },
-    { "-inc", "timeIncrement", XrmoptionSepArg, NULL },
-    { "-initString", "initString", XrmoptionSepArg, NULL },
-    { "-firstInitString", "initString", XrmoptionSepArg, NULL },
-    { "-secondInitString", "secondInitString", XrmoptionSepArg, NULL },
-    { "-firstComputerString", "firstComputerString", XrmoptionSepArg, NULL },
-    { "-secondComputerString", "secondComputerString", XrmoptionSepArg, NULL },
-    { "-firstChessProgram", "firstChessProgram", XrmoptionSepArg, NULL },
-    { "-fcp", "firstChessProgram", XrmoptionSepArg, NULL },
-    { "-secondChessProgram", "secondChessProgram", XrmoptionSepArg, NULL },
-    { "-scp", "secondChessProgram", XrmoptionSepArg, NULL },
-    { "-firstPlaysBlack", "firstPlaysBlack", XrmoptionSepArg, NULL },
-    { "-fb", "firstPlaysBlack", XrmoptionNoArg, "True" },
-    { "-xfb", "firstPlaysBlack", XrmoptionNoArg, "False" },
-    { "-noChessProgram", "noChessProgram", XrmoptionSepArg, NULL },
-    { "-ncp", "noChessProgram", XrmoptionNoArg, "True" },
-    { "-xncp", "noChessProgram", XrmoptionNoArg, "False" },
-    { "-firstHost", "firstHost", XrmoptionSepArg, NULL },
-    { "-fh", "firstHost", XrmoptionSepArg, NULL },
-    { "-secondHost", "secondHost", XrmoptionSepArg, NULL },
-    { "-sh", "secondHost", XrmoptionSepArg, NULL },
-    { "-firstDirectory", "firstDirectory", XrmoptionSepArg, NULL },
-    { "-fd", "firstDirectory", XrmoptionSepArg, NULL },
-    { "-secondDirectory", "secondDirectory", XrmoptionSepArg, NULL },
-    { "-sd", "secondDirectory", XrmoptionSepArg, NULL },
-    { "-bitmapDirectory", "bitmapDirectory", XrmoptionSepArg, NULL },
-    { "-bm", "bitmapDirectory", XrmoptionSepArg, NULL },
-    { "-remoteShell", "remoteShell", XrmoptionSepArg, NULL },
-    { "-rsh", "remoteShell", XrmoptionSepArg, NULL },
-    { "-remoteUser", "remoteUser", XrmoptionSepArg, NULL },
-    { "-ruser", "remoteUser", XrmoptionSepArg, NULL },
-    { "-timeDelay", "timeDelay", XrmoptionSepArg, NULL },
-    { "-td", "timeDelay", XrmoptionSepArg, NULL },
-    { "-timeControl", "timeControl", XrmoptionSepArg, NULL },
-    { "-tc", "timeControl", XrmoptionSepArg, NULL },
-    { "-internetChessServerMode", "internetChessServerMode",
-       XrmoptionSepArg, NULL },
-    { "-ics", "internetChessServerMode", XrmoptionNoArg, "True" },
-    { "-xics", "internetChessServerMode", XrmoptionNoArg, "False" },
-    { "-internetChessServerHost", "internetChessServerHost",
-       XrmoptionSepArg, NULL },
-    { "-icshost", "internetChessServerHost", XrmoptionSepArg, NULL },
-    { "-internetChessServerPort", "internetChessServerPort",
-       XrmoptionSepArg, NULL },
-    { "-icsport", "internetChessServerPort", XrmoptionSepArg, NULL },
-    { "-internetChessServerCommPort", "internetChessServerCommPort",
-       XrmoptionSepArg, NULL },
-    { "-icscomm", "internetChessServerCommPort", XrmoptionSepArg, NULL },
-    { "-internetChessServerLogonScript", "internetChessServerLogonScript",
-       XrmoptionSepArg, NULL },
-    { "-icslogon", "internetChessServerLogonScript", XrmoptionSepArg, NULL },
-    { "-internetChessServerHelper", "internetChessServerHelper",
-       XrmoptionSepArg, NULL },
-    { "-icshelper", "internetChessServerHelper", XrmoptionSepArg, NULL },
-    { "-internetChessServerInputBox", "internetChessServerInputBox",
-       XrmoptionSepArg, NULL },
-    { "-icsinput", "internetChessServerInputBox", XrmoptionNoArg, "True" },
-    { "-xicsinput", "internetChessServerInputBox", XrmoptionNoArg, "False" },
-    { "-icsAlarm", "icsAlarm", XrmoptionSepArg, NULL },
-    { "-alarm", "icsAlarm", XrmoptionNoArg, "True" },
-    { "-xalarm", "icsAlarm", XrmoptionNoArg, "False" },
-    { "-icsAlarmTime", "icsAlarmTime", XrmoptionSepArg, NULL },
-    { "-useTelnet", "useTelnet", XrmoptionSepArg, NULL },
-    { "-telnet", "useTelnet", XrmoptionNoArg, "True" },
-    { "-xtelnet", "useTelnet", XrmoptionNoArg, "False" },
-    { "-telnetProgram", "telnetProgram", XrmoptionSepArg, NULL },
-    { "-gateway", "gateway", XrmoptionSepArg, NULL },
-    { "-loadGameFile", "loadGameFile", XrmoptionSepArg, NULL },
-    { "-lgf", "loadGameFile", XrmoptionSepArg, NULL },
-    { "-loadGameIndex", "loadGameIndex", XrmoptionSepArg, NULL },
-    { "-lgi", "loadGameIndex", XrmoptionSepArg, NULL },
-    { "-saveGameFile", "saveGameFile", XrmoptionSepArg, NULL },
-    { "-sgf", "saveGameFile", XrmoptionSepArg, NULL },
-    { "-autoSaveGames", "autoSaveGames", XrmoptionSepArg, NULL },
-    { "-autosave", "autoSaveGames", XrmoptionNoArg, "True" },
-    { "-xautosave", "autoSaveGames", XrmoptionNoArg, "False" },
-    { "-autoRaiseBoard", "autoRaiseBoard", XrmoptionSepArg, NULL },
-    { "-autoraise", "autoRaiseBoard", XrmoptionNoArg, "True" },
-    { "-xautoraise", "autoRaiseBoard", XrmoptionNoArg, "False" },
-    { "-blindfold", "blindfold", XrmoptionSepArg, NULL },
-    { "-blind", "blindfold", XrmoptionNoArg, "True" },
-    { "-xblind", "blindfold", XrmoptionNoArg, "False" },
-    { "-loadPositionFile", "loadPositionFile", XrmoptionSepArg, NULL },
-    { "-lpf", "loadPositionFile", XrmoptionSepArg, NULL },
-    { "-loadPositionIndex", "loadPositionIndex", XrmoptionSepArg, NULL },
-    { "-lpi", "loadPositionIndex", XrmoptionSepArg, NULL },
-    { "-savePositionFile", "savePositionFile", XrmoptionSepArg, NULL },
-    { "-spf", "savePositionFile", XrmoptionSepArg, NULL },
-    { "-matchMode", "matchMode", XrmoptionSepArg, NULL },
-    { "-mm", "matchMode", XrmoptionNoArg, "True" },
-    { "-xmm", "matchMode", XrmoptionNoArg, "False" },
-    { "-matchGames", "matchGames", XrmoptionSepArg, NULL },
-    { "-mg", "matchGames", XrmoptionSepArg, NULL },
-    { "-monoMode", "monoMode", XrmoptionSepArg, NULL },
-    { "-mono", "monoMode", XrmoptionNoArg, "True" },
-    { "-xmono", "monoMode", XrmoptionNoArg, "False" },
-    { "-debugMode", "debugMode", XrmoptionSepArg, NULL },
-    { "-debug", "debugMode", XrmoptionNoArg, "True" },
-    { "-xdebug", "debugMode", XrmoptionNoArg, "False" },
-    { "-clockMode", "clockMode", XrmoptionSepArg, NULL },
-    { "-clock", "clockMode", XrmoptionNoArg, "True" },
-    { "-xclock", "clockMode", XrmoptionNoArg, "False" },
-    { "-boardSize", "boardSize", XrmoptionSepArg, NULL },
-    { "-size", "boardSize", XrmoptionSepArg, NULL },
-    { "-searchTime", "searchTime", XrmoptionSepArg, NULL },
-    { "-st", "searchTime", XrmoptionSepArg, NULL },
-    { "-searchDepth", "searchDepth", XrmoptionSepArg, NULL },
-    { "-depth", "searchDepth", XrmoptionSepArg, NULL },
-    { "-showCoords", "showCoords", XrmoptionSepArg, NULL },
-    { "-coords", "showCoords", XrmoptionNoArg, "True" },
-    { "-xcoords", "showCoords", XrmoptionNoArg, "False" },
-#if JAIL
-    { "-showJail", "showJail", XrmoptionSepArg, NULL },
-    { "-jail", "showJail", XrmoptionNoArg, "1" },
-    { "-sidejail", "showJail", XrmoptionNoArg, "2" },
-    { "-xjail", "showJail", XrmoptionNoArg, "0" },
-#endif
-    { "-showThinking", "showThinking", XrmoptionSepArg, NULL },
-    { "-thinking", "showThinking", XrmoptionNoArg, "True" },
-    { "-xthinking", "showThinking", XrmoptionNoArg, "False" },
-    { "-ponderNextMove", "ponderNextMove", XrmoptionSepArg, NULL },
-    { "-ponder", "ponderNextMove", XrmoptionNoArg, "True" },
-    { "-xponder", "ponderNextMove", XrmoptionNoArg, "False" },
-    { "-periodicUpdates", "periodicUpdates", XrmoptionSepArg, NULL },
-    { "-periodic", "periodicUpdates", XrmoptionNoArg, "True" },
-    { "-xperiodic", "periodicUpdates", XrmoptionNoArg, "False" },
-    { "-clockFont", "clockFont", XrmoptionSepArg, NULL },
-    { "-coordFont", "coordFont", XrmoptionSepArg, NULL },
-    { "-font", "font", XrmoptionSepArg, NULL },
-    { "-ringBellAfterMoves", "ringBellAfterMoves", XrmoptionSepArg, NULL },
-    { "-bell", "ringBellAfterMoves", XrmoptionNoArg, "True" },
-    { "-xbell", "ringBellAfterMoves", XrmoptionNoArg, "False" },
-    { "-movesound", "ringBellAfterMoves", XrmoptionNoArg, "True" },
-    { "-xmovesound", "ringBellAfterMoves", XrmoptionNoArg, "False" },
-    { "-autoCallFlag", "autoCallFlag", XrmoptionSepArg, NULL },
-    { "-autoflag", "autoCallFlag", XrmoptionNoArg, "True" },
-    { "-xautoflag", "autoCallFlag", XrmoptionNoArg, "False" },
-    { "-autoFlipView", "autoFlipView", XrmoptionSepArg, NULL },
-    { "-autoflip", "autoFlipView", XrmoptionNoArg, "True" },
-    { "-xautoflip", "autoFlipView", XrmoptionNoArg, "False" },
-    { "-autoObserve", "autoObserve", XrmoptionSepArg, NULL },
-    { "-autobs", "autoObserve", XrmoptionNoArg, "True" },
-    { "-xautobs", "autoObserve", XrmoptionNoArg, "False" },
-    { "-autoComment", "autoComment", XrmoptionSepArg, NULL },
-    { "-autocomm", "autoComment", XrmoptionNoArg, "True" },
-    { "-xautocomm", "autoComment", XrmoptionNoArg, "False" },
-    { "-getMoveList", "getMoveList", XrmoptionSepArg, NULL },
-    { "-moves", "getMoveList", XrmoptionNoArg, "True" },
-    { "-xmoves", "getMoveList", XrmoptionNoArg, "False" },
-#if HIGHDRAG
-    { "-highlightDragging", "highlightDragging", XrmoptionSepArg, NULL },
-    { "-highdrag", "highlightDragging", XrmoptionNoArg, "True" },
-    { "-xhighdrag", "highlightDragging", XrmoptionNoArg, "False" },
-#endif
-    { "-highlightLastMove", "highlightLastMove", XrmoptionSepArg, NULL },
-    { "-highlight", "highlightLastMove", XrmoptionNoArg, "True" },
-    { "-xhighlight", "highlightLastMove", XrmoptionNoArg, "False" },
-    { "-premove", "premove", XrmoptionSepArg, NULL },
-    { "-pre", "premove", XrmoptionNoArg, "True" },
-    { "-xpre", "premove", XrmoptionNoArg, "False" },
-    { "-testLegality", "testLegality", XrmoptionSepArg, NULL },
-    { "-legal", "testLegality", XrmoptionNoArg, "True" },
-    { "-xlegal", "testLegality", XrmoptionNoArg, "False" },
-    { "-flipView", "flipView", XrmoptionSepArg, NULL },
-    { "-flip", "flipView", XrmoptionNoArg, "True" },
-    { "-xflip", "flipView", XrmoptionNoArg, "False" },
-    { "-cmail", "cmailGameName", XrmoptionSepArg, NULL },
-    { "-alwaysPromoteToQueen", "alwaysPromoteToQueen",
-       XrmoptionSepArg, NULL },
-    { "-queen", "alwaysPromoteToQueen", XrmoptionNoArg, "True" },
-    { "-xqueen", "alwaysPromoteToQueen", XrmoptionNoArg, "False" },
-    { "-oldSaveStyle", "oldSaveStyle", XrmoptionSepArg, NULL },
-    { "-oldsave", "oldSaveStyle", XrmoptionNoArg, "True" },
-    { "-xoldsave", "oldSaveStyle", XrmoptionNoArg, "False" },
-    { "-quietPlay", "quietPlay", XrmoptionSepArg, NULL },
-    { "-quiet", "quietPlay", XrmoptionNoArg, "True" },
-    { "-xquiet", "quietPlay", XrmoptionNoArg, "False" },
-    { "-titleInWindow", "titleInWindow", XrmoptionSepArg, NULL },
-    { "-title", "titleInWindow", XrmoptionNoArg, "True" },
-    { "-xtitle", "titleInWindow", XrmoptionNoArg, "False" },
-#ifdef ZIPPY
-    { "-zippyTalk", "zippyTalk", XrmoptionSepArg, NULL },
-    { "-zt", "zippyTalk", XrmoptionNoArg, "True" },
-    { "-xzt", "zippyTalk", XrmoptionNoArg, "False" },
-    { "-zippyPlay", "zippyPlay", XrmoptionSepArg, NULL },
-    { "-zp", "zippyPlay", XrmoptionNoArg, "True" },
-    { "-xzp", "zippyPlay", XrmoptionNoArg, "False" },
-    { "-zippyLines", "zippyLines", XrmoptionSepArg, NULL },
-    { "-zippyPinhead", "zippyPinhead", XrmoptionSepArg, NULL },
-    { "-zippyPassword", "zippyPassword", XrmoptionSepArg, NULL },
-    { "-zippyPassword2", "zippyPassword2", XrmoptionSepArg, NULL },
-    { "-zippyWrongPassword", "zippyWrongPassword", XrmoptionSepArg, NULL },
-    { "-zippyAcceptOnly", "zippyAcceptOnly", XrmoptionSepArg, NULL },
-    { "-zippyUseI", "zippyUseI", XrmoptionSepArg, NULL },
-    { "-zui", "zippyUseI", XrmoptionNoArg, "True" },
-    { "-xzui", "zippyUseI", XrmoptionNoArg, "False" },
-    { "-zippyBughouse", "zippyBughouse", XrmoptionSepArg, NULL },
-    { "-zippyNoplayCrafty", "zippyNoplayCrafty", XrmoptionSepArg, NULL },
-    { "-znc", "zippyNoplayCrafty", XrmoptionNoArg, "True" },
-    { "-xznc", "zippyNoplayCrafty", XrmoptionNoArg, "False" },
-    { "-zippyGameEnd", "zippyGameEnd", XrmoptionSepArg, NULL },
-    { "-zippyGameStart", "zippyGameStart", XrmoptionSepArg, NULL },
-    { "-zippyAdjourn", "zippyAdjourn", XrmoptionSepArg, NULL },
-    { "-zadj", "zippyAdjourn", XrmoptionNoArg, "True" },
-    { "-xzadj", "zippyAdjourn", XrmoptionNoArg, "False" },
-    { "-zippyAbort", "zippyAbort", XrmoptionSepArg, NULL },
-    { "-zab", "zippyAbort", XrmoptionNoArg, "True" },
-    { "-xzab", "zippyAbort", XrmoptionNoArg, "False" },
-    { "-zippyVariants", "zippyVariants", XrmoptionSepArg, NULL },
-    { "-zippyMaxGames", "zippyMaxGames", XrmoptionSepArg, NULL },
-    { "-zippyReplayTimeout", "zippyReplayTimeout", XrmoptionSepArg, NULL },
-    { "-zippyShortGame", "zippyShortGame", XrmoptionSepArg, NULL },
-#endif
     { "-flashCount", "flashCount", XrmoptionSepArg, NULL },
     { "-flash", "flashCount", XrmoptionNoArg, "3" },
     { "-xflash", "flashCount", XrmoptionNoArg, "0" },
-    { "-flashRate", "flashRate", XrmoptionSepArg, NULL },
-    { "-pixmapDirectory", "pixmapDirectory", XrmoptionSepArg, NULL },
-    { "-msLoginDelay", "msLoginDelay", XrmoptionSepArg, NULL },
-    { "-pixmap", "pixmapDirectory", XrmoptionSepArg, NULL },
-    { "-colorizeMessages", "colorizeMessages", XrmoptionSepArg, NULL },
-    { "-colorize", "colorizeMessages", XrmoptionNoArg, "True" },
-    { "-xcolorize", "colorizeMessages", XrmoptionNoArg, "False" },
-    { "-colorShout", "colorShout", XrmoptionSepArg, NULL },
-    { "-colorSShout", "colorSShout", XrmoptionSepArg, NULL },
-    { "-colorCShout", "colorSShout", XrmoptionSepArg, NULL }, /*FICS name*/
-    { "-colorChannel1", "colorChannel1", XrmoptionSepArg, NULL },
-    { "-colorChannel", "colorChannel", XrmoptionSepArg, NULL },
-    { "-colorKibitz", "colorKibitz", XrmoptionSepArg, NULL },
-    { "-colorTell", "colorTell", XrmoptionSepArg, NULL },
-    { "-colorChallenge", "colorChallenge", XrmoptionSepArg, NULL },
-    { "-colorRequest", "colorRequest", XrmoptionSepArg, NULL },
-    { "-colorSeek", "colorSeek", XrmoptionSepArg, NULL },
-    { "-colorNormal", "colorNormal", XrmoptionSepArg, NULL },
-    { "-soundProgram", "soundProgram", XrmoptionSepArg, NULL },
-    { "-soundShout", "soundShout", XrmoptionSepArg, NULL },
-    { "-soundSShout", "soundSShout", XrmoptionSepArg, NULL },
-    { "-soundCShout", "soundSShout", XrmoptionSepArg, NULL }, /*FICS name*/
-    { "-soundChannel1", "soundChannel1", XrmoptionSepArg, NULL },
-    { "-soundChannel", "soundChannel", XrmoptionSepArg, NULL },
-    { "-soundKibitz", "soundKibitz", XrmoptionSepArg, NULL },
-    { "-soundTell", "soundTell", XrmoptionSepArg, NULL },
-    { "-soundChallenge", "soundChallenge", XrmoptionSepArg, NULL },
-    { "-soundRequest", "soundRequest", XrmoptionSepArg, NULL },
-    { "-soundSeek", "soundSeek", XrmoptionSepArg, NULL },
-    { "-soundMove", "soundMove", XrmoptionSepArg, NULL },
-    { "-soundIcsWin", "soundIcsWin", XrmoptionSepArg, NULL },
-    { "-soundIcsLoss", "soundIcsLoss", XrmoptionSepArg, NULL },
-    { "-soundIcsDraw", "soundIcsDraw", XrmoptionSepArg, NULL },
-    { "-soundIcsUnfinished", "soundIcsUnfinished", XrmoptionSepArg, NULL },
-    { "-soundIcsAlarm", "soundIcsAlarm", XrmoptionSepArg, NULL },
-    { "-reuseFirst", "reuseFirst", XrmoptionSepArg, NULL },
-    { "-reuseChessPrograms", "reuseFirst", XrmoptionSepArg, NULL }, /*compat*/
-    { "-reuse", "reuseFirst", XrmoptionNoArg, "True" },
-    { "-xreuse", "reuseFirst", XrmoptionNoArg, "False" },
-    { "-reuseSecond", "reuseSecond", XrmoptionSepArg, NULL },
-    { "-reuse2", "reuseSecond", XrmoptionNoArg, "True" },
-    { "-xreuse2", "reuseSecond", XrmoptionNoArg, "False" },
-    { "-animateMoving", "animateMoving", XrmoptionSepArg, NULL },
-    { "-animate", "animateMoving", XrmoptionNoArg, "True" },
-    { "-xanimate", "animateMoving", XrmoptionNoArg, "False" },
-    { "-animateDragging", "animateDragging", XrmoptionSepArg, NULL },
-    { "-drag", "animateDragging", XrmoptionNoArg, "True" },
-    { "-xdrag", "animateDragging", XrmoptionNoArg, "False" },
-    { "-animateSpeed", "animateSpeed", XrmoptionSepArg, NULL },
-    { "-popupExitMessage", "popupExitMessage", XrmoptionSepArg, NULL },
-    { "-exit", "popupExitMessage", XrmoptionNoArg, "True" },
-    { "-xexit", "popupExitMessage", XrmoptionNoArg, "False" },
-    { "-popupMoveErrors", "popupMoveErrors", XrmoptionSepArg, NULL },
-    { "-popup", "popupMoveErrors", XrmoptionNoArg, "True" },
-    { "-xpopup", "popupMoveErrors", XrmoptionNoArg, "False" },
-    { "-fontSizeTolerance", "fontSizeTolerance", XrmoptionSepArg, NULL },
-    { "-initialMode", "initialMode", XrmoptionSepArg, NULL },
-    { "-mode", "initialMode", XrmoptionSepArg, NULL },
-    { "-variant", "variant", XrmoptionSepArg, NULL },
-    { "-firstProtocolVersion", "firstProtocolVersion", XrmoptionSepArg, NULL },
-    { "-secondProtocolVersion","secondProtocolVersion",XrmoptionSepArg, NULL },
-    { "-showButtonBar", "showButtonBar", XrmoptionSepArg, NULL },
-    { "-buttons", "showButtonBar", XrmoptionNoArg, "True" },
-    { "-xbuttons", "showButtonBar", XrmoptionNoArg, "False" },
-    { "-lowTimeWarningColor", "lowTimeWarningColor", XrmoptionSepArg, NULL },
-    { "-lowTimeWarning", "lowTimeWarning", XrmoptionSepArg, NULL },
-    /* [AS,HR] New features */
-    { "-firstScoreAbs", "firstScoreAbs", XrmoptionSepArg, NULL },
-    { "-secondScoreAbs", "secondScoreAbs", XrmoptionSepArg, NULL },
-    { "-pgnExtendedInfo", "pgnExtendedInfo", XrmoptionSepArg, NULL },
-    { "-hideThinkingFromHuman", "hideThinkingFromHuman", XrmoptionSepArg, NULL },
-    { "-adjudicateLossThreshold", "adjudicateLossThreshold", XrmoptionSepArg, NULL },
-    { "-adjudicateDrawMoves", "adjudicateDrawMoves", XrmoptionSepArg, NULL },
-    { "-pgnEventHeader", "pgnEventHeader", XrmoptionSepArg, NULL },
-    { "-firstIsUCI", "firstIsUCI", XrmoptionSepArg, NULL },
-    { "-secondIsUCI", "secondIsUCI", XrmoptionSepArg, NULL },
-    { "-fUCI", "firstIsUCI", XrmoptionNoArg, "True" },
-    { "-sUCI", "secondIsUCI", XrmoptionNoArg, "True" },
-    { "-firstHasOwnBookUCI", "firstHasOwnBookUCI", XrmoptionSepArg, NULL },
-    { "-secondHasOwnBookUCI", "secondHasOwnBookUCI", XrmoptionSepArg, NULL },
-    { "-fNoOwnBookUCI", "firstHasOwnBookUCI", XrmoptionNoArg, "False" },
-    { "-sNoOwnBookUCI", "secondHasOwnBookUCI", XrmoptionNoArg, "False" },
-    { "-firstXBook", "firstHasOwnBookUCI", XrmoptionNoArg, "False" },
-    { "-secondXBook", "secondHasOwnBookUCI", XrmoptionNoArg, "False" },
-    { "-polyglotDir", "polyglotDir", XrmoptionSepArg, NULL },
-    { "-usePolyglotBook", "usePolyglotBook", XrmoptionSepArg, NULL },
-    { "-polyglotBook", "polyglotBook", XrmoptionSepArg, NULL },
-    { "-defaultHashSize", "defaultHashSize", XrmoptionSepArg, NULL },
-    { "-defaultCacheSizeEGTB", "defaultCacheSizeEGTB", XrmoptionSepArg, NULL },
-    { "-defaultPathEGTB", "defaultPathEGTB", XrmoptionSepArg, NULL },
-    { "-defaultFrcPosition", "defaultFrcPosition", XrmoptionSepArg, NULL },
-    { "-gameListTags", "gameListTags", XrmoptionSepArg, NULL },
-    // [HGM] I am sure AS added many more options, but we have to fish them out, from the list in winboard.c
-
-    /* [HGM,HR] User-selectable board size */
-    { "-boardWidth", "boardWidth", XrmoptionSepArg, NULL },
-    { "-boardHeight", "boardHeight", XrmoptionSepArg, NULL },
-    { "-matchPause", "matchPause", XrmoptionSepArg, NULL },
-
-    /* [HGM] new arguments of 4.3.xx. All except first three are back-end options, which should work immediately */
-    { "-holdingsSize", "holdingsSize", XrmoptionSepArg, NULL }, // requires extensive front-end changes to work
-    { "-flipBlack", "flipBlack", XrmoptionSepArg, NULL },       // requires front-end changes to work
-    { "-allWhite", "allWhite", XrmoptionSepArg, NULL },         // requires front-end changes to work
-    { "-pieceToCharTable", "pieceToCharTable", XrmoptionSepArg, NULL },
-    { "-alphaRank", "alphaRank", XrmoptionSepArg, NULL },
-    { "-testClaims", "testClaims", XrmoptionSepArg, NULL },
-    { "-checkMates", "checkMates", XrmoptionSepArg, NULL },
-    { "-materialDraws", "materialDraws", XrmoptionSepArg, NULL },
-    { "-trivialDraws", "trivialDraws", XrmoptionSepArg, NULL },
-    { "-ruleMoves", "ruleMoves", XrmoptionSepArg, NULL },
-    { "-repeatsToDraw", "repeatsToDraw", XrmoptionSepArg, NULL },
-    { "-engineDebugOutput", "engineDebugOutput", XrmoptionSepArg, NULL },
-    { "-userName", "userName", XrmoptionSepArg, NULL },
-    { "-autoKibitz", "autoKibitz", XrmoptionNoArg, "True" },
-    { "-firstTimeOdds", "firstTimeOdds", XrmoptionSepArg, NULL },
-    { "-secondTimeOdds", "secondTimeOdds", XrmoptionSepArg, NULL },
-    { "-timeOddsMode", "timeOddsMode", XrmoptionSepArg, NULL },
-    { "-firstAccumulateTC", "firstAccumulateTC", XrmoptionSepArg, NULL },
-    { "-secondAccumulateTC", "secondAccumulateTC", XrmoptionSepArg, NULL },
-    { "-firstNPS", "firstNPS", XrmoptionSepArg, NULL },
-    { "-secondNPS", "secondNPS", XrmoptionSepArg, NULL },
-    { "-serverMoves", "serverMoves", XrmoptionSepArg, NULL },
-    { "-serverPause", "serverPause", XrmoptionSepArg, NULL },
-    { "-suppressLoadMoves", "suppressLoadMoves", XrmoptionSepArg, NULL },
-    { "-egtFormats", "egtFormats", XrmoptionSepArg, NULL },
-    { "-userName", "userName", XrmoptionSepArg, NULL },
-    { "-smpCores", "smpCores", XrmoptionSepArg, NULL },
-    { "-sameColorGames", "sameColorGames", XrmoptionSepArg, NULL },
-    { "-rewindIndex", "rewindIndex", XrmoptionSepArg, NULL },
-    { "-niceEngines", "niceEngines", XrmoptionSepArg, NULL },
-    { "-delayBeforeQuit", "delayBeforeQuit", XrmoptionSepArg, NULL },
-    { "-delayAfterQuit", "delayAfterQuit", XrmoptionSepArg, NULL },
-    { "-nameOfDebugFile", "nameOfDebugFile", XrmoptionSepArg, NULL },
-    { "-debugFile", "nameOfDebugFile", XrmoptionSepArg, NULL },
-    { "-engineDebugOutput", "engineDebugOutput", XrmoptionSepArg, NULL },
-    { "-noGUI", "noGUI", XrmoptionNoArg, "True" },
-    { "-firstOptions", "firstOptions", XrmoptionSepArg, NULL },
-    { "-secondOptions", "secondOptions", XrmoptionSepArg, NULL },
-    { "-firstNeedsNoncompliantFEN", "firstNeedsNoncompliantFEN", XrmoptionSepArg, NULL },
-    { "-secondNeedsNoncompliantFEN", "secondNeedsNoncompliantFEN", XrmoptionSepArg, NULL },
-    { "-keepAlive", "keepAlive", XrmoptionSepArg, NULL },
-    { "-forceIllegalMoves", "forceIllegalMoves", XrmoptionNoArg, "True" },
-    { "-keepLineBreaksICS", "keepLineBreaksICS", XrmoptionSepArg, NULL },
-    { "-wrapContinuationSequence", "wrapContinuationSequence", XrmoptionSepArg, NULL },
-    { "-useInternalWrap", "useInternalWrap", XrmoptionSepArg, NULL },
-    { "-autoDisplayTags", "autoDisplayTags", XrmoptionSepArg, NULL },
-    { "-autoDisplayComment", "autoDisplayComment", XrmoptionSepArg, NULL },
-    { "-pasteSelection", "pasteSelection", XrmoptionSepArg, NULL },
 };
 
 XtActionsRec boardActions[] = {
@@ -1778,6 +806,7 @@ XtActionsRec boardActions[] = {
     //    { "EditPositionProc", EditPositionProc },
     //    { "TrainingProc", EditPositionProc },
     { "EngineOutputProc", EngineOutputProc}, // [HGM] Winboard_x engine-output window
+    { "EvalGraphProc", EvalGraphProc},       // [HGM] Winboard_x avaluation graph window
     { "ShowGameListProc", ShowGameListProc },
     //    { "ShowMoveListProc", HistoryShowProc},
     //    { "EditTagsProc", EditCommentProc },
@@ -1833,11 +862,13 @@ XtActionsRec boardActions[] = {
     //    { "QuietPlayProc", QuietPlayProc },
     //    { "ShowThinkingProc", ShowThinkingProc },
     //    { "HideThinkingProc", HideThinkingProc },
-    { "TestLegalityProc", TestLegalityProc },
-    //    { "InfoProc", InfoProc },
-    //    { "ManProc", ManProc },
-    //    { "HintProc", HintProc },
-    //    { "BookProc", BookProc },
+    //    { "TestLegalityProc", TestLegalityProc },
+    { "SaveSettingsProc", SaveSettingsProc },
+    { "SaveOnExitProc", SaveOnExitProc },
+//    { "InfoProc", InfoProc },
+//    { "ManProc", ManProc },
+//    { "HintProc", HintProc },
+//    { "BookProc", BookProc },
     { "AboutGameProc", AboutGameProc },
     { "DebugProc", DebugProc },
     { "NothingProc", NothingProc },
@@ -1852,6 +883,7 @@ XtActionsRec boardActions[] = {
     { "PromotionPopDown", (XtActionProc) PromotionPopDown },
     //    { "HistoryPopDown", (XtActionProc) HistoryPopDown },
     { "EngineOutputPopDown", (XtActionProc) EngineOutputPopDown },
+    { "EvalGraphPopDown", (XtActionProc) EvalGraphPopDown },
     { "ShufflePopDown", (XtActionProc) ShufflePopDown },
     { "EnginePopDown", (XtActionProc) EnginePopDown },
     { "UciPopDown", (XtActionProc) UciPopDown },
@@ -1966,6 +998,259 @@ BoardToTop()
   return;
 }
 
+//---------------------------------------------------------------------------------------------------------
+// some symbol definitions to provide the proper (= XBoard) context for the code in args.h
+#define XBOARD True
+#define JAWS_ARGS
+#define CW_USEDEFAULT (1<<31)
+#define ICS_TEXT_MENU_SIZE 90
+#define SetCurrentDirectory chdir
+#define GetCurrentDirectory(SIZE, NAME) getcwd(NAME, SIZE)
+#define OPTCHAR "-"
+#define SEPCHAR " "
+
+// these two must some day move to frontend.h, when they are implemented
+Boolean MoveHistoryIsUp();
+Boolean GameListIsUp();
+
+// The option definition and parsing code common to XBoard and WinBoard is collected in this file
+#include "args.h"
+
+// front-end part of option handling
+
+// [HGM] This platform-dependent table provides the location for storing the color info
+extern char *crWhite, * crBlack;
+
+void *
+colorVariable[] = {
+  &appData.whitePieceColor, 
+  &appData.blackPieceColor, 
+  &appData.lightSquareColor,
+  &appData.darkSquareColor, 
+  &appData.highlightSquareColor,
+  &appData.premoveHighlightColor,
+  NULL,
+  NULL,
+  NULL,
+  NULL,
+  NULL,
+  NULL,
+  &crWhite,
+  &crBlack,
+  NULL
+};
+
+void
+ParseFont(char *name, int number)
+{ // in XBoard, only 2 of the fonts are currently implemented, and we just copy their name
+  switch(number) {
+    case 0: // CLOCK_FONT
+       appData.clockFont = strdup(name);
+      break;
+    case 1: // MESSAGE_FONT
+       appData.font = strdup(name);
+      break;
+    case 2: // COORD_FONT
+       appData.coordFont = strdup(name);
+      break;
+    default:
+      return;
+  }
+}
+
+void
+SetFontDefaults()
+{ // only 2 fonts currently
+  appData.clockFont = CLOCK_FONT_NAME;
+  appData.coordFont = COORD_FONT_NAME;
+  appData.font  =   DEFAULT_FONT_NAME;
+}
+
+void
+CreateFonts()
+{ // no-op, until we identify the code for this already in XBoard and move it here
+}
+
+void
+ParseColor(int n, char *name)
+{ // in XBoard, just copy the color-name string
+  if(colorVariable[n]) *(char**)colorVariable[n] = strdup(name);
+}
+
+void
+ParseTextAttribs(ColorClass cc, char *s)
+{   
+    (&appData.colorShout)[cc] = strdup(s);
+}
+
+void
+ParseBoardSize(void *addr, char *name)
+{
+    appData.boardSize = strdup(name);
+}
+
+void
+LoadAllSounds()
+{ // In XBoard the sound-playing program takes care of obtaining the actual sound
+}
+
+void
+SetCommPortDefaults()
+{ // for now, this is a no-op, as the corresponding option does not exist in XBoard
+}
+
+// [HGM] args: these three cases taken out to stay in front-end
+void
+SaveFontArg(FILE *f, ArgDescriptor *ad)
+{
+  char *name;
+  switch((int)ad->argLoc) {
+    case 0: // CLOCK_FONT
+       name = appData.clockFont;
+      break;
+    case 1: // MESSAGE_FONT
+       name = appData.font;
+      break;
+    case 2: // COORD_FONT
+       name = appData.coordFont;
+      break;
+    default:
+      return;
+  }
+  fprintf(f, OPTCHAR "%s" SEPCHAR "%s\n", ad->argName, name);
+}
+
+void
+ExportSounds()
+{ // nothing to do, as the sounds are at all times represented by their text-string names already
+}
+
+void
+SaveAttribsArg(FILE *f, ArgDescriptor *ad)
+{      // here the "argLoc" defines a table index. It could have contained the 'ta' pointer itself, though
+       fprintf(f, OPTCHAR "%s" SEPCHAR "%s\n", ad->argName, (&appData.colorShout)[(int)ad->argLoc]);
+}
+
+void
+SaveColor(FILE *f, ArgDescriptor *ad)
+{      // in WinBoard the color is an int and has to be converted to text. In X it would be a string already?
+       if(colorVariable[(int)ad->argLoc])
+       fprintf(f, OPTCHAR "%s" SEPCHAR "%s\n", ad->argName, *(char**)colorVariable[(int)ad->argLoc]);
+}
+
+void
+SaveBoardSize(FILE *f, char *name, void *addr)
+{ // wrapper to shield back-end from BoardSize & sizeInfo
+  fprintf(f, OPTCHAR "%s" SEPCHAR "%s\n", name, appData.boardSize);
+}
+
+void
+ParseCommPortSettings(char *s)
+{ // no such option in XBoard (yet)
+}
+
+extern Widget engineOutputShell;
+extern Widget tagsShell, editTagsShell;
+void
+GetActualPlacement(Widget wg, WindowPlacement *wp)
+{
+  Arg args[16];
+  Dimension w, h;
+  Position x, y;
+  int i;
+
+  if(!wg) return;
+  
+    i = 0;
+    XtSetArg(args[i], XtNx, &x); i++;
+    XtSetArg(args[i], XtNy, &y); i++;
+    XtSetArg(args[i], XtNwidth, &w); i++;
+    XtSetArg(args[i], XtNheight, &h); i++;
+    XtGetValues(wg, args, i);
+    wp->x = x - 4;
+    wp->y = y - 23;
+    wp->height = h;
+    wp->width = w;
+}
+
+void
+GetWindowCoords()
+{ // wrapper to shield use of window handles from back-end (make addressible by number?)
+  // In XBoard this will have to wait until awareness of window parameters is implemented
+  GetActualPlacement(shellWidget, &wpMain);
+  if(EngineOutputIsUp()) GetActualPlacement(engineOutputShell, &wpEngineOutput); else
+  if(MoveHistoryIsUp()) GetActualPlacement(historyShell, &wpMoveHistory);
+  if(EvalGraphIsUp()) GetActualPlacement(evalGraphShell, &wpEvalGraph);
+  if(GameListIsUp()) GetActualPlacement(gameListShell, &wpGameList);
+  if(commentShell) GetActualPlacement(commentShell, &wpComment);
+  else             GetActualPlacement(editShell,    &wpComment);
+  if(tagsShell) GetActualPlacement(tagsShell, &wpTags);
+  else      GetActualPlacement(editTagsShell, &wpTags);
+}
+
+void
+PrintCommPortSettings(FILE *f, char *name)
+{ // This option does not exist in XBoard
+}
+
+int
+MySearchPath(char *installDir, char *name, char *fullname)
+{ // just append installDir and name. Perhaps ExpandPath should be used here?
+  name = ExpandPathName(name);
+  if(name && name[0] == '/') strcpy(fullname, name); else {
+    sprintf(fullname, "%s%c%s", installDir, '/', name);
+  }
+  return 1;
+}
+
+int
+MyGetFullPathName(char *name, char *fullname)
+{ // should use ExpandPath?
+  name = ExpandPathName(name);
+  strcpy(fullname, name);
+  return 1;
+}
+
+void
+EnsureOnScreen(int *x, int *y, int minX, int minY)
+{
+  return;
+}
+
+int
+MainWindowUp()
+{ // [HGM] args: allows testing if main window is realized from back-end
+  return xBoardWindow != 0;
+}
+
+void
+PopUpStartupDialog()
+{  // start menu not implemented in XBoard
+}
+char *
+ConvertToLine(int argc, char **argv)
+{
+  static char line[128*1024], buf[1024];
+  int i;
+
+  line[0] = NULLCHAR;
+  for(i=1; i<argc; i++) {
+    if( (strchr(argv[i], ' ') || strchr(argv[i], '\n') ||strchr(argv[i], '\t') )
+       && argv[i][0] != '{' )
+         sprintf(buf, "{%s} ", argv[i]);
+    else sprintf(buf, "%s ", argv[i]);
+    strcat(line, buf);
+  }
+    line[strlen(line)-1] = NULLCHAR;
+  return line;
+}
+
+//--------------------------------------------------------------------------------------------
+
+#ifdef IDSIZES
+  // eventually, all layout determining code should go into a subroutine, but until then IDSIZE remains undefined
+#else
+
 #define BoardSize int
 void InitDrawingSizes(BoardSize boardSize, int flags)
 {   // [HGM] resize is functional now, but for board format changes only (nr of ranks, files)
@@ -2058,6 +1343,7 @@ void InitDrawingSizes(BoardSize boardSize, int flags)
     CreateAnimVars();
 #endif
 }
+#endif
 
 void EscapeExpand(char *p, char *q)
 {      // [HGM] initstring: routine to shape up string arguments
@@ -2087,7 +1373,8 @@ main(argc, argv)
     XrmDatabase xdb;
     int forceMono = False;
 
-#define INDIRECTION
+//define INDIRECTION
+
 #ifdef INDIRECTION
     // [HGM] before anything else, expand any indirection files amongst options
     char *argvCopy[1000]; // 1000 seems enough
@@ -2199,6 +1486,9 @@ main(argc, argv)
 
     /* end parse glade file */
 
+    appData.boardSize = "";
+    InitAppData(ConvertToLine(argc, argv));
+
     if (argc > 1)
       {
        fprintf(stderr, _("%s: unrecognized argument %s\n"),
@@ -2335,6 +1625,7 @@ main(argc, argv)
                szd++;
              }
            if (szd->name == NULL) szd--;
+           appData.boardSize = strdup(szd->name); // [HGM] settings: remember name for saving settings
          } 
        else 
          {
@@ -2628,11 +1919,18 @@ main(argc, argv)
       gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Show Coords")),TRUE);
 
     if (appData.showThinking)
-      gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Show Thinking")),TRUE);
+      gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Hide Thinking")),TRUE);
 
     if (appData.testLegality)
       gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_builder_get_object (builder, "menuOptions.Test Legality")),TRUE);
 
+    // TODO: add
+    //    if (saveSettingsOnExit) {
+    // XtSetValues(XtNameToWidget(menuBarWidget,"menuOptions.Save Settings on Exit"),
+    //             args, 1);
+    //   }
+
+
     /* end setting check boxes */
 
     /* load square colors */
@@ -2702,6 +2000,7 @@ ShutDownFrontEnd()
     if (appData.icsActive && oldICSInteractionTitle != NULL) {
         DisplayIcsInteractionTitle(oldICSInteractionTitle);
     }
+    if (saveSettingsOnExit) SaveSettings(settingsFileName);
     unlink(gameCopyFilename);
     unlink(gamePasteFilename);
 }
@@ -4125,6 +3424,14 @@ Widget CommentCreate(name, text, mutable, callback, lines)
 #endif /*!NOTDEF*/
        if (commentY < 0) commentY = 0; /*avoid positioning top offscreen*/
     }
+
+    if(wpComment.width > 0) {
+      commentX = wpComment.x;
+      commentY = wpComment.y;
+      commentW = wpComment.width;
+      commentH = wpComment.height;
+    }
+
     j = 0;
     XtSetArg(args[j], XtNheight, commentH);  j++;
     XtSetArg(args[j], XtNwidth, commentW);  j++;
@@ -4834,6 +4141,7 @@ void CopyPositionProc(w, event, prms, nprms)
      * have a notion of a position that is selected but not copied.
      * See http://www.freedesktop.org/wiki/Specifications/ClipboardsWiki
      */
+    if(gameMode == EditPosition) EditPositionDone(TRUE);
     if (selected_fen_position) free(selected_fen_position);
     selected_fen_position = (char *)PositionToFEN(currentMove, NULL);
     if (!selected_fen_position) return;
@@ -4999,6 +4307,34 @@ void PasteGameProc(w, event, prms, nprms)
     return;
 }
 
+void SaveOnExitProc(w, event, prms, nprms)
+     Widget w;
+     XEvent *event;
+     String *prms;
+     Cardinal *nprms;
+{
+    Arg args[16];
+
+    saveSettingsOnExit = !saveSettingsOnExit;
+
+    if (saveSettingsOnExit) {
+       XtSetArg(args[0], XtNleftBitmap, xMarkPixmap);
+    } else {
+       XtSetArg(args[0], XtNleftBitmap, None);
+    }
+    XtSetValues(XtNameToWidget(menuBarWidget, "menuOptions.Save Settings on Exit"),
+               args, 1);
+}
+
+void SaveSettingsProc(w, event, prms, nprms)
+     Widget w;
+     XEvent *event;
+     String *prms;
+     Cardinal *nprms;
+{
+     SaveSettings(settingsFileName);
+}
+
 
 void AutoSaveGame()
 {
@@ -5849,8 +5185,11 @@ int StartChildProcess(cmdLine, dir, pr)
     strcpy(buf, cmdLine);
     p = buf;
     for (;;) {
+       while(*p == ' ') p++;
        argv[i++] = p;
-       p = strchr(p, ' ');
+       if(*p == '"' || *p == '\'')
+            p = strchr(++argv[i-1], *p);
+       else p = strchr(p, ' ');
        if (p == NULL) break;
        *p++ = NULLCHAR;
     }
diff --git a/xboard.conf b/xboard.conf
new file mode 100644 (file)
index 0000000..387ba39
--- /dev/null
@@ -0,0 +1,71 @@
+;
+; xboard 4.4.1.20091022 Save Settings file
+;
+; This file contains the system-wide settings of XBoard, in so far they
+; deviate from the compiled-in defaults, and are not settable through menus,
+; to comfort users that have no history of xboard usage.
+; You can edit the values of options that are already set in this file,
+; or add other options that you think are convenient as defaults for all users.
+; This file is not automatically overwritten, because it redefines the
+; -saveSettingsFile to .xboardrc in the user's home directory, so that
+; user settings will be saved in a place the user has write access to.
+;
+; Looks
+;
+-internetChessServerInputBox false
+-titleInWindow false
+-showButtonBar true
+-moveHistoryUp false
+-evalGraphUp false
+-engineOutputUp false
+-monoMode false
+-flashCount 0
+-flashRate 5
+-fontSizeTolerance 4
+-clockFont -adobe-helvetica-bold-r-normal--34-240-100-100-p-182-iso8859-1
+-font -adobe-helvetica-medium-r-normal--14-100-100-100-p-76-iso8859-1
+-coordFont -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
+-pixmapDirectory ""
+-bitmapDirectory ""
+;
+; Behavior
+;
+-soundProgram "aplay -q"
+-pasteSelection false
+-keepLineBreaksICS false
+-timeDelay 1
+-autoDisplayComment true
+-autoDisplayTags true
+-lowTimeWarning false
+-icsAlarm false
+-icsAlarmTime 5000
+-msLoginDelay 0
+-delayBeforeQuit 0
+-delayAfterQuit 0
+;
+; PGN format & Game List
+;
+-pgnExtendedInfo true
+-saveOutOfBookInfo true
+-gameListTags "eprd"
+;
+; Engines & adjudicatons in engine-engine games
+;
+-firstChessProgram fairymax
+-secondChessProgram fairymax
+-niceEngines 0
+-polyglotDir ""
+-defaultPathEGTB "/egtb"
+-egtFormats ""
+-testClaims true
+-checkMates true
+-materialDraws true
+-trivialDraws false
+;
+; Save user settings.
+; Must be last in file to make user options prevail over system-wide settings!
+;
+-saveSettingsOnExit true
+-saveSettingsFile "~/.xboardrc"
+-settingsFile "~/.xboardrc"
+
index 9f3cdd7..7ada32f 100644 (file)
--- a/xboard.h
+++ b/xboard.h
@@ -54,9 +54,9 @@
 #define ICS_LOGON    ".icsrc"
 #define INFOFILE     "xboard.info"
 #define MANPAGE      "xboard.6"
-#define CLOCK_FONT   "-*-helvetica-bold-r-normal--*-*-*-*-*-*-*-*"
-#define COORD_FONT   "-*-helvetica-bold-r-normal--*-*-*-*-*-*-*-*"
-#define DEFAULT_FONT "-*-helvetica-medium-r-normal--*-*-*-*-*-*-*-*"
+#define CLOCK_FONT_NAME         "-*-helvetica-bold-r-normal--*-*-*-*-*-*-*-*"
+#define COORD_FONT_NAME         "-*-helvetica-bold-r-normal--*-*-*-*-*-*-*-*"
+#define DEFAULT_FONT_NAME       "-*-helvetica-medium-r-normal--*-*-*-*-*-*-*-*"
 #define COLOR_SHOUT             "green"
 #define COLOR_SSHOUT            "green,black,1"
 #define COLOR_CHANNEL1          "cyan"
@@ -106,8 +106,15 @@ typedef struct {
 #define BORDER_Y_OFFSET 27
 #define FIRST_CHESS_PROGRAM    "fairymax"
 #define SECOND_CHESS_PROGRAM   "fairymax"
-
-#define XBOARD True
+#define FIRST_DIRECTORY         "."
+#define SECOND_DIRECTORY        "."
+#define SOUND_BELL              ""
+#define ICS_NAMES               ""
+#define FCP_NAMES               ""
+#define SCP_NAMES               ""
+#define ICS_TEXT_MENU_DEFAULT   ""
+#define SETTINGS_FILE           "/etc/xboard/xboard.conf"
+#define COLOR_BKGD              "white"
 
 typedef int (*FileProc) P((FILE *f, int n, char *title));
 void CatchDeleteWindow(Widget w, String procname);
index 5542d25..27c3e9c 100644 (file)
@@ -56,6 +56,7 @@ extern char *getenv();
 extern GtkWidget               *GUI_EditTags;
 extern GtkWidget               *GUI_EditTagsTextArea;
 
+Widget tagsShell, editTagsShell;
 
 #ifdef ENABLE_NLS
 # define  _(s) gettext (s)
index e27da9e..79a225f 100644 (file)
@@ -27,4 +27,5 @@
 void EditTagsProc P((GtkObject *object, gpointer user_data));
 void EditTagsHideProc P((GtkObject *object, gpointer user_data));
 
+extern Widget editTagsShell, tagsShell;
 #endif
index 7162631..10c59bf 100644 (file)
@@ -115,7 +115,6 @@ int  EngineOutputIsUp();
 void SetEngineColorIcon( int which );
 
 /* Imports from backend.c */
-char * SavePart(char *str);
 extern int opponentKibitzes;
 
 /* Imports from xboard.c */
@@ -184,6 +183,10 @@ void InsertIntoMemo( int which, char * text, int where )
 {
        Arg arg; XawTextBlock t; Widget edit;
 
+       /* the backend adds \r\n, which is needed for winboard, 
+        * for xboard we delete them again over here */
+       if(t.ptr = strchr(text, '\r')) *t.ptr = ' ';
+
        t.ptr = text; t.firstPos = 0; t.length = strlen(text); t.format = XawFmt8Bit;
        edit = XtNameToWidget(engineOutputShell, which ? "*form2.text" : "*form.text");
        XawTextReplace(edit, where, where, &t);
@@ -366,6 +369,13 @@ Widget EngineOutputCreate(name, text)
 
     XtRealizeWidget(shell);
 
+    if(wpEngineOutput.width > 0) {
+      engineOutputW = wpEngineOutput.width;
+      engineOutputH = wpEngineOutput.height;
+      engineOutputX = wpEngineOutput.x;
+      engineOutputY = wpEngineOutput.y;
+    }
+
     if (engineOutputX == -1) {
        int xx, yy;
        Window junk;
@@ -499,6 +509,10 @@ void EngineOutputPopDown()
     XtSetArg(args[j], XtNwidth, &engineOutputW); j++;
     XtSetArg(args[j], XtNheight, &engineOutputH); j++;
     XtGetValues(engineOutputShell, args, j);
+    wpEngineOutput.x = engineOutputX - 4;
+    wpEngineOutput.y = engineOutputY - 23;
+    wpEngineOutput.width = engineOutputW;
+    wpEngineOutput.height = engineOutputH;
     XtPopdown(engineOutputShell);
     XSync(xDisplay, False);
     j=0;
diff --git a/xevalgraph.c b/xevalgraph.c
new file mode 100644 (file)
index 0000000..3556473
--- /dev/null
@@ -0,0 +1,472 @@
+/*
+ * Evaluation graph
+ *
+ * Author: Alessandro Scotti (Dec 2005)
+ * Translated to X by H.G.Muller (Nov 2009)
+ *
+ * Copyright 2005 Alessandro Scotti
+ *
+ * Enhancements Copyright 2009 Free Software Foundation, Inc.
+ *
+ * ------------------------------------------------------------------------
+ *
+ * GNU XBoard is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or (at
+ * your option) any later version.
+ *
+ * GNU XBoard is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ *
+ * ------------------------------------------------------------------------
+ ** See the file ChangeLog for a revision history.  */
+
+#include "config.h"
+
+#include <stdio.h>
+#include <ctype.h>
+#include <errno.h>
+#include <sys/types.h>
+
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <string.h>
+#else /* not STDC_HEADERS */
+extern char *getenv();
+# if HAVE_STRING_H
+#  include <string.h>
+# else /* not HAVE_STRING_H */
+#  include <strings.h>
+# endif /* not HAVE_STRING_H */
+#endif /* not STDC_HEADERS */
+
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#include <X11/Intrinsic.h>
+#include <X11/StringDefs.h>
+#include <X11/Shell.h>
+#include <X11/Xaw/Dialog.h>
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/List.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/SimpleMenu.h>
+#include <X11/Xaw/SmeBSB.h>
+#include <X11/Xaw/SmeLine.h>
+#include <X11/Xaw/Box.h>
+#include <X11/Xaw/Paned.h>
+#include <X11/Xaw/MenuButton.h>
+#include <X11/cursorfont.h>
+#include <X11/Xaw/Text.h>
+#include <X11/Xaw/AsciiText.h>
+#include <X11/Xaw/Viewport.h>
+
+#include "common.h"
+#include "frontend.h"
+#include "backend.h"
+#include "xboard.h"
+#include "evalgraph.h"
+#include "gettext.h"
+
+#ifdef ENABLE_NLS
+# define  _(s) gettext (s)
+# define N_(s) gettext_noop (s)
+#else
+# define  _(s) (s)
+# define N_(s)  s
+#endif
+
+#include <X11/xpm.h>
+
+// [HGM] pixmaps of some ICONS used in the engine-outut window
+#include "pixmaps/WHITE_14.xpm"
+#include "pixmaps/BLACK_14.xpm"
+#include "pixmaps/CLEAR_14.xpm"
+#include "pixmaps/UNKNOWN_14.xpm"
+#include "pixmaps/THINKING_14.xpm"
+#include "pixmaps/PONDER_14.xpm"
+#include "pixmaps/ANALYZING_14.xpm"
+
+#ifdef SNAP
+#include "wsnap.h"
+#endif
+
+#define _LL_ 100
+
+// imports from xboard.c
+extern Widget formWidget, shellWidget, boardWidget, menuBarWidget;
+extern Display *xDisplay;
+extern Window xBoardWindow;
+extern int squareSize;
+extern Pixmap xMarkPixmap, wIconPixmap, bIconPixmap;
+extern char *layoutName;
+
+Pixmap icons[8]; // [HGM] this front-end array translates back-end icon indicator to handle
+Widget outputField[2][7]; // [HGM] front-end array to translate output field to window handle
+
+/* Imports from backend.c */
+
+/* Imports from xboard.c */
+extern Arg layoutArgs[2], formArgs[2], messageArgs[4];
+extern GC coordGC;
+
+//extern WindowPlacement wpEvalGraph;
+
+Position evalGraphX = -1, evalGraphY = -1;
+Dimension evalGraphW, evalGraphH;
+Widget evalGraphShell;
+static int evalGraphDialogUp;
+
+/* Module variables */
+
+char *crWhite = "#FFFFB0";
+char *crBlack = "#AD5D3D";
+static Display *yDisplay;
+static Window eGraphWindow;
+
+static GC pens[6]; // [HGM] put all pens in one array
+static GC hbrHist[3];
+
+#if 0
+static HDC hdcPB = NULL;
+static HBITMAP hbmPB = NULL;
+#endif
+
+// [HGM] front-end, added as wrapper to avoid use of LineTo and MoveToEx in other routines (so they can be back-end) 
+void DrawSegment( int x, int y, int *lastX, int *lastY, int penType )
+{
+static curX, curY;
+    if(penType != PEN_NONE)
+      XDrawLine(yDisplay, eGraphWindow, pens[penType], curX, curY, x, y);
+    if(lastX != NULL) { *lastX = curX; *lastY = curY; }
+    curX = x; curY = y;
+}
+
+// front-end wrapper for drawing functions to do rectangles
+void DrawRectangle( int left, int top, int right, int bottom, int side, int style )
+{
+    XFillRectangle(yDisplay, eGraphWindow, hbrHist[side], left, top, right-left, bottom-top);
+    if(style != FILLED)
+      XDrawRectangle(yDisplay, eGraphWindow, pens[PEN_BLACK], left, top, right-left-1, bottom-top-1);
+}
+
+// front-end wrapper for putting text in graph
+void DrawEvalText(char *buf, int cbBuf, int y)
+{
+    // the magic constants 7 and 5 should really be derived from the font size somehow
+    XDrawString(yDisplay, eGraphWindow, coordGC, MarginX - 2 - 7*cbBuf, y+5, buf, cbBuf);
+}
+
+// front-end
+static Pixel MakeColor(char *color )
+{
+    XrmValue vFrom, vTo;
+
+    vFrom.addr = (caddr_t) color;
+    vFrom.size = strlen(color);
+    XtConvert(evalGraphShell, XtRString, &vFrom, XtRPixel, &vTo);
+    // test for NULL?
+
+    return *(Pixel *) vTo.addr;
+}
+
+static GC CreateGC(int width, char *fg, char *bg, int style)
+{
+    XtGCMask value_mask = GCLineWidth | GCLineStyle | GCForeground
+      | GCBackground | GCFunction | GCPlaneMask;
+    XGCValues gc_values;
+
+    gc_values.plane_mask = AllPlanes;
+    gc_values.line_width = width;
+    gc_values.line_style = style;
+    gc_values.function = GXcopy;
+
+    gc_values.foreground = MakeColor(fg);
+    gc_values.background = MakeColor(bg);
+
+    return XtGetGC(evalGraphShell, value_mask, &gc_values);
+}
+
+// front-end. Create pens, device context and buffer bitmap for global use, copy result to display
+// The back-end part n the middle has been taken out and moed to PainEvalGraph()
+static void DisplayEvalGraph()
+{
+    int j;
+    int width;
+    int height;
+    Dimension w, h;
+    Arg args[6];
+
+    /* Get client area */
+    j = 0;
+    XtSetArg(args[j], XtNwidth, &w); j++;
+    XtSetArg(args[j], XtNheight, &h); j++;
+    XtGetValues(evalGraphShell, args, j);
+    width = w;
+    height = h;
+
+    /* Create or recreate paint box if needed */
+    if( width != nWidthPB || height != nHeightPB ) {
+
+        nWidthPB = width;
+        nHeightPB = height;
+    }
+
+    // back-end painting; calls back front-end primitives for lines, rectangles and text
+    PaintEvalGraph();
+
+    XSync(yDisplay, False);
+}
+
+static void InitializeEvalGraph()
+{ int i;    XtGCMask value_mask = GCLineWidth | GCLineStyle | GCForeground
+      | GCBackground | GCFunction | GCPlaneMask;
+    XGCValues gc_values;
+//    GC copyInvertedGC;
+
+    pens[PEN_BLACK]     = CreateGC(1, "black", "black", LineSolid);
+    pens[PEN_DOTTED]    = CreateGC(1, "#A0A0A0", "#A0A0A0", LineOnOffDash);
+    pens[PEN_BLUEDOTTED] = CreateGC(1, "#0000FF", "#0000FF", LineOnOffDash);
+    pens[PEN_BOLD]      = CreateGC(3, crWhite, crWhite, LineSolid);
+    pens[PEN_BOLD+1]    = CreateGC(3, crBlack, crBlack, LineSolid);
+    hbrHist[0] = CreateGC(3, crWhite, crWhite, LineSolid);
+    hbrHist[1] = CreateGC(3, crBlack, crBlack, LineSolid);
+    hbrHist[2] = CreateGC(3, "#E0E0F0", "#E0E0F0", LineSolid);; // background (a bit blueish, for contrst with yellow curve)
+}
+
+void EvalClick(widget, unused, event)
+     Widget widget;
+     caddr_t unused;
+     XEvent *event;
+{
+        if( widget && event->type == ButtonPress ) {
+            int index = GetMoveIndexFromPoint( event->xbutton.x, event->xbutton.y );
+
+            if( index >= 0 && index < currLast ) {
+                ToNrEvent( index + 1 );
+            }
+        }
+}
+
+// This (cloned from EventProc in xboard.c) is needed as event handler, to prevent
+// the graph being wiped out after covering / uncovering by other windows.
+void EvalEventProc(widget, unused, event)
+     Widget widget;
+     caddr_t unused;
+     XEvent *event;
+{
+    if (!XtIsRealized(widget))
+      return;
+
+    switch (event->type) {
+      case Expose:
+       if (event->xexpose.count > 0) return;  /* no clipping is done */
+       DisplayEvalGraph();
+       break;
+      default:
+       return;
+    }
+}
+// The following routines are mutated clones of the commentPopUp routines
+
+Widget EvalGraphCreate(name)
+     char *name;
+{
+    Arg args[16];
+    Widget shell, layout, form, form2, edit;
+    Dimension bw_width, bw_height;
+    int j;
+
+    // get board width
+    j = 0;
+    XtSetArg(args[j], XtNwidth,  &bw_width);  j++;
+    XtSetArg(args[j], XtNheight, &bw_height);  j++;
+    XtGetValues(boardWidget, args, j);
+
+    // define form within layout within shell.
+    j = 0;
+    XtSetArg(args[j], XtNresizable, True);  j++;
+    shell =
+#if TOPLEVEL 
+     XtCreatePopupShell(name, topLevelShellWidgetClass,
+#else
+      XtCreatePopupShell(name, transientShellWidgetClass,
+#endif
+                        shellWidget, args, j);
+    layout =
+      XtCreateManagedWidget(layoutName, formWidgetClass, shell,
+                           layoutArgs, XtNumber(layoutArgs));
+    // divide window vertically into two equal parts, by creating two forms
+    form =
+      XtCreateManagedWidget("form", formWidgetClass, layout,
+                           formArgs, XtNumber(formArgs));
+    // make sure width is known in advance, for better placement of child widgets
+    j = 0;
+    XtSetArg(args[j], XtNwidth,     (XtArgVal) bw_width-16); j++;
+    XtSetArg(args[j], XtNheight,    (XtArgVal) bw_height/4); j++;
+    XtSetValues(shell, args, j);
+
+    XtRealizeWidget(shell);
+
+    if(wpEvalGraph.width > 0) {
+      evalGraphW = wpEvalGraph.width;
+      evalGraphH = wpEvalGraph.height;
+      evalGraphX = wpEvalGraph.x;
+      evalGraphY = wpEvalGraph.y;
+    }
+
+    if (evalGraphX == -1) {
+       int xx, yy;
+       Window junk;
+       Dimension pw_height;
+       Dimension ew_height;
+       evalGraphH = bw_height/4;
+       evalGraphW = bw_width-16;
+
+       XSync(xDisplay, False);
+#ifdef NOTDEF
+       /* This code seems to tickle an X bug if it is executed too soon
+          after xboard starts up.  The coordinates get transformed as if
+          the main window was positioned at (0, 0).
+          */
+       XtTranslateCoords(shellWidget,
+                         (bw_width - evalGraphW) / 2, 0 - evalGraphH / 2,
+                         &evalGraphX, &evalGraphY);
+#else  /*!NOTDEF*/
+        XTranslateCoordinates(xDisplay, XtWindow(shellWidget),
+                             RootWindowOfScreen(XtScreen(shellWidget)),
+                             (bw_width - evalGraphW) / 2, 0 - evalGraphH / 2,
+                             &xx, &yy, &junk);
+       evalGraphX = xx;
+       evalGraphY = yy;
+#endif /*!NOTDEF*/
+       if (evalGraphY < 0) evalGraphY = 0; /*avoid positioning top offscreen*/
+    }
+    j = 0;
+    XtSetArg(args[j], XtNheight, evalGraphH);  j++;
+    XtSetArg(args[j], XtNwidth, evalGraphW);  j++;
+    XtSetArg(args[j], XtNx, evalGraphX);  j++;
+    XtSetArg(args[j], XtNy, evalGraphY);  j++;
+    XtSetValues(shell, args, j);
+//    XtSetKeyboardFocus(shell, edit);
+
+    yDisplay = XtDisplay(shell);
+    eGraphWindow = XtWindow(form);
+    XtAddEventHandler(form, ExposureMask, False,
+                     (XtEventHandler) EvalEventProc, NULL);
+    XtAddEventHandler(form, ButtonPressMask, False,
+                     (XtEventHandler) EvalClick, NULL);
+
+    return shell;
+}
+
+void 
+EvalGraphPopUp()
+{
+    Arg args[16];
+    int j;
+    Widget edit;
+    static int  needInit = TRUE;
+    static char *title = _("Evaluation graph");
+
+    if (evalGraphShell == NULL) {
+
+       evalGraphShell =
+         EvalGraphCreate(title);
+       XtRealizeWidget(evalGraphShell);
+       CatchDeleteWindow(evalGraphShell, "EvalGraphPopDown");
+       if( needInit ) {
+           InitializeEvalGraph();
+           needInit = FALSE;
+       }
+    } else {
+       j = 0;
+       XtSetArg(args[j], XtNiconName, (XtArgVal) title);   j++;
+       XtSetArg(args[j], XtNtitle, (XtArgVal) title);      j++;
+       XtSetValues(evalGraphShell, args, j);
+    }
+
+    XtPopup(evalGraphShell, XtGrabNone);
+    XSync(yDisplay, False);
+
+    j=0;
+    XtSetArg(args[j], XtNleftBitmap, xMarkPixmap); j++;
+    XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Evaluation Graph"),
+               args, j);
+
+    evalGraphDialogUp = True;
+//    ShowThinkingEvent(); // [HGM] thinking: might need to prompt engine for thinking output
+}
+
+void EvalGraphPopDown()
+{
+    Arg args[16];
+    int j;
+
+    if (!evalGraphDialogUp) return;
+    j = 0;
+    XtSetArg(args[j], XtNx, &evalGraphX); j++;
+    XtSetArg(args[j], XtNy, &evalGraphY); j++;
+    XtSetArg(args[j], XtNwidth, &evalGraphW); j++;
+    XtSetArg(args[j], XtNheight, &evalGraphH); j++;
+    XtGetValues(evalGraphShell, args, j);
+    wpEvalGraph.x = evalGraphX - 4;
+    wpEvalGraph.y = evalGraphY - 23;
+    wpEvalGraph.width = evalGraphW;
+    wpEvalGraph.height = evalGraphH;
+    XtPopdown(evalGraphShell);
+    XSync(xDisplay, False);
+    j=0;
+    XtSetArg(args[j], XtNleftBitmap, None); j++;
+    XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Evaluation Graph"),
+               args, j);
+
+    evalGraphDialogUp = False;
+//    ShowThinkingEvent(); // [HGM] thinking: might need to shut off thinking output
+}
+
+Boolean EvalGraphIsUp()
+{
+    return evalGraphDialogUp;
+}
+
+int EvalGraphDialogExists()
+{
+    return evalGraphShell != NULL;
+}
+
+void
+EvalGraphProc(w, event, prms, nprms)
+     Widget w;
+     XEvent *event;
+     String *prms;
+     Cardinal *nprms;
+{
+  if (evalGraphDialogUp) {
+    EvalGraphPopDown();
+  } else {
+    EvalGraphPopUp();
+  }
+}
+// This function is the interface to the back-end. It is currently called through the front-end,
+// though, where it shares the HistorySet() wrapper with MoveHistorySet(). Once all front-ends
+// support the eval graph, it would be more logical to call it directly from the back-end.
+void EvalGraphSet( int first, int last, int current, ChessProgramStats_Move * pvInfo )
+{
+    /* [AS] Danger! For now we rely on the pvInfo parameter being a static variable! */
+
+    currFirst = first;
+    currLast = last;
+    currCurrent = current;
+    currPvInfo = pvInfo;
+
+    if( evalGraphShell ) {
+        DisplayEvalGraph();
+    }
+}
index 46e2b20..009356b 100644 (file)
@@ -91,7 +91,7 @@ extern char *getenv();
 #endif
 
 
-extern Widget formWidget, shellWidget, boardWidget, menuBarWidget;
+extern Widget formWidget, shellWidget, boardWidget, menuBarWidget, gameListShell;
 extern Display *xDisplay;
 extern int squareSize;
 extern Pixmap xMarkPixmap;
@@ -137,11 +137,11 @@ GameListCreate(name, callback, client_data)
     XtSetArg(args[j], XtNresizable, True);  j++;
     XtSetArg(args[j], XtNallowShellResize, True);  j++;
 #if TOPLEVEL
-    shell =
+    shell = gameListShell =
       XtCreatePopupShell(name, topLevelShellWidgetClass,
                         shellWidget, args, j);
 #else
-    shell =
+    shell = gameListShell =
       XtCreatePopupShell(name, transientShellWidgetClass,
                         shellWidget, args, j);
 #endif
@@ -218,6 +218,13 @@ GameListCreate(name, callback, client_data)
       XtCreateManagedWidget(_("close"), commandWidgetClass, form, args, j);
     XtAddCallback(b_close, XtNcallback, callback, client_data);
 
+    if(wpGameList.width > 0) {
+       glc->x = wpGameList.x;
+       glc->y = wpGameList.y;
+       glc->w = wpGameList.width;
+       glc->h = wpGameList.height;
+    }
+
     if (glc->x == -1) {
        Position y1;
        Dimension h1;
@@ -455,6 +462,10 @@ GameListPopDown()
     XtSetArg(args[j], XtNheight, &glc->h); j++;
     XtSetArg(args[j], XtNwidth, &glc->w); j++;
     XtGetValues(glc->shell, args, j);
+    wpGameList.x = glc->x - 4;
+    wpGameList.y = glc->y - 23;
+    wpGameList.width = glc->w;
+    wpGameList.height = glc->h;
     XtPopdown(glc->shell);
     XtSetKeyboardFocus(shellWidget, formWidget);
     glc->up = False;
@@ -473,3 +484,9 @@ GameListHighlight(index)
     listwidg = XtNameToWidget(glc->shell, "*form.viewport.list");
     XawListHighlight(listwidg, index - 1);
 }
+
+Boolean
+GameListIsUp()
+{
+    return glc && glc->up;
+}
index f020f22..21340aa 100644 (file)
@@ -28,4 +28,5 @@ void ShowGameListProc P((Widget w, XEvent *event,
 void LoadSelectedProc P((Widget w, XEvent *event,
                         String *prms, Cardinal *nprms));
 
+extern Widget gameListShell;
 #endif /* _XGAMEL_H */
index 2b861eb..c220e9a 100644 (file)
@@ -64,7 +64,7 @@ extern GtkListStore            *LIST_MoveHistory;
 
 String dots=" ... ";
 Position gameHistoryX, gameHistoryY;
-Dimension gameHistoryW;
+Dimension gameHistoryW, gameHistoryH;
 
 void
 HistoryPopDown(object, user_data)
@@ -149,6 +149,7 @@ void HistorySet(char movelist[][2*MOVE_LEN],int first,int last,int current)
          strcpy(moveblack,"");
        };
     }
+
   /* check if ther is a white move left */
   if(movewhite[0])
     {
@@ -162,6 +163,9 @@ void HistorySet(char movelist[][2*MOVE_LEN],int first,int last,int current)
                          2, moveblack,
                          -1);
     };
+
+  //TODO
+  //  EvalGraphSet( first, last, current, pvInfoList ); // piggy-backed
   
   return;
 }
@@ -176,15 +180,16 @@ void HistoryCreate()
 
     return;
     /*-------- create the widgets ---------------*/
+//<<<<<<< HEAD
 //    j = 0;
 //    XtSetArg(args[j], XtNresizable, True);  j++;
 //    XtSetArg(args[j], XtNallowShellResize, True);  j++;
 //#if TOPLEVEL
-//    hist->sh =
+//    hist->sh = historyShell =
 //      XtCreatePopupShell(_("Move list"), topLevelShellWidgetClass,
 //                      shellWidget, args, j);
 //#else
-//    hist->sh =
+//    hist->sh = historyShell =
 //      XtCreatePopupShell(_("Move list"), transientShellWidgetClass,
 //                      shellWidget, args, j);
 //#endif
@@ -201,10 +206,8 @@ void HistoryCreate()
 //
 //    form =
 //      XtCreateManagedWidget("form", formWidgetClass, layout, args, j);
-//     j=0;
 //
 //    j = 0;
-//
 //    XtSetArg(args[j], XtNtop, XtChainTop);  j++;
 //    XtSetArg(args[j], XtNbottom, XtChainBottom);  j++;
 //    XtSetArg(args[j], XtNleft, XtChainLeft);  j++;
@@ -293,19 +296,26 @@ void HistoryCreate()
 //      strcpy(hist->black[i],"");
 //     }
 //
+//    if(wpMoveHistory.width > 0) {
+//      gameHistoryW = wpMoveHistory.width;
+//      gameHistoryH = wpMoveHistory.height;
+//      gameHistoryX = wpMoveHistory.x;
+//      gameHistoryY = wpMoveHistory.y;
+//    }
+//
 //  // [HGM] restore old position
+//  if(gameHistoryW > 0) {
 //  j = 0;
-//  XtSetArg(args[j], XtNx, &gameHistoryX);  j++;
-//  XtSetArg(args[j], XtNy, &gameHistoryY);  j++;
-//  XtSetArg(args[j], XtNwidth, &gameHistoryW);  j++;
-//  XtGetValues(shellWidget, args, j);
-//  j = 0;
-//  XtSetArg(args[j], XtNx, gameHistoryX + gameHistoryW);  j++;
+//    XtSetArg(args[j], XtNx, gameHistoryX);  j++;
 //  XtSetArg(args[j], XtNy, gameHistoryY);  j++;
+//    XtSetArg(args[j], XtNwidth, gameHistoryW);  j++;
+//    XtSetArg(args[j], XtNheight, gameHistoryH);  j++;
 //  XtSetValues(hist->sh, args, j);
+//  }
 //    XtRealizeWidget(hist->sh);
 //
 //    return hist->sh;
+//
 }
 
 void
@@ -331,3 +341,10 @@ HistoryShowProc(object, user_data)
   return;
 }
 
+Boolean
+MoveHistoryIsUp()
+{
+  // TODO
+  return 0;
+  //  return hist && hist->Up;
+}
index 8e8c5d7..109e1bd 100644 (file)
@@ -27,5 +27,8 @@ void HistoryShowProc  P((GtkObject *object, gpointer user_data));
 
 void HistoryPopDown   P((GtkObject *object, gpointer user_data));
 
+Boolean MoveHistoryIsUp P((void));
+
+extern Widget historyShell;
 #endif /* _XHISTL_H */
  
index c154030..2f0ea15 100644 (file)
@@ -603,8 +603,8 @@ void EngineCallback(w, client_data, call_data)
        // read all switches
        appData.periodicUpdates = ReadToggle(w1);
 //     appData.hideThinkingFromHuman = ReadToggle(w2);
-       appData.firstScoreIsAbsolute  = ReadToggle(w3);
-       appData.secondScoreIsAbsolute = ReadToggle(w4);
+       first.scoreIsAbsolute  = appData.firstScoreIsAbsolute  = ReadToggle(w3);
+       second.scoreIsAbsolute = appData.secondScoreIsAbsolute = ReadToggle(w4);
        appData.testClaims    = ReadToggle(w5);
        appData.checkMates    = ReadToggle(w6);
        appData.materialDraws = ReadToggle(w7);