Fix multi-leg promotions
[xboard.git] / moves.h
diff --git a/moves.h b/moves.h
index 82c7482..4a02a19 100644 (file)
--- a/moves.h
+++ b/moves.h
@@ -5,7 +5,8 @@
  * Massachusetts.
  *
  * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006,
- * 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ * 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free
+ * Software Foundation, Inc.
  *
  * Enhancements Copyright 2005 Alessandro Scotti
  *
  *------------------------------------------------------------------------
  ** See the file ChangeLog for a revision history.  */
 
+#define SUFFIXES "'!"
+
 extern ChessSquare PromoPiece P((ChessMove moveType));
 extern ChessMove PromoCharToMoveType P((int whiteOnMove, int promoChar));
-extern char PieceToChar P((ChessSquare p));
+extern char PieceSuffix P((ChessSquare p));
 extern ChessSquare CharToPiece P((int c));
 extern int PieceToNumber P((ChessSquare p));
 
 extern void CopyBoard P((Board to, Board from));
 extern int CompareBoards P((Board board1, Board board2));
-extern char pieceToChar[(int)EmptySquare+1];
+extern unsigned char pieceToChar[(int)EmptySquare+1];
+extern unsigned char pieceNickName[(int)EmptySquare];
+extern int promoPartner[(int)EmptySquare];
+extern char *pieceDesc[(int)EmptySquare];
+extern Board initialPosition;
+extern Boolean pieceDefs;
 
 typedef void (*MoveCallback) P((Board board, int flags, ChessMove kind,
                                int rf, int ff, int rt, int ft,
@@ -76,16 +84,19 @@ typedef void (*MoveCallback) P((Board board, int flags, ChessMove kind,
 #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; 
+                                  and all non-pawns on adjacent squares;
                                   destroying your own king is illegal */
 #define F_FRC_TYPE_CASTLING 256 /* generate castlings as captures of own Rook */
 #define F_MANDATORY_CAPTURE 0x200
+#define F_NULL_MOVE         0x400
 
 /* Special epfile values. [HGM] positive values are non-reversible moves! */
-#define EP_NONE (-4)           /* [HGM] Tricky! order matters:            */
-#define EP_UNKNOWN (-1)        /*       >= EP_UNKNOWN spils rep-draw      */
+#define EP_NONE (-6)           /* [HGM] Tricky! order matters:            */
+#define EP_UNKNOWN (-1)        /*       >= EP_UNKNOWN spoils rep-draw     */
 #define EP_CAPTURE (-2)        /*       <= EP_NONE is reversible move     */
 #define EP_PAWN_MOVE (-3)
+#define EP_IRON_LION (-4)
+#define EP_ROYAL_LION (-5)
 #define EP_REP_DRAW   (-15)
 #define EP_RULE_DRAW  (-14)
 #define EP_INSUF_DRAW  (-13)
@@ -104,16 +115,16 @@ typedef void (*MoveCallback) P((Board board, int flags, ChessMove kind,
    Promotion moves generated are to Queen only.
 */
 extern void GenPseudoLegal P((Board board, int flags,
-                             MoveCallback callback, VOIDSTAR closure));
+                             MoveCallback callback, VOIDSTAR closure, ChessSquare filter));
 
-/* Like GenPseudoLegal, but include castling moves and (unless 
+/* 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,
-                       MoveCallback callback, VOIDSTAR closure));
+                       MoveCallback callback, VOIDSTAR closure, ChessSquare filter));
 
 /* 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
@@ -121,7 +132,7 @@ extern int GenLegal P((Board board, int flags,
    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. */ 
+   king is in check. */
 extern int CheckTest P((Board board, int flags,
                        int rf, int ff, int rt, int ft, int enPassant));
 
@@ -170,3 +181,5 @@ void Disambiguate P((Board board, int flags, DisambiguateClosure *closure));
 ChessMove CoordsToAlgebraic P((Board board, int flags,
                               int rf, int ff, int rt, int ft,
                               int promoChar, char out[MOVE_LEN]));
+
+extern int quickFlag, killX, killY, kill2X, kill2Y, legNr;