Merge commit 'v4.3.16'
[xboard.git] / common.h
index be6d4e8..7883184 100644 (file)
--- a/common.h
+++ b/common.h
@@ -86,6 +86,8 @@ int pclose(FILE *);
 #define FALSE 0\r
 #endif\r
 \r
+#define UNKNOWN -1 /* [HGM] nps */\r
+\r
 #if !HAVE_RANDOM\r
 # if HAVE_RAND48\r
 #  define srandom srand48\r
@@ -98,7 +100,11 @@ int pclose(FILE *);
 \r
 /* End compatibility grunge */\r
 \r
-#define PROTOVER                2       /* engine protocol version */\r
+#define PROTOVER                2       /* engine protocol version */
+
+// [HGM] license: Messages that engines must print to satisfy their license requirements for patented variants\r
+#define GOTHIC "Gothic Chess (see www.GothicChess.com) is licensed under U.S. Patent #6,481,716 by Ed Trice"\r
+#define NOFALCON "Falcon Chess (see www.chessvariants.com) is licensed under U.S. Patent #5,690,334 by George W. Duke"\r
 \r
 /* [HGM] Some notes about board sizes:\r
    In games that allow piece drops, the holdings are considered part of the\r
@@ -172,7 +178,7 @@ int pclose(FILE *);
 #define ZIPPY_GAME_START ""\r
 #define ZIPPY_ADJOURN FALSE\r
 #define ZIPPY_ABORT FALSE\r
-#define ZIPPY_VARIANTS "normal"\r
+#define ZIPPY_VARIANTS "normal,fischerandom,crazyhouse,losers,suicide,3checks,twokings,bughouse,shatranj"\r
 #define ZIPPY_MAX_GAMES 0\r
 #define ZIPPY_REPLAY_TIMEOUT 120\r
 \r
@@ -185,29 +191,26 @@ typedef enum {
   } GameMode;\r
 \r
 typedef enum {\r
-    WhitePawn, WhiteKnight, WhiteBishop, WhiteRook, WhiteQueen, \r
-#ifdef FAIRY\r
     /* [HGM] the order here is crucial for Crazyhouse & Shogi: */\r
     /* only the first N pieces can go into the holdings, and   */\r
-    /* promotions in those variants shift P-W to E-M           */\r
-    WhiteFerz, WhiteWazir, WhiteAlfil, WhiteNightrider, WhiteCardinal,\r
-    WhiteMarshall, WhiteGrasshopper, WhiteCannon, WhiteMan, WhiteUnicorn,\r
-#endif\r
-    WhiteKing, BlackPawn, BlackKnight, BlackBishop, BlackRook, BlackQueen, \r
-#ifdef FAIRY\r
-    BlackFerz, BlackWazir, BlackAlfil, BlackNightrider, BlackCardinal,\r
-    BlackMarshall, BlackGrasshopper, BlackCannon, BlackMan, BlackUnicorn,\r
-#endif\r
-    BlackKing,\r
+    /* promotions in those variants shift P-W to U-S           */\r
+    WhitePawn, WhiteKnight, WhiteBishop, WhiteRook, WhiteQueen, \r
+    WhiteFerz, WhiteAlfil, WhiteAngel, WhiteMarshall, WhiteWazir, WhiteMan, \r
+    WhiteCannon, WhiteNightrider, WhiteCardinal, WhiteDragon, WhiteGrasshopper,\r
+    WhiteSilver, WhiteFalcon, WhiteLance, WhiteCobra, WhiteUnicorn, WhiteKing,\r
+    BlackPawn, BlackKnight, BlackBishop, BlackRook, BlackQueen,\r
+    BlackFerz, BlackAlfil, BlackAngel, BlackMarshall, BlackWazir, BlackMan, \r
+    BlackCannon, BlackNightrider, BlackCardinal, BlackDragon, BlackGrasshopper,\r
+    BlackSilver, BlackFalcon, BlackLance, BlackCobra, BlackUnicorn, BlackKing,\r
     EmptySquare, \r
-    ClearBoard, WhitePlay, BlackPlay /*for use on EditPosition menus*/\r
+    ClearBoard, WhitePlay, BlackPlay, PromotePiece, DemotePiece /*for use on EditPosition menus*/\r
   } ChessSquare;\r
 \r
 /* [HGM] some macros that can be used as prefixes to convert piece types */\r
 #define WHITE_TO_BLACK (int)BlackPawn - (int)WhitePawn + (int)\r
 #define BLACK_TO_WHITE (int)WhitePawn - (int)BlackPawn + (int)\r
-#define PROMOTED       (int)WhiteAlfil - (int)WhitePawn + (int)\r
-#define DEMOTED        (int)WhitePawn - (int)WhiteAlfil + (int)\r
+#define PROMOTED       (int)WhiteDragon - (int)WhiteRook + (int)\r
+#define DEMOTED        (int)WhiteRook - (int)WhiteDragon + (int)\r
 #define SHOGI          (int)EmptySquare + (int)\r
 \r
 \r
@@ -222,14 +225,10 @@ typedef enum {
     BlackHSideCastleFR, BlackASideCastleFR, \r
     WhitePromotionKnight, WhitePromotionBishop,\r
     WhitePromotionRook, WhitePromotionQueen, WhitePromotionKing,\r
-#ifdef FAIRY\r
-    WhitePromotionChancellor, WhitePromotionArchbishop,\r
-#endif\r
+    WhitePromotionChancellor, WhitePromotionArchbishop, WhitePromotionCentaur,\r
     BlackPromotionKnight, BlackPromotionBishop,\r
     BlackPromotionRook, BlackPromotionQueen, BlackPromotionKing,\r
-#ifdef FAIRY\r
-    BlackPromotionChancellor, BlackPromotionArchbishop,\r
-#endif\r
+    BlackPromotionChancellor, BlackPromotionArchbishop, BlackPromotionCentaur,\r
     WhiteCapturesEnPassant, BlackCapturesEnPassant,\r
     WhiteDrop, BlackDrop, \r
     NormalMove, AmbiguousMove, IllegalMove, ImpossibleMove,\r
@@ -281,7 +280,13 @@ typedef enum {
     VariantCapablanca,\r
     VariantKnightmate,\r
     VariantFairy,        \r
-    VariantShowgi,\r
+    VariantCylinder,\r
+    VariantFalcon,\r
+    VariantCapaRandom,\r
+    VariantBerolina,\r
+    VariantJanus,\r
+    VariantSuper,\r
+    VariantGreat,\r
     VariantUnknown       /* Catchall for other unknown variants */\r
 } VariantClass;\r
 \r
@@ -316,7 +321,13 @@ typedef enum {
   "capablanca", \\r
   "knightmate", \\r
   "fairy", \\r
-  "showgi", \\r
+  "cylinder", \\r
+  "falcon",\\r
+  "caparandom",\\r
+  "berolina",\\r
+  "janus",\\r
+  "super",\\r
+  "great",\\r
   "unknown" \\r
 }\r
 \r
@@ -470,6 +481,7 @@ typedef struct {
     int firstProtocolVersion;\r
     int secondProtocolVersion;\r
     Boolean showButtonBar;\r
+    Boolean icsEngineAnalyze; \r
 \r
     /* [AS] New properties (down to the "ZIPPY" part) */\r
     Boolean firstScoreIsAbsolute;  /* If true, engine score is always from white side */\r
@@ -521,6 +533,9 @@ typedef struct {
     int NrRanks;\r
     int holdingsSize;\r
     int matchPause;\r
+    char * pieceToCharTable;\r
+    Boolean allWhite;\r
+    Boolean upsideDown;\r
     Boolean alphaRank;\r
     Boolean testClaims;\r
     Boolean checkMates;\r
@@ -528,7 +543,6 @@ typedef struct {
     Boolean trivialDraws;\r
     int ruleMoves;\r
     int drawRepeats;\r
-    char * pieceToCharTable;\r
 \r
 #if ZIPPY\r
     char *zippyLines;\r
@@ -548,6 +562,29 @@ typedef struct {
     int zippyMaxGames;\r
     int zippyReplayTimeout; /*seconds*/\r
 #endif\r
+\r
+    char *serverMovesName;\r
+    Boolean suppressLoadMoves;\r
+    int serverPause;\r
+    int firstTimeOdds;\r
+    int secondTimeOdds;\r
+    int timeOddsMode;\r
+    int firstAccumulateTC;\r
+    int secondAccumulateTC;\r
+    int firstNPS;\r
+    int secondNPS;\r
+    Boolean autoKibitz;\r
+    int engineComments;\r
+    char *userName;\r
+    int rewindIndex;    /* [HGM] autoinc   */\r
+    int sameColorGames; /* [HGM] alternate */\r
+    int smpCores;       /* [HGM] SMP       */\r
+    char *egtFormats;\r
+    int niceEngines;    /* [HGM] nice      */\r
+    char *firstLogo;    /* [HGM] logo      */\r
+    char *secondLogo;\r
+    Boolean autoLogo;\r
+    Boolean noGUI;      /* [HGM] fast: suppress all display updates */\r
 } AppData, *AppDataPtr;\r
 \r
 /* [AS] PGN tags (for showing in the game list) */\r
@@ -599,6 +636,3 @@ typedef struct {
 \r
 #endif\r
 \r
-/* extern int holdingsWidth;  \r
-extern int holdingsHeight; \r
-/*extern int holdings[(int) EmptySquare];*/\r