From d533e3ee12288f2b2d1043a0163db3eb4b0aacd9 Mon Sep 17 00:00:00 2001 From: Daniel Mehrmann Date: Sat, 17 Jan 2004 00:11:28 +0000 Subject: [PATCH] mehrmann wb extensions --- winboard-dm-beta4/moves.h | 147 +++++++ winboard-dm-beta4/parser.l | 922 +++++++++++++++++++++++++++++++++++++++++ winboard-dm-beta4/resource.h | 429 +++++++++++++++++++ winboard-dm-beta4/wgamelist.h | 26 ++ 4 files changed, 1524 insertions(+), 0 deletions(-) create mode 100755 winboard-dm-beta4/moves.h create mode 100755 winboard-dm-beta4/parser.l create mode 100755 winboard-dm-beta4/resource.h create mode 100755 winboard-dm-beta4/wgamelist.h diff --git a/winboard-dm-beta4/moves.h b/winboard-dm-beta4/moves.h new file mode 100755 index 0000000..b1cf2ef --- /dev/null +++ b/winboard-dm-beta4/moves.h @@ -0,0 +1,147 @@ +/* + * moves.h - Move generation and checking + * $Id$ + * + * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. + * Enhancements Copyright 1992-95 Free Software Foundation, Inc. + * + * 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: + * ------------------------------------------------------------------------ + * This program 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 2 of the License, or + * (at your option) any later version. + * + * This program 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ------------------------------------------------------------------------ + */ + +extern ChessSquare PromoPiece P((ChessMove moveType)); +extern ChessMove PromoCharToMoveType P((int whiteOnMove, int promoChar)); +extern char PieceToChar P((ChessSquare p)); +extern ChessSquare CharToPiece P((int c)); + +extern void CopyBoard P((Board to, Board from)); +extern int CompareBoards P((Board board1, Board board2)); + +typedef void (*MoveCallback) P((Board board, int flags, ChessMove kind, + int rf, int ff, int rt, int ft, + VOIDSTAR closure)); + +/* Values for flags arguments */ +#define F_WHITE_ON_MOVE 1 +#define F_WHITE_KCASTLE_OK 2 +#define F_WHITE_QCASTLE_OK 4 +#define F_BLACK_KCASTLE_OK 8 +#define F_BLACK_QCASTLE_OK 16 +#define F_ALL_CASTLE_OK (F_WHITE_KCASTLE_OK | F_WHITE_QCASTLE_OK | \ + F_BLACK_KCASTLE_OK | F_BLACK_QCASTLE_OK) +#define F_IGNORE_CHECK 32 +#define F_KRIEGSPIEL_CAPTURE 64 /* pawns can try to capture invisible pieces */ +#define F_ATOMIC_CAPTURE 128 /* capturing piece explodes, destroying itself + and all non-pawns on adjacent squares; + destroying your own king is illegal */ + +/* Special epfile values */ +#define EP_NONE -1 +#define EP_UNKNOWN -2 + +/* Call callback once for each pseudo-legal move in the given + position, except castling moves. A move is pseudo-legal if it is + legal, or if it would be legal except that it leaves the king in + check. In the arguments, epfile is EP_NONE if the previous move + was not a double pawn push, or the file 0..7 if it was, or + EP_UNKNOWN if we don't know and want to allow all e.p. captures. + Promotion moves generated are to Queen only. +*/ +extern void GenPseudoLegal P((Board board, int flags, int epfile, + MoveCallback callback, VOIDSTAR closure)); + +/* Like GenPseudoLegal, but include castling moves and (unless + F_IGNORE_CHECK is set in the flags) omit moves that would leave the + king in check. The CASTLE_OK flags are true if castling is not yet + ruled out by a move of the king or rook. Return TRUE if the player + on move is currently in check and F_IGNORE_CHECK is not set. +*/ +extern int GenLegal P((Board board, int flags, int epfile, + MoveCallback callback, VOIDSTAR closure)); + +/* If the player on move were to move from (rf, ff) to (rt, ft), would + he leave himself in check? Or if rf == -1, is the player on move + in check now? enPassant must be TRUE if the indicated move is an + e.p. capture. The possibility of castling out of a check along the + back rank is not accounted for (i.e., we still return nonzero), as + this is illegal anyway. Return value is the number of times the + king is in check. */ +extern int CheckTest P((Board board, int flags, + int rf, int ff, int rt, int ft, int enPassant)); + +/* Is a move from (rf, ff) to (rt, ft) legal for the player whom the + flags say is on move? Other arguments as in GenPseudoLegal. + Returns the type of move made, taking promoChar into account. */ +extern ChessMove LegalityTest P((Board board, int flags, int epfile, + int rf, int ff, int rt, int ft, + int promoChar)); + +#define MT_NONE 0 +#define MT_CHECK 1 +#define MT_CHECKMATE 2 +#define MT_STALEMATE 3 + +/* Return MT_NONE, MT_CHECK, MT_CHECKMATE, or MT_STALEMATE */ +extern int MateTest P((Board board, int flags, int epfile)); + +typedef struct { + /* Input data */ + ChessSquare pieceIn; /* EmptySquare if unknown */ + int rfIn, ffIn, rtIn, ftIn; /* -1 if unknown */ + int promoCharIn; /* NULLCHAR if unknown */ + /* Output data for matched move */ + ChessMove kind; + ChessSquare piece; + int rf, ff, rt, ft; + int promoChar; /* 'q' if a promotion and promoCharIn was NULLCHAR */ + int count; /* Number of possibilities found */ +} DisambiguateClosure; + +/* Disambiguate a partially-known move */ +void Disambiguate P((Board board, int flags, int epfile, + DisambiguateClosure *closure)); + + +/* Convert coordinates to normal algebraic notation. + promoChar must be NULLCHAR or '.' if not a promotion. +*/ +ChessMove CoordsToAlgebraic P((Board board, int flags, int epfile, + int rf, int ff, int rt, int ft, + int promoChar, char out[MOVE_LEN])); diff --git a/winboard-dm-beta4/parser.l b/winboard-dm-beta4/parser.l new file mode 100755 index 0000000..39264f5 --- /dev/null +++ b/winboard-dm-beta4/parser.l @@ -0,0 +1,922 @@ +%a 10000 +%o 10000 +%e 2000 +%k 2500 +%p 7000 +%n 1000 +%{ +/* + * parser.l -- lex parser of algebraic chess moves for XBoard + * $Id$ + * + * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts. + * Enhancements Copyright 1992-95 Free Software Foundation, Inc. + * + * 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: + * ------------------------------------------------------------------------ + * This program 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 2 of the License, or + * (at your option) any later version. + * + * This program 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * ------------------------------------------------------------------------ + */ + +/* This parser handles all forms of promotion. + * The parser resolves ambiguous moves by searching and check-testing. + * It also parses comments of the form [anything] or (anything). + */ + +#include "config.h" + +#define NO_CONSTRAINT -1 +#undef YYLMAX +#define YYLMAX 4096 +#define UNPUT_BUF_SIZE YYLMAX + +#ifdef FLEX_SCANNER +/* yytext is probably a char*, but could be a char[]. yy_text is set + in YY_DECL below, because if yytext is a char*, its value is not + constant. */ +char *yy_text; +#else /*!FLEX_SCANNER*/ +/* yytext is definitely a char[], so yy_text can be set here, statically. */ +char *yy_text = (char *) yytext; +#endif + +#ifdef FLEX_SCANNER +/* This is flex */ +#undef YY_INPUT +#define YY_INPUT(buf, result, max_size) my_yy_input(buf, &result, max_size) +#undef YY_DECL +#define YY_DECL \ + int _yylex YY_PROTO((void)); \ + int yylex YY_PROTO((void)) \ + { \ + int result = _yylex(); \ + yy_text = (char *) yytext; \ + return(result); \ + } \ + int _yylex YY_PROTO((void)) +#else +/* This is lex */ +#undef input +#undef output +#undef unput +#endif + +/* The includes must be here, below the #undef input */ + +#include + +#if STDC_HEADERS +# include +# include +#else /* not STDC_HEADERS */ +# if HAVE_STRING_H +# include +# else /* not HAVE_STRING_H */ +# include +# endif /* not HAVE_STRING_H */ +#endif /* not STDC_HEADERS */ + +#if HAVE_UNISTD_H +# include +#endif + +#if defined(_amigados) +# include +# if HAVE_FCNTL_H +# include /* isatty() prototype */ +# endif /* HAVE_FCNTL_H */ +#endif /* defined(_amigados) */ + +#include "common.h" +#include "backend.h" +#include "frontend.h" +#include "parser.h" +#include "moves.h" + +extern int PosFlags P((int)); + +extern Board boards[MAX_MOVES]; +int yyboardindex; +int yyskipmoves = FALSE; +char currentMoveString[YYLMAX]; +#ifndef FLEX_SCANNER +char unputBuffer[UNPUT_BUF_SIZE]; +int unputCount = 0; +#endif + +#ifdef FLEX_SCANNER +void my_yy_input P((char *buf, int *result, int max_size)); +#else /*!FLEX_SCANNER*/ +static int input P((void)); +static void output P((int ch)); +static void unput P((int ch)); +int yylook P((void)); +int yyback P((int *, int)); +#endif +#undef yywrap +int yywrap P((void)); +extern void CopyBoard P((Board to, Board from)); + +%} +%% + +[RrBbNnQqKkPp][/]?[a-h][1-8][xX:-]?[a-h][1-8](=?\(?[RrBbNnQqKk]\)?)? { + /* + * Fully-qualified algebraic move, possibly with promotion + */ + int skip1 = 0, skip2 = 0; + ChessSquare piece; + ChessMove result; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + /* remove the / */ + if (yytext[1] == '/') skip1 = 1; + + /* remove the [xX:-] */ + if ((yytext[3+skip1] == 'x') || (yytext[3+skip1] == 'X') || + (yytext[3+skip1] == '-') || (yytext[3+skip1] == ':')) skip2 = 1; + + currentMoveString[0] = yytext[1+skip1]; + currentMoveString[1] = yytext[2+skip1]; + currentMoveString[2] = yytext[3+skip1+skip2]; + currentMoveString[3] = yytext[4+skip1+skip2]; + currentMoveString[4] = NULLCHAR; + + if (yyleng-skip1-skip2 > 5) { + if (yytext[yyleng-1] == ')') { + currentMoveString[4] = ToLower(yytext[yyleng-2]); + } else { + currentMoveString[4] = ToLower(yytext[yyleng-1]); + } + currentMoveString[5] = NULLCHAR; + } + + piece = boards[yyboardindex] + [currentMoveString[1] - '1'][currentMoveString[0] - 'a']; + if (ToLower(yytext[0]) != ToLower(PieceToChar(piece))) + return (int) IllegalMove; + + result = LegalityTest(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, + currentMoveString[1] - '1', + currentMoveString[0] - 'a', + currentMoveString[3] - '1', + currentMoveString[2] - 'a', + currentMoveString[4]); + + if (currentMoveString[4] == NULLCHAR && + (result == WhitePromotionQueen || result == BlackPromotionQueen)) { + currentMoveString[4] = 'q'; + currentMoveString[5] = NULLCHAR; + } + + return (int) result; +} + +[a-h][1-8][xX:-]?[a-h][1-8](=?\(?[RrBbNnQqKk]\)?)? { + /* + * Simple algebraic move, possibly with promotion + */ + int skip = 0; + ChessMove result; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + /* remove the [xX:-] */ + if ((yytext[2] == 'x') || (yytext[2] == 'X') || + (yytext[2] == '-') || (yytext[2] == ':')) skip = 1; + + currentMoveString[0] = yytext[0]; + currentMoveString[1] = yytext[1]; + currentMoveString[2] = yytext[2+skip]; + currentMoveString[3] = yytext[3+skip]; + currentMoveString[4] = NULLCHAR; + + if (yyleng-skip > 4) { + if (yytext[yyleng-1] == ')') { + currentMoveString[4] = ToLower(yytext[yyleng-2]); + } else { + currentMoveString[4] = ToLower(yytext[yyleng-1]); + } + currentMoveString[5] = NULLCHAR; + } + + result = LegalityTest(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, + currentMoveString[1] - '1', + currentMoveString[0] - 'a', + currentMoveString[3] - '1', + currentMoveString[2] - 'a', + currentMoveString[4]); + + if (currentMoveString[4] == NULLCHAR && + (result == WhitePromotionQueen || result == BlackPromotionQueen)) { + currentMoveString[4] = 'q'; + currentMoveString[5] = NULLCHAR; + } + + return (int) result; +} + +[a-h][1-8](=?\(?[RrBbNnQqKk]\)?)? { + /* + * Pawn move, possibly with promotion + */ + DisambiguateClosure cl; + int skip = 0; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + /* remove the =() */ + if (yytext[2] == '=') skip++; + if (yytext[2+skip] == '(') skip++; + + cl.pieceIn = WhiteOnMove(yyboardindex) ? WhitePawn : BlackPawn; + cl.rfIn = -1; + cl.ffIn = yytext[0] - 'a'; + cl.rtIn = yytext[1] - '1'; + cl.ftIn = yytext[0] - 'a'; + cl.promoCharIn = yytext[2+skip]; + Disambiguate(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, &cl); + + currentMoveString[0] = cl.ff + 'a'; + currentMoveString[1] = cl.rf + '1'; + currentMoveString[2] = cl.ft + 'a'; + currentMoveString[3] = cl.rt + '1'; + currentMoveString[4] = cl.promoChar; + currentMoveString[5] = NULLCHAR; + + return (int) cl.kind; +} + + +(ab|bc|cd|de|ef|fg|gh|hg|gf|fe|ed|dc|cb|ba|([a-h][xX:-][a-h]))(=?\(?[RrBbNnQqKk]\)?)?(ep|"e.p.")? { + /* + * Pawn capture, possibly with promotion, possibly ambiguous + */ + DisambiguateClosure cl; + int skip1 = 0, skip2 = 0; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + /* remove trailing ep or e.p. (nonstandard PGN) */ + if (yytext[yyleng-1] == 'p') { + yyleng -= 2; + yytext[yyleng] = NULLCHAR; + } else if (yytext[yyleng-1] == '.') { + yyleng -= 4; + yytext[yyleng] = NULLCHAR; + } + + /* remove the [xX:-] and =() */ + if ((yytext[1] == 'x') || (yytext[1] == 'X') + || (yytext[1] == ':') || (yytext[1] == '-')) skip1 = 1; + if (yytext[2+skip1] == '=') skip2++; + if (yytext[2+skip1+skip2] == '(') skip2++; + + cl.pieceIn = WhiteOnMove(yyboardindex) ? WhitePawn : BlackPawn; + cl.rfIn = -1; + cl.ffIn = yytext[0] - 'a'; + cl.rtIn = -1; + cl.ftIn = yytext[1+skip1] - 'a'; + cl.promoCharIn = yytext[2+skip1+skip2]; + Disambiguate(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, &cl); + + currentMoveString[0] = cl.ff + 'a'; + currentMoveString[1] = cl.rf + '1'; + currentMoveString[2] = cl.ft + 'a'; + currentMoveString[3] = cl.rt + '1'; + currentMoveString[4] = cl.promoChar; + currentMoveString[5] = NULLCHAR; + + return (int) cl.kind; +} + +[a-h][xX:]?[a-h][1-8](=?\(?[RrBbNnQqKk]\)?)?(ep|"e.p.")? { + /* + * unambiguously abbreviated Pawn capture, possibly with promotion + */ + int skip = 0; + ChessMove result; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + /* remove trailing ep or e.p. (nonstandard PGN) */ + if (yytext[yyleng-1] == 'p') { + yyleng -= 2; + yytext[yyleng] = NULLCHAR; + } else if (yytext[yyleng-1] == '.') { + yyleng -= 4; + yytext[yyleng] = NULLCHAR; + } + + /* remove the [xX:-] */ + if ((yytext[1] == 'x') || (yytext[1] == 'X') + || (yytext[1] == ':') || (yytext[1] == '-')) skip = 1; + + currentMoveString[0] = yytext[0]; + currentMoveString[2] = yytext[1+skip]; + currentMoveString[3] = yytext[2+skip]; + if (WhiteOnMove(yyboardindex)) { + if (yytext[2+skip] == '1') return (int) ImpossibleMove; + currentMoveString[1] = yytext[2+skip] - 1; + } else { + if (yytext[2+skip] == '8') return (int) ImpossibleMove; + currentMoveString[1] = yytext[2+skip] + 1; + } + if (yyleng-skip > 3) { + if (yytext[yyleng-1] == ')') + currentMoveString[4] = ToLower(yytext[yyleng-2]); + else + currentMoveString[4] = ToLower(yytext[yyleng-1]); + currentMoveString[5] = NULLCHAR; + } else { + currentMoveString[4] = NULLCHAR; + } + + result = LegalityTest(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, + currentMoveString[1] - '1', + currentMoveString[0] - 'a', + currentMoveString[3] - '1', + currentMoveString[2] - 'a', + currentMoveString[4]); + + if (currentMoveString[4] == NULLCHAR && + (result == WhitePromotionQueen || result == BlackPromotionQueen)) { + currentMoveString[4] = 'q'; + currentMoveString[5] = NULLCHAR; + } + + if (result != IllegalMove) return (int) result; + + /* Special case: improperly written en passant capture */ + if (WhiteOnMove(yyboardindex)) { + if (currentMoveString[3] == '5') { + currentMoveString[1] = '5'; + currentMoveString[3] = '6'; + } else { + return (int) IllegalMove; + } + } else { + if (currentMoveString[3] == '4') { + currentMoveString[1] = '4'; + currentMoveString[3] = '3'; + } else { + return (int) IllegalMove; + } + } + + result = LegalityTest(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, + currentMoveString[1] - '1', + currentMoveString[0] - 'a', + currentMoveString[3] - '1', + currentMoveString[2] - 'a', + currentMoveString[4]); + + if (result == WhiteCapturesEnPassant || result == BlackCapturesEnPassant) + return (int) result; + else + return (int) IllegalMove; +} + +[RrBbNnQqKk][xX:-]?[a-h][1-8] { + /* + * piece move, possibly ambiguous + */ + DisambiguateClosure cl; + int skip = 0; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + /* remove the [xX:-] */ + if ((yytext[1] == 'x') || (yytext[1] == 'X') + || (yytext[1] == ':') || (yytext[1] == '-')) skip = 1; + + if (WhiteOnMove(yyboardindex)) { + cl.pieceIn = CharToPiece(ToUpper(yytext[0])); + } else { + cl.pieceIn = CharToPiece(ToLower(yytext[0])); + } + cl.rfIn = -1; + cl.ffIn = -1; + cl.rtIn = yytext[2+skip] - '1'; + cl.ftIn = yytext[1+skip] - 'a'; + cl.promoCharIn = NULLCHAR; + Disambiguate(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, &cl); + + currentMoveString[0] = cl.ff + 'a'; + currentMoveString[1] = cl.rf + '1'; + currentMoveString[2] = cl.ft + 'a'; + currentMoveString[3] = cl.rt + '1'; + currentMoveString[4] = cl.promoChar; + currentMoveString[5] = NULLCHAR; + + return (int) cl.kind; +} + +[RrBbNnQqKk][a-h1-8][xX:-]?[a-h][1-8] { + /* + * piece move with rank or file disambiguator + */ + DisambiguateClosure cl; + int skip = 0; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + /* remove the [xX:-] */ + if ((yytext[2] == 'x') || (yytext[2] == 'X') + || (yytext[2] == ':') || (yytext[2] == '-')) skip = 1; + + if (WhiteOnMove(yyboardindex)) { + cl.pieceIn = CharToPiece(ToUpper(yytext[0])); + } else { + cl.pieceIn = CharToPiece(ToLower(yytext[0])); + } + if (isalpha(yytext[1])) { + cl.rfIn = -1; + cl.ffIn = yytext[1] - 'a'; + } else { + cl.rfIn = yytext[1] - '1'; + cl.ffIn = -1; + } + cl.rtIn = yytext[3+skip] - '1'; + cl.ftIn = yytext[2+skip] - 'a'; + cl.promoCharIn = NULLCHAR; + Disambiguate(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, &cl); + + currentMoveString[0] = cl.ff + 'a'; + currentMoveString[1] = cl.rf + '1'; + currentMoveString[2] = cl.ft + 'a'; + currentMoveString[3] = cl.rt + '1'; + currentMoveString[4] = cl.promoChar; + currentMoveString[5] = NULLCHAR; + + return (int) cl.kind; +} + +000|0-0-0|ooo|OOO|o-o-o|O-O-O { + int rf, ff, rt, ft; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + if (WhiteOnMove(yyboardindex)) { + if (boards[yyboardindex][0][3] == WhiteKing) { + /* ICS wild castling */ + strcpy(currentMoveString, "d1f1"); + rf = 0; + ff = 3; + rt = 0; + ft = 5; + } else { + strcpy(currentMoveString, "e1c1"); + rf = 0; + ff = 4; + rt = 0; + ft = 2; + } + } else{ + if (boards[yyboardindex][7][3] == BlackKing) { + /* ICS wild castling */ + strcpy(currentMoveString, "d8f8"); + rf = 7; + ff = 3; + rt = 7; + ft = 5; + } else { + strcpy(currentMoveString, "e8c8"); + rf = 7; + ff = 4; + rt = 7; + ft = 2; + } + } + return (int) LegalityTest(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, + rf, ff, rt, ft, NULLCHAR); +} + +00|0-0|oo|OO|o-o|O-O { + int rf, ff, rt, ft; + + if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */ + + if (WhiteOnMove(yyboardindex)) { + if (boards[yyboardindex][0][3] == WhiteKing) { + /* ICS wild castling */ + strcpy(currentMoveString, "d1b1"); + rf = 0; + ff = 3; + rt = 0; + ft = 1; + } else { + strcpy(currentMoveString, "e1g1"); + rf = 0; + ff = 4; + rt = 0; + ft = 6; + } + } else { + if (boards[yyboardindex][7][3] == BlackKing) { + /* ICS wild castling */ + strcpy(currentMoveString, "d8b8"); + rf = 7; + ff = 3; + rt = 7; + ft = 1; + } else { + strcpy(currentMoveString, "e8g8"); + rf = 7; + ff = 4; + rt = 7; + ft = 6; + } + } + return (int) LegalityTest(boards[yyboardindex], + PosFlags(yyboardindex), EP_UNKNOWN, + rf, ff, rt, ft, NULLCHAR); +} + +[PpNnBbRrQq]@[a-h][1-8] { + /* Bughouse piece drop. No legality checking for now. */ + currentMoveString[1] = '@'; + currentMoveString[2] = yytext[2]; + currentMoveString[3] = yytext[3]; + currentMoveString[4] = NULLCHAR; + if (WhiteOnMove(yyboardindex)) { + currentMoveString[0] = ToUpper(yytext[0]); + return (int) WhiteDrop; + } else { + currentMoveString[0] = ToLower(yytext[0]); + return (int) BlackDrop; + } +} + +[Rr]esign(s|ed)? { + if (WhiteOnMove(yyboardindex)) + return (int) BlackWins; + else + return (int) WhiteWins; +} + +(([Ww](hite)?)|([Bb](lack)?))" "(([Rr]esign)|([Ff]orfeit))(s|ed)? { + return (int) (ToUpper(yytext[0]) == 'W' ? BlackWins : WhiteWins); +} + +(([Ww](hite)?)|([Bb](lack)?))" "[Dd]isconnect(s|ed) { + return (int) GameUnfinished; +} + +[Ss]talemate { + return (int) GameIsDrawn; +} + +"+-+" { + return (int) GameIsDrawn; +} + +([Cc]heck)?[Mm]ate { + if (WhiteOnMove(yyboardindex)) + return (int) BlackWins; + else + return (int) WhiteWins; +} + +"++" { + if (WhiteOnMove(yyboardindex)) + return (int) BlackWins; + else + return (int) WhiteWins; +} + +[Dd]raw(n)?(" "by)?(" "[Rr]epetition)|(" "[Aa]gree(d|ment)) { + return (int) GameIsDrawn; +} + +[Dd]raw(n)?(" (".*")")? { + return (int) GameIsDrawn; +} + +(([Ww](hite)?)|([Bb](lack)?))" "([Mm]ate(s|ed)?)|([Ww][io]n(s)?.*) { + return (int) (ToUpper(yytext[0]) == 'W' ? WhiteWins : BlackWins); +} + +(([Ww](hite)?)|([Bb](lack)?))" "([Mm]ate(s|ed)?)|([Ll]os[tes]+.*) { + return (int) (ToUpper(yytext[0]) == 'W' ? BlackWins : WhiteWins); +} + +("{"[^\}\n]*"} ")?(1-0|"1 - 0"|"1/0"|"1 / 0"|"1:0"|"1 : 0")(" (".*")"|" {".*"}")? { + return (int) WhiteWins; +} + +("{"[^\}\n]*"} ")?(0-1|"0 - 1"|"0/1"|"0 / 1"|"0:1"|"0 : 1")(" (".*")"|" {".*"}")? { + return (int) BlackWins; +} + +("{"[^\}\n]*"} ")?("1/2"|"1 / 2")(" "?[-:]" "?("1/2"|"1 / 2"))?(" (".*")"|" {".*"}")? { + return (int) GameIsDrawn; +} + +("{"[^\}\n]*"} ")?"*"(" (".*")"|" {".*"}")? { + return (int) GameUnfinished; +} + +[1-9][0-9]*/"."?[ \t\n]*[a-hNnPpRrBQqKkOo] { + /* move numbers */ + if ((yyleng == 1) && (yytext[0] == '1')) + return (int) MoveNumberOne; +} + +\([0-9]+:[0-9][0-9](\.[0-9]+)?\)|\{[0-9]+:[0-9][0-9](\.[0-9]+)?\} { + /* elapsed time indication, e.g. (0:12) or {10:21.071} */ + return (int) ElapsedTime; +} + +"[--"[^\]]*"--]" { + /* position diagram enclosed in [-- --] */ + return (int) PositionDiagram; +} + +^"{--------------"\n[^\}]*\n"--------------}"$ { + /* position diagram enclosed in {-- --} */ + return (int) PositionDiagram; +} + +\[[ \t\n]*[A-Za-z0-9][A-Za-z0-9_+#=-]*[ \t\n]*\"[^"]*\"[ \t\n]*\] { + return (int) PGNTag; +} + +[Gg](nu|NU)" "?[Cc](hess|HESS).*[Gg](ame|AME) { + return (int) GNUChessGame; +} + +^[#;%]" "[^ ]*(" game file"|" position file").*$ { + return (int) XBoardGame; +} + +\$[0-9]+ { /* numeric annotation glyph */ + return (int) NAG; +} + +\{[^\}]*\} { /* anything in {} */ + return (int) Comment; +} + +;.*$ { /* ; to end of line */ + return (int) Comment; +} + +\[[^\]]*\] { /* anything in [] */ + return (int) Comment; +} + +\([^()]*(\([^()]*\)[^()]*)+[^()]*\) { /* nested () */ + return (int) Comment; +} + +\([^)][^)]+\) { /* >=2 chars in () */ + return (int) Comment; +} + +^[-a-zA-Z0-9]+:" ".*(\n[ \t]+.*)* { + /* Skip mail headers */ +} + +[a-zA-Z0-9'-]+ { + /* Skip random words */ +} + +.|\n { + /* Skip everything else */ +} + +%% + + +static char *StringToLex; + +#ifndef FLEX_SCANNER +static FILE *lexFP; + +static int input() +{ + int ret; + + if (StringToLex != NULL) { + ret = *StringToLex; + if (ret == NULLCHAR) + ret = EOF; + else + StringToLex++; + } else if (unputCount > 0) { + ret = unputBuffer[--unputCount]; + } else { + ret = fgetc(lexFP); + } + + if (ret == EOF) + return 0; + else + return ret; +} + +/* + * Return offset of next pattern within current file + */ +int yyoffset() +{ + int offset = ftell(lexFP) - unputCount; + + if (offset < 0) { + offset = 0; + } + return(offset); +} + +static void output(ch) + int ch; +{ + fprintf(stderr, "PARSER BUG: unmatched character '%c' (0%o)\n", + ch, ch); +} + +static void unput(ch) + int ch; +{ + if (ch == 0) return; + if (StringToLex != NULL) { + StringToLex--; + } else { + if (unputCount >= UNPUT_BUF_SIZE) + fprintf(stderr, "PARSER BUG: unput buffer overflow '%c' (0%o)\n", + ch, ch); + unputBuffer[unputCount++] = ch; + } +} + +/* Get ready to lex from a new file. Kludge below sticks + an artificial newline at the front of the file, which the + above grammar ignores, but which makes ^ at start of pattern + match at the real start of the file. +*/ +void yynewfile(f) + FILE *f; +{ + lexFP = f; + StringToLex = NULL; + unputCount = 0; + unput('\n'); /* kludge */ +} + +/* Get ready to lex from a string. ^ at start of pattern WON'T + match at the start of the string! +*/ +void yynewstr(s) + char *s; +{ + lexFP = NULL; + StringToLex = s; + unputCount = 0; +} +#endif /*!FLEX_SCANNER*/ + +#ifdef FLEX_SCANNER +void my_yy_input(buf, result, max_size) + char *buf; + int *result; + int max_size; +{ + int count; + + if (StringToLex != NULL) { + count = 0; + while (*StringToLex != NULLCHAR) { + *buf++ = *StringToLex++; + count++; + } + *result = count; + return; + } else { + count = fread(buf, 1, max_size, yyin); + if (count == 0) { + *result = YY_NULL; + } else { + *result = count; + } + return; + } +} + +static YY_BUFFER_STATE my_file_buffer = NULL; + +/* + Return offset of next pattern in the current file. +*/ +int yyoffset() +{ + int pos = yy_c_buf_p - yy_current_buffer->yy_ch_buf; + + return(ftell(yy_current_buffer->yy_input_file) - + 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); + yy_switch_to_buffer(my_file_buffer); +} + +void yynewfile(f) + FILE *f; +{ + if (my_file_buffer != NULL) + yy_delete_buffer(my_file_buffer); + StringToLex = NULL; + my_file_buffer = yy_create_buffer(f, YY_BUF_SIZE); + yy_switch_to_buffer(my_file_buffer); +} +#endif /*FLEX_SCANNER*/ + +int yywrap() +{ + return TRUE; +} + +/* Parse a move from the given string s */ +/* ^ at start of pattern WON'T work here unless using flex */ +ChessMove yylexstr(boardIndex, s) + int boardIndex; + char *s; +{ + ChessMove ret; + char *oldStringToLex; +#ifdef FLEX_SCANNER + YY_BUFFER_STATE buffer, oldBuffer; +#endif + + yyboardindex = boardIndex; + oldStringToLex = StringToLex; + StringToLex = s; +#ifdef FLEX_SCANNER + buffer = yy_create_buffer(stdin, YY_BUF_SIZE); + oldBuffer = YY_CURRENT_BUFFER; + yy_switch_to_buffer(buffer); +#endif /*FLEX_SCANNER*/ + + ret = (ChessMove) yylex(); + +#ifdef FLEX_SCANNER + if (oldBuffer != NULL) + yy_switch_to_buffer(oldBuffer); + yy_delete_buffer(buffer); +#endif /*FLEX_SCANNER*/ + StringToLex = oldStringToLex; + + return ret; +} diff --git a/winboard-dm-beta4/resource.h b/winboard-dm-beta4/resource.h new file mode 100755 index 0000000..449f74e --- /dev/null +++ b/winboard-dm-beta4/resource.h @@ -0,0 +1,429 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by winboard.rc +// +#define DLG_ZippyDraw 2 +#define IDM_NewGame 100 +#define IDM_LoadGame 101 +#define IDM_SaveGame 102 +#define IDM_Exit 103 +#define IDM_LoadPosition 104 +#define IDM_SavePosition 105 +#define IDM_EditPosition 106 +#define IDM_FlipView 107 +#define IDM_MachineWhite 108 +#define IDM_MachineBlack 109 +#define IDM_TwoMachines 110 +#define IDM_EditGame 111 +#define IDM_Forward 112 +#define IDM_Backward 113 +#define IDM_ToEnd 114 +#define IDM_ToStart 115 +#define IDM_Pause 116 +#define IDM_CallFlag 117 +#define IDM_Draw 118 +#define IDM_Abort 120 +#define IDM_Adjourn 122 +#define IDM_Resign 124 +#define IDM_Hint 125 +#define IDM_IcsClient 126 +#define IDM_TimeControl 131 +#define IDM_LoadOptions 132 +#define IDM_SaveOptions 133 +#define IDM_CommPort 147 +#define IDM_EditComment 148 +#define IDM_LoadNextGame 149 +#define IDM_LoadPrevGame 150 +#define IDM_ReloadGame 151 +#define IDM_Accept 153 +#define IDM_Decline 154 +#define IDM_StopObserving 155 +#define IDM_StopExamining 156 +#define IDM_Revert 157 +#define IDM_TruncateGame 158 +#define IDM_MoveNow 159 +#define IDM_RetractMove 160 +#define IDM_MailMove 164 +#define IDM_ReloadCMailMsg 165 +#define IDM_Book 166 +#define IDM_AboutGame 167 +#define IDM_ShowGameList 170 +#define IDM_EditTags 171 +#define IDM_Debug 174 +#define IDM_AnalysisMode 177 +#define IDM_AnalyzeFile 178 +#define IDM_CopyGame 180 +#define IDM_PasteGame 181 +#define IDM_CopyPosition 182 +#define IDM_PastePosition 183 +#define OPT_TCtext1 202 +#define OPT_TCTime 203 +#define OPT_TCtext2 204 +#define OPT_TCtext3 205 +#define OPT_Autosave 206 +#define OPT_AVPrompt 208 +#define OPT_AVToFile 209 +#define OPT_AVFilename 210 +#define OPT_Autostep 214 +#define OPT_ASTimeDelay 215 +#define OPT_AStext1 216 +#define OPT_TCMoves 217 +#define IDM_HELPCONTENTS 300 +#define IDM_HELPSEARCH 301 +#define IDM_HELPHELP 302 +#define IDM_ABOUT 303 +#define IDM_CommandX 310 +#define IDM_CommandXLast 399 +#define DLG_TimeControl 400 +#define ABOUTBOX_Version 401 +#define OPT_TCUseMoves 402 +#define OPT_TCUseInc 403 +#define OPT_TCitext1 405 +#define OPT_TCitext2 406 +#define OPT_TCInc 407 +#define OPT_TCitext3 408 +#define OPT_TCTime2 409 +#define DLG_PremoveOptions 450 +#define DLG_GeneralOptions 453 +#define DLG_IcsOptions 454 +#define DLG_BoardOptions 455 +#define DLG_Fonts 456 +#define DLG_icsAnalyze 459 +#define IDD_DIALOG2 460 +#define DLG_Promotion 500 +#define PB_Queen 502 +#define PB_Rook 503 +#define PB_Bishop 504 +#define PB_Knight 505 +#define EP_White 600 +#define EP_WhitePawn 601 +#define EP_WhiteKnight 602 +#define EP_WhiteBishop 603 +#define EP_WhiteRook 604 +#define EP_WhiteQueen 605 +#define EP_Black 606 +#define EP_BlackPawn 607 +#define EP_BlackKnight 608 +#define EP_BlackBishop 609 +#define EP_BlackRook 610 +#define EP_BlackQueen 611 +#define EP_EmptySquare 612 +#define EP_ClearBoard 613 +#define EP_WhiteKing 614 +#define EP_BlackKing 615 +#define DP_Pawn 616 +#define DP_Knight 617 +#define DP_Bishop 618 +#define DP_Rook 619 +#define DP_Queen 620 +#define DLG_LoadOptions 700 +#define DLG_SaveOptions 800 +#define OPT_PGN 802 +#define OPT_Old 803 +#define DLG_CommPort 900 +#define OPT_Port 901 +#define OPT_DataRate 902 +#define OPT_Bits 903 +#define OPT_Parity 904 +#define OPT_StopBits 905 +#define OPT_Flow 910 +#define OPT_SerialHelp 911 +#define DLG_BoardSize 1000 +#define OPT_Small 1001 +#define OPT_SizeSmall 1001 +#define OPT_Medium 1002 +#define OPT_SizeBulky 1002 +#define OPT_Large 1003 +#define DLG_EditComment 1004 +#define OPT_ClearComment 1005 +#define OPT_EditComment 1006 +#define OPT_CommentText 1007 +#define DLG_ViewComment 1008 +#define DLG_GameList 1009 +#define OPT_GameListPrev 1010 +#define OPT_GameListText 1011 +#define OPT_GameListLoad 1012 +#define OPT_GameListNext 1013 +#define OPT_GameListClose 1014 +#define DLG_EditTags 1015 +#define OPT_TagsText 1016 +#define DLG_Analysis 1017 +#define OPT_AnalysisText 1018 +#define DLG_Error 1019 +#define OPT_ErrorIcon 1020 +#define IDD_DIALOG1 1021 +#define DLG_ConsoleRich 1022 +#define IDC_EDIT1 1023 +#define OPT_DarkSquareColor 1023 +#define OPT_ConsoleText 1024 +#define OPT_LightSquareColor 1024 +#define OPT_CommandInput 1025 +#define OPT_WhitePieceColor 1025 +#define OPT_QuestionInput 1026 +#define OPT_BlackPieceColor 1026 +#define OPT_ChessEngineName 1027 +#define OPT_HighlightSquareColor 1027 +#define OPT_WavFileName 1028 +#define OPT_PremoveHighlightColor 1028 +#define OPT_IndexNumber 1029 +#define OPT_SampleLightSquare 1029 +#define OPT_Move 1030 +#define OPT_SampleDarkSquare 1030 +#define OPT_PremoveWhiteText 1031 +#define IDC_EDIT2 1032 +#define OPT_ConsoleInput 1033 +#define OPT_AdditionalOptions 1034 +#define OPT_PremoveBlackText 1035 +#define OPT_ErrorText 1036 +#define OPT_IcsAlarmTime 1037 +#define OPT_icsKillPVs 1038 +#define OPT_icsTells 1039 +#define DLG_Console 1100 +#define DLG_PromotionKing 1102 +#define DLG_Colorize 1106 +#define DLG_Command 1122 +#define DLG_Question 1123 +#define DLG_Startup 1124 +#define DLG_Sound 1127 +#define DLG_IndexNumber 1149 +#define DLG_TypeInMove 1151 +#define OPT_IndexNumberOld 1155 +#define IDM_Rematch 1203 +#define IDA_PAGEUP 1216 +#define IDA_PAGEDOWN 1217 +#define IDA_CTRLHOME 1218 +#define IDA_CTRLEND 1219 +#define IDA_TAB 1221 +#define IDM_SaveSettings 1223 +#define IDM_Iconize 1224 +#define IDM_DirectCommand1 1226 +#define IDM_DirectCommand2 1227 +#define IDM_Copy 1229 +#define IDM_Paste 1230 +#define IDM_MatchX 1231 +#define IDM_ObserveX 1232 +#define IDM_FingerX 1233 +#define IDM_TellX 1234 +#define IDM_QuickPaste 1235 +#define IDM_MessageX 1237 +#define IDM_VarsX 1238 +#define IDM_Cut 1240 +#define IDM_Undo 1242 +#define IDM_SelectAll 1243 +#define IDM_SaveSettingsOnExit 1280 +#define IDM_LoadNextPosition 1286 +#define IDM_ReloadPosition 1287 +#define IDM_LoadPrevPosition 1288 +#define IDM_TypeInMove 1291 +#define IDM_PopupExitMessage 1292 +#define IDM_Training 1293 +#define IDM_GeneralOptions 1299 +#define IDM_BoardOptions 1300 +#define IDM_Fonts 1301 +#define IDM_MODE_COACHVSWHITE 1302 +#define IDM_AnalyzeBlunder 1303 +#define IDM_MODE_COACHVSBLACK 1304 +#define PB_King 1307 +#define IDM_ZippyDraw 1311 +#define OPT_Bold 1312 +#define OPT_Italic 1313 +#define OPT_Underline 1314 +#define OPT_Strikeout 1315 +#define OPT_ChooseColor 1316 +#define OPT_Sample 1318 +#define OPT_SampleSShout 1319 +#define OPT_CancelComment 1320 +#define OPT_SampleChannel1 1320 +#define OPT_SampleChannel 1321 +#define OPT_SampleKibitz 1322 +#define OPT_SampleTell 1324 +#define OPT_EditTags 1325 +#define OPT_SampleChallenge 1325 +#define OPT_TagsCancel 1326 +#define OPT_SampleRequest 1326 +#define OPT_CommandText 1327 +#define OPT_QuestionText 1327 +#define OPT_SampleSeek 1327 +#define OPT_ChessEngine 1328 +#define OPT_SampleNormal 1328 +#define OPT_ChessServer 1329 +#define OPT_View 1330 +#define OPT_ChessServerName 1331 +#define OPT_NoSound 1333 +#define OPT_DefaultBeep 1334 +#define OPT_SystemSound 1335 +#define OPT_BuiltInSound 1336 +#define OPT_WavFile 1337 +#define OPT_BuiltInSoundName 1339 +#define OPT_SystemSoundName 1340 +#define OPT_BrowseSound 1341 +#define OPT_PlaySound 1342 +#define OPT_AVBrowse 1343 +#define OPT_SecondChessEngineName 1344 +#define OPT_AnyAdditional 1345 +#define OPT_Premove 1346 +#define OPT_PremoveWhite 1347 +#define OPT_PremoveBlack 1348 +#define OPT_IcsAlarm 1349 +#define CBO_Sounds 1350 +#define OPT_DefaultSounds 1351 +#define OPT_AlwaysOnTop 1352 +#define OPT_AutoFlag 1353 +#define OPT_AlwaysQueen 1354 +#define OPT_AutoComment 1354 +#define OPT_AnimateDragging 1355 +#define OPT_AutoObserve 1355 +#define OPT_AnimateMoving 1356 +#define OPT_GetMoveList 1356 +#define OPT_AutoFlipView 1357 +#define OPT_LocalLineEditing 1357 +#define OPT_HighlightDragging 1358 +#define OPT_QuietPlay 1358 +#define OPT_HighlightLastMove 1359 +#define OPT_icsAnalyze 1359 +#define OPT_PeriodicUpdates 1360 +#define OPT_ChooseLightSquareColor 1360 +#define OPT_icsAnalyzeWindow 1360 +#define OPT_PonderNextMove 1361 +#define OPT_ChooseDarkSquareColor 1361 +#define OPT_icsKillPV 1361 +#define OPT_PopupExitMessage 1362 +#define OPT_ChooseWhitePieceColor 1362 +#define OPT_smartQueue 1362 +#define OPT_PopupMoveErrors 1363 +#define OPT_ChooseBlackPieceColor 1363 +#define OPT_dropMoves 1363 +#define OPT_ShowCoordinates 1364 +#define OPT_ChooseHighlightSquareColor 1364 +#define OPT_ShowThinking 1365 +#define OPT_ChoosePremoveHighlightColor 1365 +#define OPT_TestLegality 1366 +#define OPT_Blindfold 1367 +#define OPT_SizeTiny 1368 +#define OPT_AnalysisWindow 1368 +#define OPT_SizeTeeny 1369 +#define OPT_SizeDinky 1370 +#define OPT_SizePetite 1371 +#define OPT_SizeSlim 1372 +#define OPT_SizeMediocre 1374 +#define OPT_SizeMiddling 1375 +#define OPT_SizeAverage 1376 +#define OPT_SizeModerate 1377 +#define OPT_SizeMedium 1378 +#define OPT_SizeLarge 1379 +#define OPT_SizeBig 1380 +#define OPT_SizeHuge 1381 +#define OPT_SizeGiant 1382 +#define OPT_SizeColossal 1383 +#define OPT_SizeTitanic 1384 +#define OPT_Monochrome 1385 +#define OPT_DefaultBoardColors 1386 +#define OPT_ChooseShoutColor 1387 +#define OPT_ChooseSShoutColor 1388 +#define OPT_ChooseChannel1Color 1389 +#define OPT_ChooseChannelColor 1390 +#define OPT_ChooseKibitzColor 1391 +#define OPT_ChooseBackgroundColor 1392 +#define OPT_ChooseTellColor 1393 +#define OPT_ChooseChallengeColor 1394 +#define OPT_ChooseRequestColor 1395 +#define OPT_ChooseSeekColor 1396 +#define OPT_ChooseNormalColor 1397 +#define OPT_DefaultColors 1398 +#define IDM_Minimize 1400 +#define OPT_SampleShout 1400 +#define IDM_Sounds 1401 +#define OPT_SampleClockFont 1401 +#define OPT_ADV 1401 +#define IDM_IcsOptions 1402 +#define OPT_SampleCoordFont 1402 +#define OPT_DontColorize 1403 +#define OPT_SampleMessageFont 1403 +#define OPT_SampleTagFont 1404 +#define IDM_focus_EngineRoom 1404 +#define OPT_SampleCommentsFont 1405 +#define IDM_focus_wb 1405 +#define OPT_SampleConsoleFont 1406 +#define IDM_ShowHistory 1406 +#define OPT_MessageFont 1407 +#define IDM_OperatorTime 1407 +#define OPT_ClockFont 1408 +#define IDM_EnginesButton 1408 +#define OPT_CoordFont 1409 +#define IDM_ICSEXAMINE 1409 +#define OPT_EditTagsFont 1410 +#define IDM_SelPaste 1410 +#define OPT_CommentsFont 1411 +#define OPT_MessageFont5 1412 +#define OPT_ChooseClockFont 1413 +#define OPT_ChooseMessageFont 1414 +#define OPT_ChooseCoordFont 1415 +#define OPT_ChooseTagFont 1416 +#define OPT_ChooseCommentsFont 1417 +#define OPT_ChooseConsoleFont 1418 +#define OPT_DefaultFonts 1419 +#define OPT_AutoRaiseBoard 1421 +#define OPT_ShowButtonBar 1422 +#define OPT_HistoryText 1422 +#define OPT_icsWhisper 1423 +#define OPT_icsKibitz 1424 +#define OPT_icsNone 1425 +#define OPT_icsTell 1426 +#define IDC_WHITE_MOVE 1426 +#define OPT_icsWBprotoNorm 1427 +#define IDC_BLACK_MOVE 1427 +#define OPT_icsWBprotoAgr 1428 +#define OPT_icsWriteLog 1429 +#define OPT_icsShowBook 1430 +#define OPT_BLUWhite 1430 +#define OPT_icsSmartQueueBlitz 1431 +#define OPT_BLUBlack 1431 +#define OPT_icsSmartQueueStd 1432 +#define OPT_BLUTime 1433 +#define OPT_BLUDeleteComment 1435 +#define OPT_HistoryReinit 1435 +#define OPT_BLUThreshold 1436 +#define OPT_engineDepth 1437 +#define OPT_BLUAbsoluteScore 1437 +#define OPT_engineScore 1438 +#define IDC_ANALYST_MSG 1438 +#define OPT_engineNPS 1439 +#define OPT_engineName 1440 +#define OPT_engineNodes 1441 +#define OPT_engineMoveNr 1442 +#define OPT_engineTime 1443 +#define OPT_engineStart 1444 +#define OPT_engineMove 1445 +#define OPT_engineStatLine 1446 +#define OPT_engineTourneyMode 1447 +#define OPT_showInfo 1447 +#define OPT_engineHash 1448 +#define OPT_GameData 1448 +#define OPT_egtb 1449 +#define OPT_SendToICS 1451 +#define OPT_EnableZippyDraw 1457 +#define OPT_OfferDraw 1458 +#define OPT_AcceptDraw 1459 +#define OPT_DrawFactor 1460 +#define OPT_TitlePlayers 1461 +#define OPT_DrawFactor2 1462 +#define OPT_RatingPoints 1463 +#define OPT_RatingPoints2 1464 +#define OPT_RatingPoints3 1465 +#define OPT_RatingPoints4 1466 +#define IDC_PROGRESS1 1470 +#define DLG_History 1537 +#define DLG_Analyst 1538 +#define IDC_STATIC -1 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NO_MFC 1 +#define _APS_NEXT_RESOURCE_VALUE 468 +#define _APS_NEXT_COMMAND_VALUE 1312 +#define _APS_NEXT_CONTROL_VALUE 1471 +#define _APS_NEXT_SYMED_VALUE 1411 +#endif +#endif diff --git a/winboard-dm-beta4/wgamelist.h b/winboard-dm-beta4/wgamelist.h new file mode 100755 index 0000000..c6540bb --- /dev/null +++ b/winboard-dm-beta4/wgamelist.h @@ -0,0 +1,26 @@ +/* + * wgamelist.h -- Game list window for WinBoard + * $Id$ + * + * Copyright 1995 Free Software Foundation, Inc. + * + * ------------------------------------------------------------------------ + * This program 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 2 of the License, or + * (at your option) any later version. + * + * This program 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * ------------------------------------------------------------------------ + */ + +VOID ShowGameListProc(void); +extern HWND gameListDialog; +extern int gameListX, gameListY, gameListW, gameListH; -- 1.7.0.4