Subversion Repositories Games.Chess Giants

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.     Protector -- a UCI chess engine
  3.  
  4.     Copyright (C) 2009-2010 Raimund Heid (Raimund_Heid@yahoo.com)
  5.  
  6.     This program is free software: you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation, either version 3 of the License, or
  9.     (at your option) any later version.
  10.  
  11.     This program is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.     GNU General Public License for more details.
  15.  
  16.     You should have received a copy of the GNU General Public License
  17.     along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  
  19. */
  20.  
  21. #ifndef _xboard_h_
  22. #define _xboard_h_
  23.  
  24. #include "protector.h"
  25. #include "position.h"
  26.  
  27. extern int minPvHashEntrySendDepth;
  28. extern int minPvHashEntrySendTime;
  29. extern int maxPvHashEntrySendHeight;
  30. extern int pvHashEntriesSendInterval;
  31.  
  32. typedef struct
  33. {
  34.    int movesToGo;
  35.    int incrementTime;           /* unit: milliseconds */
  36.  
  37.    int numberOfMovesPlayed;
  38.    int restTime;                /* unit: milliseconds */
  39. }
  40. TimecontrolData;
  41.  
  42. #define XBOARD_OPERATIONMODE_ANALYSIS 2
  43. #define XBOARD_OPERATIONMODE_USERGAME 4
  44.  
  45. typedef struct
  46. {
  47.    TimecontrolData timecontrolData[2];
  48.    int operationMode;           /* see above */
  49.    Color engineColor;
  50.    bool pondering;
  51.    bool engineIsActive, engineIsPondering, bestMoveWasSent;
  52.    Move ponderingMove;
  53.    Move ponderResultMove;
  54.    int maxPlies;
  55. }
  56. XboardStatus;
  57.  
  58. /**
  59.  * Wait for the next Xboard/Winboard command and process it.
  60.  */
  61. void acceptGuiCommands(void);
  62.  
  63. /*
  64.  * Send a hash entry via UCI.
  65.  */
  66. void sendHashentry(Hashentry * entry);
  67.  
  68. /**
  69.  * Initialize this module.
  70.  *
  71.  * @return 0 if no errors occurred.
  72.  */
  73. int initializeModuleXboard(void);
  74.  
  75. /**
  76.  * Test this module.
  77.  *
  78.  * @return 0 if all tests succeed.
  79.  */
  80. int testModuleXboard(void);
  81.  
  82. #endif
  83.