#ifndef _BACKEND\r
#define _BACKEND\r
\r
+/* unsigned int 64 for engine nodes work and display */\r
+#ifdef WIN32\r
+ /* I don't know the name for this type of other compiler\r
+ * If it not work, just modify here\r
+ * This is for MS Visual Studio\r
+ */\r
+ #ifdef _MSC_VER\r
+ #define u64 unsigned __int64\r
+ #define s64 signed __int64\r
+ #define u64Display "%I64u"\r
+ #define s64Display "%I64d"\r
+ #define u64Const(c) (c ## UI64)\r
+ #define s64Const(c) (c ## I64)\r
+ #else\r
+ /* place holder\r
+ * or dummy types for other compiler\r
+ */\r
+ #define u64 unsigned long long\r
+ #define s64 signed long long\r
+ #define u64Display "%llu"\r
+ #define s64Display "%lld"\r
+ #define u64Const(c) (c ## ULL)\r
+ #define s64Const(c) (c ## LL)\r
+ #endif\r
+#else\r
+ /* GNU gcc */\r
+ #define u64 unsigned long long\r
+ #define s64 signed long long\r
+ #define u64Display "%llu"\r
+ #define s64Display "%lld"\r
+ #define u64Const(c) (c ## ull)\r
+ #define s64Const(c) (c ## ll)\r
+#endif\r
+\r
#include "lists.h"\r
#include "frontend.h"\r
\r
void StopObservingEvent P((void));\r
void StopExaminingEvent P((void));\r
void PonderNextMoveEvent P((int newState));\r
-void ShowThinkingEvent P((int newState));\r
+void NewSettingeEvent P((int option, char *command, int value));\r
+void ShowThinkingEvent P(());\r
void PeriodicUpdatesEvent P((int newState));\r
void HintEvent P((void));\r
void BookEvent P((void));\r
int *toX, int *toY, char *promoChar));\r
char *VariantName P((VariantClass v));\r
VariantClass StringToVariant P((char *e));\r
+double u64ToDouble P((u64 value));\r
\r
char *StrStr P((char *string, char *match));\r
char *StrCaseStr P((char *string, char *match));\r
\r
extern GameInfo gameInfo;\r
\r
+/* ICS vars used with backend.c and zippy.c */\r
+#define ICS_GENERIC 0\r
+#define ICS_ICC 1\r
+#define ICS_FICS 2\r
+#define ICS_CHESSNET 3 /* not really supported */\r
+int ics_type;\r
+\r
+ \r
\r
/* pgntags.c prototypes\r
*/\r
extern char* StripHighlight P((char *)); /* returns static data */\r
extern char* StripHighlightAndTitle P((char *)); /* returns static data */\r
\r
+typedef enum { CheckBox, ComboBox, TextBox, Button, Spin, SaveButton } Control;\r
+\r
+typedef struct _OPT { // [HGM] options: descriptor of UCI-style option\r
+ int value; // current setting, starts as default\r
+ int min;\r
+ int max;\r
+ void *handle; // for use by front end\r
+ char *textValue; // points to beginning of text value in name field\r
+ char **choice; // points to array of combo choices in cps->combo\r
+ Control type;\r
+ char name[MSG_SIZ]; // holds both option name and text value\r
+} Option;\r
+\r
typedef struct _CPS {\r
char *which;\r
int maybeThinking;\r
int scoreIsAbsolute; /* [AS] 0=don't know (standard), 1=score is always from white side */\r
int isUCI; /* [AS] 0=no (Winboard), 1=UCI (requires Polyglot) */\r
int hasOwnBookUCI; /* [AS] 0=use GUI or Polyglot book, 1=has own book */\r
+\r
+ /* [HGM] time odds */\r
+ int timeOdds; /* factor through which we divide time for this engine */\r
+ int debug; /* [HGM] ignore engine debug lines starting with '#' */\r
+ int maxNrOfSessions; /* [HGM] secondary TC: max args in 'level' command */\r
+ int accumulateTC; /* [HGM] secondary TC: how to handle extra sessions */\r
+ int nps; /* [HGM] nps: factor for node count to replace time */\r
+ int supportsNPS;\r
+ int alphaRank; /* [HGM] shogi: engine uses shogi-type coordinates */\r
+ int maxCores; /* [HGM] SMP: engine understands cores command */\r
+ int memSize; /* [HGM] memsize: engine understands memory command */\r
+ char egtFormats[MSG_SIZ]; /* [HGM] EGT: supported tablebase formats */\r
+ int bookSuspend; /* [HGM] book: go was deferred because of book hit */\r
+ int nrOptions; /* [HGM] options: remembered option="..." features */\r
+#define MAX_OPTIONS 50\r
+ Option option[MAX_OPTIONS];\r
+ int comboCnt;\r
+ char *comboList[10*MAX_OPTIONS];\r
+ char *optionSettings;\r
+ void *programLogo; /* [HGM] logo: bitmap of the logo */\r
} ChessProgramState;\r
\r
extern ChessProgramState first, second;\r
int time; /* Milliseconds */\r
} ChessProgramStats_Move;\r
\r
+/* Search stats from chessprogram */\r
+typedef struct {\r
+ char movelist[2*MSG_SIZ]; /* Last PV we were sent */\r
+ int depth; /* Current search depth */\r
+ int nr_moves; /* Total nr of root moves */\r
+ int moves_left; /* Moves remaining to be searched */\r
+ char move_name[MOVE_LEN]; /* Current move being searched, if provided */\r
+ u64 nodes; /* # of nodes searched */\r
+ int time; /* Search time (centiseconds) */\r
+ int score; /* Score (centipawns) */\r
+ int got_only_move; /* If last msg was "(only move)" */\r
+ int got_fail; /* 0 - nothing, 1 - got "--", 2 - got "++" */\r
+ int ok_to_send; /* handshaking between send & recv */\r
+ int line_is_book; /* 1 if movelist is book moves */\r
+ int seen_stat; /* 1 if we've seen the stat01: line */\r
+} ChessProgramStats;\r
+\r
extern ChessProgramStats_Move pvInfoList[MAX_MOVES];\r
+extern shuffleOpenings;\r
+extern ChessProgramStats programStats;\r
\r
#endif /* _BACKEND */\r