changes from H.G. Muller; version 4.3.16
[xboard.git] / backend.h
index 995890d..eba5366 100644 (file)
--- a/backend.h
+++ b/backend.h
@@ -206,6 +206,19 @@ char * GameListLineFull P(( int, GameInfo *));
 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
@@ -263,8 +276,14 @@ typedef struct _CPS {
     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 */
-    int bookSuspend;  /* HGM book: go was deferred bcause of book hit       */\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
+    void *programLogo; /* [HGM] logo: bitmap of the logo                    */\r
 } ChessProgramState;\r
 \r
 extern ChessProgramState first, second;\r
@@ -276,7 +295,25 @@ typedef struct {
     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
+  unsigned long 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