+=========1.4.45b================\r
+- The engine specific config files (<myname>.ini) are now stored in a separate directory. $HOME/.polyglot on Linux and "./Polyglot Settings" on Windows. \r
+- The engine specific config files are now complete config files. So they can be used in a stand alone fashion.\r
+- Implemented a minor hack to make xboard show error messages during startup. \r
=========1.4.44b================\r
- "Implementation" of new buttons and controls.\r
- The "Persist" option is now persistent. That is if you turn of "Persist" then as a special case PG will remember this.\r
NAME
PolyGlot - Winboard protocol to UCI protocol adapter
- book engine for Polyglot books
- - a collection of utilities for creating and analyzing open-
- ing books
+ - a collection of utilities for creating and analyzing
+ opening books
- a utility for analyzing epd files
- a perft counter
<name>=<value>]* [-uci <name>=<value>]*
polyglot make-book [-pgn inputfile] [-bin outputfile] [-max-ply ply]
- [-min-game games] [-min-score score] [-only-white] [-only-black] [-uni-
- form]
+ [-min-game games] [-min-score score] [-only-white] [-only-black]
+ [-uniform]
polyglot merge-book -in1 inputfile1 -in2 inputfile2 [-out outputfile]
By specifying an opening book (in PolyGlot book format) chess engines
can transparently use such books.
- PolyGlot understands the two main GUI protocols: UCI and xboard. Nor-
- mally the protocol will be auto detected but this can be overridden in
- the configuration file.
+ PolyGlot understands the two main GUI protocols: UCI and xboard.
+ Normally the protocol will be auto detected but this can be overridden
+ in the configuration file.
In xboard mode PolyGlot fully translates between the xboard and UCI
protocols. In addition it tries to solve known problems with other
engine and vice versa, except that it will play book moves on behalf of
the engine when the occasion arises.
- The engine options are exported as UCI options in UCI mode and as "fea-
- ture option=" commands in xboard mode. The latter form an extension of
- the xboard protocol as defined by H.G. Muller.
+ The engine options are exported as UCI options in UCI mode and as
+ "feature option=" commands in xboard mode. The latter form an extension
+ of the xboard protocol as defined by H.G. Muller.
Options which normally appear in the [PolyGlot] section of the config
file (see below) are exported as options with their name prefixed by
Book making utilities
PolyGlot supports the "PolyGlot opening book format". This is the
- defacto standard non-proprietary opening book format. It is fully docu-
- mented here
+ defacto standard non-proprietary opening book format. It is fully
+ documented here
http://alpha.uhasselt.be/Research/Algebra/Toga/book_format.html
.abk format are undocumented and proprietary. They can only be used by
their own GUIs.
- PolyGlot can compile a pgn file into a binary PolyGlot book and fur-
- thermore it can merge two such binary books into a third one.
+ PolyGlot can compile a pgn file into a binary PolyGlot book and
+ furthermore it can merge two such binary books into a third one.
PolyGlot can also extract some useful information from PolyGlot books.
The utility "dump-book" dumps the "lines" in a book for a given color.
- By definition a line is a sequence of moves (from the starting posi-
- tion) in which the given color makes only book moves and the other
+ By definition a line is a sequence of moves (from the starting
+ position) in which the given color makes only book moves and the other
color makes arbitrary moves (i.e. not necessarily book moves).
Since a PolyGlot book is built up from positions and not lines there
Epd test mode
In epd test mode, PolyGlot will search positions in an epd file and
- record the number of times the right best move was found. The argu-
- ments specify when to stop the search in any given position.
+ record the number of times the right best move was found. The
+ arguments specify when to stop the search in any given position.
Perft counts
A perft count is the number of legal move sequence in a given position
- up to a given depth. PolyGlot can perform such perft counts. It is how-
- ever much slower than other more dedicated programs.
+ up to a given depth. PolyGlot can perform such perft counts. It is
+ however much slower than other more dedicated programs.
OPTIONS
When PolyGlot is invoked as an adapter of in epd-test mode it gets its
The argument is a string of the form <name>=<value>. This option
will set the engine option <name> to <value>.
- -ec This is an alias for -pg "EngineCommand=<value>".
+ -ec This sets the EngineCommand.
- -ed This is an alias for -pg "EngineDir=<value>".
+ -ed This sets the EngineDir.
- -en This is an alias for -pg "EngineName=<value>"
+ -en This sets the EngineName.
-hash
This is an alias for -uci "Hash=<value>".
Input file in PolyGlot book format.
-exact
- Attempt to count the provably unreachable positions among the iso-
- lated ones. Note that this takes a very long time.
+ Attempt to count the provably unreachable positions among the
+ isolated ones. Note that this takes a very long time.
When invoked as
The characters "#" and ";" serve as comment characters.
- By default initial and final white space is stripped from option val-
- ues. If you want to avoid this, or if you want use one of the comment
- characters # or ; in option values (such as for NalimovPath), enclose
- the value in quotes.
+ By default initial and final white space is stripped from option
+ values. If you want to avoid this, or if you want use one of the
+ comment characters # or ; in option values (such as for NalimovPath),
+ enclose the value in quotes.
[PolyGlot] section
move are ignored.
ResignScore (default: 600)
- This is the score in centipawns that will trigger resign "count-
- ing".
+ This is the score in centipawns that will trigger resign
+ "counting".
ShowPonder (default: true)
Show search information during engine pondering. Turning this off
move).
KibitzCommand (default: "tellall")
- xboard command to use for kibitzing, normally "tellall" for kibitz-
- ing or "tellothers" for whispering.
+ xboard command to use for kibitzing, normally "tellall" for
+ kibitzing or "tellothers" for whispering.
KibitzDelay (default: 5)
How many seconds to wait before starting kibitzing. This has an
BookFile (default: book.bin)
The name of the (binary) book file. Note that PolyGlot will look
for it in the directory it was launched from, not in the engine
- directory. Of course, full path can be used in which case the cur-
- rent directory does not matter.
+ directory. Of course, full path can be used in which case the
+ current directory does not matter.
BookRandom (default: true)
Select moves according to their weights in the book. If false the
Persist (default: true)
If true then PolyGlot will implement persistence by loading options
- from an additional INI file which is specified by the option "Per-
- sistFile". At exit PolyGlot will also save its options to this INI
- file.
+ from an additional INI file whose name is by default derived from
+ the engine name. At exit PolyGlot will also save its options to
+ this INI file.
- PersistFile (default: PG_<EngineName>.ini)
- The name of the file from which to take the additional options.
- You can safely edit this file, or delete it to restore the default
- options.
+ PersistFile (default: <EngineName>.ini)
+ The name of the file from which to take the additional options. It
+ is probably best to stick with the default. You can safely edit
+ this file, or delete it to restore the default options.
+
+ PersistDir (default: $HOME/.polyglot on Linux; ".\Polyglot Settings" on
+ Windows)
+ The directory where the PersistFile is stored.
Work arounds
only when necessary. Their purpose is to try to hide problems with
various software (not just engines).
- IMPORTANT: Any of these work arounds might be removed in future ver-
- sions of PolyGlot. You are strongly recommended to contact the author
- of faulty software and truly fix the problem.
+ IMPORTANT: Any of these work arounds might be removed in future
+ versions of PolyGlot. You are strongly recommended to contact the
+ author of faulty software and truly fix the problem.
PolyGlot supports the following work arounds:
CanPonder (default: false)
PolyGlot now conforms to the documented UCI behaviour: the engine
will be allowed to ponder only if it (the engine) declares the
- "Ponder" UCI option. However some engines which can actually pon-
- der do not declare the option. This work around lets PolyGlot know
- that they can ponder.
+ "Ponder" UCI option. However some engines which can actually
+ ponder do not declare the option. This work around lets PolyGlot
+ know that they can ponder.
SyncStop (default: false)
- When a ponder miss occurs, Polyglot interrupts the engine and IMME-
- DIATELY launches a new search. While there should be no problem
- with this, some engines seem confused and corrupt their search
- board. "SyncStop" forces PolyGlot to wait for the (now useless)
- ponder search to finish before launching the new search.
+ When a ponder miss occurs, Polyglot interrupts the engine and
+ IMMEDIATELY launches a new search. While there should be no
+ problem with this, some engines seem confused and corrupt their
+ search board. "SyncStop" forces PolyGlot to wait for the (now
+ useless) ponder search to finish before launching the new search.
PromoteWorkAround (default: false)
Some engines do not specify a promotion piece, e.g. they send
UCI form). You can add any UCI option that makes sense to the engine
(not just the common options about hash-table size and tablebases).
- NOTE: use INI syntax, not UCI. For example "OwnBook = true" is cor-
- rect. It will be replaced by PolyGlot with "setoption name OwnBook
+ NOTE: use INI syntax, not UCI. For example "OwnBook = true" is
+ correct. It will be replaced by PolyGlot with "setoption name OwnBook
value true" at engine startup.
Standard UCI options are
GUI or launch the engine in a console and type "uci".
EXAMPLES
+ Running the UCI engine "fruit" under xboard 4.3.15 and later (this
+ invokes PolyGlot internally).
+
+ xboard -fcp fruit -fUCI
+
+ An explicit command line for using the UCI engine "fruit" with 128M
+ hash in xboard with logging enabled (this also works on xboard 4.2.7).
+
+ xboard -fcp "polyglot -noini -log -ec fruit -hash 128"
+
+ The equivalent config file would be:
+
+ [PolyGlot]
+ EngineCommand = fruit
+ Log = true
+ [Engine]
+ Hash=128
+
Compile "games.pgn" into a book "book.bin" retaining all lines of at
most 30 plies.
polyglot epd-test -epd test.epd -max-time 420
- The command line for using the UCI engine "fruit" with 128M hash in
- xboard with logging enabled.
-
- xboard -fcp "polyglot -noini -log -ec fruit -hash 128"
-
- The equivalent config file would be:
-
- [PolyGlot]
- EngineCommand = fruit
- Log = true
- [Engine]
- Hash=128
-
EXIT STATUS
PolyGlot always returns 0 on exit.
Various enhancements: Fonzy Bleumers<match(at)geenvis.net>
- UCI port: Michel Van den Bergh <michel.vandenbergh(at)uhasselt.be>
+ UCI port, option persistence and new WB protocol: Michel Van den Bergh
+ <michel.vandenbergh(at)uhasselt.be>
SEE ALSO
xboard(6)
- 2009-09-01 POLYGLOT(6)
+ 2009-09-04 POLYGLOT(6)
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
-# Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Free Software Foundation, Inc.
-timestamp='2007-07-22'
+timestamp='2008-01-23'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
echo rs6000-ibm-aix3.2
fi
exit ;;
- *:AIX:*:[45])
+ *:AIX:*:[456])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
EM64T | authenticamd)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
+ IA64)
+ echo ia64-unknown-interix${UNAME_RELEASE}
+ exit ;;
esac ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
echo ${UNAME_MACHINE}-pc-minix
exit ;;
arm*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ fi
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
exit ;;
- xtensa:Linux:*:*)
- echo xtensa-unknown-linux-gnu
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
and
- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
If the version you run ($0) is already up to date, please
send the following data and any information you think might be
#define PACKAGE_NAME "polyglot"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "polyglot 1.4.44b"
+#define PACKAGE_STRING "polyglot 1.4.45b"
/* 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.44b"
+#define PACKAGE_VERSION "1.4.45b"
/* 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.44b"
+#define VERSION "1.4.45b"
/* Define like PROTOTYPES; this can be used by system headers. */
#define __PROTOTYPES 1
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
-# Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Free Software Foundation, Inc.
-timestamp='2007-06-28'
+timestamp='2008-01-16'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
version="\
GNU config.sub ($timestamp)
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
- | xstormy16-* | xtensa-* \
+ | xstormy16-* | xtensa*-* \
| ymp-* \
| z8k-*)
;;
+ # Recognize the basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
+ ;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
basic_machine=ns32k-sequent
os=-dynix
;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
c90)
basic_machine=c90-cray
os=-unicos
basic_machine=m68k-isi
os=-sysv
;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
m88k-omron*)
basic_machine=m88k-omron
;;
basic_machine=i860-intel
os=-osf
;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
pbd)
basic_machine=sparc-tti
;;
basic_machine=tic6x-unknown
os=-coff
;;
+ tile*)
+ basic_machine=tile-unknown
+ os=-linux-gnu
+ ;;
tx39)
basic_machine=mipstx39-unknown
;;
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for polyglot 1.4.44b.
+# Generated by GNU Autoconf 2.61 for polyglot 1.4.45b.
#
# Report bugs to <michel.vandenbergh@uhasselt.be>.
#
# Identity of this package.
PACKAGE_NAME='polyglot'
PACKAGE_TARNAME='polyglot'
-PACKAGE_VERSION='1.4.44b'
-PACKAGE_STRING='polyglot 1.4.44b'
+PACKAGE_VERSION='1.4.45b'
+PACKAGE_STRING='polyglot 1.4.45b'
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.44b to adapt to many kinds of systems.
+\`configure' configures polyglot 1.4.45b 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.44b:";;
+ short | recursive ) echo "Configuration of polyglot 1.4.45b:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-polyglot configure 1.4.44b
+polyglot configure 1.4.45b
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.44b, which was
+It was created by polyglot $as_me 1.4.45b, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
# Define the identity of the package.
PACKAGE='polyglot'
- VERSION='1.4.44b'
+ VERSION='1.4.45b'
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.44b, which was
+This file was extended by polyglot $as_me 1.4.45b, 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.44b
+polyglot config.status 1.4.45b
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.44b], [michel.vandenbergh@uhasselt.be])
+AC_INIT([polyglot], [1.4.45b], [michel.vandenbergh@uhasselt.be])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([mainloop.c])
AC_CONFIG_HEADER([config.h])
}else if(result==NAME_VALUE){
ini_insert_ex(ini,current_section,name,value);
}else if(result==SYNTAX_ERROR){
- my_fatal("ini_parse(): Syntax error in \"%s\": line %d\n",
+ // Dirty hack.
+ // The "not found" triggers xboard to show the error.
+ my_fatal("ini_parse(): Syntax error in \"%s\": line %d (not found)\n",
filename,
line_nr);
#include <stdio.h>\r
#include <stdlib.h>\r
#include <string.h>\r
+#include <time.h>\r
\r
#include "attack.h"\r
#include "board.h"\r
#include "xboard2uci.h"\r
#include "uci2uci.h"\r
#include "ini.h"\r
+#include "util.h"\r
+\r
\r
// constants\r
\r
\r
-static const char * const Version = "1.4.44b";\r
+static const char * const Version = "1.4.45b";\r
static const char * const HelpMessage = "\\r
SYNTAX\n\\r
* polyglot [configfile] [-noini] [-ec engine] [-ed enginedirectory] [-en enginename] [-log] [-lf logfile] [-hash value] [-bk book] [-pg <name>=<value>]* [-uci <name>=<value>]*\n\\r
static const double SearchTime = 3600.0;\r
static const int StringSize = 4096;\r
\r
+static const char * const IniIntro=\r
+ "; This ini file is used internally by PolyGlot\n"\r
+ "; to remember the settings for the UCI engine\n"\r
+ "; whose name is \"%s\".\n"\r
+ "\n"\r
+ "; The values for these settings would be typicallly\n"\r
+ "; obtained from the engine settings dialog\n"\r
+ "; in WinBoard/xboard 4.4.0 and higher.\n"\r
+ "\n" \r
+ "; It is allowed to manually edit this file\n"\r
+ "; and you may safely delete it as well.\n"\r
+ "\n";\r
+\r
// variables\r
\r
static bool Init;\r
option_t *opt;\r
char tmp[StringSize];\r
FILE *f;\r
+ time_t t=time(NULL);\r
f=fopen(filename,"w");\r
if(!f){\r
- my_fatal("write_ini(): Cannot open %s for writing.\n",filename);\r
- }\r
- fprintf(f,"; You may edit this file to set options for the\n"\r
- "; UCI engine whose PolyGlot name is %s.\n"\r
- "; You may also safely delete this file\n"\r
- "; to restore the default options.\n",\r
- option_get_string(Option,"EngineName"));\r
+ // alas this does nothing....\r
+ gui_send(GUI,"tellusererror write_ini(): %s: %s.",filename,strerror(errno));\r
+ // but at least we log the error\r
+ my_log("POLYGLOT write_ini(): %s: %s.\n",filename,strerror(errno));\r
+ return;\r
+ }\r
+ fprintf(f,"; %s\n",ctime(&t));\r
+ fprintf(f,IniIntro,option_get_string(Option,"EngineName"));\r
fprintf(f,"[PolyGlot]\n");\r
+ fprintf(f,"EngineName=%s\n",\r
+ option_get_string(Option,"EngineName"));\r
+ fprintf(f,"EngineCommand=%s\n",\r
+ option_get_string(Option,"EngineCommand"));\r
+ fprintf(f,"EngineDir=%s\n",\r
+ option_get_string(Option,"EngineDir"));\r
option_start_iter(pg_options);\r
while((opt=option_next(pg_options))){\r
if(!my_string_equal(opt->value,opt->default_)&&\r
ini_entry_t *entry;\r
char tmp[StringSize];\r
FILE *f;\r
+ time_t t=time(NULL);\r
f=fopen(filename,"w");\r
if(!f){\r
- my_fatal("write_ini_ex(): Cannot open %s for writing.\n",filename);\r
- }\r
- fprintf(f,"; You may edit this file to set options for the\n"\r
- "; UCI engine whose PolyGlot name is %s.\n"\r
- "; You may also safely delete this file\n"\r
- "; to restore the default options.\n",\r
- option_get_string(Option,"EngineName"));\r
+ // alas this does nothing....\r
+ gui_send(GUI,"tellusererror write_ini(): %s: %s.",filename,strerror(errno));\r
+ // but at least we log the error\r
+ my_log("POLYGLOT write_ini(): %s: %s.\n",filename,strerror(errno));\r
+ return;\r
+ }\r
+ fprintf(f,"; %s\n",ctime(&t));\r
+ fprintf(f,IniIntro,option_get_string(Option,"EngineName"));\r
fprintf(f,"[PolyGlot]\n");\r
+ fprintf(f,"EngineName=%s\n",\r
+ option_get_string(Option,"EngineName"));\r
+ fprintf(f,"EngineCommand=%s\n",\r
+ option_get_string(Option,"EngineCommand"));\r
+ fprintf(f,"EngineDir=%s\n",\r
+ option_get_string(Option,"EngineDir"));\r
ini_start_iter(ini);\r
while((entry=ini_next(ini))){\r
if(my_string_case_equal(entry->section,"polyglot")){\r
char *arg;\r
int arg_index;\r
bool NoIni, Persist;\r
+ char persist_path[StringSize];\r
\r
if(!DEBUG){\r
printf("PolyGlot %s by Fabien Letouzey.\n",Version);\r
\r
if(my_string_equal(option_get_string(Option,"PersistFile"),"<empty>")){\r
char tmp[StringSize];\r
- snprintf(tmp,sizeof(tmp),"PG_%s.ini",\r
+ snprintf(tmp,sizeof(tmp),"%s.ini",\r
option_get_string(Option,"EngineName"));\r
tmp[sizeof(tmp)-1]='\0';\r
option_set(Option,"PersistFile",tmp);\r
\r
// Load the persist file\r
\r
- my_log("POLYGLOT PersistFile=%s\n",option_get_string(Option,"PersistFile")); \r
- if(ini_parse(ini_save,option_get_string(Option,"PersistFile"))){\r
+ my_path_join(persist_path,\r
+ option_get_string(Option,"PersistDir"),\r
+ option_get_string(Option,"PersistFile"));\r
+\r
+ my_log("POLYGLOT PersistFile=%s\n",persist_path); \r
+ if(ini_parse(ini_save,persist_path)){\r
my_log("POLYGLOT Unable to open PersistFile\n"); \r
}\r
\r
my_log("POLYGLOG Options from PersistFile and command line\n");\r
ini_disp(ini_save);\r
\r
- // extract PG options; this time do not set the default\r
+ // Extract PG options; this time do not set the default.\r
// polyglot_set_option() performs the necessary actions such\r
// as opening the log file/opening book etcetera.\r
+ // Ignore EngineName, EngineCommand and EngineDir\r
+ // as these are really meant as comments.\r
\r
ini_start_iter(ini_save);\r
while((entry=ini_next(ini_save))){\r
if(my_string_case_equal(entry->section,"polyglot")){\r
+ if(my_string_case_equal(entry->value,"EngineName")) \r
+ continue;\r
+ if(my_string_case_equal(entry->value,"EngineCommand")) \r
+ continue;\r
+ if(my_string_case_equal(entry->value,"EngineDir")) \r
+ continue;\r
polyglot_set_option(entry->name,entry->value);\r
}\r
}\r
void quit() {\r
\r
ini_t empty[1];\r
+ char persist_path[StringSize];\r
+ int ret;\r
\r
ini_init(empty);\r
\r
engine_close(Engine);\r
\r
}\r
- // printf("def=%s val=%s\n",option_get_default(Option,"Persist"),option_get_string(Option,"Persist"));\r
- if(option_get_bool(Option,"Persist")){\r
- write_ini(option_get_string(Option,"PersistFile"),\r
+ ret=my_mkdir(option_get(Option,"PersistDir"));\r
+ if(ret){\r
+ my_log("POLYGLOT quit(): %s: %s\n",option_get(Option,"PersistDir"),strerror(errno));\r
+ }\r
+ // PersistFile can be named "<empty>" in case of a crash before the\r
+ // engine is started. \r
+ if(!my_string_case_equal(option_get(Option,"PersistFile"),\r
+ "<empty>")){\r
+ my_path_join(persist_path,\r
+ option_get(Option,"PersistDir"),\r
+ option_get(Option,"PersistFile"));\r
+ if(option_get_bool(Option,"Persist")){\r
+ write_ini(persist_path,\r
Option,Uci->option);\r
- }else if(!my_string_case_equal(option_get_default(Option,"Persist"),\r
- option_get_string(Option,"Persist"))){\r
- // Hack\r
- ini_insert_ex(empty,"PolyGlot","Persist","false");\r
- write_ini_ex(option_get_string(Option,"PersistFile"),empty);\r
- }else{\r
- write_ini_ex(option_get_string(Option,"PersistFile"),empty);\r
+ }else if(!my_string_case_equal(option_get_default(Option,"Persist"),\r
+ option_get_string(Option,"Persist"))){\r
+ // Hack\r
+ ini_insert_ex(empty,"PolyGlot","Persist","false");\r
+ write_ini_ex(persist_path,empty);\r
+ }else{\r
+ write_ini_ex(persist_path,empty);\r
+ }\r
+ my_log("POLYGLOT Calling exit\n");\r
}\r
- my_log("POLYGLOT Calling exit\n");\r
exit(EXIT_SUCCESS);\r
}\r
\r
// constants\r
\r
static const bool UseDebug = FALSE;\r
-\r
+static const int StringSize = 4096;\r
\r
// variables\r
\r
\r
// options\r
\r
- { "Persist", "check","0","0", "true" , NULL,0,NNB, PG|XBOARD},\r
-\r
+ { "Persist", "check","0","0", "true" , NULL,0,NNB, PG|XBOARD},\r
{ "PersistFile", "string","0","0", "<empty>" , NULL,0,NNB, PG},\r
+ { "PersistDir", "string","0","0", "<empty>" , NULL,0,NNB, PG},\r
\r
{ "EngineName", "string","0","0", "<empty>" , NULL,0,NNB, PG}, \r
{ "EngineDir", "string","0","0", "." , NULL,0,NNB, PG}, \r
\r
int i;\r
option_t *p=DefaultOptions;\r
+ char *home_dir;\r
+ char PersistDir[StringSize];\r
\r
option_init(Option);\r
while(p){\r
for(i=0;i<Option->option_nb;i++){\r
Option->options[i].value=my_strdup(Option->options[i].default_);\r
}\r
+#ifndef _WIN32\r
+ home_dir=getenv("HOME");\r
+ if(!home_dir){\r
+ home_dir=".";\r
+ }\r
+ snprintf(PersistDir,sizeof(PersistDir),"%s/.polyglot",home_dir);\r
+ PersistDir[sizeof(PersistDir)-1]='\0';\r
+#else\r
+ sprintf(PersistDir,".\\Polyglot Settings");\r
+#endif\r
+ option_set(Option,"PersistDir",PersistDir);\r
+ option_set_default(Option,"PersistDir",PersistDir);\r
}\r
\r
// option_init()\r
// execvp() only returns when an error has occured
- my_fatal("engine_open(): execvp(): %s\n",strerror(errno));
+ my_fatal("engine_open(): execvp(): %s: %s\n",command,strerror(errno));
} else { // pid > 0
pipex->bConsole = FALSE;
pipex->bPipe=TRUE;
}else{
- my_fatal("pipex_open(): %s",win32_error());
+ my_fatal("pipex_open(): %s: %s",szProcFile,win32_error());
}
_chdir(szCurrentDir);
}
-.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
+.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
.\"
.\" Standard preamble:
.\" ========================================================================
. ds R" ''
'br\}
.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
-.if \nF \{\
+.ie \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
-.\"
-.\" For nroff, turn off justification. Always turn off hyphenation; it makes
-.\" way too many mistakes in technical documents.
-.hy 0
-.if n .na
+.el \{\
+. de IX
+..
+.\}
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
.\" ========================================================================
.\"
.IX Title "POLYGLOT 6"
-.TH POLYGLOT 6 "2009-09-01" "" ""
+.TH POLYGLOT 6 "2009-09-04" "" ""
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
.SH "NAME"
PolyGlot \- Winboard protocol to UCI protocol adapter
\- book engine for Polyglot books
.PP
polyglot dump-book [\-bin inputfile] \-color color [\-out outputfile]
.PP
-polyglot [configfile] epd-test [engineoptions] [\-epd inputfile] [\-min\-depth depth] [\-max\-depth depth] [\-max\-time time] [\-depth\-delta delta]
+polyglot [configfile] epd-test [engineoptions] [\-epd inputfile] [\-min\-depth depth] [\-max\-depth depth] [\-max\-time time] [\-depth\-delta delta]
.PP
polyglot perft [\-fen fen] [\-max\-depth depth]
.SH "DESCRIPTION"
Roughly speaking a PolyGlot opening book is a collection of triples
(position, move, weight). A \*(L"position\*(R" is represented by a 64\-bit
Zobrist hash key. The weight is proportional to the probability the move should
-be played.
+be played.
.PP
Other opening book formats such as ChessBase's .ctg format and Arena's
\&.abk format are undocumented and proprietary. They can only be used
-by their own GUIs.
+by their own GUIs.
.PP
PolyGlot can compile a pgn file into a binary PolyGlot book and furthermore
it can merge two such binary books into a third one.
.PP
PolyGlot can also extract some useful information from PolyGlot books. The utility
-\&\*(L"dump\-book\*(R" dumps the \*(L"lines\*(R" in a book for a given color. By definition
+\&\*(L"dump-book\*(R" dumps the \*(L"lines\*(R" in a book for a given color. By definition
a line is a sequence of moves (from the starting position) in which
the given color makes only book moves and the other color makes
arbitrary moves (i.e. not necessarily book moves).
Since a PolyGlot book is built up from positions and not lines there
may be (and there usually are) many positions in the book that are not
on a \*(L"line\*(R" as defined in the previous paragraph. It is convenient
-to call such positions \*(L"isolated\*(R" positions. The utility \*(L"info\-book\*(R"
+to call such positions \*(L"isolated\*(R" positions. The utility \*(L"info-book\*(R"
counts such isolated positions.
.PP
Some of the isolated positions are provably unreachable and they
.IP "\fB\-pg\fR" 4
.IX Item "-pg"
The argument is a string of the form <name>=<value>. This option will
-set the Polyglot option <name> to <value>.
+set the Polyglot option <name> to <value>.
.IP "\fB\-uci\fR" 4
.IX Item "-uci"
The argument is a string of the form <name>=<value>. This option will
-set the engine option <name> to <value>.
+set the engine option <name> to <value>.
.IP "\fB\-ec\fR" 4
.IX Item "-ec"
-This is an alias for \-pg \*(L"EngineCommand=<value>\*(R".
+This sets the EngineCommand.
.IP "\fB\-ed\fR" 4
.IX Item "-ed"
-This is an alias for \-pg \*(L"EngineDir=<value>\*(R".
+This sets the EngineDir.
.IP "\fB\-en\fR" 4
.IX Item "-en"
-This is an alias for \-pg \*(L"EngineName=<value>\*(R"
+This sets the EngineName.
.IP "\fB\-hash\fR" 4
.IX Item "-hash"
This is an alias for \-uci \*(L"Hash=<value>\*(R".
.ie n .IP "\fB\-pgn\fR (default: ""book.pgn"")" 4
.el .IP "\fB\-pgn\fR (default: ``book.pgn'')" 4
.IX Item "-pgn (default: book.pgn)"
-Input file in pgn format.
+Input file in pgn format.
.ie n .IP "\fB\-bin\fR (default: ""book.bin"")" 4
.el .IP "\fB\-bin\fR (default: ``book.bin'')" 4
.IX Item "-bin (default: book.bin)"
-Output file in PolyGlot format.
+Output file in PolyGlot format.
.IP "\fB\-max\-ply\fR (default: 1024)" 4
.IX Item "-max-ply (default: 1024)"
Specifies the maximum ply-depth of lines included in the book.
.IX Item "-min-score (default: 0.0)"
Specifies the minimum score (or weight) this move should have received for
it to be included in the book. The score is 2*(wins)+(draws), globally scaled
-to fit into 16 bits.
+to fit into 16 bits.
.IP "\fB\-only\-white\fR" 4
.IX Item "-only-white"
Include only moves for white in the book.
.IP "\fB\-uniform\fR" 4
.IX Item "-uniform"
Set all weights to 1. In other words, all moves will be selected with
-equal probability.
+equal probability.
.PP
When invoked
as
.IP "\fB\-exact\fR" 4
.IX Item "-exact"
Attempt to count the provably unreachable positions among the isolated ones.
-Note that this takes a very long time.
+Note that this takes a very long time.
.PP
When invoked as
.Sh "polyglot epd-test"
Maximum depth to search.
.SH "CONFIG FILE FORMAT"
.IX Header "CONFIG FILE FORMAT"
-There should be a different config file for each engine.
+There should be a different config file for each engine.
.PP
-The config file is in the traditional \s-1INI\s0 format.
+The config file is in the traditional \s-1INI\s0 format.
.PP
.Vb 6
\& [PolyGLot]
\& ...
.Ve
.PP
-The characters \*(L"#\*(R" and \*(L";\*(R" serve as comment characters.
+The characters \*(L"#\*(R" and \*(L";\*(R" serve as comment characters.
.PP
By default initial and final white space is stripped from option
values. If you want to avoid this, or if you want use one of
.IP "\fBKibitzInterval\fR (default: 0)" 4
.IX Item "KibitzInterval (default: 0)"
This is another form of throttling. PolyGlot will usually wait this
-many seconds before doing the next kibitz.
+many seconds before doing the next kibitz.
.IP "\fB\s-1UCI\s0\fR (default: false)" 4
.IX Item "UCI (default: false)"
-If true PolyGlot will not understand xboard commands.
+If true PolyGlot will not understand xboard commands.
.IP "\fBMateScore\fR (default: 10000)" 4
.IX Item "MateScore (default: 10000)"
Mate score reported to \s-1GUI\s0 when in xboard mode.
.IP "\fBBookRandom\fR (default: true)" 4
.IX Item "BookRandom (default: true)"
Select moves according to their weights in the book. If false the move
-with the highest weight is selected.
+with the highest weight is selected.
.IP "\fBBookRandom\fR (default: true)" 4
.IX Item "BookRandom (default: true)"
Select moves according to their weights in the book. If false the move
-with the highest weight is selected.
+with the highest weight is selected.
.IP "\fBBookDepth\fR (default: 256)" 4
.IX Item "BookDepth (default: 256)"
-Stop using the book after this number of moves.
+Stop using the book after this number of moves.
.IP "\fBBookTreshold\fR (default: 5)" 4
.IX Item "BookTreshold (default: 5)"
-Do not play moves with a weight (probability) lower than this (in per mil).
+Do not play moves with a weight (probability) lower than this (in per mil).
.IP "\fBUseNice\fR (default: false)" 4
.IX Item "UseNice (default: false)"
Run the engine at nice level 5, or \*(L"NiceValue\*(R" if it set. On some
.IP "\fBAffinity\fR (default: \-1)" 4
.IX Item "Affinity (default: -1)"
This a bit vector in which each bit represents the processors that a
-process is allowed to run on. This option works only on Windows.
+process is allowed to run on. This option works only on Windows.
.IP "\fBPersist\fR (default: true)" 4
.IX Item "Persist (default: true)"
-If true then PolyGlot will implement persistence by loading
-options from an additional \s-1INI\s0 file which is specified by the option
-\&\*(L"PersistFile\*(R". At exit PolyGlot will also save its options to this \s-1INI\s0
-file.
-.IP "\fBPersistFile\fR (default: PG_<EngineName>.ini)" 4
-.IX Item "PersistFile (default: PG_<EngineName>.ini)"
-The name of the file from which to take the additional options.
-You can safely edit this file, or delete it to restore the default
-options.
+If true then PolyGlot will implement persistence by loading options
+from an additional \s-1INI\s0 file whose name is by default derived from the
+engine name. At exit PolyGlot will also save its options to this \s-1INI\s0
+file.
+.IP "\fBPersistFile\fR (default: <EngineName>.ini)" 4
+.IX Item "PersistFile (default: <EngineName>.ini)"
+The name of the file from which to take the additional options. It is
+probably best to stick with the default. You can safely edit this
+file, or delete it to restore the default options.
+.ie n .IP "\fBPersistDir\fR (default: $HOME/.polyglot on Linux; "".\ePolyglot Settings"" on Windows)" 4
+.el .IP "\fBPersistDir\fR (default: \f(CW$HOME\fR/.polyglot on Linux; ``.\ePolyglot Settings'' on Windows)" 4
+.IX Item "PersistDir (default: $HOME/.polyglot on Linux; .Polyglot Settings on Windows)"
+The directory where the PersistFile is stored.
.Sh "Work arounds"
.IX Subsection "Work arounds"
Work arounds are identical to options except that they should be used
only when necessary. Their purpose is to try to hide problems with
-various software (not just engines).
+various software (not just engines).
.PP
\&\s-1IMPORTANT:\s0 Any of these work arounds might be removed in future
versions of PolyGlot. You are strongly recommended to contact the
however do not send a new pv string just before sending the move.
In that case the output of PolyGlot would be inconsistent.
When RepeatPV is false PolyGlot does not repeat the last pv string.
-Due to the way kibitzing is implemented, KibitzMove is disabled in that case.
+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 these options is to provide work arounds for
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.
+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.
+the display.
.Sh "[Engine] section"
.IX Subsection "[Engine] section"
This section contains engine \s-1UCI\s0 options. PolyGlot does not
correct. It will be replaced by PolyGlot with \*(L"setoption name OwnBook
value true\*(R" at engine startup.
.PP
-Standard \s-1UCI\s0 options are
+Standard \s-1UCI\s0 options are
.PP
.Vb 4
\& Hash
Hidden options like \*(L"Ponder\*(R" or \*(L"UCI_xxx\*(R" are automatic
and should not be put in an \s-1INI\s0 file.
.PP
-The other options are engine\-specific. Check their name using a \s-1UCI\s0
+The other options are engine-specific. Check their name using a \s-1UCI\s0
\&\s-1GUI\s0 or launch the engine in a console and type \*(L"uci\*(R".
.SH "EXAMPLES"
.IX Header "EXAMPLES"
+Running the \s-1UCI\s0 engine \*(L"fruit\*(R" under xboard 4.3.15 and later (this invokes PolyGlot internally).
+.PP
+.Vb 1
+\& xboard \-fcp fruit \-fUCI
+.Ve
+.PP
+An explicit command line for using the \s-1UCI\s0 engine \*(L"fruit\*(R" with 128M hash in xboard with logging enabled (this also works on xboard 4.2.7).
+.PP
+.Vb 1
+\& xboard \-fcp "polyglot \-noini \-log \-ec fruit \-hash 128"
+.Ve
+.PP
+The equivalent config file would be:
+.PP
+.Vb 5
+\& [PolyGlot]
+\& EngineCommand = fruit
+\& Log = true
+\& [Engine]
+\& Hash=128
+.Ve
+.PP
Compile \*(L"games.pgn\*(R" into a book \*(L"book.bin\*(R" retaining all lines of at
most 30 plies.
.PP
.Vb 1
\& polyglot epd\-test \-epd test.epd \-max\-time 420
.Ve
-.PP
-The command line for using the \s-1UCI\s0 engine \*(L"fruit\*(R" with 128M hash in xboard with logging enabled.
-.PP
-.Vb 1
-\& xboard \-fcp "polyglot \-noini \-log \-ec fruit \-hash 128"
-.Ve
-.PP
-The equivalent config file would be:
-.PP
-.Vb 5
-\& [PolyGlot]
-\& EngineCommand = fruit
-\& Log = true
-\& [Engine]
-\& Hash=128
-.Ve
.SH "EXIT STATUS"
.IX Header "EXIT STATUS"
-PolyGlot always returns 0 on exit.
+PolyGlot always returns 0 on exit.
.SH "AUTHORS"
.IX Header "AUTHORS"
Main author: Fabien Letouzey<fabien_letouzey(at)hotmail.com>
.PP
Various enhancements: Fonzy Bleumers<match(at)geenvis.net>
.PP
-\&\s-1UCI\s0 port: Michel Van den Bergh <michel.vandenbergh(at)uhasselt.be>
+\&\s-1UCI\s0 port, option persistence and new \s-1WB\s0 protocol: Michel Van den Bergh
+<michel.vandenbergh(at)uhasselt.be>
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fIxboard\fR\|(6)
=item B<-ec>
-This is an alias for -pg "EngineCommand=<value>".
+This sets the EngineCommand.
=item B<-ed>
-This is an alias for -pg "EngineDir=<value>".
+This sets the EngineDir.
=item B<-en>
-This is an alias for -pg "EngineName=<value>"
+This sets the EngineName.
=item B<-hash>
=item B<Persist> (default: true)
-If true then PolyGlot will implement persistence by loading
-options from an additional INI file which is specified by the option
-"PersistFile". At exit PolyGlot will also save its options to this INI
-file.
+If true then PolyGlot will implement persistence by loading options
+from an additional INI file whose name is by default derived from the
+engine name. At exit PolyGlot will also save its options to this INI
+file.
-=item B<PersistFile> (default: PG_<EngineName>.ini)
+=item B<PersistFile> (default: <EngineName>.ini)
-The name of the file from which to take the additional options.
-You can safely edit this file, or delete it to restore the default
-options.
+The name of the file from which to take the additional options. It is
+probably best to stick with the default. You can safely edit this
+file, or delete it to restore the default options.
+
+=item B<PersistDir> (default: $HOME/.polyglot on Linux; ".\Polyglot Settings" on Windows)
+
+The directory where the PersistFile is stored.
=back
=head1 EXAMPLES
+Running the UCI engine "fruit" under xboard 4.3.15 and later (this invokes PolyGlot internally).
+
+ xboard -fcp fruit -fUCI
+
+An explicit command line for using the UCI engine "fruit" with 128M hash in xboard with logging enabled (this also works on xboard 4.2.7).
+
+ xboard -fcp "polyglot -noini -log -ec fruit -hash 128"
+
+The equivalent config file would be:
+
+ [PolyGlot]
+ EngineCommand = fruit
+ Log = true
+ [Engine]
+ Hash=128
+
Compile "games.pgn" into a book "book.bin" retaining all lines of at
most 30 plies.
polyglot epd-test -epd test.epd -max-time 420
-The command line for using the UCI engine "fruit" with 128M hash in xboard with logging enabled.
-
- xboard -fcp "polyglot -noini -log -ec fruit -hash 128"
-
-The equivalent config file would be:
-
- [PolyGlot]
- EngineCommand = fruit
- Log = true
- [Engine]
- Hash=128
-
=head1 EXIT STATUS
PolyGlot always returns 0 on exit.
Various enhancements: Fonzy Bleumers<match(at)geenvis.net>
-UCI port: Michel Van den Bergh <michel.vandenbergh(at)uhasselt.be>
+UCI port, option persistence and new WB protocol: Michel Van den Bergh
+<michel.vandenbergh(at)uhasselt.be>
+
+
=head1 SEE ALSO
Summary: A Winboard protocol to UCI protocol adapter
Name: polyglot
-Version: 1.4.44b
+Version: 1.4.45b
Release: 1
License: GPL
Group: Amusement/Games
#include "main.h"\r
#include "util.h"\r
\r
+// macros\r
+\r
+#define StringSize 4096\r
+\r
// variables\r
\r
static bool Error;\r
return TRUE;\r
}\r
\r
+// my_file_join()\r
+\r
+void my_path_join(char *join_path, const char *path, const char *file){\r
+ char separator;\r
+#ifdef _WIN32\r
+ separator='\\';\r
+#else\r
+ separator='/';\r
+#endif\r
+ snprintf(join_path,StringSize,"%s%c%s",path,separator,file);\r
+ join_path[StringSize-1]='\0';\r
+}\r
+\r
+// my_mkdir()\r
+\r
+int my_mkdir(const char *path){\r
+ int ret;\r
+#ifdef _WIN32\r
+ ret=_mkdir(path);\r
+#else\r
+ ret=mkdir(path,S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);\r
+#endif\r
+ return ret;\r
+}\r
+\r
+\r
// my_string_empty()\r
\r
bool my_string_empty(const char string[]) {\r
#include <stdio.h>\r
#include <sys/types.h>\r
#include <sys/timeb.h>\r
+#include <sys/stat.h>\r
\r
// defines\r
\r
extern void my_fatal (const char format[], ...);\r
\r
extern bool my_file_read_line (FILE * file, char string[], int size);\r
+extern void my_path_join (char *join_path, const char *path, const char *file);\r
+\r
+extern int my_mkdir (const char *path);\r
\r
extern bool my_string_empty (const char string[]);\r
extern bool my_string_whitespace (const char string[]);\r