+=========1.4.36b================\r
+- Bugfix: option = 0/1 was translated incorrectly.\r
+- Default node count is 1.\r
+- EOF received from the engine should now be logged correctly (i.e. after the buffer is empty).\r
+- Bugfix: Nasty buffer overflow in the macro CONSTRUCT_ARG_STRING.\r
+- Bugfix: pipex_writeln (win32) was logging at the wrong spot. \r
+- Log board when an illegal move is received. \r
=========1.4.35b================\r
- New WbWorkAround for silly bug in WB. Depth <=1 clears the engine output window. Why should an engine not be allowed to send info at depth one?\r
=========1.4.34b================\r
case.
WbWorkArounds (default: true)
- The intention of this option is to provide work arounds for
- xboard/winboard bugs should they arise. Currently it decapitalizes
- the word Draw in options that contain this word. Some versions of
+ The intention of these options is to provide work arounds for
+ xboard/winboard bugs should they arise. This one decapitalizes the
+ word Draw in options that contain this word. Some versions of
xboard/winboard contain a bug which causes such options to be
interpreted as draw claims by the engine.
Engines that send options with "Draw" in their name are Rybka and
HIARCS.
+ WbWorkArounds2 (default: false)
+ Old version of Winboard clear the engine output window at depth 1.
+ With this work around PG will send info lines at depth >=2. This
+ may or may not improve the display.
+
[Engine] section
This section contains engine UCI options. PolyGlot does not understand
- 2009-08-07 POLYGLOT(6)
+ 2009-08-11 POLYGLOT(6)
int file, rank, sq;\r
int piece, c;\r
char fen[256];\r
+ char row[9];\r
+ char line[256];\r
\r
ASSERT(board!=NULL);\r
\r
if (!board_to_fen(board,fen,256)) ASSERT(FALSE);\r
- my_log("POLYGLOT %s\n",fen);\r
- my_log("POLYGLOT\n");\r
+ my_log("POLYGLOT FEN %s\n",fen);\r
+ my_log("POLYGLOT *** CURRENT BOARD ***\n");\r
\r
for (rank = 7; rank >= 0; rank--) {\r
\r
- my_log("POLYGLOT ");\r
-\r
for (file = 0; file < 8; file++) {\r
\r
sq = square_make(file,rank);\r
piece = board->square[sq];\r
\r
c = (piece != Empty) ? piece_to_char(piece) : '-';\r
- my_log("%c ",c);\r
+ row[file]=c;\r
}\r
-\r
- my_log("\n");\r
+ row[8]='\0';\r
+ snprintf(line,sizeof(line),"POLYGLOT %s\n",row);\r
+ line[sizeof(line)-1]='\0';\r
+ my_log(line);\r
}\r
\r
- my_log("POLYGLOT\n");\r
-\r
my_log("POLYGLOT %s to play\n",(colour_is_black(board->turn))?"black":"white");\r
my_log("POLYGLOT\n");\r
}\r
#define PACKAGE_NAME "polyglot"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "polyglot 1.4.35b"
+#define PACKAGE_STRING "polyglot 1.4.36b"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "polyglot"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "1.4.35b"
+#define PACKAGE_VERSION "1.4.36b"
/* Define to 1 if the C compiler supports function prototypes. */
#define PROTOTYPES 1
#define TIME_WITH_SYS_TIME 1
/* Version number of package */
-#define VERSION "1.4.35b"
+#define VERSION "1.4.36b"
/* Define like PROTOTYPES; this can be used by system headers. */
#define __PROTOTYPES 1
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for polyglot 1.4.35b.
+# Generated by GNU Autoconf 2.61 for polyglot 1.4.36b.
#
# Report bugs to <michel.vandenbergh@uhasselt.be>.
#
# Identity of this package.
PACKAGE_NAME='polyglot'
PACKAGE_TARNAME='polyglot'
-PACKAGE_VERSION='1.4.35b'
-PACKAGE_STRING='polyglot 1.4.35b'
+PACKAGE_VERSION='1.4.36b'
+PACKAGE_STRING='polyglot 1.4.36b'
PACKAGE_BUGREPORT='michel.vandenbergh@uhasselt.be'
ac_unique_file="mainloop.c"
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures polyglot 1.4.35b to adapt to many kinds of systems.
+\`configure' configures polyglot 1.4.36b to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of polyglot 1.4.35b:";;
+ short | recursive ) echo "Configuration of polyglot 1.4.36b:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-polyglot configure 1.4.35b
+polyglot configure 1.4.36b
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by polyglot $as_me 1.4.35b, which was
+It was created by polyglot $as_me 1.4.36b, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
# Define the identity of the package.
PACKAGE='polyglot'
- VERSION='1.4.35b'
+ VERSION='1.4.36b'
cat >>confdefs.h <<_ACEOF
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by polyglot $as_me 1.4.35b, which was
+This file was extended by polyglot $as_me 1.4.36b, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-polyglot config.status 1.4.35b
+polyglot config.status 1.4.36b
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
-AC_INIT([polyglot], [1.4.35b], [michel.vandenbergh@uhasselt.be])
+AC_INIT([polyglot], [1.4.36b], [michel.vandenbergh@uhasselt.be])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([mainloop.c])
AC_CONFIG_HEADER([config.h])
// constants\r
\r
\r
-static const char * const Version = "1.4.35b";\r
+static const char * const Version = "1.4.36b";\r
static const char * const HelpMessage = "\\r
SYNTAX\n\\r
* polyglot [configfile]\n\\r
{ "PromoteWorkAround","check","0","0", "false" , NULL,0,NNB, PG|XBOARD}, \r
\r
{ "WbWorkArounds", "check","0","0", "true" , NULL,0,NNB, PG|XBOARD}, \r
+ { "WbWorkArounds2", "check","0","0", "false" , NULL,0,NNB, PG|XBOARD}, \r
{ NULL, NULL,"0","0", NULL , NULL,0,NNB, 0},\r
\r
};\r
EnterCriticalSection(&(pipex->CriticalSection));
(pipex->state)|=PIPEX_EOF;
LeaveCriticalSection(&(pipex->CriticalSection));
- // not quit the right place
- my_log("%s->Adapter: EOF\n",pipex->name);
-
-}
+ }
// pipex_active()
WaitForSingleObject(pipex->hEvent,INFINITE);
}
}
+ my_log("%s->Adapter: EOF\n",pipex->name);
szLineStr[0]='\0';
return FALSE;
}
void pipex_writeln(pipex_t *pipex, const char *szLineStr) {
DWORD dwBytes;
DWORD dwLengthWriteBuffer;
- my_log("Adapter->%s: %s\n",pipex->name,pipex->szWriteBuffer);
pipex_write(pipex, szLineStr);
+ my_log("Adapter->%s: %s\n",pipex->name,pipex->szWriteBuffer);
if(pipex->bPipe){
dwLengthWriteBuffer = strlen(pipex->szWriteBuffer);
if(dwLengthWriteBuffer>=sizeof(pipex->szWriteBuffer)-3){
.\" ========================================================================
.\"
.IX Title "POLYGLOT 6"
-.TH POLYGLOT 6 "2009-08-07" "" ""
+.TH POLYGLOT 6 "2009-08-11" "" ""
.SH "NAME"
PolyGlot \- Winboard protocol to UCI protocol adapter
\- book engine for Polyglot books
Due to the way kibitzing is implemented, KibitzMove is disabled in that case.
.IP "\fBWbWorkArounds\fR (default: true)" 4
.IX Item "WbWorkArounds (default: true)"
-The intention of this option is to provide work arounds for
-xboard/winboard bugs should they arise. Currently it decapitalizes
+The intention of these options is to provide work arounds for
+xboard/winboard bugs should they arise. This one decapitalizes
the word Draw in options that contain this word. Some versions of
xboard/winboard contain a bug which causes such options to be
interpreted as draw claims by the engine.
.Sp
Engines that send options with \*(L"Draw\*(R" in their name are Rybka and \s-1HIARCS\s0.
+.IP "\fBWbWorkArounds2\fR (default: false)" 4
+.IX Item "WbWorkArounds2 (default: false)"
+Old version of Winboard clear the engine output window at depth 1. With this
+work around \s-1PG\s0 will send info lines at depth >=2. This may or may not improve
+the display.
.Sh "[Engine] section"
.IX Subsection "[Engine] section"
This section contains engine \s-1UCI\s0 options. PolyGlot does not
=item B<WbWorkArounds> (default: true)
-The intention of this option is to provide work arounds for
-xboard/winboard bugs should they arise. Currently it decapitalizes
+The intention of these options is to provide work arounds for
+xboard/winboard bugs should they arise. This one decapitalizes
the word Draw in options that contain this word. Some versions of
xboard/winboard contain a bug which causes such options to be
interpreted as draw claims by the engine.
Engines that send options with "Draw" in their name are Rybka and HIARCS.
+=item B<WbWorkArounds2> (default: false)
+
+Old version of Winboard clear the engine output window at depth 1. With this
+work around PG will send info lines at depth >=2. This may or may not improve
+the display.
+
=back
Summary: A Winboard protocol to UCI protocol adapter
Name: polyglot
-Version: 1.4.35b
+Version: 1.4.36b
Release: 1
License: GPL
Group: Amusement/Games
uci->best_depth = 0;\r
uci->best_sel_depth = 0;\r
line_clear(uci->best_pv);\r
-\r
- uci->node_nb = 0;\r
+// make the default 1 instead of 0 so that info lines can be recognized by their node number 0\r
+ uci->node_nb = 1;\r
uci->time = 0.0;\r
uci->speed = 0.0;\r
uci->cpu = 0.0;\r
}else if(my_string_case_equal(argument,"Resign")){\r
event |= EVENT_RESIGN;\r
}else{\r
- strcpy(uci->info,argument);\r
+ snprintf(uci->info,sizeof(uci->info),"%s",argument);\r
+ uci->info[sizeof(uci->info)-1]='\0';\r
event|=EVENT_INFO;\r
}\r
// TODO: argument to EOS\r
} else {\r
\r
my_log("POLYGLOT unknown option \"%s\" for command \"%s\"\n",option,command);\r
- // this is for buggy engines; it should probably be protected\r
+ // This should probably be protected\r
// by a "WorkAround" option.\r
- strcpy(uci->info,option);\r
- strcat(uci->info," ");\r
- strcat(uci->info,argument);\r
+ snprintf(uci->info,sizeof(uci->info),"%s %s",option,argument);\r
+ uci->info[sizeof(uci->info)-1]='\0';\r
event|=EVENT_INFO;\r
}\r
}\r
\r
CONSTRUCT_ARG_STRING(format,string);\r
\r
- fprintf(stderr,format,string);\r
- if (LogFile != NULL) fprintf(LogFile,format,&string);\r
+ fprintf(stderr,"%s",string);\r
+ if (LogFile != NULL) fprintf(LogFile,"%s",string);\r
\r
if (Error) { // recursive error\r
my_log("POLYGLOT *** RECURSIVE ERROR ***\n");\r
format, \\r
arg_list); \\r
va_end(arg_list); \\r
- buf[sizeof(buf)]='\0'; \\r
+ buf[sizeof(buf)-1]='\0'; \\r
if(written>=sizeof(buf) || written<0){ \\r
my_fatal("write_buffer overflow: file \"%s\", line %d\n", \\r
__FILE__,__LINE__); \\r
char *pg_name=Star[0];\r
polyglot_set_option(pg_name,value);\r
}else{\r
- start_protected_command();\r
- if(!uci_send_option(Uci, name, "%s", value)){\r
+ option_t *opt=option_find(Uci->option,name);\r
+ if(opt){\r
+ if(my_string_case_equal(opt->type,"check")){\r
+ value=my_string_equal(value,"1")?"true":"false";\r
+ }\r
+ start_protected_command();\r
+ uci_send_option(Uci, name, "%s", value);\r
+ end_protected_command();\r
+ }else{\r
gui_send(GUI,"Error (unknown option): %s",name); \r
}\r
- end_protected_command();\r
}\r
} else if (match(string,"option *")){\r
char *name=Star[0];\r
gui_send(GUI,"1-0 {polyglot: resign"\r
" (illegal engine move black)}");\r
}\r
+ board_disp(board);\r
XB->result = TRUE;\r
mess();\r
}\r
\r
static void send_info() {\r
int min_depth;\r
- if(option_get_bool(Option,"WbWorkArounds")){\r
+ if(option_get_bool(Option,"WbWorkArounds2")){\r
// Silly bug in some versions of WinBoard.\r
// depth <=1 clears the engine output window.\r
// Why shouldn't an engine be allowed to send info at depth 1?\r