Print egt feature
authorH.G.Muller <hgm@hgm-xboard.(none)>
Sat, 24 Dec 2016 18:39:57 +0000 (19:39 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Sat, 24 Dec 2016 18:57:32 +0000 (19:57 +0100)
Options of the form xxxPath for xxx = Nalimov, Gaviota of Syzygy are now
intercepted, and the EGT type name 'xxx' collected, for printing as a
single egt feature when 'uciok' is received.

README.txt
UCI2WB.c

index e9f2399..97a6549 100644 (file)
@@ -50,13 +50,15 @@ H.G.Muller
 \r
 Change log:\r
 \r
-22/12/2016 3.0\r
+24/12/2016 3.0\r
 Implement UCI_AnalyseMode option\r
+Support egtpath command for Nalimov, Gaviota and Syzygy\r
 Allow ?, quit, force and result commands to terminate thinking\r
 Stop search during setoption commands, or buffer those until engine is done thinking\r
 Explicitly report when engine dies, through GUI popup (tellusererror)\r
 Make sure reporting of mated-in-0 score causes resign, even without PV\r
 Fix eclipsing of -var option with engines that have UCI_Chess960 option\r
+Fix empty default of string options\r
 \r
 8/11/2016 2.3\r
 Implement handling of 'UCI_Variant' option for variant announcement and selection\r
index 6b4d19d..4d3a4df 100644 (file)
--- a/UCI2WB.c
+++ b/UCI2WB.c
@@ -32,6 +32,7 @@
 // Set VARIANTS for in WinBoard variant feature. (With -s option this will always be reset to use "shogi".)\r
 #define VARIANTS ",normal,xiangqi"\r
 #define STDVARS "chess,chess960,crazyhouse,threecheck,giveaway,atomic,seirawan,shogi,xiangqi"\r
+#define EGT ",syzygypath,nalimovpath,gaviotapath,"\r
 \r
 #define DPRINT if(debug) printf\r
 #define EPRINT(X) { char f[999]; sprintf X; DPRINT("%s", f); fprintf(toE, "%s", f + 2*(*f == '#')); /* strip optional # prefix */ }\r
@@ -255,7 +256,7 @@ GetChar()
 void *\r
 Engine2GUI()\r
 {\r
-    char line[1024], command[256];\r
+    char line[1024], command[256]; static char egts[999];\r
 \r
     if(fromF = fopen("DefectiveEngineOptions.ini", "r")) printf("# fake engine input\n");\r
     while(1) {\r
@@ -354,6 +355,7 @@ Engine2GUI()
            }\r
            if(!strcasecmp(name, "newgame") && !strcmp(type, "button")) { newGame++; continue; }\r
            if(!strcasecmp(name, "usemillisec")) { unit = (!strcmp(val, "false") ? 2 : 1); continue; }\r
+           sprintf(buf, ",%s,", name); if(strcasestr(EGT, buf)) { buf[strlen(buf)-5] = 0; strcat(egts, buf); continue; } // collect EGT formats\r
            // pass on engine-defined option as WB option feature\r
            if(!strcmp(type, "filename")) type[4] = 0;\r
            sprintf(buf, "feature option=\"%s -%s", name, type); q = buf + strlen(buf);\r
@@ -388,6 +390,7 @@ Engine2GUI()
                                else *p++ = *q++; // copy other variant names unmodified\r
            if(frc) sprintf(p, ",normal,fischerandom"), printf("feature oocastle=%d\n", frc<0); // unannounced FRC uses O-O castling\r
            if(*varList) printf("feature variants=\"%s\"\n", varList+1); // from UCI_Variant combo and/or UCI_Chess960 check options\r
+           if(*egts) { for(p=egts; *p = tolower(*p); p++); printf("feature egt=\"%s\"\n", egts+1); }\r
            printf("feature smp=1 memory=%d done=1\n", hasHash);\r
            if(unit == 2) { unit = 1; EPRINT((f, "# setoption usemillisec true\n")) }\r
            Sync(WAKEUP); // done with options\r