gnuchess-6.2.2/000755 000766 000024 00000000000 12610434565 014161 5ustar00antoniostaff000000 000000 gnuchess-6.2.2/ABOUT-NLS000644 000766 000024 00000267133 12205361267 015422 0ustar00antoniostaff000000 000000 1 Notes on the Free Translation Project *************************************** Free software is going international! The Free Translation Project is a way to get maintainers of free software, translators, and users all together, so that free software will gradually become able to speak many languages. A few packages already provide translations for their messages. If you found this `ABOUT-NLS' file inside a distribution, you may assume that the distributed package does use GNU `gettext' internally, itself available at your nearest GNU archive site. But you do _not_ need to install GNU `gettext' prior to configuring, installing or using this package with messages translated. Installers will find here some useful hints. These notes also explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and work on translations can contact the appropriate team. 1.1 INSTALL Matters =================== Some packages are "localizable" when properly installed; the programs they contain can be made to speak your own native language. Most such packages use GNU `gettext'. Other packages have their own ways to internationalization, predating GNU `gettext'. By default, this package will be installed to allow translation of messages. It will automatically detect whether the system already provides the GNU `gettext' functions. Installers may use special options at configuration time for changing the default behaviour. The command: ./configure --disable-nls will _totally_ disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will probably detect the previously built and installed `libintl' library and will decide to use it. If not, you may have to to use the `--with-libintl-prefix' option to tell `configure' where to look for it. Internationalized packages usually have many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless translations have been forbidden at `configure' time by using the `--disable-nls' switch, all available translations are installed together with the package. However, the environment variable `LINGUAS' may be set, prior to configuration, to limit the installed set. `LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. 1.2 Using This Package ====================== As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate `LL_CC' combination. If you happen to have the `LC_ALL' or some other `LC_xxx' environment variables set, you should unset them before setting `LANG', otherwise the setting of `LANG' will not have the desired effect. Here `LL' is an ISO 639 two-letter language code, and `CC' is an ISO 3166 two-letter country code. For example, let's suppose that you speak German and live in Germany. At the shell prompt, merely execute `setenv LANG de_DE' (in `csh'), `export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). This can be done from your `.login' or `.profile' file, once and for all. You might think that the country code specification is redundant. But in fact, some languages have dialects in different countries. For example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The country code serves to distinguish the dialects. The locale naming convention of `LL_CC', with `LL' denoting the language and `CC' denoting the country, is the one use on systems based on GNU libc. On other systems, some variations of this scheme are used, such as `LL' or `LL_CC.ENCODING'. You can get the list of locales supported by your system for your language by running the command `locale -a | grep '^LL''. Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you understand other languages, you can set up a priority list of languages. This is done through a different environment variable, called `LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' for the purpose of message handling, but you still need to have `LANG' set to the primary language; this is required by other parts of the system libraries. For example, some Swedish users who would rather read translations in German than English for when Swedish is not available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. Special advice for Norwegian users: The language code for Norwegian bokma*l changed from `no' to `nb' recently (in 2003). During the transition period, while some message catalogs for this language are installed under `nb' and some older ones under `no', it's recommended for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and older translations are used. In the `LANGUAGE' environment variable, but not in the `LANG' environment variable, `LL_CC' combinations can be abbreviated as `LL' to denote the language's main dialect. For example, `de' is equivalent to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' (Portuguese as spoken in Portugal) in this context. 1.3 Translating Teams ===================== For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. Each translation team has its own mailing list. The up-to-date list of teams can be found at the Free Translation Project's homepage, `http://translationproject.org/', in the "Teams" area. If you'd like to volunteer to _work_ at translating messages, you should become a member of the translating team for your own language. The subscribing address is _not_ the same as the list itself, it has `-request' appended. For example, speakers of Swedish can send a message to `sv-request@li.org', having this message body: subscribe Keep in mind that team members are expected to participate _actively_ in translations, or at solving translational difficulties, rather than merely lurking around. If your team does not exist yet and you want to start one, or if you are unsure about what to do or how to get started, please write to `coordinator@translationproject.org' to reach the coordinator for all translator teams. The English team is special. It works at improving and uniformizing the terminology in use. Proven linguistic skills are praised more than programming skills, here. 1.4 Available Packages ====================== Languages are not equally supported in all packages. The following matrix shows the current state of internationalization, as of June 2010. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination, with a translation percentage of at least 50%. Ready PO files af am an ar as ast az be be@latin bg bn_IN bs ca +--------------------------------------------------+ a2ps | [] [] | aegis | | ant-phone | | anubis | | aspell | [] [] | bash | | bfd | | bibshelf | [] | binutils | | bison | | bison-runtime | [] | bluez-pin | [] [] | bombono-dvd | | buzztard | | cflow | | clisp | | coreutils | [] [] | cpio | | cppi | | cpplib | [] | cryptsetup | | dfarc | | dialog | [] [] | dico | | diffutils | [] | dink | | doodle | | e2fsprogs | [] | enscript | [] | exif | | fetchmail | [] | findutils | [] | flex | [] | freedink | | gas | | gawk | [] [] | gcal | [] | gcc | | gettext-examples | [] [] [] [] | gettext-runtime | [] [] | gettext-tools | [] [] | gip | [] | gjay | | gliv | [] | glunarclock | [] [] | gnubiff | | gnucash | [] | gnuedu | | gnulib | | gnunet | | gnunet-gtk | | gnutls | | gold | | gpe-aerial | | gpe-beam | | gpe-bluetooth | | gpe-calendar | | gpe-clock | [] | gpe-conf | | gpe-contacts | | gpe-edit | | gpe-filemanager | | gpe-go | | gpe-login | | gpe-ownerinfo | [] | gpe-package | | gpe-sketchbook | | gpe-su | [] | gpe-taskmanager | [] | gpe-timesheet | [] | gpe-today | [] | gpe-todo | | gphoto2 | | gprof | [] | gpsdrive | | gramadoir | | grep | | grub | [] [] | gsasl | | gss | | gst-plugins-bad | [] | gst-plugins-base | [] | gst-plugins-good | [] | gst-plugins-ugly | [] | gstreamer | [] [] [] | gtick | | gtkam | [] | gtkorphan | [] | gtkspell | [] [] [] | gutenprint | | hello | [] | help2man | | hylafax | | idutils | | indent | [] [] | iso_15924 | | iso_3166 | [] [] [] [] [] [] [] | iso_3166_2 | | iso_4217 | | iso_639 | [] [] [] [] | iso_639_3 | | jwhois | | kbd | | keytouch | [] | keytouch-editor | | keytouch-keyboa... | [] | klavaro | [] | latrine | | ld | [] | leafpad | [] [] | libc | [] [] | libexif | () | libextractor | | libgnutls | | libgpewidget | | libgpg-error | | libgphoto2 | | libgphoto2_port | | libgsasl | | libiconv | [] | libidn | | lifelines | | liferea | [] [] | lilypond | | linkdr | [] | lordsawar | | lprng | | lynx | [] | m4 | | mailfromd | | mailutils | | make | | man-db | | man-db-manpages | | minicom | | mkisofs | | myserver | | nano | [] [] | opcodes | | parted | | pies | | popt | | psmisc | | pspp | [] | pwdutils | | radius | [] | recode | [] [] | rosegarden | | rpm | | rush | | sarg | | screem | | scrollkeeper | [] [] [] | sed | [] [] | sharutils | [] [] | shishi | | skencil | | solfege | | solfege-manual | | soundtracker | | sp | | sysstat | | tar | [] | texinfo | | tin | | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] | vice | | vmm | | vorbis-tools | | wastesedge | | wdiff | | wget | [] [] | wyslij-po | | xchat | [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] | +--------------------------------------------------+ af am an ar as ast az be be@latin bg bn_IN bs ca 6 0 1 2 3 19 1 10 3 28 3 1 38 crh cs da de el en en_GB en_ZA eo es et eu fa +-------------------------------------------------+ a2ps | [] [] [] [] [] [] [] | aegis | [] [] [] | ant-phone | [] () | anubis | [] [] | aspell | [] [] [] [] [] | bash | [] [] [] | bfd | [] | bibshelf | [] [] [] | binutils | [] | bison | [] [] | bison-runtime | [] [] [] [] | bluez-pin | [] [] [] [] [] [] | bombono-dvd | [] | buzztard | [] [] [] | cflow | [] [] | clisp | [] [] [] [] | coreutils | [] [] [] [] | cpio | | cppi | | cpplib | [] [] [] | cryptsetup | [] | dfarc | [] [] [] | dialog | [] [] [] [] [] | dico | | diffutils | [] [] [] [] [] [] | dink | [] [] [] | doodle | [] | e2fsprogs | [] [] [] | enscript | [] [] [] | exif | () [] [] | fetchmail | [] [] () [] [] [] | findutils | [] [] [] | flex | [] [] | freedink | [] [] [] | gas | [] | gawk | [] [] [] | gcal | [] | gcc | [] [] | gettext-examples | [] [] [] [] | gettext-runtime | [] [] [] [] | gettext-tools | [] [] [] | gip | [] [] [] [] | gjay | [] | gliv | [] [] [] | glunarclock | [] [] | gnubiff | () | gnucash | [] () () () () | gnuedu | [] [] | gnulib | [] [] | gnunet | | gnunet-gtk | [] | gnutls | [] [] | gold | [] | gpe-aerial | [] [] [] [] | gpe-beam | [] [] [] [] | gpe-bluetooth | [] [] | gpe-calendar | [] | gpe-clock | [] [] [] [] | gpe-conf | [] [] [] | gpe-contacts | [] [] [] | gpe-edit | [] [] | gpe-filemanager | [] [] [] | gpe-go | [] [] [] [] | gpe-login | [] [] | gpe-ownerinfo | [] [] [] [] | gpe-package | [] [] [] | gpe-sketchbook | [] [] [] [] | gpe-su | [] [] [] [] | gpe-taskmanager | [] [] [] [] | gpe-timesheet | [] [] [] [] | gpe-today | [] [] [] [] | gpe-todo | [] [] [] | gphoto2 | [] [] () [] [] [] | gprof | [] [] [] | gpsdrive | [] [] [] | gramadoir | [] [] [] | grep | [] | grub | [] [] | gsasl | [] | gss | | gst-plugins-bad | [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] () [] | gtkam | [] [] () [] [] | gtkorphan | [] [] [] [] | gtkspell | [] [] [] [] [] [] [] | gutenprint | [] [] [] | hello | [] [] [] [] | help2man | [] | hylafax | [] [] | idutils | [] [] | indent | [] [] [] [] [] [] [] | iso_15924 | [] () [] [] | iso_3166 | [] [] [] [] () [] [] [] () | iso_3166_2 | () | iso_4217 | [] [] [] () [] [] | iso_639 | [] [] [] [] () [] [] | iso_639_3 | [] | jwhois | [] | kbd | [] [] [] [] [] | keytouch | [] [] | keytouch-editor | [] [] | keytouch-keyboa... | [] | klavaro | [] [] [] [] | latrine | [] () | ld | [] [] | leafpad | [] [] [] [] [] [] | libc | [] [] [] [] | libexif | [] [] () | libextractor | | libgnutls | [] | libgpewidget | [] [] | libgpg-error | [] [] | libgphoto2 | [] () | libgphoto2_port | [] () [] | libgsasl | | libiconv | [] [] [] [] [] | libidn | [] [] [] | lifelines | [] () | liferea | [] [] [] [] [] | lilypond | [] [] [] | linkdr | [] [] [] | lordsawar | [] | lprng | | lynx | [] [] [] [] | m4 | [] [] [] [] | mailfromd | | mailutils | [] | make | [] [] [] | man-db | | man-db-manpages | | minicom | [] [] [] [] | mkisofs | | myserver | | nano | [] [] [] | opcodes | [] [] | parted | [] [] | pies | | popt | [] [] [] [] [] | psmisc | [] [] [] | pspp | [] | pwdutils | [] | radius | [] | recode | [] [] [] [] [] [] | rosegarden | () () () | rpm | [] [] [] | rush | | sarg | | screem | | scrollkeeper | [] [] [] [] [] | sed | [] [] [] [] [] [] | sharutils | [] [] [] [] | shishi | | skencil | [] () [] | solfege | [] [] [] | solfege-manual | [] [] | soundtracker | [] [] [] | sp | [] | sysstat | [] [] [] | tar | [] [] [] [] | texinfo | [] [] [] | tin | [] [] | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] [] [] [] | vice | () () | vmm | [] | vorbis-tools | [] [] | wastesedge | [] | wdiff | [] [] | wget | [] [] [] | wyslij-po | | xchat | [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] [] [] | +-------------------------------------------------+ crh cs da de el en en_GB en_ZA eo es et eu fa 5 64 105 117 18 1 8 0 28 89 18 19 0 fi fr ga gl gu he hi hr hu hy id is it ja ka kn +----------------------------------------------------+ a2ps | [] [] [] [] | aegis | [] [] | ant-phone | [] [] | anubis | [] [] [] [] | aspell | [] [] [] [] | bash | [] [] [] [] | bfd | [] [] [] | bibshelf | [] [] [] [] [] | binutils | [] [] [] | bison | [] [] [] [] | bison-runtime | [] [] [] [] [] [] | bluez-pin | [] [] [] [] [] [] [] [] | bombono-dvd | [] | buzztard | [] | cflow | [] [] [] | clisp | [] | coreutils | [] [] [] [] [] | cpio | [] [] [] [] | cppi | [] [] | cpplib | [] [] [] | cryptsetup | [] [] [] | dfarc | [] [] [] | dialog | [] [] [] [] [] [] [] | dico | | diffutils | [] [] [] [] [] [] [] [] [] | dink | [] | doodle | [] [] | e2fsprogs | [] [] | enscript | [] [] [] [] | exif | [] [] [] [] [] [] | fetchmail | [] [] [] [] | findutils | [] [] [] [] [] [] | flex | [] [] [] | freedink | [] [] [] | gas | [] [] | gawk | [] [] [] [] () [] | gcal | [] | gcc | [] | gettext-examples | [] [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] | gettext-tools | [] [] [] [] | gip | [] [] [] [] [] [] | gjay | [] | gliv | [] () | glunarclock | [] [] [] [] | gnubiff | () [] () | gnucash | () () () () () [] | gnuedu | [] [] | gnulib | [] [] [] [] [] [] | gnunet | | gnunet-gtk | [] | gnutls | [] [] | gold | [] [] | gpe-aerial | [] [] [] | gpe-beam | [] [] [] [] | gpe-bluetooth | [] [] [] [] | gpe-calendar | [] [] | gpe-clock | [] [] [] [] [] | gpe-conf | [] [] [] [] | gpe-contacts | [] [] [] [] | gpe-edit | [] [] [] | gpe-filemanager | [] [] [] [] | gpe-go | [] [] [] [] [] | gpe-login | [] [] [] | gpe-ownerinfo | [] [] [] [] [] | gpe-package | [] [] [] | gpe-sketchbook | [] [] [] [] | gpe-su | [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] | gpe-timesheet | [] [] [] [] [] | gpe-today | [] [] [] [] [] [] [] | gpe-todo | [] [] [] | gphoto2 | [] [] [] [] [] [] | gprof | [] [] [] [] | gpsdrive | [] [] [] | gramadoir | [] [] [] | grep | [] [] | grub | [] [] [] [] | gsasl | [] [] [] [] [] | gss | [] [] [] [] [] | gst-plugins-bad | [] [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] [] [] [] [] | gtkam | [] [] [] [] [] | gtkorphan | [] [] [] | gtkspell | [] [] [] [] [] [] [] [] [] | gutenprint | [] [] [] [] | hello | [] [] [] | help2man | [] [] | hylafax | [] | idutils | [] [] [] [] [] [] | indent | [] [] [] [] [] [] [] [] | iso_15924 | [] () [] [] | iso_3166 | [] () [] [] [] [] [] [] [] [] [] [] | iso_3166_2 | () [] [] [] | iso_4217 | [] () [] [] [] [] | iso_639 | [] () [] [] [] [] [] [] [] | iso_639_3 | () [] [] | jwhois | [] [] [] [] [] | kbd | [] [] | keytouch | [] [] [] [] [] [] | keytouch-editor | [] [] [] [] [] | keytouch-keyboa... | [] [] [] [] [] | klavaro | [] [] | latrine | [] [] [] | ld | [] [] [] [] | leafpad | [] [] [] [] [] [] [] () | libc | [] [] [] [] [] | libexif | [] | libextractor | | libgnutls | [] [] | libgpewidget | [] [] [] [] | libgpg-error | [] [] | libgphoto2 | [] [] [] | libgphoto2_port | [] [] [] | libgsasl | [] [] [] [] [] | libiconv | [] [] [] [] [] [] | libidn | [] [] [] [] | lifelines | () | liferea | [] [] [] [] | lilypond | [] [] | linkdr | [] [] [] [] [] | lordsawar | | lprng | [] | lynx | [] [] [] [] [] | m4 | [] [] [] [] [] [] | mailfromd | | mailutils | [] [] | make | [] [] [] [] [] [] [] [] [] | man-db | [] [] | man-db-manpages | [] | minicom | [] [] [] [] [] | mkisofs | [] [] [] [] | myserver | | nano | [] [] [] [] [] [] | opcodes | [] [] [] [] | parted | [] [] [] [] | pies | | popt | [] [] [] [] [] [] [] [] [] | psmisc | [] [] [] | pspp | | pwdutils | [] [] | radius | [] [] | recode | [] [] [] [] [] [] [] [] | rosegarden | () () () () () | rpm | [] [] | rush | | sarg | [] | screem | [] [] | scrollkeeper | [] [] [] [] | sed | [] [] [] [] [] [] [] [] | sharutils | [] [] [] [] [] [] [] | shishi | [] | skencil | [] | solfege | [] [] [] [] | solfege-manual | [] [] | soundtracker | [] [] | sp | [] () | sysstat | [] [] [] [] [] | tar | [] [] [] [] [] [] [] | texinfo | [] [] [] [] | tin | [] | unicode-han-tra... | | unicode-transla... | [] [] | util-linux-ng | [] [] [] [] [] [] | vice | () () () | vmm | [] | vorbis-tools | [] | wastesedge | () () | wdiff | [] | wget | [] [] [] [] [] [] [] [] | wyslij-po | [] [] [] | xchat | [] [] [] [] [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] [] | +----------------------------------------------------+ fi fr ga gl gu he hi hr hu hy id is it ja ka kn 105 121 53 20 4 8 3 5 53 2 120 5 84 67 0 4 ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne +-----------------------------------------------+ a2ps | [] | aegis | | ant-phone | | anubis | [] [] | aspell | [] | bash | | bfd | | bibshelf | [] [] | binutils | | bison | [] | bison-runtime | [] [] [] [] [] | bluez-pin | [] [] [] [] [] | bombono-dvd | | buzztard | | cflow | | clisp | | coreutils | [] | cpio | | cppi | | cpplib | | cryptsetup | | dfarc | [] | dialog | [] [] [] [] [] | dico | | diffutils | [] [] | dink | | doodle | | e2fsprogs | | enscript | | exif | [] | fetchmail | | findutils | | flex | | freedink | [] | gas | | gawk | | gcal | | gcc | | gettext-examples | [] [] [] [] | gettext-runtime | [] | gettext-tools | [] | gip | [] [] | gjay | | gliv | | glunarclock | [] | gnubiff | | gnucash | () () () () | gnuedu | | gnulib | | gnunet | | gnunet-gtk | | gnutls | [] | gold | | gpe-aerial | [] | gpe-beam | [] | gpe-bluetooth | [] [] | gpe-calendar | [] | gpe-clock | [] [] [] [] [] | gpe-conf | [] [] | gpe-contacts | [] [] | gpe-edit | [] | gpe-filemanager | [] [] | gpe-go | [] [] [] | gpe-login | [] | gpe-ownerinfo | [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] | gpe-su | [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] [] | gpe-timesheet | [] [] | gpe-today | [] [] [] [] | gpe-todo | [] [] | gphoto2 | | gprof | [] | gpsdrive | | gramadoir | | grep | | grub | | gsasl | | gss | | gst-plugins-bad | [] [] [] [] | gst-plugins-base | [] [] | gst-plugins-good | [] [] | gst-plugins-ugly | [] [] [] [] [] | gstreamer | | gtick | | gtkam | [] | gtkorphan | [] [] | gtkspell | [] [] [] [] [] [] [] | gutenprint | | hello | [] [] [] | help2man | | hylafax | | idutils | | indent | | iso_15924 | [] [] | iso_3166 | [] [] () [] [] [] [] [] | iso_3166_2 | | iso_4217 | [] [] | iso_639 | [] [] | iso_639_3 | [] | jwhois | [] | kbd | | keytouch | [] | keytouch-editor | [] | keytouch-keyboa... | [] | klavaro | [] | latrine | [] | ld | | leafpad | [] [] [] | libc | [] | libexif | | libextractor | | libgnutls | [] | libgpewidget | [] [] | libgpg-error | | libgphoto2 | | libgphoto2_port | | libgsasl | | libiconv | | libidn | | lifelines | | liferea | | lilypond | | linkdr | | lordsawar | | lprng | | lynx | | m4 | | mailfromd | | mailutils | | make | [] | man-db | | man-db-manpages | | minicom | [] | mkisofs | | myserver | | nano | [] [] | opcodes | | parted | | pies | | popt | [] [] [] | psmisc | | pspp | | pwdutils | | radius | | recode | | rosegarden | | rpm | | rush | | sarg | | screem | | scrollkeeper | [] [] | sed | | sharutils | | shishi | | skencil | | solfege | [] | solfege-manual | | soundtracker | | sp | | sysstat | [] | tar | [] | texinfo | [] | tin | | unicode-han-tra... | | unicode-transla... | | util-linux-ng | | vice | | vmm | | vorbis-tools | | wastesedge | | wdiff | | wget | [] | wyslij-po | | xchat | [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] | +-----------------------------------------------+ ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne 20 5 10 1 13 48 4 2 2 4 24 10 20 3 1 nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr +---------------------------------------------------+ a2ps | [] [] [] [] [] [] [] [] | aegis | [] [] [] | ant-phone | [] [] | anubis | [] [] [] | aspell | [] [] [] [] [] | bash | [] [] | bfd | [] | bibshelf | [] [] | binutils | [] [] | bison | [] [] [] | bison-runtime | [] [] [] [] [] [] [] | bluez-pin | [] [] [] [] [] [] [] [] | bombono-dvd | [] () | buzztard | [] [] | cflow | [] | clisp | [] [] | coreutils | [] [] [] [] [] [] | cpio | [] [] [] | cppi | [] | cpplib | [] | cryptsetup | [] | dfarc | [] | dialog | [] [] [] [] | dico | [] | diffutils | [] [] [] [] [] [] | dink | () | doodle | [] [] | e2fsprogs | [] [] | enscript | [] [] [] [] [] | exif | [] [] [] () [] | fetchmail | [] [] [] [] | findutils | [] [] [] [] [] | flex | [] [] [] [] [] | freedink | [] [] | gas | | gawk | [] [] [] [] | gcal | | gcc | [] | gettext-examples | [] [] [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] [] [] [] | gettext-tools | [] [] [] [] [] [] | gip | [] [] [] [] [] | gjay | | gliv | [] [] [] [] [] [] | glunarclock | [] [] [] [] [] | gnubiff | [] () | gnucash | [] () () () | gnuedu | [] | gnulib | [] [] [] [] | gnunet | | gnunet-gtk | | gnutls | [] [] | gold | | gpe-aerial | [] [] [] [] [] [] [] | gpe-beam | [] [] [] [] [] [] [] | gpe-bluetooth | [] [] | gpe-calendar | [] [] [] [] | gpe-clock | [] [] [] [] [] [] [] [] | gpe-conf | [] [] [] [] [] [] [] | gpe-contacts | [] [] [] [] [] | gpe-edit | [] [] [] | gpe-filemanager | [] [] [] | gpe-go | [] [] [] [] [] [] [] [] | gpe-login | [] [] | gpe-ownerinfo | [] [] [] [] [] [] [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] [] [] [] [] [] | gpe-su | [] [] [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] [] [] [] | gpe-timesheet | [] [] [] [] [] [] [] [] | gpe-today | [] [] [] [] [] [] [] [] | gpe-todo | [] [] [] [] [] | gphoto2 | [] [] [] [] [] [] [] [] | gprof | [] [] [] | gpsdrive | [] [] | gramadoir | [] [] | grep | [] [] [] [] | grub | [] [] [] | gsasl | [] [] [] [] | gss | [] [] [] | gst-plugins-bad | [] [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] [] [] | gtkam | [] [] [] [] [] [] | gtkorphan | [] | gtkspell | [] [] [] [] [] [] [] [] [] [] | gutenprint | [] [] | hello | [] [] [] [] | help2man | [] [] | hylafax | [] | idutils | [] [] [] [] [] | indent | [] [] [] [] [] [] [] | iso_15924 | [] [] [] [] | iso_3166 | [] [] [] [] [] () [] [] [] [] [] [] [] [] | iso_3166_2 | [] [] [] | iso_4217 | [] [] [] [] [] [] [] [] | iso_639 | [] [] [] [] [] [] [] [] [] | iso_639_3 | [] [] | jwhois | [] [] [] [] | kbd | [] [] [] | keytouch | [] [] [] | keytouch-editor | [] [] [] | keytouch-keyboa... | [] [] [] | klavaro | [] [] | latrine | [] [] | ld | | leafpad | [] [] [] [] [] [] [] [] [] | libc | [] [] [] [] | libexif | [] [] () [] | libextractor | | libgnutls | [] [] | libgpewidget | [] [] [] | libgpg-error | [] [] | libgphoto2 | [] [] | libgphoto2_port | [] [] [] [] [] | libgsasl | [] [] [] [] [] | libiconv | [] [] [] [] [] | libidn | [] [] | lifelines | [] [] | liferea | [] [] [] [] [] () () [] | lilypond | [] | linkdr | [] [] [] | lordsawar | | lprng | [] | lynx | [] [] [] | m4 | [] [] [] [] [] | mailfromd | [] | mailutils | [] | make | [] [] [] [] | man-db | [] [] [] | man-db-manpages | [] [] [] | minicom | [] [] [] [] | mkisofs | [] [] [] | myserver | | nano | [] [] [] [] | opcodes | [] [] | parted | [] [] [] [] | pies | [] | popt | [] [] [] [] | psmisc | [] [] [] | pspp | [] [] | pwdutils | [] | radius | [] [] [] | recode | [] [] [] [] [] [] [] [] | rosegarden | () () | rpm | [] [] [] | rush | [] [] | sarg | | screem | | scrollkeeper | [] [] [] [] [] [] [] [] | sed | [] [] [] [] [] [] [] [] [] | sharutils | [] [] [] [] | shishi | [] | skencil | [] [] | solfege | [] [] [] [] | solfege-manual | [] [] [] | soundtracker | [] | sp | | sysstat | [] [] [] [] | tar | [] [] [] [] | texinfo | [] [] [] [] | tin | [] | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] [] [] [] [] | vice | [] | vmm | [] | vorbis-tools | [] [] | wastesedge | [] | wdiff | [] [] | wget | [] [] [] [] [] [] [] | wyslij-po | [] [] [] | xchat | [] [] [] [] [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] | +---------------------------------------------------+ nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr 135 10 4 7 105 1 29 62 47 91 3 54 46 9 37 sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW +---------------------------------------------------+ a2ps | [] [] [] [] [] | 27 aegis | [] | 9 ant-phone | [] [] [] [] | 9 anubis | [] [] [] [] | 15 aspell | [] [] [] | 20 bash | [] [] [] | 12 bfd | [] | 6 bibshelf | [] [] [] | 16 binutils | [] [] | 8 bison | [] [] | 12 bison-runtime | [] [] [] [] [] [] | 29 bluez-pin | [] [] [] [] [] [] [] [] | 37 bombono-dvd | [] | 4 buzztard | [] | 7 cflow | [] [] [] | 9 clisp | | 10 coreutils | [] [] [] [] | 22 cpio | [] [] [] [] [] [] | 13 cppi | [] [] | 5 cpplib | [] [] [] [] [] [] | 14 cryptsetup | [] [] | 7 dfarc | [] | 9 dialog | [] [] [] [] [] [] [] | 30 dico | [] | 2 diffutils | [] [] [] [] [] [] | 30 dink | | 4 doodle | [] [] | 7 e2fsprogs | [] [] [] | 11 enscript | [] [] [] [] | 17 exif | [] [] [] | 16 fetchmail | [] [] [] | 17 findutils | [] [] [] [] [] | 20 flex | [] [] [] [] | 15 freedink | [] | 10 gas | [] | 4 gawk | [] [] [] [] | 18 gcal | [] [] | 5 gcc | [] [] [] | 7 gettext-examples | [] [] [] [] [] [] [] | 34 gettext-runtime | [] [] [] [] [] [] [] | 29 gettext-tools | [] [] [] [] [] [] | 22 gip | [] [] [] [] | 22 gjay | [] | 3 gliv | [] [] [] | 14 glunarclock | [] [] [] [] [] | 19 gnubiff | [] [] | 4 gnucash | () [] () [] () | 10 gnuedu | [] [] | 7 gnulib | [] [] [] [] | 16 gnunet | [] | 1 gnunet-gtk | [] [] [] | 5 gnutls | [] [] [] | 10 gold | [] | 4 gpe-aerial | [] [] [] | 18 gpe-beam | [] [] [] | 19 gpe-bluetooth | [] [] [] | 13 gpe-calendar | [] [] [] [] | 12 gpe-clock | [] [] [] [] [] | 28 gpe-conf | [] [] [] [] | 20 gpe-contacts | [] [] [] | 17 gpe-edit | [] [] [] | 12 gpe-filemanager | [] [] [] [] | 16 gpe-go | [] [] [] [] [] | 25 gpe-login | [] [] [] | 11 gpe-ownerinfo | [] [] [] [] [] | 25 gpe-package | [] [] [] | 13 gpe-sketchbook | [] [] [] | 20 gpe-su | [] [] [] [] [] | 30 gpe-taskmanager | [] [] [] [] [] | 29 gpe-timesheet | [] [] [] [] [] | 25 gpe-today | [] [] [] [] [] [] | 30 gpe-todo | [] [] [] [] | 17 gphoto2 | [] [] [] [] [] | 24 gprof | [] [] [] | 15 gpsdrive | [] [] [] | 11 gramadoir | [] [] [] | 11 grep | [] [] [] | 10 grub | [] [] [] | 14 gsasl | [] [] [] [] | 14 gss | [] [] [] | 11 gst-plugins-bad | [] [] [] [] | 26 gst-plugins-base | [] [] [] [] [] | 24 gst-plugins-good | [] [] [] [] | 24 gst-plugins-ugly | [] [] [] [] [] | 29 gstreamer | [] [] [] [] | 22 gtick | [] [] [] | 13 gtkam | [] [] [] | 20 gtkorphan | [] [] [] | 14 gtkspell | [] [] [] [] [] [] [] [] [] | 45 gutenprint | [] | 10 hello | [] [] [] [] [] [] | 21 help2man | [] [] | 7 hylafax | [] | 5 idutils | [] [] [] [] | 17 indent | [] [] [] [] [] [] | 30 iso_15924 | () [] () [] [] | 16 iso_3166 | [] [] () [] [] () [] [] [] () | 53 iso_3166_2 | () [] () [] | 9 iso_4217 | [] () [] [] () [] [] | 26 iso_639 | [] [] [] () [] () [] [] [] [] | 38 iso_639_3 | [] () | 8 jwhois | [] [] [] [] [] | 16 kbd | [] [] [] [] [] | 15 keytouch | [] [] [] | 16 keytouch-editor | [] [] [] | 14 keytouch-keyboa... | [] [] [] | 14 klavaro | [] | 11 latrine | [] [] [] | 10 ld | [] [] [] [] | 11 leafpad | [] [] [] [] [] [] | 33 libc | [] [] [] [] [] | 21 libexif | [] () | 7 libextractor | [] | 1 libgnutls | [] [] [] | 9 libgpewidget | [] [] [] | 14 libgpg-error | [] [] [] | 9 libgphoto2 | [] [] | 8 libgphoto2_port | [] [] [] [] | 14 libgsasl | [] [] [] | 13 libiconv | [] [] [] [] | 21 libidn | () [] [] | 11 lifelines | [] | 4 liferea | [] [] [] | 21 lilypond | [] | 7 linkdr | [] [] [] [] [] | 17 lordsawar | | 1 lprng | [] | 3 lynx | [] [] [] [] | 17 m4 | [] [] [] [] | 19 mailfromd | [] [] | 3 mailutils | [] | 5 make | [] [] [] [] | 21 man-db | [] [] [] | 8 man-db-manpages | | 4 minicom | [] [] | 16 mkisofs | [] [] | 9 myserver | | 0 nano | [] [] [] [] | 21 opcodes | [] [] [] | 11 parted | [] [] [] [] [] | 15 pies | [] [] | 3 popt | [] [] [] [] [] [] | 27 psmisc | [] [] | 11 pspp | | 4 pwdutils | [] [] | 6 radius | [] [] | 9 recode | [] [] [] [] | 28 rosegarden | () | 0 rpm | [] [] [] | 11 rush | [] [] | 4 sarg | | 1 screem | [] | 3 scrollkeeper | [] [] [] [] [] | 27 sed | [] [] [] [] [] | 30 sharutils | [] [] [] [] [] | 22 shishi | [] | 3 skencil | [] [] | 7 solfege | [] [] [] [] | 16 solfege-manual | [] | 8 soundtracker | [] [] [] | 9 sp | [] | 3 sysstat | [] [] | 15 tar | [] [] [] [] [] [] | 23 texinfo | [] [] [] [] [] | 17 tin | | 4 unicode-han-tra... | | 0 unicode-transla... | | 2 util-linux-ng | [] [] [] [] | 20 vice | () () | 1 vmm | [] | 4 vorbis-tools | [] | 6 wastesedge | | 2 wdiff | [] [] | 7 wget | [] [] [] [] [] | 26 wyslij-po | [] [] | 8 xchat | [] [] [] [] [] [] | 36 xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] | 63 xkeyboard-config | [] [] [] | 22 +---------------------------------------------------+ 85 teams sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW 178 domains 119 1 3 3 0 10 65 51 155 17 98 7 41 2618 Some counters in the preceding matrix are higher than the number of visible blocks let us expect. This is because a few extra PO files are used for implementing regional variants of languages, or language dialects. For a PO file in the matrix above to be effective, the package to which it applies should also have been internationalized and distributed as such by its maintainer. There might be an observable lag between the mere existence a PO file and its wide availability in a distribution. If June 2010 seems to be old, you may fetch a more recent copy of this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date matrix with full percentage details can be found at `http://translationproject.org/extra/matrix.html'. 1.5 Using `gettext' in new packages =================================== If you are writing a freely available program and want to internationalize it you are welcome to use GNU `gettext' in your package. Of course you have to respect the GNU Library General Public License which covers the use of the GNU `gettext' library. This means in particular that even non-free programs can use `libintl' as a shared library, whereas only free software can use `libintl' as a static library or use modified versions of `libintl'. Once the sources are changed appropriately and the setup can handle the use of `gettext' the only thing missing are the translations. The Free Translation Project is also available for packages which are not developed inside the GNU project. Therefore the information given above applies also for every other Free Software Project. Contact `coordinator@translationproject.org' to make the `.pot' files available to the translation teams. gnuchess-6.2.2/acinclude.m4000644 000766 000024 00000070303 12461115242 016345 0ustar00antoniostaff000000 000000 dnl @synopsis AX_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])] dnl dnl the "ISO C9X: 7.18 Integer types " section requires the dnl existence of an include file that defines a set of dnl typedefs, especially uint8_t,int32_t,uintptr_t. dnl Many older installations will not provide this file, but some will dnl have the very same definitions in . In other enviroments dnl we can use the inet-types in which would define the dnl typedefs int8_t and u_int8_t respectivly. dnl dnl This macros will create a local "_stdint.h" or the headerfile given as dnl an argument. In many cases that file will just "#include " dnl or "#include ", while in other environments it will provide dnl the set of basic 'stdint's definitions/typedefs: dnl int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,intptr_t,uintptr_t dnl int_least32_t.. int_fast32_t.. intmax_t dnl which may or may not rely on the definitions of other files, dnl or using the AC_COMPILE_CHECK_SIZEOF macro to determine the actual dnl sizeof each type. dnl dnl if your header files require the stdint-types you will want to create an dnl installable file mylib-int.h that all your other installable header dnl may include. So if you have a library package named "mylib", just use dnl AX_CREATE_STDINT_H(mylib-int.h) dnl in configure.ac and go to install that very header file in Makefile.am dnl along with the other headers (mylib.h) - and the mylib-specific headers dnl can simply use "#include " to obtain the stdint-types. dnl dnl Remember, if the system already had a valid , the generated dnl file will include it directly. No need for fuzzy HAVE_STDINT_H things... dnl dnl @, (status: used on new platforms) (see http://ac-archive.sf.net/gstdint/) dnl @version $Id: acinclude.m4,v 1.4 2003/06/12 21:33:06 srw Exp $ dnl @author Guido Draheim AC_DEFUN([AX_CREATE_STDINT_H], [# ------ AX CREATE STDINT H ------------------------------------- AC_MSG_CHECKING([for stdint types]) ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)` # try to shortcircuit - if the default include path of the compiler # can find a "stdint.h" header then we assume that all compilers can. AC_CACHE_VAL([ac_cv_header_stdint_t],[ old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS="" old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="" old_CFLAGS="$CFLAGS" ; CFLAGS="" AC_TRY_COMPILE([#include ],[int_least32_t v = 0;], [ac_cv_stdint_result="(assuming C99 compatible system)" ac_cv_header_stdint_t="stdint.h"; ], [ac_cv_header_stdint_t=""]) CXXFLAGS="$old_CXXFLAGS" CPPFLAGS="$old_CPPFLAGS" CFLAGS="$old_CFLAGS" ]) v="... $ac_cv_header_stdint_h" if test "$ac_stdint_h" = "stdint.h" ; then AC_MSG_RESULT([(are you sure you want them in ./stdint.h?)]) elif test "$ac_stdint_h" = "inttypes.h" ; then AC_MSG_RESULT([(are you sure you want them in ./inttypes.h?)]) elif test "_$ac_cv_header_stdint_t" = "_" ; then AC_MSG_RESULT([(putting them into $ac_stdint_h)$v]) else ac_cv_header_stdint="$ac_cv_header_stdint_t" AC_MSG_RESULT([$ac_cv_header_stdint (shortcircuit)]) fi if test "_$ac_cv_header_stdint_t" = "_" ; then # can not shortcircuit.. dnl .....intro message done, now do a few system checks..... dnl btw, all CHECK_TYPE macros do automatically "DEFINE" a type, therefore dnl we use the autoconf implementation detail _AC CHECK_TYPE_NEW instead inttype_headers=`echo $2 | sed -e 's/,/ /g'` ac_cv_stdint_result="(no helpful system typedefs seen)" AC_CACHE_CHECK([for stdint uintptr_t], [ac_cv_header_stdint_x],[ ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h) AC_MSG_RESULT([(..)]) for i in stdint.h inttypes.h sys/inttypes.h $inttype_headers ; do unset ac_cv_type_uintptr_t unset ac_cv_type_uint64_t _AC_CHECK_TYPE_NEW(uintptr_t,[ac_cv_header_stdint_x=$i],dnl continue,[#include <$i>]) AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>]) ac_cv_stdint_result="(seen uintptr_t$and64 in $i)" break; done AC_MSG_CHECKING([for stdint uintptr_t]) ]) if test "_$ac_cv_header_stdint_x" = "_" ; then AC_CACHE_CHECK([for stdint uint32_t], [ac_cv_header_stdint_o],[ ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h) AC_MSG_RESULT([(..)]) for i in inttypes.h sys/inttypes.h stdint.h $inttype_headers ; do unset ac_cv_type_uint32_t unset ac_cv_type_uint64_t AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],dnl continue,[#include <$i>]) AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>]) ac_cv_stdint_result="(seen uint32_t$and64 in $i)" break; done AC_MSG_CHECKING([for stdint uint32_t]) ]) fi if test "_$ac_cv_header_stdint_x" = "_" ; then if test "_$ac_cv_header_stdint_o" = "_" ; then AC_CACHE_CHECK([for stdint u_int32_t], [ac_cv_header_stdint_u],[ ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h) AC_MSG_RESULT([(..)]) for i in sys/types.h inttypes.h sys/inttypes.h $inttype_headers ; do unset ac_cv_type_u_int32_t unset ac_cv_type_u_int64_t AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],dnl continue,[#include <$i>]) AC_CHECK_TYPE(u_int64_t,[and64="/u_int64_t"],[and64=""],[#include<$i>]) ac_cv_stdint_result="(seen u_int32_t$and64 in $i)" break; done AC_MSG_CHECKING([for stdint u_int32_t]) ]) fi fi dnl if there was no good C99 header file, do some typedef checks... if test "_$ac_cv_header_stdint_x" = "_" ; then AC_MSG_CHECKING([for stdint datatype model]) AC_MSG_RESULT([(..)]) AC_COMPILE_CHECK_SIZEOF(char) AC_COMPILE_CHECK_SIZEOF(short) AC_COMPILE_CHECK_SIZEOF(int) AC_COMPILE_CHECK_SIZEOF(long) AC_COMPILE_CHECK_SIZEOF(void*) ac_cv_stdint_char_model="" ac_cv_stdint_char_model="$ac_cv_stdint_char_model$ac_cv_sizeof_char" ac_cv_stdint_char_model="$ac_cv_stdint_char_model$ac_cv_sizeof_short" ac_cv_stdint_char_model="$ac_cv_stdint_char_model$ac_cv_sizeof_int" ac_cv_stdint_long_model="" ac_cv_stdint_long_model="$ac_cv_stdint_long_model$ac_cv_sizeof_int" ac_cv_stdint_long_model="$ac_cv_stdint_long_model$ac_cv_sizeof_long" ac_cv_stdint_long_model="$ac_cv_stdint_long_model$ac_cv_sizeof_voidp" name="$ac_cv_stdint_long_model" case "$ac_cv_stdint_char_model/$ac_cv_stdint_long_model" in 122/242) name="$name, IP16 (standard 16bit machine)" ;; 122/244) name="$name, LP32 (standard 32bit mac/win)" ;; 122/*) name="$name (unusual int16 model)" ;; 124/444) name="$name, ILP32 (standard 32bit unixish)" ;; 124/488) name="$name, LP64 (standard 64bit unixish)" ;; 124/448) name="$name, LLP64 (unusual 64bit unixish)" ;; 124/*) name="$name (unusual int32 model)" ;; 128/888) name="$name, ILP64 (unusual 64bit numeric)" ;; 128/*) name="$name (unusual int64 model)" ;; 222/*|444/*) name="$name (unusual dsptype)" ;; *) name="$name (very unusal model)" ;; esac AC_MSG_RESULT([combined for stdint datatype model... $name]) fi if test "_$ac_cv_header_stdint_x" != "_" ; then ac_cv_header_stdint="$ac_cv_header_stdint_x" elif test "_$ac_cv_header_stdint_o" != "_" ; then ac_cv_header_stdint="$ac_cv_header_stdint_o" elif test "_$ac_cv_header_stdint_u" != "_" ; then ac_cv_header_stdint="$ac_cv_header_stdint_u" else ac_cv_header_stdint="stddef.h" fi AC_MSG_CHECKING([for extra inttypes in chosen header]) AC_MSG_RESULT([($ac_cv_header_stdint)]) dnl see if int_least and int_fast types are present in _this_ header. unset ac_cv_type_int_least32_t unset ac_cv_type_int_fast32_t AC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>]) AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>]) AC_CHECK_TYPE(intmax_t,,,[#include <$ac_cv_header_stdint>]) fi # shortcircut to system "stdint.h" # ------------------ PREPARE VARIABLES ------------------------------ if test "$GCC" = "yes" ; then ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1` else ac_cv_stdint_message="using $CC" fi AC_MSG_RESULT([make use of $ac_cv_header_stdint in $ac_stdint_h dnl $ac_cv_stdint_result]) # ----------------- DONE inttypes.h checks START header ------------- AC_CONFIG_COMMANDS([$ac_stdint_h],[ AC_MSG_NOTICE(creating $ac_stdint_h : $_ac_stdint_h) ac_stdint=$tmp/_stdint.h echo "#ifndef" $_ac_stdint_h >$ac_stdint echo "#define" $_ac_stdint_h "1" >>$ac_stdint echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint if test "_$ac_cv_header_stdint_t" != "_" ; then echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint fi cat >>$ac_stdint < #else #include /* .................... configured part ............................ */ STDINT_EOF echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint if test "_$ac_cv_header_stdint_x" != "_" ; then ac_header="$ac_cv_header_stdint_x" echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint else echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint fi echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint if test "_$ac_cv_header_stdint_o" != "_" ; then ac_header="$ac_cv_header_stdint_o" echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint else echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint fi echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint if test "_$ac_cv_header_stdint_u" != "_" ; then ac_header="$ac_cv_header_stdint_u" echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint else echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint fi echo "" >>$ac_stdint if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then echo "#include <$ac_header>" >>$ac_stdint echo "" >>$ac_stdint fi fi echo "/* which 64bit typedef has been found */" >>$ac_stdint if test "$ac_cv_type_uint64_t" = "yes" ; then echo "#define _STDINT_HAVE_UINT64_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint fi if test "$ac_cv_type_u_int64_t" = "yes" ; then echo "#define _STDINT_HAVE_U_INT64_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint fi echo "" >>$ac_stdint echo "/* which type model has been detected */" >>$ac_stdint if test "_$ac_cv_stdint_char_model" != "_" ; then echo "#define _STDINT_CHAR_MODEL" "$ac_cv_stdint_char_model" >>$ac_stdint echo "#define _STDINT_LONG_MODEL" "$ac_cv_stdint_long_model" >>$ac_stdint else echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint fi echo "" >>$ac_stdint echo "/* whether int_least types were detected */" >>$ac_stdint if test "$ac_cv_type_int_least32_t" = "yes"; then echo "#define _STDINT_HAVE_INT_LEAST32_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint fi echo "/* whether int_fast types were detected */" >>$ac_stdint if test "$ac_cv_type_int_fast32_t" = "yes"; then echo "#define _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint fi echo "/* whether intmax_t type was detected */" >>$ac_stdint if test "$ac_cv_type_intmax_t" = "yes"; then echo "#define _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint fi echo "" >>$ac_stdint cat >>$ac_stdint <= 199901L #define _HAVE_UINT64_T typedef long long int64_t; typedef unsigned long long uint64_t; #elif !defined __STRICT_ANSI__ #if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__ #define _HAVE_UINT64_T typedef __int64 int64_t; typedef unsigned __int64 uint64_t; #elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__ /* note: all ELF-systems seem to have loff-support which needs 64-bit */ #if !defined _NO_LONGLONG #define _HAVE_UINT64_T typedef long long int64_t; typedef unsigned long long uint64_t; #endif #elif defined __alpha || (defined __mips && defined _ABIN32) #if !defined _NO_LONGLONG typedef long int64_t; typedef unsigned long uint64_t; #endif /* compiler/cpu type to define int64_t */ #endif #endif #endif #if defined _STDINT_HAVE_U_INT_TYPES /* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */ typedef u_int8_t uint8_t; typedef u_int16_t uint16_t; typedef u_int32_t uint32_t; /* glibc compatibility */ #ifndef __int8_t_defined #define __int8_t_defined #endif #endif #ifdef _STDINT_NEED_INT_MODEL_T /* we must guess all the basic types. Apart from byte-adressable system, */ /* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */ /* (btw, those nibble-addressable systems are way off, or so we assume) */ dnl /* have a look at "64bit and data size neutrality" at */ dnl /* http://unix.org/version2/whatsnew/login_64bit.html */ dnl /* (the shorthand "ILP" types always have a "P" part) */ #if defined _STDINT_BYTE_MODEL #if _STDINT_LONG_MODEL+0 == 242 /* 2:4:2 = IP16 = a normal 16-bit system */ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned long uint32_t; #ifndef __int8_t_defined #define __int8_t_defined typedef char int8_t; typedef short int16_t; typedef long int32_t; #endif #elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444 /* 2:4:4 = LP32 = a 32-bit system derived from a 16-bit */ /* 4:4:4 = ILP32 = a normal 32-bit system */ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #ifndef __int8_t_defined #define __int8_t_defined typedef char int8_t; typedef short int16_t; typedef int int32_t; #endif #elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488 /* 4:8:4 = IP32 = a 32-bit system prepared for 64-bit */ /* 4:8:8 = LP64 = a normal 64-bit system */ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #ifndef __int8_t_defined #define __int8_t_defined typedef char int8_t; typedef short int16_t; typedef int int32_t; #endif /* this system has a "long" of 64bit */ #ifndef _HAVE_UINT64_T #define _HAVE_UINT64_T typedef unsigned long uint64_t; typedef long int64_t; #endif #elif _STDINT_LONG_MODEL+0 == 448 /* LLP64 a 64-bit system derived from a 32-bit system */ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #ifndef __int8_t_defined #define __int8_t_defined typedef char int8_t; typedef short int16_t; typedef int int32_t; #endif /* assuming the system has a "long long" */ #ifndef _HAVE_UINT64_T #define _HAVE_UINT64_T typedef unsigned long long uint64_t; typedef long long int64_t; #endif #else #define _STDINT_NO_INT32_T #endif #else #define _STDINT_NO_INT8_T #define _STDINT_NO_INT32_T #endif #endif /* * quote from SunOS-5.8 sys/inttypes.h: * Use at your own risk. As of February 1996, the committee is squarely * behind the fixed sized types; the "least" and "fast" types are still being * discussed. The probability that the "fast" types may be removed before * the standard is finalized is high enough that they are not currently * implemented. */ #if defined _STDINT_NEED_INT_LEAST_T typedef int8_t int_least8_t; typedef int16_t int_least16_t; typedef int32_t int_least32_t; #ifdef _HAVE_UINT64_T typedef int64_t int_least64_t; #endif typedef uint8_t uint_least8_t; typedef uint16_t uint_least16_t; typedef uint32_t uint_least32_t; #ifdef _HAVE_UINT64_T typedef uint64_t uint_least64_t; #endif /* least types */ #endif #if defined _STDINT_NEED_INT_FAST_T typedef int8_t int_fast8_t; typedef int int_fast16_t; typedef int32_t int_fast32_t; #ifdef _HAVE_UINT64_T typedef int64_t int_fast64_t; #endif typedef uint8_t uint_fast8_t; typedef unsigned uint_fast16_t; typedef uint32_t uint_fast32_t; #ifdef _HAVE_UINT64_T typedef uint64_t uint_fast64_t; #endif /* fast types */ #endif #ifdef _STDINT_NEED_INTMAX_T #ifdef _HAVE_UINT64_T typedef int64_t intmax_t; typedef uint64_t uintmax_t; #else typedef long intmax_t; typedef unsigned long uintmax_t; #endif #endif #ifdef _STDINT_NEED_INTPTR_T #ifndef __intptr_t_defined #define __intptr_t_defined /* we encourage using "long" to store pointer values, never use "int" ! */ #if _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484 typedef unsinged int uintptr_t; typedef int intptr_t; #elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444 typedef unsigned long uintptr_t; typedef long intptr_t; #elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T typedef uint64_t uintptr_t; typedef int64_t intptr_t; #else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */ typedef unsigned long uintptr_t; typedef long intptr_t; #endif #endif #endif /* shortcircuit*/ #endif /* once */ #endif #endif STDINT_EOF if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then AC_MSG_NOTICE([$ac_stdint_h is unchanged]) else ac_dir=`AS_DIRNAME(["$ac_stdint_h"])` AS_MKDIR_P(["$ac_dir"]) rm -f $ac_stdint_h mv $ac_stdint $ac_stdint_h fi ],[# variables for create stdint.h replacement PACKAGE="$PACKAGE" VERSION="$VERSION" ac_stdint_h="$ac_stdint_h" _ac_stdint_h=AS_TR_CPP(_$PACKAGE-$ac_stdint_h) ac_cv_stdint_message="$ac_cv_stdint_message" ac_cv_header_stdint_t="$ac_cv_header_stdint_t" ac_cv_header_stdint_x="$ac_cv_header_stdint_x" ac_cv_header_stdint_o="$ac_cv_header_stdint_o" ac_cv_header_stdint_u="$ac_cv_header_stdint_u" ac_cv_type_uint64_t="$ac_cv_type_uint64_t" ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t" ac_cv_stdint_char_model="$ac_cv_stdint_char_model" ac_cv_stdint_long_model="$ac_cv_stdint_long_model" ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t" ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t" ac_cv_type_intmax_t="$ac_cv_type_intmax_t" ]) ]) dnl Available from the GNU Autoconf Macro Archive at: dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_compile_check_sizeof.html dnl AC_DEFUN([AC_COMPILE_CHECK_SIZEOF], [changequote(<<, >>)dnl dnl The name to #define. define(<>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl dnl The cache variable name. define(<>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl changequote([, ])dnl AC_MSG_CHECKING(size of $1) AC_CACHE_VAL(AC_CV_NAME, [for ac_size in 4 8 1 2 16 $2 ; do # List sizes in rough order of prevalence. AC_TRY_COMPILE([#include "confdefs.h" #include $2 ], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size) if test x$AC_CV_NAME != x ; then break; fi done ]) if test x$AC_CV_NAME = x ; then AC_MSG_ERROR([cannot determine a size for $1]) fi AC_MSG_RESULT($AC_CV_NAME) AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1]) undefine([AC_TYPE_NAME])dnl undefine([AC_CV_NAME])dnl ]) dnl Available from the GNU Autoconf Macro Archive at: dnl http://www.gnu.org/software/ac-archive/htmldoc/acx_pthread.html dnl AC_DEFUN([ACX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_LANG_SAVE AC_LANG_C acx_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) AC_MSG_RESULT($acx_pthread_ok) if test x"$acx_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi if test x"$PTHREAD_LIBS$PTHREAD_CXXFLAGS" != x; then save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CXXFLAGS=$PTHREAD_CXXFLAGS]) AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) AC_MSG_RESULT($acx_pthread_ok) if test x"$acx_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CXXFLAGS="" fi LIBS="$save_LIBS" CXXFLAGS="$save_CXXFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all. acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # pthread: Linux, etcetera # --thread-safe: KAI C++ case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthread or # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags" ;; esac if test x"$acx_pthread_ok" = xno; then for flag in $acx_pthread_flags; do case $flag in none) AC_MSG_CHECKING([whether pthreads work without any flags]) ;; -*) AC_MSG_CHECKING([whether pthreads work with $flag]) PTHREAD_CFLAGS="$flag" PTHREAD_CXXFLAGS="$flag" ;; *) AC_MSG_CHECKING([for the pthreads library -l$flag]) PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. AC_TRY_LINK([#include ], [pthread_t th; pthread_join(th, 0); pthread_attr_init(0); pthread_cleanup_push(0, 0); pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], [acx_pthread_ok=yes]) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS" AC_MSG_RESULT($acx_pthread_ok) if test "x$acx_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" PTHREAD_CXXFLAGS="" done fi # Various other checks: if test "x$acx_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" # Detect AIX lossage: threads are created detached by default # and the JOINABLE attribute has a nonstandard name (UNDETACHED). AC_MSG_CHECKING([for joinable pthread attribute]) AC_TRY_LINK([#include ], [int attr=PTHREAD_CREATE_JOINABLE;], ok=PTHREAD_CREATE_JOINABLE, ok=unknown) if test x"$ok" = xunknown; then AC_TRY_LINK([#include ], [int attr=PTHREAD_CREATE_UNDETACHED;], ok=PTHREAD_CREATE_UNDETACHED, ok=unknown) fi if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok, [Define to the necessary symbol if this constant uses a non-standard name on your system.]) fi AC_MSG_RESULT(${ok}) if test x"$ok" = xunknown; then AC_MSG_WARN([we do not know how to create joinable pthreads]) fi AC_MSG_CHECKING([if more special flags are required for pthreads]) flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd*) flag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac AC_MSG_RESULT(${flag}) if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" PTHREAD_CXXFLAGS="$flag $PTHREAD_CXXFLAGS" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS" # More AIX lossage: must compile with cc_r AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC}) else PTHREAD_CC="$CC" fi AC_SUBST(PTHREAD_LIBS) AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_CXXFLAGS) AC_SUBST(PTHREAD_CC) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_pthread_ok" = xyes; then ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) : else acx_pthread_ok=no $2 fi AC_LANG_RESTORE ])dnl ACX_PTHREAD gnuchess-6.2.2/aclocal.m4000644 000766 000024 00000123414 12606706415 016027 0ustar00antoniostaff000000 000000 # generated automatically by aclocal 1.14 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.14], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.14])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Copyright (C) 1998-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_LEX # ----------- # Autoconf leaves LEX=: if lex or flex can't be found. Change that to a # "missing" invocation, for better error output. AC_DEFUN([AM_PROG_LEX], [AC_PREREQ([2.50])dnl AC_REQUIRE([AM_MISSING_HAS_RUN])dnl AC_REQUIRE([AC_PROG_LEX])dnl if test "$LEX" = :; then LEX=${am_missing_run}flex fi]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/gettext.m4]) m4_include([m4/iconv.m4]) m4_include([m4/intlmacosx.m4]) m4_include([m4/lib-ld.m4]) m4_include([m4/lib-link.m4]) m4_include([m4/lib-prefix.m4]) m4_include([m4/nls.m4]) m4_include([m4/po.m4]) m4_include([m4/progtest.m4]) m4_include([acinclude.m4]) gnuchess-6.2.2/AUTHORS000644 000766 000024 00000001406 12461115242 015222 0ustar00antoniostaff000000 000000 Authors of GNU Chess Copyright (C) 2001-2013 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. The following contributions warranted legal paper exchanges with the Free Software Foundation. See also the ChangeLog and THANKS files. Antonio Ceballos Chua Kong Sian David A. Wheeler Elvis Vasconcelos Fabien Letouzey John Stanback Lukas Geyer Simon Waters Stuart Cracraft , gnuchess-6.2.2/ChangeLog000644 000766 000024 00000037743 12610427415 015745 0ustar00antoniostaff000000 000000 2015-10-17 Antonio Ceballos * configure.ac: version 6.2.2. * NEWS: version 6.2.2. * TODO: version 6.2.2. * doc/version.texi: version 6.2.2. 2015-10-13 Antonio Ceballos * po/es.po: update. * po/fr.po: added. * po/nl.po: update. * po/uk.po: update. * po/vi.po: update. * po/LINGUAS: added fr. 2015-10-10 Antonio Ceballos * src/frontend/engine.cc: robust program exit concerning threads. * src/adapter/main.cpp: robust program exit concerning threads. * src/engine/protocol.cpp: robust program exit concerning threads. * src/main.cc: robust program exit concerning threads. * src/components.cc: robust program exit concerning threads. * src/components.h: robust program exit concerning threads. * TODO: new tasks. * configure.ac: set version 6.2.2-rc1. * doc/version.texi: version 6.2.2-rc1. 2015-04-05 Antonio Ceballos * src/adapter/fen.cpp: detailed error messages for bad FEN syntax. 2015-04-05 Antonio Ceballos * po/es.po: small corrections in Spanish translation. 2015-01-25 Antonio Ceballos * configure.ac: version 6.2.1e (evolution of 6.2.1). * doc/version.texi: version 6.2.1e. * src/main.cc: mark translatable strings. * src/frontend/engine.cc: mark translatable strings. * po/gnuchess.pot: updated for the new translatable strings. * po/POTFILES.in: include main.cc and engine.cc. * po/POTFILES: include main.cc and engine.cc. * po/es.po: translation of the new strings. 2015-01-04 Antonio Ceballos * NEWS: changes in version 6.2.1. * configure.ac: set version 6.2.1. * doc/version.texi: set version 6.2.1. * doc/Makefile.am: clean files. * man/Makefile.am: clean files. 2015-01-04 Antonio Ceballos * NEWS: changes in version 6.2.0. * configure.ac: set version 6.2.0. * doc/version.texi: set version 6.2.0. * doc/gnuchess.texi: copyright year 2015. * src/main.cc: copyright year 2015. 2015-01-03 H.G. Muller (tiny change) * misc: new directory * misc/gnuchess.eng: engine file for XBoard. * misc/gnuchess.png: logo file for XBoard. * configure.ac: path for installation of game data files. * Makefile.am: distribution of engine and logo file. 2015-01-02 Michael Vetter (tiny change) * doc/gnuchess.texi: correct punctuation and wording. * src/* (several files): remove trailing spaces. 2014-08-01 Antonio Ceballos * src/frontend/move.cc: lowercase not allowed for piece names. 2014-08-01 Antonio Ceballos * configure.ac: simple man page based on help2man. * Makefile.am: simple man page based on help2man. * man/: simple man page based on help2man. * man/Makefile.am: simple man page based on help2man. * doc/Makefile.am: small error in header description, 2014-07-29 Antonio Ceballos * src/frontend/debug.cc: compile with no warnings when DEBUG directive defined. * src/adapter/book.cpp: replace weird characters. * src/main.cc: copyright year 2014. * configure.ac: set version 6.1.2. * doc/gnuchess.texi: replace CFLAGS by CPPFLAGS. * doc/version.texi: set version 6.1.2. * TODO: added new task. * NEWS: changes in version 6.1.2. * po/LINGUAS: added gl, vi, nb. * po/gl.po: added. * po/vi.po: added. * po/nb.po: added. * po/*.po: updated. 2014-07-29 Pawel Koziol (tiny change) * src/engine/book.cpp: fix for correct handling of castling moves. 2013-11-23 Antonio Ceballos * configure.ac: set version 6.1.1. * NEWS: changes in version 6.1.1. 2013-11-23 Antonio Ceballos * po/LINGUAS: added pt_BR. * po/eo.po: added (forgot to really add it on 2013-11-16). * po/pt_BR.po: added. * po/nl.po: update. 2013-11-23 Antonio Ceballos * src/frontend/: *.l renamed as *.ll. * src/frontend/: *.c renamed as *.cc. * src/frontend/players.cc: cast required in C++. * src/frontend/Makefile.am: *.l renamed as *.ll; *.c renamed as *.cc. * src/main.cc: 'remove extern "C"'. * doc/gnuchess.texi: frontend no longer compiled in C; now in C++. 2013-11-23 Antonio Ceballos * configure.ac: require autoconf 2.69. 2013-11-16 Benno Schulenberg (tiny change) * src/frontend/cmd.c: small corrections in translatable strings. 2013-11-16 Sebastian Pipping (tiny change) * src/adapter/main.cc: remove extra '>'. 2013-11-16 Antonio Ceballos * po/gnuchess.pot: update. * po/LINGUAS: added eo. * po/es.po: update. * po/nl.po: update. * po/eo.po: added. 2013-11-08 Antonio Ceballos * src/main.cc: clean up includes. * src/frontend/cmd.c: correct help gextextization. * configure.ac: set version 6.1.0. * doc/version.texi: set version 6.1.0. * doc/gnuchess.texi: translations section. * TODO: remove gettext and Spanish translation tasks. * po/gnuchess.pot: update. * po/LINGUAS: added uk, de, sr, nl. * po/es.po: update. * po/de.po: added. * po/uk.po: added. * po/sr.po: added. * po/nl.po: added. * NEWS: changes in version 6.1.0. * test/README: record 6.1.0 ranking in FICS. 2013-10-12 Antonio Ceballos * src/main.cc: add #include . * src/frontend/cmd.c: remove blank spaces. * configure.ac: set version 6.0.93. 2013-08-27 Antonio Ceballos * po/es.po: fix some formats. * src/frontend/cmd.c: make some texts more suitable for translation. * configure.ac: set version 6.0.92. 2013-08-26 Antonio Ceballos * po/es.po: convert from ISO-8859-1 to UTF-8. * src/frontend/cmd.c: make some texts more suitable for translation. * configure.ac: set version 6.0.91. 2013-08-23 Antonio Ceballos * po/es.po: add some Spanish translations. 2013-08-23 Antonio Ceballos gettextize GNU Chess: * configure.ac: add gettext macros; set version 6.0.90. * Makefile.am: add gettext flags. * src/Makefile.am: add gettext flags. * src/main.cc: initialize locale data. * src/frontend/Makefile.am: add gettext flags. * src/frontend/cmd.c: mark translatable strings . * doc/version.texi: set version 6.0.90. * lib: create directory. * lib/gettext.h: copied from gettext 0.18.3. * po: create file as explained in gettext maintainers. 2013-08-23 gettextize * Makefile.am (EXTRA_DIST): Add config.rpath, m4/ChangeLog. * configure.ac (AC_CONFIG_FILES): Add po/Makefile.in. 2013-08-22 Antonio Ceballos * src/frontend/cmd.c: add command pgnreplay and keep former pgnload as is in version 6.0.3. * src/frontend/pgn.c: add flag in PGNReadFromFile() to optionally show a summary (used by pgnreplay). * src/frontend/common.h: add flag in PGNReadFromFile(); declare pgnreplay(). * doc/gnuchess.texi: explain commands pgnreplay, first, last, next, n, previous, p. * src/frontend/Makefile.am: CFLAGS += -std=c99, so that output.c happily compiles unicode characters. 2013-08-21 Antonio Ceballos * src/frontend/cmd.c: fix setboard so that the engine is aware of the loaded position. * src/frontend/common.h: likewise. 2013-08-20 Antonio Ceballos * src/book.bin: deleted - moved to src/smallbook.bin. * src/smallbook.bin: added. * src/gnuchess.ini: default book name changed to smallbook.bin. * Makefile.am: book.bin replaced by smallbook.bin. 2013-08-19 Antonio Ceballos * doc/gnuchess.texi: graphic mode explained. 2013-08-19 Antonio Ceballos * src/frontend/cmd.c: graphic mode usage and help improved; replace 'prior' by 'first' for pgnload. * src/frontend/common.h: replace 'prior' by 'first' for pgnload. 2013-08-19 Antonio Ceballos * src/main.cc: avoid 100% CPU usage in UCI mode. 2013-08-18 Elvis Vasconcelos * src/main.cc: graphic mode and pgnload enhancements. * src/frontend/output.c: likewise. * src/frontend/cmd.c: likewise. * src/frontend/pgn.c: likewise. * src/frontend/common.h: likewise. 2013-08-18 Antonio Ceballos * AUTHORS: graphic mode and pgnload enhancements.. 2013-03-11 Antonio Ceballos * src/main.cc: Copyright year updated to 2013. 2013-03-10 Antonio Ceballos * configure.ac: explicit package name in AC_INIT. 2013-03-10 Antonio Ceballos * configure.ac: version 6.0.3 * NEWS: changes in version 6.0.3 * doc/gnuchess.texi: date * doc/version.texi: version 2013-03-10 Antonio Ceballos * configure.ac: replace AM_CONFIG_HEADER by AC_CONFIG_HEADERS; modernize AM_INIT_AUTOMAKE. 2013-03-10 Antonio Ceballos * src/frontend/cmd.c: if in manual mode, keep it after undo. * src/main.cc: sleep 100us in main loop to avoid 100% CPU. 2012-08-29 Antonio Ceballos * src/adapter/pgn.cpp: Ignore rest of line instead of crashing when unexpected token is found in game line. This way, book_1.01.pgn can be successfully read. 2012-08-29 Antonio Ceballos * src/frontend/output.c: removed unused code. * src/frontend/genmove.c: removed unused code. * src/frontend/move.c: removed unused code. * src/frontend/atak.c: removed unused code. * src/frontend/solve.c: removed unused code. * src/frontend/common.h: removed unused code. * src/main.cc: removed unused code. * TODO: added some tasks 2012-03-05 Antonio Ceballos * INSTALL: Remove reference to inexistent doc/README. 2012-03-04 Antonio Ceballos Idea from Kamil Rytarowski * src/adapter/main.cpp: Open book file in read-only or read-write mode depending on BookLearn option false or true, respectively. * src/adapter/adapter.cpp: Open book file in read-only or read-write mode depending on BookLearn option false or true, respectively. * src/adapter/book.h: book_open() can open a book file in read-only or read-write mode. * src/adapter/book.cpp: book_open() can open a book file in read-only or read-write mode. * NEWS: Add the book open mode issue to the changes in version 6.0.2 2012-02-12 Antonio Ceballos * src/main.cc: Fix version number in file heading. Increase size of string for the --addbook option. * src/components.cc: Fix version number in file heading. * src/components.h: Fix version number in file heading. * configure.ac: help for --addbook option. * NEWS: changes in version 6.0.2 * test/README: record 6.0.1 ranking in FICS. * configure.ac: version 6.0.2 2012-02-06 Antonio Ceballos * src/main.cc: new --addbook option to compile book and quit. * src/frontend/cmd.c: help for --addbook option. * doc/gnuchess.texi: info for --addbook option. 2011-12-26 Josef Reidinger (tiny change) * src/components.cc: add missing return in functions returning non-void. 2011-09-20 Antonio Ceballos * src/frontend/epd.c: extend maximum file name length of EPD files to 127 characters for the load and loadepd commands. 2011-09-07 Antonio Ceballos * src/components.cc: fix race condition. * configure.ac: version 6.0.1 * NEWS: changes in version 6.0.1 * INSTALL: remove info not related to installation 2011-08-20 Antonio Ceballos * src/adapter/adapter.cpp: fix program crash for solveepd with st 30. * src/frontend/engine.c: allow kibitz for solve command. 2011-07-31 Antonio Ceballos * doc/gnuchess.texi: 'book.dat' replaced by 'book.bin'. 2011-07-30 Antonio Ceballos * INSTALL: 'cd src' before './gnuchess' 2011-07-30 Antonio Ceballos * src/components.cc: if gnuchess.ini is not found, report error before prompt. * src/adapter/main.cpp: if gnuchess.ini is not found, report error before prompt. * TODO: if gnuchess.ini is not found, report error before prompt. 2011-07-29 Antonio Ceballos * src/adapter/adapter.cpp: after 'book on', open the book. 2011-06-23 Antonio Ceballos * src/adapter/adapter.cpp: use strlen instead of sizeof to get length of book file name. 2011-05-02 Antonio Ceballos * src/frontend/common.h: remove declarations of unused functions and variables. * src/frontend/cmd.c: remove initialization of unused variable, * src/frontend/init.c: remove unused functions. * src/main.cc: remove unused variables. 2011-04-29 Antonio Ceballos * src/frontend/Makefile.am: remove unused code: ttable.c * src/frontend/ttable.c: remove unused file. * src/frontend/common.h: remove declarations of functions defined in ttable.c; remove declaration of unused variable: HashTab[]. * src/frontend/pgn.c: remove unused code: call to TTClear(); * src/main.cc: removed unused code: references to HashTab[]. 2011-04-27 Antonio Ceballos * INSTALL: typo in book file name. 2011-04-24 Antonio Ceballos * AUTHORS: correct e-mail address. * Makefile.am: iq6.epd removed from distribution. * test/: new directory, for test suites. * test/iq6.epd: moved from . * test/endgame.epd: new file, copied from CVS. * test/BT2630.epd: new file, copied from CVS. * test/README: new file, for the record of test executions. 2011-04-18 Antonio Ceballos * ChangeLog: changes taking v5.9.91 as first version. * NEWS: reorganized. * TODO: reorganized. * configure.ac: doc/Makefile included. * Makefile.am: doc subdir added; doc/README* removed. * doc/quotes.rb: new file, removes extra quotes in book source file. * doc/README: deleted, replaced by texinfo file. * doc/README_adapter: deleted, replaced by texinfo file. * doc/README_engine: deleted, replaced by texinfo file. * doc/README_engine_technical: deleted, replaced by texinfo file. * doc/Makefile.am: new file, builds info file. * doc/gnuchess.texi: new file, replaces all previous doc/README*. * doc/fdl.texi: new file, required to build info file: license. * doc/version.texi: new file, required to build info file: version. * src/gnuchessx: new file (was in v5), script to run in xboard mode. * src/gnuchessu: new file, script to run in UCI mode. * src/Makefile.am: gnuchessx and gnuchessu added to bin_SCRIPTS. * src/gnuchess.ini: no log file by default. * src/main.cc: add v5 options: manual, easy, post, memory N; remove v5 options: hashsize N * src/frontend/cmd.c: add v5 commands: book *, hash on/off, memory [N], null on/off; remove v5 options: hashsize [N]; update help command. * src/frontend/engine.c: support to v5 options and commands. * src/frontend/solve.c: remove ELO computation. * src/frontend/common.h: remove hashsize command. * src/adapter/option.cpp: added option BookWorst to support command 'book worst'; default values: EngineName (GNU Chess), LogFile (adapter.log), BookWorst (false). * src/adapter/book.cpp: method book_move overloaded to support command 'book worst'. * src/adapter/book.h: method book_move overloaded to support command 'book worst'. * src/adapter/adapter.cpp: ponder by default; support to commands: book *, hash on/off, memory [N], null on/off. * src/adapter/uci.cpp: support to hashsize command. * src/adapter/main.cpp: support to hashsize command; use defaults if gnuchess.ini not found. * src/engine/protocol.cpp: support to hash on/off command. * src/engine/search_full.cpp: support to hash on/off command. 2011-04-18 Antonio Ceballos * README-svn: for building gnuchess from Subversion. * src/frontend/engine.c: comment out extra output write. * src/adapter/adapter.cpp: remove debug trace. Copyright (C) 2001-2015 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. gnuchess-6.2.2/compile000755 000766 000024 00000016245 12244054564 015547 0ustar00antoniostaff000000 000000 #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: gnuchess-6.2.2/config.guess000755 000766 000024 00000130361 12244054564 016505 0ustar00antoniostaff000000 000000 #! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2013 Free Software Foundation, Inc. timestamp='2013-06-10' # 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 # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches with a ChangeLog entry to config-patches@gnu.org. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2013 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." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) 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 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) 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 exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) 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-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; or1k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: gnuchess-6.2.2/config.rpath000755 000766 000024 00000044435 12205361267 016501 0ustar00antoniostaff000000 000000 #! /bin/sh # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # # Copyright 1996-2013 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer # than 256 bytes, otherwise the compiler driver will dump core. The only # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Code taken from libtool.m4's _LT_CC_BASENAME. for cc_temp in $CC""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` # Code taken from libtool.m4's _LT_COMPILER_PIC. wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix*) wl='-Wl,' ;; mingw* | cygwin* | pw32* | os2* | cegcc*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in ecc*) wl='-Wl,' ;; icc* | ifort*) wl='-Wl,' ;; lf95*) wl='-Wl,' ;; nagfor*) wl='-Wl,-Wl,,' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; xl* | bgxl* | bgf* | mpixl*) wl='-Wl,' ;; como) wl='-lopt=' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ F* | *Sun*Fortran*) wl= ;; *Sun\ C*) wl='-Wl,' ;; esac ;; esac ;; newsos6) ;; *nto* | *qnx*) ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; rdos*) ;; solaris*) case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) wl='-Qoption ld ' ;; *) wl='-Wl,' ;; esac ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3*) wl='-Wl,' ;; sysv4*MP*) ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) wl='-Wl,' ;; unicos*) wl='-Wl,' ;; uts4*) ;; esac fi # Code taken from libtool.m4's _LT_LINKER_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. # Unlike libtool, we use -rpath here, not --rpath, since the documented # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' case "$host_os" in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no fi ;; amigaos*) case "$host_cpu" in powerpc) ;; m68k) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then : else ld_shlibs=no fi ;; haiku*) ;; interix[3-9]*) hardcode_direct=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; netbsd*) ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' else ld_shlibs=no fi ;; esac ;; sunos4*) hardcode_direct=yes ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then hardcode_libdir_flag_spec= fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac fi # Begin _LT_AC_SYS_LIBPATH_AIX. echo 'int main () { return 0; }' > conftest.c ${CC} ${LDFLAGS} conftest.c -o conftest aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` fi if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib" fi rm -f conftest.c conftest # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" fi fi ;; amigaos*) case "$host_cpu" in powerpc) ;; m68k) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) hardcode_direct=no if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then : else ld_shlibs=no fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; freebsd2.2*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; freebsd2*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd* | dragonfly*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; hpux10*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no ;; *) hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) case $host_vendor in sni) hardcode_direct=yes # is this really true??? ;; siemens) hardcode_direct=no ;; motorola) hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac ;; sysv4.3*) ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) ;; sysv5* | sco3.2v5* | sco5v6*) hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. # Unlike libtool.m4, here we don't care about _all_ names of the library, but # only about the one the linker finds when passed -lNAME. This is the last # element of library_names_spec in libtool.m4, or possibly two of them if the # linker has special search rules. library_names_spec= # the last element of library_names_spec in libtool.m4 libname_spec='lib$name' case "$host_os" in aix3*) library_names_spec='$libname.a' ;; aix[4-9]*) library_names_spec='$libname$shrext' ;; amigaos*) case "$host_cpu" in powerpc*) library_names_spec='$libname$shrext' ;; m68k) library_names_spec='$libname.a' ;; esac ;; beos*) library_names_spec='$libname$shrext' ;; bsdi[45]*) library_names_spec='$libname$shrext' ;; cygwin* | mingw* | pw32* | cegcc*) shrext=.dll library_names_spec='$libname.dll.a $libname.lib' ;; darwin* | rhapsody*) shrext=.dylib library_names_spec='$libname$shrext' ;; dgux*) library_names_spec='$libname$shrext' ;; freebsd* | dragonfly*) case "$host_os" in freebsd[123]*) library_names_spec='$libname$shrext$versuffix' ;; *) library_names_spec='$libname$shrext' ;; esac ;; gnu*) library_names_spec='$libname$shrext' ;; haiku*) library_names_spec='$libname$shrext' ;; hpux9* | hpux10* | hpux11*) case $host_cpu in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac library_names_spec='$libname$shrext' ;; interix[3-9]*) library_names_spec='$libname$shrext' ;; irix5* | irix6* | nonstopux*) library_names_spec='$libname$shrext' case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac ;; linux*oldld* | linux*aout* | linux*coff*) ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) library_names_spec='$libname$shrext' ;; knetbsd*-gnu) library_names_spec='$libname$shrext' ;; netbsd*) library_names_spec='$libname$shrext' ;; newsos6) library_names_spec='$libname$shrext' ;; *nto* | *qnx*) library_names_spec='$libname$shrext' ;; openbsd*) library_names_spec='$libname$shrext$versuffix' ;; os2*) libname_spec='$name' shrext=.dll library_names_spec='$libname.a' ;; osf3* | osf4* | osf5*) library_names_spec='$libname$shrext' ;; rdos*) ;; solaris*) library_names_spec='$libname$shrext' ;; sunos4*) library_names_spec='$libname$shrext$versuffix' ;; sysv4 | sysv4.3*) library_names_spec='$libname$shrext' ;; sysv4*MP*) library_names_spec='$libname$shrext' ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) library_names_spec='$libname$shrext' ;; tpf*) library_names_spec='$libname$shrext' ;; uts4*) library_names_spec='$libname$shrext' ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2013 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." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 \ | or1k | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # 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=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) 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 ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) 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 ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or1k-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: gnuchess-6.2.2/configure000755 000766 000024 00001203322 12606706420 016070 0ustar00antoniostaff000000 000000 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for GNU Chess 6.2.2. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: bug-gnu-chess@gnu.org about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a $0: shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='GNU Chess' PACKAGE_TARNAME='gnuchess' PACKAGE_VERSION='6.2.2' PACKAGE_STRING='GNU Chess 6.2.2' PACKAGE_BUGREPORT='bug-gnu-chess@gnu.org' PACKAGE_URL='http://www.gnu.org/software/gnuchess/' ac_unique_file="src/main.cc" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" gt_needs= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS PLUGINSDIR POSUB LTLIBINTL LIBINTL INTLLIBS LTLIBICONV LIBICONV INTL_MACOSX_LIBS XGETTEXT_EXTRA_OPTIONS MSGMERGE XGETTEXT_015 XGETTEXT GMSGFMT_015 MSGFMT_015 GMSGFMT MSGFMT GETTEXT_MACRO_VERSION USE_NLS SED HELP2MAN PTHREAD_CXXFLAGS PTHREAD_CFLAGS PTHREAD_LIBS PTHREAD_CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBOBJS EGREP GREP CPP LEXLIB LEX_OUTPUT_ROOT LEX LN_S RANLIB am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking with_readline enable_nls with_gnu_ld enable_rpath with_libiconv_prefix with_libintl_prefix with_pluginsdir ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # 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 GNU Chess 6.2.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/gnuchess] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of GNU Chess 6.2.2:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-nls do not use Native Language Support --disable-rpath do not hardcode runtime library paths Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-readline use readline library if available (default is YES) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib --without-libintl-prefix don't search for libintl in includedir and libdir --with-pluginsdir=DIR path where game data files get installed (default: $datadir/games/plugins) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . GNU Chess home page: . General help using GNU software: . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF GNU Chess configure 6.2.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ------------------------------------ ## ## Report this to bug-gnu-chess@gnu.org ## ## ------------------------------------ ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by GNU Chess $as_me 6.2.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi gt_needs="$gt_needs " # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers src/config.h" am__api_version='1.14' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='gnuchess' VERSION='6.2.2' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 $as_echo "$LEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ yyless ((input () != 0)); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int main (void) { return ! yylex () + ! yywrap (); } _ACEOF { { ac_try="$LEX conftest.l" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$LEX conftest.l") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 $as_echo_n "checking lex output file root... " >&6; } if ${ac_cv_prog_lex_root+:} false; then : $as_echo_n "(cached) " >&6 else if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 $as_echo "$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 $as_echo_n "checking lex library... " >&6; } if ${ac_cv_lib_lex+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_LIBS=$LIBS ac_cv_lib_lex='none needed' for ac_lib in '' -lfl -ll; do LIBS="$ac_lib $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lex=$ac_lib fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext test "$ac_cv_lib_lex" != 'none needed' && break done LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 $as_echo "$ac_cv_lib_lex" >&6; } test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 $as_echo_n "checking whether yytext is a pointer... " >&6; } if ${ac_cv_prog_lex_yytext_pointer+:} false; then : $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no ac_save_LIBS=$LIBS LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_prog_lex_yytext_pointer=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 $as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then $as_echo "#define YYTEXT_POINTER 1" >>confdefs.h fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi if test "$LEX" = :; then LEX=${am_missing_run}flex fi # Check whether --with-readline was given. if test "${with_readline+set}" = set; then : withval=$with_readline; ac_cv_use_readline=$withval else ac_cv_use_readline=yes fi if test x"$ac_cv_use_readline" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tputs in -lncurses" >&5 $as_echo_n "checking for tputs in -lncurses... " >&6; } if ${ac_cv_lib_ncurses_tputs+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char tputs (); int main () { return tputs (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ncurses_tputs=yes else ac_cv_lib_ncurses_tputs=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_tputs" >&5 $as_echo "$ac_cv_lib_ncurses_tputs" >&6; } if test "x$ac_cv_lib_ncurses_tputs" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNCURSES 1 _ACEOF LIBS="-lncurses $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5 $as_echo_n "checking for readline in -lreadline... " >&6; } if ${ac_cv_lib_readline_readline+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char readline (); int main () { return readline (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_readline_readline=yes else ac_cv_lib_readline_readline=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_readline" >&5 $as_echo "$ac_cv_lib_readline_readline" >&6; } if test "x$ac_cv_lib_readline_readline" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBREADLINE 1 _ACEOF LIBS="-lreadline $LIBS" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in readline/readline.h readline/history.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi for ac_header in time.h sys/time.h unistd.h errno.h fcntl.h libintl.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 $as_echo_n "checking for working volatile... " >&6; } if ${ac_cv_c_volatile+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { volatile int x; int * volatile y = (int *) 0; return !x && !y; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_volatile=yes else ac_cv_c_volatile=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 $as_echo "$ac_cv_c_volatile" >&6; } if test $ac_cv_c_volatile = no; then $as_echo "#define volatile /**/" >>confdefs.h fi for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 $as_echo_n "checking for GNU libc compatible realloc... " >&6; } if ${ac_cv_func_realloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_realloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *realloc (); #endif int main () { return ! realloc (0, 0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_realloc_0_nonnull=yes else ac_cv_func_realloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 $as_echo "$ac_cv_func_realloc_0_nonnull" >&6; } if test $ac_cv_func_realloc_0_nonnull = yes; then : $as_echo "#define HAVE_REALLOC 1" >>confdefs.h else $as_echo "#define HAVE_REALLOC 0" >>confdefs.h case " $LIBOBJS " in *" realloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS realloc.$ac_objext" ;; esac $as_echo "#define realloc rpl_realloc" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if ${ac_cv_header_stdbool_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; /* See body of main program for 'e'. */ char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { bool e = &s; *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdbool_h=yes else ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" if test "x$ac_cv_type__Bool" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi # ------ AX CREATE STDINT H ------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint types" >&5 $as_echo_n "checking for stdint types... " >&6; } ac_stdint_h=`echo src/GCint.h` # try to shortcircuit - if the default include path of the compiler # can find a "stdint.h" header then we assume that all compilers can. if ${ac_cv_header_stdint_t+:} false; then : $as_echo_n "(cached) " >&6 else old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS="" old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="" old_CFLAGS="$CFLAGS" ; CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int_least32_t v = 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_stdint_result="(assuming C99 compatible system)" ac_cv_header_stdint_t="stdint.h"; else ac_cv_header_stdint_t="" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CXXFLAGS="$old_CXXFLAGS" CPPFLAGS="$old_CPPFLAGS" CFLAGS="$old_CFLAGS" fi v="... $ac_cv_header_stdint_h" if test "$ac_stdint_h" = "stdint.h" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: (are you sure you want them in ./stdint.h?)" >&5 $as_echo "(are you sure you want them in ./stdint.h?)" >&6; } elif test "$ac_stdint_h" = "inttypes.h" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: (are you sure you want them in ./inttypes.h?)" >&5 $as_echo "(are you sure you want them in ./inttypes.h?)" >&6; } elif test "_$ac_cv_header_stdint_t" = "_" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: (putting them into $ac_stdint_h)$v" >&5 $as_echo "(putting them into $ac_stdint_h)$v" >&6; } else ac_cv_header_stdint="$ac_cv_header_stdint_t" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdint (shortcircuit)" >&5 $as_echo "$ac_cv_header_stdint (shortcircuit)" >&6; } fi if test "_$ac_cv_header_stdint_t" = "_" ; then # can not shortcircuit.. inttype_headers=`echo | sed -e 's/,/ /g'` ac_cv_stdint_result="(no helpful system typedefs seen)" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint uintptr_t" >&5 $as_echo_n "checking for stdint uintptr_t... " >&6; } if ${ac_cv_header_stdint_x+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h) { $as_echo "$as_me:${as_lineno-$LINENO}: result: (..)" >&5 $as_echo "(..)" >&6; } for i in stdint.h inttypes.h sys/inttypes.h $inttype_headers ; do unset ac_cv_type_uintptr_t unset ac_cv_type_uint64_t ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "#include <$i> " if test "x$ac_cv_type_uintptr_t" = xyes; then : ac_cv_header_stdint_x=$i else continue fi ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "#include<$i> " if test "x$ac_cv_type_uint64_t" = xyes; then : and64="/uint64_t" else and64="" fi ac_cv_stdint_result="(seen uintptr_t$and64 in $i)" break; done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint uintptr_t" >&5 $as_echo_n "checking for stdint uintptr_t... " >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdint_x" >&5 $as_echo "$ac_cv_header_stdint_x" >&6; } if test "_$ac_cv_header_stdint_x" = "_" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint uint32_t" >&5 $as_echo_n "checking for stdint uint32_t... " >&6; } if ${ac_cv_header_stdint_o+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h) { $as_echo "$as_me:${as_lineno-$LINENO}: result: (..)" >&5 $as_echo "(..)" >&6; } for i in inttypes.h sys/inttypes.h stdint.h $inttype_headers ; do unset ac_cv_type_uint32_t unset ac_cv_type_uint64_t ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "#include <$i> " if test "x$ac_cv_type_uint32_t" = xyes; then : ac_cv_header_stdint_o=$i else continue fi ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "#include<$i> " if test "x$ac_cv_type_uint64_t" = xyes; then : and64="/uint64_t" else and64="" fi ac_cv_stdint_result="(seen uint32_t$and64 in $i)" break; done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint uint32_t" >&5 $as_echo_n "checking for stdint uint32_t... " >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdint_o" >&5 $as_echo "$ac_cv_header_stdint_o" >&6; } fi if test "_$ac_cv_header_stdint_x" = "_" ; then if test "_$ac_cv_header_stdint_o" = "_" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint u_int32_t" >&5 $as_echo_n "checking for stdint u_int32_t... " >&6; } if ${ac_cv_header_stdint_u+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h) { $as_echo "$as_me:${as_lineno-$LINENO}: result: (..)" >&5 $as_echo "(..)" >&6; } for i in sys/types.h inttypes.h sys/inttypes.h $inttype_headers ; do unset ac_cv_type_u_int32_t unset ac_cv_type_u_int64_t ac_fn_c_check_type "$LINENO" "u_int32_t" "ac_cv_type_u_int32_t" "#include <$i> " if test "x$ac_cv_type_u_int32_t" = xyes; then : ac_cv_header_stdint_u=$i else continue fi ac_fn_c_check_type "$LINENO" "u_int64_t" "ac_cv_type_u_int64_t" "#include<$i> " if test "x$ac_cv_type_u_int64_t" = xyes; then : and64="/u_int64_t" else and64="" fi ac_cv_stdint_result="(seen u_int32_t$and64 in $i)" break; done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint u_int32_t" >&5 $as_echo_n "checking for stdint u_int32_t... " >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdint_u" >&5 $as_echo "$ac_cv_header_stdint_u" >&6; } fi fi if test "_$ac_cv_header_stdint_x" = "_" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint datatype model" >&5 $as_echo_n "checking for stdint datatype model... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: (..)" >&5 $as_echo "(..)" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char" >&5 $as_echo_n "checking size of char... " >&6; } if ${ac_cv_sizeof_char+:} false; then : $as_echo_n "(cached) " >&6 else for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" #include int main () { switch (0) case 0: case (sizeof (char) == $ac_size):; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sizeof_char=$ac_size fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test x$ac_cv_sizeof_char != x ; then break; fi done fi if test x$ac_cv_sizeof_char = x ; then as_fn_error $? "cannot determine a size for char" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char" >&5 $as_echo "$ac_cv_sizeof_char" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_CHAR $ac_cv_sizeof_char _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 $as_echo_n "checking size of short... " >&6; } if ${ac_cv_sizeof_short+:} false; then : $as_echo_n "(cached) " >&6 else for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" #include int main () { switch (0) case 0: case (sizeof (short) == $ac_size):; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sizeof_short=$ac_size fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test x$ac_cv_sizeof_short != x ; then break; fi done fi if test x$ac_cv_sizeof_short = x ; then as_fn_error $? "cannot determine a size for short" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 $as_echo "$ac_cv_sizeof_short" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 $as_echo_n "checking size of int... " >&6; } if ${ac_cv_sizeof_int+:} false; then : $as_echo_n "(cached) " >&6 else for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" #include int main () { switch (0) case 0: case (sizeof (int) == $ac_size):; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sizeof_int=$ac_size fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test x$ac_cv_sizeof_int != x ; then break; fi done fi if test x$ac_cv_sizeof_int = x ; then as_fn_error $? "cannot determine a size for int" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 $as_echo "$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } if ${ac_cv_sizeof_long+:} false; then : $as_echo_n "(cached) " >&6 else for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" #include int main () { switch (0) case 0: case (sizeof (long) == $ac_size):; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sizeof_long=$ac_size fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test x$ac_cv_sizeof_long != x ; then break; fi done fi if test x$ac_cv_sizeof_long = x ; then as_fn_error $? "cannot determine a size for long" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 $as_echo "$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void*" >&5 $as_echo_n "checking size of void*... " >&6; } if ${ac_cv_sizeof_voidp+:} false; then : $as_echo_n "(cached) " >&6 else for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" #include int main () { switch (0) case 0: case (sizeof (void*) == $ac_size):; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sizeof_voidp=$ac_size fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test x$ac_cv_sizeof_voidp != x ; then break; fi done fi if test x$ac_cv_sizeof_voidp = x ; then as_fn_error $? "cannot determine a size for void*" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_voidp" >&5 $as_echo "$ac_cv_sizeof_voidp" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_VOIDP $ac_cv_sizeof_voidp _ACEOF ac_cv_stdint_char_model="" ac_cv_stdint_char_model="$ac_cv_stdint_char_model$ac_cv_sizeof_char" ac_cv_stdint_char_model="$ac_cv_stdint_char_model$ac_cv_sizeof_short" ac_cv_stdint_char_model="$ac_cv_stdint_char_model$ac_cv_sizeof_int" ac_cv_stdint_long_model="" ac_cv_stdint_long_model="$ac_cv_stdint_long_model$ac_cv_sizeof_int" ac_cv_stdint_long_model="$ac_cv_stdint_long_model$ac_cv_sizeof_long" ac_cv_stdint_long_model="$ac_cv_stdint_long_model$ac_cv_sizeof_voidp" name="$ac_cv_stdint_long_model" case "$ac_cv_stdint_char_model/$ac_cv_stdint_long_model" in 122/242) name="$name, IP16 (standard 16bit machine)" ;; 122/244) name="$name, LP32 (standard 32bit mac/win)" ;; 122/*) name="$name (unusual int16 model)" ;; 124/444) name="$name, ILP32 (standard 32bit unixish)" ;; 124/488) name="$name, LP64 (standard 64bit unixish)" ;; 124/448) name="$name, LLP64 (unusual 64bit unixish)" ;; 124/*) name="$name (unusual int32 model)" ;; 128/888) name="$name, ILP64 (unusual 64bit numeric)" ;; 128/*) name="$name (unusual int64 model)" ;; 222/*|444/*) name="$name (unusual dsptype)" ;; *) name="$name (very unusal model)" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: combined for stdint datatype model... $name" >&5 $as_echo "combined for stdint datatype model... $name" >&6; } fi if test "_$ac_cv_header_stdint_x" != "_" ; then ac_cv_header_stdint="$ac_cv_header_stdint_x" elif test "_$ac_cv_header_stdint_o" != "_" ; then ac_cv_header_stdint="$ac_cv_header_stdint_o" elif test "_$ac_cv_header_stdint_u" != "_" ; then ac_cv_header_stdint="$ac_cv_header_stdint_u" else ac_cv_header_stdint="stddef.h" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for extra inttypes in chosen header" >&5 $as_echo_n "checking for extra inttypes in chosen header... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: ($ac_cv_header_stdint)" >&5 $as_echo "($ac_cv_header_stdint)" >&6; } unset ac_cv_type_int_least32_t unset ac_cv_type_int_fast32_t ac_fn_c_check_type "$LINENO" "int_least32_t" "ac_cv_type_int_least32_t" "#include <$ac_cv_header_stdint> " if test "x$ac_cv_type_int_least32_t" = xyes; then : fi ac_fn_c_check_type "$LINENO" "int_fast32_t" "ac_cv_type_int_fast32_t" "#include<$ac_cv_header_stdint> " if test "x$ac_cv_type_int_fast32_t" = xyes; then : fi ac_fn_c_check_type "$LINENO" "intmax_t" "ac_cv_type_intmax_t" "#include <$ac_cv_header_stdint> " if test "x$ac_cv_type_intmax_t" = xyes; then : fi fi # shortcircut to system "stdint.h" # ------------------ PREPARE VARIABLES ------------------------------ if test "$GCC" = "yes" ; then ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1` else ac_cv_stdint_message="using $CC" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: make use of $ac_cv_header_stdint in $ac_stdint_h $ac_cv_stdint_result" >&5 $as_echo "make use of $ac_cv_header_stdint in $ac_stdint_h $ac_cv_stdint_result" >&6; } # ----------------- DONE inttypes.h checks START header ------------- ac_config_commands="$ac_config_commands $ac_stdint_h" { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if ${ac_cv_type_signal+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_signal=int else ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 $as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 $as_echo_n "checking for GNU libc compatible malloc... " >&6; } if ${ac_cv_func_malloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_malloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { return ! malloc (0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_malloc_0_nonnull=yes else ac_cv_func_malloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes; then : $as_echo "#define HAVE_MALLOC 1" >>confdefs.h else $as_echo "#define HAVE_MALLOC 0" >>confdefs.h case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac $as_echo "#define malloc rpl_malloc" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 $as_echo_n "checking for working memcmp... " >&6; } if ${ac_cv_func_memcmp_working+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_memcmp_working=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Some versions of memcmp are not 8-bit clean. */ char c0 = '\100', c1 = '\200', c2 = '\201'; if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) return 1; /* The Next x86 OpenStep bug shows up only when comparing 16 bytes or more and with at least one buffer not starting on a 4-byte boundary. William Lewis provided this test program. */ { char foo[21]; char bar[21]; int i; for (i = 0; i < 4; i++) { char *a = foo + i; char *b = bar + i; strcpy (a, "--------01111111"); strcpy (b, "--------10000000"); if (memcmp (a, b, 16) >= 0) return 1; } return 0; } ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_memcmp_working=yes else ac_cv_func_memcmp_working=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 $as_echo "$ac_cv_func_memcmp_working" >&6; } test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in *" memcmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;; esac for ac_func in gettimeofday strchr strcspn strstr strerror memset strdup strtol do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu acx_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 $as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_join (); int main () { return pthread_join (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : acx_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5 $as_echo "$acx_pthread_ok" >&6; } if test x"$acx_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi if test x"$PTHREAD_LIBS$PTHREAD_CXXFLAGS" != x; then save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CXXFLAGS=$PTHREAD_CXXFLAGS" >&5 $as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CXXFLAGS=$PTHREAD_CXXFLAGS... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_join (); int main () { return pthread_join (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : acx_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5 $as_echo "$acx_pthread_ok" >&6; } if test x"$acx_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CXXFLAGS="" fi LIBS="$save_LIBS" CXXFLAGS="$save_CXXFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all. acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # pthread: Linux, etcetera # --thread-safe: KAI C++ case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthread or # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags" ;; esac if test x"$acx_pthread_ok" = xno; then for flag in $acx_pthread_flags; do case $flag in none) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 $as_echo_n "checking whether pthreads work without any flags... " >&6; } ;; -*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5 $as_echo_n "checking whether pthreads work with $flag... " >&6; } PTHREAD_CFLAGS="$flag" PTHREAD_CXXFLAGS="$flag" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5 $as_echo_n "checking for the pthreads library -l$flag... " >&6; } PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { pthread_t th; pthread_join(th, 0); pthread_attr_init(0); pthread_cleanup_push(0, 0); pthread_create(0,0,0,0); pthread_cleanup_pop(0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : acx_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_pthread_ok" >&5 $as_echo "$acx_pthread_ok" >&6; } if test "x$acx_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" PTHREAD_CXXFLAGS="" done fi # Various other checks: if test "x$acx_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" # Detect AIX lossage: threads are created detached by default # and the JOINABLE attribute has a nonstandard name (UNDETACHED). { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 $as_echo_n "checking for joinable pthread attribute... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int attr=PTHREAD_CREATE_JOINABLE; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ok=PTHREAD_CREATE_JOINABLE else ok=unknown fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test x"$ok" = xunknown; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int attr=PTHREAD_CREATE_UNDETACHED; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ok=PTHREAD_CREATE_UNDETACHED else ok=unknown fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then $as_echo "#define PTHREAD_CREATE_JOINABLE \$ok" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ok}" >&5 $as_echo "${ok}" >&6; } if test x"$ok" = xunknown; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: we do not know how to create joinable pthreads" >&5 $as_echo "$as_me: WARNING: we do not know how to create joinable pthreads" >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5 $as_echo_n "checking if more special flags are required for pthreads... " >&6; } flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd*) flag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5 $as_echo "${flag}" >&6; } if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" PTHREAD_CXXFLAGS="$flag $PTHREAD_CXXFLAGS" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS" # More AIX lossage: must compile with cc_r # Extract the first word of "cc_r", so it can be a program name with args. set dummy cc_r; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PTHREAD_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PTHREAD_CC"; then ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PTHREAD_CC="cc_r" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_PTHREAD_CC" && ac_cv_prog_PTHREAD_CC="${CC}" fi fi PTHREAD_CC=$ac_cv_prog_PTHREAD_CC if test -n "$PTHREAD_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 $as_echo "$PTHREAD_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else PTHREAD_CC="$CC" fi # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_pthread_ok" = xyes; then $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h : else acx_pthread_ok=no fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # GNU help2man creates man pages from --help output; in many cases, this # is sufficient, and obviates the need to maintain man pages separately. # However, this means invoking executables, which we generally cannot do # when cross-compiling, so we test to avoid that (the variable # "cross_compiling" is set by AC_PROG_CC). if test $cross_compiling = no; then HELP2MAN=${HELP2MAN-"${am_missing_run}help2man"} else HELP2MAN=: fi # Support from GNU gettext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 $as_echo_n "checking whether NLS is requested... " >&6; } # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then : enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } GETTEXT_MACRO_VERSION=0.18 # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case "$MSGFMT" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GMSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 $as_echo "$GMSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XGETTEXT+:} false; then : $as_echo_n "(cached) " >&6 else case "$XGETTEXT" in [\\/]* | ?:[\\/]*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f messages.po case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGMERGE+:} false; then : $as_echo_n "(cached) " >&6 else case "$MSGMERGE" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" ;; esac fi MSGMERGE="$ac_cv_path_MSGMERGE" if test "$MSGMERGE" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 $as_echo "$MSGMERGE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$localedir" || localedir='${datadir}/locale' test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= ac_config_commands="$ac_config_commands po-directories" if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${acl_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${acl_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 $as_echo_n "checking for shared library run path origin... " >&6; } if ${acl_cv_rpath+:} false; then : $as_echo_n "(cached) " >&6 else CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 $as_echo "$acl_cv_rpath" >&6; } wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then : enableval=$enable_rpath; : else enable_rpath=yes fi acl_libdirstem=lib acl_libdirstem2= case "$host_os" in solaris*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 $as_echo_n "checking for 64-bit host... " >&6; } if ${gl_cv_solaris_64bit+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _LP64 sixtyfour bits #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "sixtyfour bits" >/dev/null 2>&1; then : gl_cv_solaris_64bit=yes else gl_cv_solaris_64bit=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 $as_echo "$gl_cv_solaris_64bit" >&6; } if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then : withval=$with_libiconv_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi fi LIBICONV= LTLIBICONV= INCICONV= LIBICONV_PREFIX= HAVE_LIBICONV= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='iconv ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" else LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = 'iconv'; then LIBICONV_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = 'iconv'; then LIBICONV_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" ;; esac done fi else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 $as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; } if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { CFPreferencesCopyAppValue(NULL, NULL) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_CFPreferencesCopyAppValue=yes else gt_cv_func_CFPreferencesCopyAppValue=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 $as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then $as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 $as_echo_n "checking for CFLocaleCopyCurrent... " >&6; } if ${gt_cv_func_CFLocaleCopyCurrent+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { CFLocaleCopyCurrent(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_CFLocaleCopyCurrent=yes else gt_cv_func_CFLocaleCopyCurrent=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 $as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; } if test $gt_cv_func_CFLocaleCopyCurrent = yes; then $as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi LIBINTL= LTLIBINTL= POSUB= case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 $as_echo_n "checking for GNU gettext in libc... " >&6; } if eval \${$gt_func_gnugettext_libc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$gt_func_gnugettext_libc=yes" else eval "$gt_func_gnugettext_libc=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$gt_func_gnugettext_libc { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } if ${am_cv_func_iconv+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_lib_iconv=yes am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 $as_echo "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 $as_echo_n "checking for working iconv... " >&6; } if ${am_cv_func_iconv_works+:} false; then : $as_echo_n "(cached) " >&6 else am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi if test "$cross_compiling" = yes; then : case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static const char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static const char input[] = "\263"; char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; const char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) result |= 16; return result; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : am_cv_func_iconv_works=yes else am_cv_func_iconv_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi LIBS="$am_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 $as_echo "$am_cv_func_iconv_works" >&6; } case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then $as_echo "#define HAVE_ICONV 1" >>confdefs.h fi if test "$am_cv_lib_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 $as_echo_n "checking how to link with libiconv... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 $as_echo "$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libintl-prefix was given. if test "${with_libintl_prefix+set}" = set; then : withval=$with_libintl_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi fi LIBINTL= LTLIBINTL= INCINTL= LIBINTL_PREFIX= HAVE_LIBINTL= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='intl ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" else LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = 'intl'; then LIBINTL_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = 'intl'; then LIBINTL_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" ;; esac done fi else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 $as_echo_n "checking for GNU gettext in libintl... " >&6; } if eval \${$gt_func_gnugettext_libintl+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$gt_func_gnugettext_libintl=yes" else eval "$gt_func_gnugettext_libintl=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi eval ac_res=\$$gt_func_gnugettext_libintl { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else LIBINTL= LTLIBINTL= INCINTL= fi if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then $as_echo "#define ENABLE_NLS 1" >>confdefs.h else USE_NLS=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 $as_echo_n "checking whether to use NLS... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } if test "$USE_NLS" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 $as_echo_n "checking where the gettext function comes from... " >&6; } if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 $as_echo "$gt_source" >&6; } fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 $as_echo_n "checking how to link with libintl... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 $as_echo "$LIBINTL" >&6; } for element in $INCINTL; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done fi $as_echo "#define HAVE_GETTEXT 1" >>confdefs.h $as_echo "#define HAVE_DCGETTEXT 1" >>confdefs.h fi POSUB=po fi INTLLIBS="$LIBINTL" # Check whether --with-pluginsdir was given. if test "${with_pluginsdir+set}" = set; then : withval=$with_pluginsdir; PLUGINSDIR="$withval" else PLUGINSDIR='$(datadir)/games/plugins' fi ac_config_files="$ac_config_files Makefile src/Makefile src/frontend/Makefile src/adapter/Makefile src/engine/Makefile doc/Makefile po/Makefile.in man/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by GNU Chess $as_me 6.2.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to . GNU Chess home page: . General help using GNU software: ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ GNU Chess config.status 6.2.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # variables for create stdint.h replacement PACKAGE="$PACKAGE" VERSION="$VERSION" ac_stdint_h="$ac_stdint_h" _ac_stdint_h=`$as_echo "_$PACKAGE-$ac_stdint_h" | $as_tr_cpp` ac_cv_stdint_message="$ac_cv_stdint_message" ac_cv_header_stdint_t="$ac_cv_header_stdint_t" ac_cv_header_stdint_x="$ac_cv_header_stdint_x" ac_cv_header_stdint_o="$ac_cv_header_stdint_o" ac_cv_header_stdint_u="$ac_cv_header_stdint_u" ac_cv_type_uint64_t="$ac_cv_type_uint64_t" ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t" ac_cv_stdint_char_model="$ac_cv_stdint_char_model" ac_cv_stdint_long_model="$ac_cv_stdint_long_model" ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t" ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t" ac_cv_type_intmax_t="$ac_cv_type_intmax_t" # Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "$ac_stdint_h") CONFIG_COMMANDS="$CONFIG_COMMANDS $ac_stdint_h" ;; "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/frontend/Makefile") CONFIG_FILES="$CONFIG_FILES src/frontend/Makefile" ;; "src/adapter/Makefile") CONFIG_FILES="$CONFIG_FILES src/adapter/Makefile" ;; "src/engine/Makefile") CONFIG_FILES="$CONFIG_FILES src/engine/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "$ac_stdint_h":C) { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_stdint_h : $_ac_stdint_h" >&5 $as_echo "$as_me: creating $ac_stdint_h : $_ac_stdint_h" >&6;} ac_stdint=$tmp/_stdint.h echo "#ifndef" $_ac_stdint_h >$ac_stdint echo "#define" $_ac_stdint_h "1" >>$ac_stdint echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint if test "_$ac_cv_header_stdint_t" != "_" ; then echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint fi cat >>$ac_stdint < #else #include /* .................... configured part ............................ */ STDINT_EOF echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint if test "_$ac_cv_header_stdint_x" != "_" ; then ac_header="$ac_cv_header_stdint_x" echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint else echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint fi echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint if test "_$ac_cv_header_stdint_o" != "_" ; then ac_header="$ac_cv_header_stdint_o" echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint else echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint fi echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint if test "_$ac_cv_header_stdint_u" != "_" ; then ac_header="$ac_cv_header_stdint_u" echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint else echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint fi echo "" >>$ac_stdint if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then echo "#include <$ac_header>" >>$ac_stdint echo "" >>$ac_stdint fi fi echo "/* which 64bit typedef has been found */" >>$ac_stdint if test "$ac_cv_type_uint64_t" = "yes" ; then echo "#define _STDINT_HAVE_UINT64_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint fi if test "$ac_cv_type_u_int64_t" = "yes" ; then echo "#define _STDINT_HAVE_U_INT64_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint fi echo "" >>$ac_stdint echo "/* which type model has been detected */" >>$ac_stdint if test "_$ac_cv_stdint_char_model" != "_" ; then echo "#define _STDINT_CHAR_MODEL" "$ac_cv_stdint_char_model" >>$ac_stdint echo "#define _STDINT_LONG_MODEL" "$ac_cv_stdint_long_model" >>$ac_stdint else echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint fi echo "" >>$ac_stdint echo "/* whether int_least types were detected */" >>$ac_stdint if test "$ac_cv_type_int_least32_t" = "yes"; then echo "#define _STDINT_HAVE_INT_LEAST32_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint fi echo "/* whether int_fast types were detected */" >>$ac_stdint if test "$ac_cv_type_int_fast32_t" = "yes"; then echo "#define _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint fi echo "/* whether intmax_t type was detected */" >>$ac_stdint if test "$ac_cv_type_intmax_t" = "yes"; then echo "#define _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint else echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint fi echo "" >>$ac_stdint cat >>$ac_stdint <= 199901L #define _HAVE_UINT64_T typedef long long int64_t; typedef unsigned long long uint64_t; #elif !defined __STRICT_ANSI__ #if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__ #define _HAVE_UINT64_T typedef __int64 int64_t; typedef unsigned __int64 uint64_t; #elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__ /* note: all ELF-systems seem to have loff-support which needs 64-bit */ #if !defined _NO_LONGLONG #define _HAVE_UINT64_T typedef long long int64_t; typedef unsigned long long uint64_t; #endif #elif defined __alpha || (defined __mips && defined _ABIN32) #if !defined _NO_LONGLONG typedef long int64_t; typedef unsigned long uint64_t; #endif /* compiler/cpu type to define int64_t */ #endif #endif #endif #if defined _STDINT_HAVE_U_INT_TYPES /* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */ typedef u_int8_t uint8_t; typedef u_int16_t uint16_t; typedef u_int32_t uint32_t; /* glibc compatibility */ #ifndef __int8_t_defined #define __int8_t_defined #endif #endif #ifdef _STDINT_NEED_INT_MODEL_T /* we must guess all the basic types. Apart from byte-adressable system, */ /* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */ /* (btw, those nibble-addressable systems are way off, or so we assume) */ #if defined _STDINT_BYTE_MODEL #if _STDINT_LONG_MODEL+0 == 242 /* 2:4:2 = IP16 = a normal 16-bit system */ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned long uint32_t; #ifndef __int8_t_defined #define __int8_t_defined typedef char int8_t; typedef short int16_t; typedef long int32_t; #endif #elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444 /* 2:4:4 = LP32 = a 32-bit system derived from a 16-bit */ /* 4:4:4 = ILP32 = a normal 32-bit system */ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #ifndef __int8_t_defined #define __int8_t_defined typedef char int8_t; typedef short int16_t; typedef int int32_t; #endif #elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488 /* 4:8:4 = IP32 = a 32-bit system prepared for 64-bit */ /* 4:8:8 = LP64 = a normal 64-bit system */ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #ifndef __int8_t_defined #define __int8_t_defined typedef char int8_t; typedef short int16_t; typedef int int32_t; #endif /* this system has a "long" of 64bit */ #ifndef _HAVE_UINT64_T #define _HAVE_UINT64_T typedef unsigned long uint64_t; typedef long int64_t; #endif #elif _STDINT_LONG_MODEL+0 == 448 /* LLP64 a 64-bit system derived from a 32-bit system */ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #ifndef __int8_t_defined #define __int8_t_defined typedef char int8_t; typedef short int16_t; typedef int int32_t; #endif /* assuming the system has a "long long" */ #ifndef _HAVE_UINT64_T #define _HAVE_UINT64_T typedef unsigned long long uint64_t; typedef long long int64_t; #endif #else #define _STDINT_NO_INT32_T #endif #else #define _STDINT_NO_INT8_T #define _STDINT_NO_INT32_T #endif #endif /* * quote from SunOS-5.8 sys/inttypes.h: * Use at your own risk. As of February 1996, the committee is squarely * behind the fixed sized types; the "least" and "fast" types are still being * discussed. The probability that the "fast" types may be removed before * the standard is finalized is high enough that they are not currently * implemented. */ #if defined _STDINT_NEED_INT_LEAST_T typedef int8_t int_least8_t; typedef int16_t int_least16_t; typedef int32_t int_least32_t; #ifdef _HAVE_UINT64_T typedef int64_t int_least64_t; #endif typedef uint8_t uint_least8_t; typedef uint16_t uint_least16_t; typedef uint32_t uint_least32_t; #ifdef _HAVE_UINT64_T typedef uint64_t uint_least64_t; #endif /* least types */ #endif #if defined _STDINT_NEED_INT_FAST_T typedef int8_t int_fast8_t; typedef int int_fast16_t; typedef int32_t int_fast32_t; #ifdef _HAVE_UINT64_T typedef int64_t int_fast64_t; #endif typedef uint8_t uint_fast8_t; typedef unsigned uint_fast16_t; typedef uint32_t uint_fast32_t; #ifdef _HAVE_UINT64_T typedef uint64_t uint_fast64_t; #endif /* fast types */ #endif #ifdef _STDINT_NEED_INTMAX_T #ifdef _HAVE_UINT64_T typedef int64_t intmax_t; typedef uint64_t uintmax_t; #else typedef long intmax_t; typedef unsigned long uintmax_t; #endif #endif #ifdef _STDINT_NEED_INTPTR_T #ifndef __intptr_t_defined #define __intptr_t_defined /* we encourage using "long" to store pointer values, never use "int" ! */ #if _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484 typedef unsinged int uintptr_t; typedef int intptr_t; #elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444 typedef unsigned long uintptr_t; typedef long intptr_t; #elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T typedef uint64_t uintptr_t; typedef int64_t intptr_t; #else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */ typedef unsigned long uintptr_t; typedef long intptr_t; #endif #endif #endif /* shortcircuit*/ #endif /* once */ #endif #endif STDINT_EOF if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_stdint_h is unchanged" >&5 $as_echo "$as_me: $ac_stdint_h is unchanged" >&6;} else ac_dir=`$as_dirname -- "$ac_stdint_h" || $as_expr X"$ac_stdint_h" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_stdint_h" : 'X\(//\)[^/]' \| \ X"$ac_stdint_h" : 'X\(//\)$' \| \ X"$ac_stdint_h" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_stdint_h" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p rm -f $ac_stdint_h mv $ac_stdint $ac_stdint_h fi ;; "po-directories":C) for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" gt_tab=`printf '\t'` cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi gnuchess-6.2.2/configure.ac000644 000766 000024 00000006146 12606706317 016460 0ustar00antoniostaff000000 000000 dnl Process this file with autoconf to produce a configure script. dnl dnl Copyright (C) 2001-2015 Free Software Foundation, Inc. dnl dnl This file is free software; as a special exception the author gives dnl unlimited permission to copy and/or distribute it, with or without dnl modifications, as long as this notice is preserved. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. AC_INIT([GNU Chess], [6.2.2], [bug-gnu-chess@gnu.org], [gnuchess]) AC_PREREQ(2.69) AC_CONFIG_HEADERS(src/config.h) AC_CONFIG_SRCDIR([src/main.cc]) AM_INIT_AUTOMAKE dnl Checks for programs. AC_PROG_CC AC_PROG_CXX AC_PROG_RANLIB AC_PROG_INSTALL AC_PROG_AWK AC_PROG_LN_S AC_STRUCT_TM AM_PROG_LEX dnl --with and --enable things AC_ARG_WITH(readline, AC_HELP_STRING([--with-readline], [use readline library if available (default is YES)]), ac_cv_use_readline=$withval, ac_cv_use_readline=yes) dnl Check for readline library _and_ headers if test x"$ac_cv_use_readline" = "xyes"; then AC_CHECK_LIB(ncurses, tputs) AC_CHECK_LIB(readline, readline) AC_CHECK_HEADERS(readline/readline.h readline/history.h) fi dnl Checks for header files. AC_HEADER_STDC dnl Either we should make these checks fail with an dnl AC_MSG_ERROR or we should treat missing headers dnl with #ifdef somehow. (As it stands, it still gives dnl valuable debugging info for bug reports, but not more.) AC_CHECK_HEADERS(time.h sys/time.h unistd.h errno.h fcntl.h libintl.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_VOLATILE AC_FUNC_REALLOC AC_HEADER_STDBOOL AC_C_INLINE AC_TYPE_SIZE_T AC_HEADER_TIME AX_CREATE_STDINT_H(src/GCint.h) dnl Checks for library functions. AC_TYPE_SIGNAL AC_FUNC_MALLOC AC_FUNC_MEMCMP dnl See above, how do we treat failure here? AC_CHECK_FUNCS(gettimeofday strchr strcspn strstr strerror memset strdup strtol) dnl Don't Check for getopt_long dnl just use bundled version like hello does dnl AC_SUBST(LIBOBJS) dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] ) ACX_PTHREAD() # GNU help2man creates man pages from --help output; in many cases, this # is sufficient, and obviates the need to maintain man pages separately. # However, this means invoking executables, which we generally cannot do # when cross-compiling, so we test to avoid that (the variable # "cross_compiling" is set by AC_PROG_CC). if test $cross_compiling = no; then AM_MISSING_PROG(HELP2MAN, help2man) else HELP2MAN=: fi # Support from GNU gettext. AM_GNU_GETTEXT_VERSION([0.18.3]) AM_GNU_GETTEXT([external]) AC_ARG_WITH([pluginsdir], [AS_HELP_STRING([--with-pluginsdir=DIR], [path where game data files get installed (default: $datadir/games/plugins)])], [PLUGINSDIR="$withval"], [PLUGINSDIR='$(datadir)/games/plugins']) AC_SUBST(PLUGINSDIR) AC_CONFIG_FILES(Makefile src/Makefile src/frontend/Makefile src/adapter/Makefile src/engine/Makefile doc/Makefile po/Makefile.in man/Makefile) AC_OUTPUT gnuchess-6.2.2/COPYING000644 000766 000024 00000104513 12461115242 015210 0ustar00antoniostaff000000 000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . gnuchess-6.2.2/depcomp000755 000766 000024 00000056016 12244054565 015547 0ustar00antoniostaff000000 000000 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: gnuchess-6.2.2/doc/000755 000766 000024 00000000000 12610434563 014724 5ustar00antoniostaff000000 000000 gnuchess-6.2.2/INSTALL000644 000766 000024 00000036605 12244054564 015224 0ustar00antoniostaff000000 000000 Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX `make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as `configure' are involved. Use GNU `make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. gnuchess-6.2.2/install-sh000755 000766 000024 00000033255 12244054564 016175 0ustar00antoniostaff000000 000000 #!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: gnuchess-6.2.2/lib/000755 000766 000024 00000000000 12610434562 014724 5ustar00antoniostaff000000 000000 gnuchess-6.2.2/m4/000755 000766 000024 00000000000 12610434562 014476 5ustar00antoniostaff000000 000000 gnuchess-6.2.2/Makefile.am000644 000766 000024 00000002742 12461115242 016212 0ustar00antoniostaff000000 000000 # Process this file with automake to produce Makefile.in (in this, # and all subdirectories). # Makefile for the top-level directory of GNU Chess. # # Copyright (C) 2001-2015 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Find gnulib headers. ACLOCAL_AMFLAGS = --install -I m4 # Subdirectories to descend into. SUBDIRS = src doc po man dist_pkgdata_DATA = src/gnuchess.ini src/smallbook.bin # For recognition and usage by GUIs pluginsdir=@PLUGINSDIR@ engdir=$(pluginsdir)/xboard eng_DATA = misc/gnuchess.eng logodir=$(pluginsdir)/logos logo_DATA = misc/gnuchess.png # Additional files to distribute. EXTRA_DIST = config.rpath m4/ChangeLog TODO src/gnuchess.ini src/smallbook.bin src/gnuchessx src/gnuchessu doc/quotes.rb lib/gettext.h misc/gnuchess.eng misc/gnuchess.png DISTCLEANFILES = *~ src/GCint.h pkgdatadir =$(datadir)/gnuchess AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_builddir)/lib gnuchess-6.2.2/Makefile.in000644 000766 000024 00000073430 12606706417 016240 0ustar00antoniostaff000000 000000 # Makefile.in generated by automake 1.14 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Process this file with automake to produce Makefile.in (in this, # and all subdirectories). # Makefile for the top-level directory of GNU Chess. # # Copyright (C) 2001-2015 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) ABOUT-NLS \ $(dist_pkgdata_DATA) COPYING TODO compile config.guess \ config.rpath config.sub depcomp install-sh missing ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(engdir)" \ "$(DESTDIR)$(logodir)" DATA = $(dist_pkgdata_DATA) $(eng_DATA) $(logo_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print pkgdatadir = $(datadir)/gnuchess ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HELP2MAN = @HELP2MAN@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGINSDIR = @PLUGINSDIR@ POSUB = @POSUB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXXFLAGS = @PTHREAD_CXXFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Find gnulib headers. ACLOCAL_AMFLAGS = --install -I m4 # Subdirectories to descend into. SUBDIRS = src doc po man dist_pkgdata_DATA = src/gnuchess.ini src/smallbook.bin # For recognition and usage by GUIs pluginsdir = @PLUGINSDIR@ engdir = $(pluginsdir)/xboard eng_DATA = misc/gnuchess.eng logodir = $(pluginsdir)/logos logo_DATA = misc/gnuchess.png # Additional files to distribute. EXTRA_DIST = config.rpath m4/ChangeLog TODO src/gnuchess.ini src/smallbook.bin src/gnuchessx src/gnuchessu doc/quotes.rb lib/gettext.h misc/gnuchess.eng misc/gnuchess.png DISTCLEANFILES = *~ src/GCint.h AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_builddir)/lib all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): install-dist_pkgdataDATA: $(dist_pkgdata_DATA) @$(NORMAL_INSTALL) @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \ done uninstall-dist_pkgdataDATA: @$(NORMAL_UNINSTALL) @list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir) install-engDATA: $(eng_DATA) @$(NORMAL_INSTALL) @list='$(eng_DATA)'; test -n "$(engdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(engdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(engdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(engdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(engdir)" || exit $$?; \ done uninstall-engDATA: @$(NORMAL_UNINSTALL) @list='$(eng_DATA)'; test -n "$(engdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(engdir)'; $(am__uninstall_files_from_dir) install-logoDATA: $(logo_DATA) @$(NORMAL_INSTALL) @list='$(logo_DATA)'; test -n "$(logodir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(logodir)'"; \ $(MKDIR_P) "$(DESTDIR)$(logodir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(logodir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(logodir)" || exit $$?; \ done uninstall-logoDATA: @$(NORMAL_UNINSTALL) @list='$(logo_DATA)'; test -n "$(logodir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(logodir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(engdir)" "$(DESTDIR)$(logodir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dist_pkgdataDATA install-engDATA \ install-logoDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-dist_pkgdataDATA uninstall-engDATA \ uninstall-logoDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dist_pkgdataDATA install-dvi \ install-dvi-am install-engDATA install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-logoDATA install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-dist_pkgdataDATA uninstall-engDATA \ uninstall-logoDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: gnuchess-6.2.2/man/000755 000766 000024 00000000000 12610434565 014734 5ustar00antoniostaff000000 000000 gnuchess-6.2.2/misc/000755 000766 000024 00000000000 12610434562 015111 5ustar00antoniostaff000000 000000 gnuchess-6.2.2/missing000755 000766 000024 00000015331 12244054564 015563 0ustar00antoniostaff000000 000000 #! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2012-06-26.16; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'automa4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: gnuchess-6.2.2/NEWS000644 000766 000024 00000116030 12610427111 014646 0ustar00antoniostaff000000 000000 NEWS of GNU Chess Copyright (C) 2001-2015 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. Version 6.2.2 (October 2015) - More robust program exit concerning threads. - Detailed error messages for bad FEN syntax. Version 6.2.1 (January 2015) - Man page in English. Version 6.2.0 (January 2015) - "Tighter connection" with XBoard by means of an engine file and a logo, as expected by XBoard (>= 4.6.0). - Some cleanup (typos in info and removed trailing spaces in sources). - Uppercase chars only for piece names, as Fruit doesn't like lowercase. - A man page based on help2man. Version 6.1.2 (July 2014) - CFLAGS replaced by CPPFLAGS in info. - Fix for correct handling of castling moves. - Include translations to other languages. Version 6.1.1 (November 2013) - Include translations to other languages. - Minor corrections in translatable strings. - Migrate frontend to C++. - Use autoconf 2.69 and require it in configure.ac. - Use automake 1.14. Version 6.1.0 (November 2013) - Add support for package internationalization based on GNU gettext. - Include first translations provided by the Translation Team. - Graphic mode, a new board shape based on the unicode characters for chess. - pgnreplay command, similar to pgnload, with the capability of manually showing a saved game step by step and moving backwards. - Fix bug in setboard. - Avoid using 100% CPU in UCI mode. - Rename the small book.bin as smallbook.bin. Version 6.0.93 (October 2013, pretest version of v6.1.0) - Fix gettext support. Version 6.0.92 (August 2013, pretest version of v6.1.0) - Fix gettext support. Version 6.0.91 (August 2013, pretest version of v6.1.0) - Fix gettext support. Version 6.0.90 (August 2013, pretest version of v6.1.0) - Add support for package internationalization based on GNU gettext. - Graphic mode, a new board shape based on the unicode characters for chess. - pgnreplay command, similar to pgnload, with the capability of manually showing a saved game step by step and moving backwards. - Fix bug in setboard. - Avoid using 100% CPU in UCI mode. - Rename the small book.bin as smallbook.bin. Version 6.0.3 (March 2013) - Run autoreconf and configure based on autoconf 2.69 and automake 1.13 to get rid of these vulnerabilies: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-4029 http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-3386 - Update configure.ac to automake 1.13. - If in manual mode, keep it after undo. - Remove some unused code. - Avoid crashing when importing book_1.01.pgn Version 6.0.2 (March 2012) - New option --addbook to compile a book. - Maximum file name length of EPD files extended to 127 characters. - Book file allowed to be read only unless the BookLearn option is set. Version 6.0.1 (August 2011) - Allow kibitz for solve command. - If gnuchess.ini is not found, report error before prompt. - Fix 'book on' command. - Fix 'book add' command. - Insert sleep(0) in adapter thread - prevents from crash for solveepd with st 30. - Typo in info file: 'book.dat' replaced by 'book.bin'. - Correct INSTALL: 'cd src' before './gnuchess' - Remove some unused code. Version 6.0.0 (27 April 2011) - First official release of GNU Chess version 6! - iq6.epd no longer included in the distribution - stored in Subversion. Version 5.9.92 (24 April 2011) - Implement 'book *' commands as in v5. (Implemented by extending the protocol messages between frontend and adapter. Engine book options uncontrollable, since I am more reluctant to modify the protocol between adapter and engine (UCI), but it could be done.) - Implement v5 command 'hash on/off'. (UseTrans to be variable and driven by new option.) - Implement v5 command 'null on/off'. (UCI option NullMove Pruning) - Implement v5 command memory. (UCI option UseTrans) - Implement v5 command memory N. (UCI option Hash) - Remove v5 commands hashsize/hashsize N. Memory command replaces them. - Hard mode at startup. - Implement v5 command-line options not working in the previous version: --post --easy --manual --memory - All pieces of text doc transformed into texinfo. - Include v5 script gnuchessx for xboard mode. - Implement script gnuchessu for UCI mode, similar to gnuchessx. - Set writing to adapter.log to false by default. - Default config so that the config file gnuchess.ini is not mandatory. Version 5.9.91 (14 January 2011) - Relax dependency on config file gnuchess.ini New in gnuchess 5.9.90 (10 January 2011, first pretest version of v6.0.0) - Fruit 2.1 engine, by Fabien Letouzy - Polyglot 1.4 adapter, by Fabien Letouzy - Three decoupled components: frontend, engine and adapter - UCI mode, providing UCI interface, through -u/--uci command-line option. New in gnuchess 5.07: - New PGN parser handles annotated PGN when creating opening book - Additional command line options - gnuchessx script added New in gnuchess 5.06: - Added code for pondering and analysis mode - Added white/black commands for use with icsDrone - Command line options now follow GNU standards (./gnuchess --help) - Some optimisations added - Book may be stored in /usr/share/games/gnuchess/book.dat - Program no longer starts search from scratch every move New in gnuchess 5.05: - Fixed a potential buffer overflow in pgn.c. - General code cleanups, bug fixes, and probably introduction of new bugs, especially in pondering related code - The opening book is now looked for in /usr/lib/games/gnuchess/book.dat if it is not found in the working directory. - Changes for easing compilation with MSVC - Removed support for the Novag Universal Board. The recommended alternative is to use the winboard driver for this board, which is linked to on http://www.tim-mann.org/extensions.html New in gnuchess 5.04: - Bug fixes (as always) New in gnuchess 5.03: - Bug fixes (The infamous "illegal move" bug should be dead by now.) - Architecture independent binary book. Yes, you may now move your binary book around between little and big endian, 32 and 64 bit machines and it should not break. - Build system is now automake/autoconf, should ease porting gnuchess to your favorite strange architecture. (Hell, what about gnuchess on cellphones...?) Version 5.03 Book handling rewritten, and other major changes collected and applied by Stuart Cracraft before use of CVS. Book need to be remade from PGN. List of Grandmasters we "trust" in generating the opening book was extended. Contributed Bug fixes - various. Code placed under CVS after some minor changes to 5.02. Opening book not placed under CVS - too large. Other changes managed under CVS Installation instructions corrected "book create" to "book add". Makefile modified to work with OpenBSD make. Use of C++ reserved words as variable names removed for ease of reuse. The C Macro i386 replaced with Endianness test for portability. Lots of unreachable code removed to make it more readable. "#ifdef debug" and "#ifdef never" code removed. Removed problem with "space" on the end of filenames. Handle XBoard SIGINT gracefully (Caused Solaris Xboard problem). Reduced default hashtable size. Deleted Crafty style bad trade code as it was incorrect. The calculations for hung and pinned pieces were using stale information in the calculations. All relevant code was removed from the position evaluation routine. Fixed loop bound error that allowed King to remain in check!!! Made input buffers consistent to stop crash on long commands. Correct hashtable handling of En Passant. Fixed EPD output when loading a game from file with Black to move. Fixed file handling problem extending opening book. Various modifications to SortMove to encourage examination of pushing passed pawns, centralisation, before other moves. Some modification have little effect, as the calling of sorting routines is quite complex. Added various EPD files for developer testing. These files cannot be included in the released tar file until copyright issues are resolved. Removed Outside passed pawn bonus from Evaluate as it was incorrectly in the pawn hash section. Removed the chess_faq.html file from the distribution, as this belongs on the GNU web site. Version 5.02 Various bug fixes. Version 5.01 Sun Mar 4 11:02:52 EST 2001 - book/book.* Stuart Cracraft Expanded opening book Sun Dec 12 11:42:10 EST 1999 - src/version.c Patrick Gundlach fflush stdout in Xboard startup (i.e. "Chess" herald) Version 5.00 *** RELEASE *** (September 30, 1999 - cracraft) o Found that after first ^C interrupt to running program a second one would exit it. Added a new signal (..) call in EndSearch. Okay now. o Structure the tree (doc, book, src, etc.) o Rename the tree from gnuchess5.0 to chess-5.00 o Revise version.h. o Revised copywrite. o Revised COPYING (update FSF address). o Default to post mode (statistics) if not xboard. Version 5.00j - integrated 1.21k from Kong. - added traditional anti-computer locked pawn structure penalty traditional anti-computer stonewall pawn structure penalty crafty's eight pawns penalty old cobalt's ahopen traditional anti-computer edge-of-board attack center pawns shortened time until queen penalty (4 moves instead of 8) EICS 5/31/99 Games: 83 Ave.opp: 1882 Percent: 77 Result: 63W + 4D + 16L = 77 % Rating: 2093 FICS 6/15/99 Games: 125 Ave.opp: 1766 Percent: 81 Result: 100W + 10D + 15L = 81 % Rating: 2017 Version 5.00i - use GNU 4.0 eval instead. toss out evaluation. - Win-at-Chess test: 229/300 at 5 seconds per move. 10,949,825 nodes 1507 seconds - Add Queen+Piece threat extension from Kong. - WAC: 235/300 at 5 seconds per move. 9,656,161 nodes. 1525 seconds. - Add the whole GNU 4.0 style calling sequence in Evaluate (lazy, single lone king, etc.) - WAC: 213/300 at 5 seconds per move, 17,911,670 nodes. 1437 seconds. - FICS result: Games: 34 Ave.opp: 1836 Percent: 85 Result: 28W + 4D + 2L = 85 % Rating: 2132 Version 5.00h - book.c: when in XBOARD mode, the book needs to be quiet without status. - eval.c: some formatting - Win-at-Chess test: 219/300 at 5 seconds per move. 11,864,883 nodes. 1441.7 seconds (out of 1500 permitted). - eval.c: penalize knight on rim even more. up undevelopment penalty. Version 5.00g - Add Crafty-style bad-trade code for bad piece exchange penalty. Version 5.00f - Kong contributed rotated bitboards move generator. It tests 21% faster than the old move generator, yet overall program speed is about 8% slower based on testing. - Added ROOKTRAPPED code for rook trapped by king. Version 5.00f - BUGFIX: Kong provided a fix to prevent segmentation faults in certain rare positions: 6Q1/8/8/4K3/8/8/p7/1k1 w - - bm 1; id 1; - based on analysis of 7 lost games last night it was noted that 6 of these were in positions where the program played other than double king-pawn or double queen-pawn instead opting for non-classical openings, so... fix to always play double-pawn as long as the evaluation resolves to that order of moves once book has been scored. this is done by having the program choose from between the top 2 moves for white's first move (excluding Nf3, but including e4 and d4) and only the top 1 move for black's first move (excluding non-kp/qp replies to KP/QP by white). For odd openings like Reti or Nc3, fairly good moves are picked with the above algorithm, that may be preferable to just having only kp/kp or qp/qp for this algorithm). - BUGFIX: fix problem that resulted in friendly king not being penalized enough for being far from enemy passed pawns. - FEATURE: Add DistMap[m][n] array. This array has all bits turned on that are n squares away from the m square where m is A1..H8. Aids in rapid diagnosis of distances. - FEATURE: Add penalty for every enemy pawn within 3 squares of the friendly king in the opening and middlegame: KINGNEARENEMYPAWN. - FEATURE: Add penalty for no friendly minors or queen within 3 squares of king in opening or middlegame: KINGNOSUPPORT. Games: 27 Ave.opp: 1631 Percent: 96 Result: 26W + 0D + 1L = 96 % Rating: 2132 Version 5.00e (beginning of March) - try increasing pawncover values -- no good. - try diminishing underattack values -- seems good. - add pawn majority/minority calculation - add in better connected passed pawn evaluator - double penalty for open files adjacent to or on king's file if enemy queen present. Games: 91 Ave.opp: 1763 Percent: 87 Result: 79W + 2D + 10L = 87 % Rating: 2085 Version 5.00d (late February) - cleaned up version prior to all the mods to get rating back. - one night result: Games: 29 Ave.opp: 1616 Percent: 89 Result: 25W + 2D + 2L = 89 % Rating: 1967 - fix up PGN save-to-file routine. Was putting black in result. - ScoreDev returns only if fully developed. - Diminish connected passed pawn penalty. Games: 104 Ave.opp: 1797 Percent: 77 Result: 80W + 2D + 22L = 77 % Rating: 2008 Version 5.00b (late January) search.c - Razoring. This applies at depth == 3. If we are more than a Q behind and there is no extension, then reduce the depth by 1. Extended futility pruning. At depth == 2, if we are more than 600 points behind and there is no extension, then we only look at checking moves & captures which bring the material score back to alpha. Everything else is pruned away. This is an extension of the basic futility pruning which applies at depth == 1. cmd.c - modify so that all games go to game.nnn and the log of their searches go to log.nnn where the two nnn's match. version.c - split off VERSION/etc info into version.h Makefile - make version.c depend on version.h pgn.c - have PGNSaveGame record player's names based on "name" command common.h - adjust knight and bishop values iterate.c - was not taking up to 2 x nominal time per move when in bad situations. fixed. book.c - for random choice amongst top N moves of preferred book now sorts all moves by stored book score and picks randomly amongst N based. Previous algorithm was flawed. eval.c - add penalties for attacks against ones king in - add OPENGAME heuristic (1/4 pawn reward for positions in which root position either side has more than 6 pawns and in the leaf position both sides have <= 6 (idea due to Larry Kaufman and Don Dailey of Socrates) - lots of work on development scoring. - Win-at-Chess test: 233/300 at 5 seconds per move. 14,940,780 nodes. - Rating went to FICS 2050 with all the positional changes on 1/31/99. - make king attacks per piece to reward multiple attacks to same square by multiple pieces - anti-stonewall - credit protectors in front of king and penalize attackers. - penalize repeat pawn moves before development complete. - rating maintained at FICS 2049. Version 5.00a (13 Dec 98) - integrated with WinBoard 4.0 / Xboard - post/nopost (show iterative deepening) - time controls (level, fischer, sudden-death, time, otim, etc.) - works properly with FICS (Free Internet Chess Server) - added opening book capability. - futility pruning according to Kong. - weak back rank handling for kings - canned attacks against computer's king (via opening A/H file) - penalize early minor piece repeat moves. - wingpawn advance before castling penalty. - Win-at-Chess test: 233/300 at 5 seconds per move. 14,977,757 nodes. - Convert it to properly run on a standard Unix system, not just PC's. - Make it work with "configure". - Distribute to beta-testers - eval.c - PawnSq[], make penalty for d2/e2/d7/e7 pawns KingSq, KnightSq, PawnSq improved eval.h - PINNED* worsened - BISHOP_PAIR from 40 to 25. beta tester input. - iterate.c - disable Hyatt more-time-after-book algorithm disable Chua's dont-start-every-new-iteration - this version made a 115 point rating jump (to FICS 2030). ****************** BEGIN GNU 5 (Stuart Cracraft) ******************** Version 1.19 (18 Jul 98) a. Found problems when PV not updated when best >= beta; changed this in both Quiesce() and Search(). b. A ValidateBoard() function. c. Bug fix in SwapOff(). In Evaluate(), position with KNN with no pawns wasn't being scored as 0; done. d. More accurate & faster hung piece evaluation. e. We skip null search when MATERIAL+ValueP <= beta instead of alpha. This makes more sense as we are only interested in beta. Also if the hash table returns an upper bound, the score < beta, so forget about doing the null test. This both gives about 6% reduction in nodes searched. f. In Search(), when doing TTGet, g0 is destroyed even though we use it in the null test later. This is fixed. Passed pawns made less valuable; increased CONNECTEDPP from 450 to 650 to compensate. g. One-reply extensions should be checked before probing the hash table otherwise, such a probe will take place at a lesser depth than it should. The algorithm to prune if no faster mate is found is also brought forward to before the hash probe. h. When all root-moves fail low, it is still a good idea to try the best move found at the last iteration first. i. Sometimes pawn-to-7th rank extensions wasn't being carried out. This is fixed; also these extensions are only done at the leaf only. If a root move is a recapture, it is extended as well. j. Bonus/penalties for rook behind/in front of passed pawn. For ending don't give bonus for rook on open files as rook behind passed pawns are stronger. k. SwapOff() wasn't handling promotion moves at all; this is now fixed. Some of the sort algorithm has to be changed to take into account the update to SwapOff. Also minor bug fix to AddXrayPiece(). l. Penalize side where a pawn base is under attack by opponent's pawn. m. At SearchRoot() we don't need to do any extensions. For recapture extensions, we only extend if it is capture of equal or more material so as to follow sacrifices (e.g QxP+ KxQ etc). n. Bonus for pawn on c6/f6 if opponent king is in the appropriate corner. o. Extension for useless interposing moves. Limit recapture extensions to below Idepth+2. p. For PV's we no longer back it up from the root. Now the whole PV is taken from the hash table except for the first move. This is a much cleaner way of managing it, saving code in search. Otherwise, the PV that is return isn't always correct and its really very difficult to fix. q. There were some bugs with HashKey calculation in move.c, init.c and hash.c. These have been fixed. The idea is that for ALL positions in a game, the HashKey must be equal to the HashKey calculated if the positions are epd-loaded. Got rid of CptrCnt[] array; I no longer use it for capture extensions. r. King position is now stored in the variable board; we no longer need to run leadz (board.b[side][king]) anymore, which takes place in quite a number of places! s. An AttackXTo() routine which generates a bitboard of all pieces of side which attack a square. This includes x-rays. Bug in GenCheckEscapes() whereby a pawn capturing a checking piece is not checked for promotion. When Idepth <= 3, we don't do null move. This allows us to catch some mates in 2 which would otherwise be pruned away by the null move. t. Added in threat extension code. A mate at any depth is better than a non-mate score, so it will replace it in the ttable. More "bug fixes", eg. sometimes null moves terminate the PV, hopefully this is all fixed in this release. u. A TTGetPV to pull the PV from the hash table. This works better than TTGet which can sometimes miss the PV due to the way the hash tables are managed. v. Bonus for fianchetto bishops. Minor change to TTPut() whereby occasionally the same position can occupy both slots but the 2nd slot has a lower draft. The 2nd slot is wasted. This is changed so that this waste will no longer occur. Version 1.18 (18 Mar 98) a. In MakeMove(), when a rook is captured, the castling flag has to be updated too. This also means that in genmove.c, when generating castling moves, it is not necessary to check if the rook is on its original square. However this check hasn't been removed yet. b. Add "epdsave/save" command. c. Debug code in quiesce.c wasn't being activated; fixed. d. In ttable.c, use & for calculating hashindex rather than the more expensive modulo operation. Gain a couple of percent speedup. Also fix the hashsize command so that it is also a power of 2. Also get rid of modulo operation everywhere else in the code. e. For connected pawns on 6th/7th rank only apply super bonus when the enemy only has rooks. When researching a fail high move & it fail low, immediately set alpha to -INF and research it. This assumes that the original move did not fail high. f. PhasePick() was sometimes trying out the Hashmv twice resulting in wasted time. Fixed by making Hashmv[] an array. g. Bug in trade down code fixed. Also modified the way worstscore was calculated resulting in a significant speedup in Evaluate(). Fine tune ScoreB(). h. Added a FindPins() function which returns a bitboard of all pinned pieces. This is used in eval.c for evaluating pinned pieces. i. Modify way in which sorting of captures was done. This led to a reduction in the quiescent search speeding things up slightly. j. For killers, only update them if best >= beta; this gives much improved pruning. Remove killer updates in SearchRoot(). Remove transposition lookup & updates in SearchRoot(). Got rid of pbest in SearchRoot(). k. In quiesce(), only update the PV if the score > alpha, not when score > best. When a mate in N plies have been found, at the N-1 ply, we don't search the opponent moves; we only check to see if he is mated. Simplify SearchRoot(). l. If the hash table returns an upperbound, then we don't want the move that is returned, so set Hashmv=0. This improves pruning. m. SquarePawnMask[] for pawns on 2nd rank is wrong; it is now set to mask for pawns on 3rd rank as they can advance 2 square. SwapOff() used to assume that the side to move is the one moving the piece. This has been changed to that SwapOff() can be used for any side. Bug fixed in evaluation of trapped bishop. Bug in GenCheckEscapes() whereby an e.p. capture was allowed even if the pawn is pinned; this is fixed. A nicer and bigger board. n. For endings with opposite colour bishops, half the score as they are mostly drawish. Instead of penalizing weak pawns, give bonus to pieces which attack weak enemy pawns. Lots of evaluation tuning. Commented out ShowThinking() resulting in faster search. All this has improved the nodes per second by 50%! Fix bug in MakeMove() whereby if a R captures another R, the castling flag for the captured rook is not cleared. o. Updated FindPins() to include more pin situations. Introduce a variable called computer; this hold the colour that the program plays. Make a trapped bishop part of lazy evaluation as it gives a high penalty. Promotion weren't taken into account in SortRoot(). p. A basic KPK evaluation for certain positions. Another bug in GenCheckEscape(); a promotion move to escape check isn't taken into account. Introduced a board.pmaterial[] variable which holds the pieces total value for a side. PHASE is now calculated using only pieces values. In Quiesce(), when side is in check we don't prune even if best >= beta; this is now fixed; when in check, we see if we are checkmated, if not and there is a beta cut, do it saving some branches. History was updated everytime best > alpha; now it is updated only when best >= beta, or when a score > alpha has been found. All this gives rise to improved pruning about 2-3 %. q. Some fine tuning of passed pawn eval. Add quiesce move to ttable so that it can appear in the PV. Version 1.17 (9 Feb 98) a. Added very elementary hanging piece evaluation. b. For square of the pawn, instead of adding ValueQ - ValueP, we a fraction of ValueQ based on how far advance the pawn is. This is to encourage the pawn to advance and queen. Fix a bug in IsLegalMove() whereby an en-passant was considered illegal. c. More accurate hanging piece evaluation. d. IsLegalMove() was missing out enpassant captures. Fixed. e. Added a ptype[] variable to distinguish between pawn & bpawn; f. In Search(), initialize PVlen before checking for draws. This fix problems with illegal moves in the PV (e.g. GMG1.epd 42). g. Renamed Pinned() to PinnedOnKing(). A new Pinned() function will be written to be more generic. Minor change to SearchRoot(), the first move is also moved within the main loop, making things tidy. h. Xboard support. i. In Search(), the first move is also moved into the main loop. This is to make the code better suited for adding threat extensions. Game50 variable wasn't being properly updated; fixed. j. Trapped bishop at A7/H7/A2/H2. Rook moved before castling is now penalized. Minor optimization in eval.c. More eval tuning. k. Also promotion moves were not being sorted properly; this is fixed. l. board.ep was initialized to 0; now its -1 fixing a bug when promotion happens at A1 square (square 0). m. Instead of storing the whole board HashKey into the ttable, we now store the top 32 bits, saving memory. Same for Pawn table. n. Fix bug in backward pawn detection. Fix bug in search whereby sometimes the best move wasn't being properly set. Fortunately, this happens quite deep in the tree, so not much improvement might be seen. Change the way that scores are returned from the hash table probe to improve pruning. o. Trade down bonus implemented. Recaptures extensions modified so that only recaptures of same value & square are extended. p. In Quiesce(), check for mates as well. q. Killers at ply-2 is also used for sorting. Reduced tree size slightly (2-3%). r. Moves in the Quiesce() search were not being recorded in the PV. This is now fixed. s. Bug fix in evaluation of square of the pawn whereby if the opponent is on the move, the pawn isn't scored properly. t. Phase pick is implemented. Code seems to be working. Also bug fixes in IsLegalMove() and Evaluate(). Version 1.16 (26 Jan 98) a. Added a Mvboard[] array which returns the number of times a piece on [sq] have moved. Use it for penalizing early Q moves. b. ScoreDev() returns only development of side-to-move instead of white-black. c. Separate Search() into a SearchRoot() which is called at ply==1 and Search(). Some modifications in search. d. Added back GenAtaks() into evaluate when doing slow evaluation. Modifications in the ScoreX() routines to make use of attack tables. e. Fixed a bug in UnmakeNullMove whereby the board.ep variable wasn't correctly restored. f. Added the passed BitBoard into the pawn hash table allowing us to save the passed pawn board into the table. g. In evaluate, when one side has no mating material, make sure the score is never > 0. h. Added in Square of the pawn evaluation. Fix a bug in ScoreP whereby passed pawns information was being changed. In EvaluateDraw(), fix a bug whereby 2N vs 2N wasn't a draw. i. Fix a bug which sometimes put an illegal move in the PV. This was happening when an EXACTSCORE was returned, but the PVlen was incorrectly set. j. Lots of changes/tuning to eval.c. k. Added in an IsLegalMove() function to test if a move is legal. l. Added a Pinned() function to test if a piece is pinned against the King. m. Added a GenCheckEscape() routine to generate move when a king is in check. In SearchRoot(), there is no need to check if a move is legal as all root moves are legal. n. If King is in check, generate check escapes only and if there is only 1 move, extend by another move. Version 1.15 (16 Jan 1998) a. Convert AlgbrMove() to return char * rather than void. b. In the quiescent search, use SwapOff() to see if a capture is futile and prune it. Removed as it wasn't working well. c. Big bonus for connected passed pawns on the 6/7th rank. Solves WAC/2 easily. d. Bug fix and clean up of code in sort.c. Results in improve capture sorting and better pruning. Got rid of DeepExtCnt; not used. e. For search extensions, limit capture to maximum of 2 and checks to maximum of Idepth, the iteration depth. f. SwapOff() wasn't working for non-captures as pointed out by Stuart. Fixed SwapOff(); appears to be okay now. Used SwapOff() in capture move ordering; seems to help a bit. g. In Search(), move the Quiesce() call before the ttable probe. Slight improvement in pruning and ttable stats are now much higher. h. Still another bug in AddXrayPiece() was fixed. i. Slight change in GenMoves() to speed it up slightly. j. Implemented pawn hash table. Achieves good increase in nps (25%). k. Added in a SquarePawnMask[] array. This is to determine if a king is able to stop a passed in a king and pawns only endgame. l. Material values of 100,350,350,550,1100. Also some optimizations in move.c. PHASE modified for new material values. m. Implemented a two-tier transposition table. Minimal gain in tree size reduction. n. Only store non-captures as killers; try killers after captures in sort. This gives more than 30% reductions in nodes searched. Also fix a bug in SortMoves(). o. Only give bonus for rook on 7th rank if enemy king is on 8th rank or there are enemy pawns on 7th rank. Other bug fixes and tuning in eval. p. Recognize and penalize backward pawns. Version 1.14 (3 Jan 98) a. Fixed bug in solve.c whereby the test for a correct solution is not correctly done (pointed out by Stuart). b. When searching for mates, eval just return MATERIAL saving time. c. Uses EPD format rather than FEN; also clean up ParseEPD; fen.c now called epd.c d. io.c renamed to output.c. Game phase is now 1-8 (opening-ending). e. In quiesce(), if a capture cannot bring the score near alpha, don't search it, speeding things up. f. If we have a rootscore much worst that our previous iteration rootscore, we continuing searching. (Fix from Stuart). g. Got rid of nxtline, bstline way of updating the PV. Instead use the method in cheops, resulting in much cleaner code. h. Got rid of savePVar[] array and all the code related to it. What its for, I can't remember. i. SortMoves() takes into account moves towards the centre. Pruning is slightly improved. j. AttackFrom() function is added. This returns the bitboard of squares attacked by a piece. Remove GenAtaks() and other code in eval.c which required the use of attack tables. k. Bug in ScoreDev() whereby an early Queen move which should be penalized isn't. Various bug fixes & tuning in eval code. l. PGNReadFromFile() is able to read the 1st game in a pgn file. m. In the null move, instead of searching with window [alpha,beta], we search with [beta-1,beta]. n. Added in a directions[][] array. This array is used in swap.c when checking for x-ray pieces. Added AddXrayPiece() routine which is used in the static evaluator. o. Got rid of foundPV variable. It isn't really necessary. p. Don't flag mate score in ttable as exact score; they aren't. q. Change some (best >= alpha) code to (best > alpha) in Search(). What was I thinking of then!? Note: From this point on, changes within a release are labelled as a-z. This is also reflected in version.c Version 1.13 (1 Jan 98) Got rid of history.c. Killer is stored only if it is a beta cut. Fix bug in pawn eval for isolated pawns and passed pawns. Functions like ScoreDev & MATERIAL now return the score for side to move instead of score for white. This also fixed a bug in the null move condition whereby MATERIAL was only seen from white point of view when it should be from the side-to-move view. Got rid of SlowEval variable speeding up things quite a bit. GenAtaks() was NOT called in Evaluate(); this is now fixed. Version 1.12 (27 Dec 97) When a mate in n-ply is found, the search will never go deeper than n-2 ply. Fix some bugs in search.c. Mate scores in hashtables are now always flag as EXACTSCORE, fixing some bugs in mates. At ply 1, we now don't return the hash score if it is an exact score as we need to search the rest of the moves. In ttable.c, SANMove() should not be called as GenMoves(ply) was never called. This affected the debug code. Now algebraic moves are printed rather than SANMove for ttable debug code. Fix repetition code, now gmg1.ci/42 can be solved. In iterate.c, foundPV should be set to false when a research is being done. A Hashmv variable is used to store the move return from probing the hash table. This is use for move sorting. Version 1.11 (21 Nov 97) Nulls can be toggled on/off. Worstscore[] is now initialized to -100 instead of infinity. EvaluateDraw() is called after iterative deepening is over to see if the game is a draw. New routine ScoreDev() to calculate development separately; "show eval" command will print development score. Got rid of Developed[2] global variable. Some tweaking in search.c. The decision to print '&' or '+' for a PV is now in ShowLine(). Version 1.10 (29 Aug 96) KBBK with bishops of the same colour are now recognized as draws. Matescore now starts from 32767 instead of 9999. INFINITY extended to 32767. Added Ctrl-C trap so that the search will end instead of aborting the program. Originally the move returned by a hash probe is added to the history score. This is removed and the program show much improved pruning. Version 1.9 (17 Aug 96) Change the way check/recapture extensions are tested; previously check extensions only take place at <= Idepth*2. Now a total of Idepth+1 check extensions are allowed. For recapture, a total of 2 extensions are allowed. This makes the program search deeper. Fix bug whereby a promotion move (e.g. d8=Q or d8Q) was considered illegal if the opponent tried to enter it on the command line. Fixed a bug in the PVS search. Version 1.8 (12 Aug 96) A lot of leaf struct variables are converted to int, making the program slightly faster. Search extension for pushing pawns to 7th rank. The SANMove() code is now responsible for determining if a checking move is mate and adds the '#' sign accordingly. This is much cleaner. Added passed-pawn evaluations. Fix bug in eval.c where EnemyKing was wrongly initialized. Added KingSq[] array to help King stay in the corner. Added primitive development code; if bishops and knights are on original squares, penalize. Got rid of Material() and substitute a macro MATERIAL for speed. Version 1.7 (5 Aug 96) A nullhashcode was added so that a null move will change the HashKey (a bad bug!). Repetition code is now working correctly. The enpassant and castling hash codes are now 64 bit hash values instead of being bits in the HashKey. A lone king evaluator is added in. This allows the program to perform elementary mates. Got rid of FilterIllegalMoves() in search. Now all pseudo-legal moves are tried; they are immediately rejected if it is determined that they are illegal. An EvaluateDraw() routine is called early in the Search() and Quiesce(); if the position is a known draw (e.g. not enough mating material), no searching is done. A KBNK() mating routine is added; this seems to be working fine. Version 1.6 (2 Aug 96) When displaying the PV and the end is reached, see if the rest of the line can be found from the transposition table. The random number generator is taken from Knuth. FilterIllegalMoves is called to cull out illegal moves. This prunes enough branches such that it turns out to be a gain. Speeded up FilterIllegalMoves(). Converted board.ep to short rather than using a BitBoard. Also fast evaluation is done in Evaluate() rather than quiesce. Got rid of epsq variable in leaf structure; it wasn't needed as a board.ep already exists. A bug was introduced when the new random number generator was added; the top ten bits of the hashkey was being corrupted; this is now fixed. Speeded up null.c code and MakeMove() UnmakeMove() routines. Got rid of piececap in leaf{} structure; It has been integrated in the the leaf.flag variable. The leaf.f and leaf.t variable has been merged into the leaf.mv variable. Version 1.5 (29 Jul 96) Mate stored in the transposition table need to be offset by (+-ply). Pruning via killer moves has been improved. A new HistoryStore() is created for code dealing with history & killer. InChk and GenMoves() are no longer needed in quiesce(). All that work is the responsibility of the full-width search. Much improved pruning. The flag structure was replaced by an unsigned long. Got rid of the ExScore variable. Now all calls to Evaluate() will yield the exact score. Version 1.4 (19 Jul 96) Check for repetition in search (code currently not working). Added in transposition table code. Currently there is no rehashing done. The whole PV was returned to the top of the tree. Version 1.3 (16 Jul 96) For null moves, if the current material+pawn value is less than alpha, then we don't try the null move test. The reason is that since our position is already so poor, when playing a null move, our score is going to be less (unless the position is zugzwang). So its not going to be a beta-cut neither is it likely to improve alpha. This appears to reduce the nodecount. Added a flag.ended variable to the flag structure. When this is true, the game has ended and typing go will produce nothing. Version 1.2 (13 Jul 96) For sort captures, a recapture is always tried before another capture of the same value. This gives slightly better pruning. Material for white & black is updated incrementally in make/unmake move. This speeded up the program significantly. Stalemates are recognized during the search and a score of 0 is returned. Version 1.1 (19 Feb 96) Added in the NULL move heuristics. Currently the null move depth reduction is 2. Version 1.0 (17 Feb 96) (Chua Kong Sian) This version plays a legal game of chess. It supports all the special moves (en passant, castling and promotion/underpromotion). It uses the standard PVS search algorithm and incorporates the fail-soft alpha-beta enhancement which gives tighter alpha-beta bounds. All evaluations are only done at the end-points. Move ordering is by captures first and also history heuristics. gnuchess-6.2.2/po/000755 000766 000024 00000000000 12610434565 014577 5ustar00antoniostaff000000 000000 gnuchess-6.2.2/README000644 000766 000024 00000001404 12461115242 015030 0ustar00antoniostaff000000 000000 README of GNU Chess Copyright (C) 2001-2011 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. GNU Chess Project For latest information visit: http://www.gnu.org/software/chess/ See INSTALL for installation instructions. See doc directory for documentation. Mailing list: bug-gnu-chess@gnu.org - please use this list for all discussion: bug reports, enhancements, etc. - archived at: http://lists.gnu.org/pipermail/bug-gnu-chess - anyone is welcome to join the list; to do so, visit http://lists.gnu.org/mailman/listinfo/bug-gnu-chess Mailing list for announcements: info-gnu-chess@gnu.org gnuchess-6.2.2/src/000755 000766 000024 00000000000 12610434563 014746 5ustar00antoniostaff000000 000000 gnuchess-6.2.2/TODO000644 000766 000024 00000005722 12606677410 014662 0ustar00antoniostaff000000 000000 TODO of GNU Chess Copyright (C) 2001-2015 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. Items are in random order, mostly reverse chronological. * Clean and refurbish frontend new code: components.cc, engine.cc, etc. * Evaluate the possibility to include an option 'enable/disable bigboard', to show a bigger board. * Evaluate the possibility to include an option 'enable/disable coords', to show row and column numbers beside the board. Coordinates are already present in graphic mode. * Consider using readline: replace calls to read() in frontend/engine.cc by calls to get_line(), the latter defined as in v5.08. Useful examples in the package examples directory. Those based on rl_callback_read_char can be interesting. See also http://www.gnu.org/software/autoconf-archive/ax_lib_readline.html. * 'pgnsave' will not save a file identical to the original in a sequence pgnload-pgnsave. * 'manual' and 'force' are almost identical, except for the order they do things. See cmd.cc. * 'name ' forces output redirection to a log file. Comparing with version 5.08, some of the output is lost. * Report invalid move instead of segmentation fault for the following position: uci ucinewgame position startpos moves c2c4 g8f6 b1c3 c7c6 e2e4 d7d5 e4e5 f6e4 c3e4 d5e4 d1c2 c8f5 g1f3 e7e6 f3g1 f8c5 g2g4 e4e3 g4f5 e3f2 e1d1 f2g1Q h1g1 go wtime 298000 btime 300000 The problem is the 'Q' for queen in 'f2g1Q'. It must be a 'q'. This was reported by Igor Alelekov on 2014/06/29. * Consider adding resign and draw offer commands. * Add analysis tools for the evaluation function. * Commands white/black/switch don't work. They are supposed to be used for icsDrone. However, icsDrone reports to not work for GNU Chess 5.02. Neither for v6... * General cleanups: still some unused code from v5. * Implement the weak mode. * Improve compatibility with Chess Engine Communication Protocol. For instance, 'move e2e4' instead of 'My move is : e2e4'. * Add support for MS Windows. * icsdrone for Internet * 'pgnsave filename.pgn' will not replace filename.pgn, but will append to it. This is not supported by the PGN format. The file must be replaced, may be asking the user to confirm or deny, or a new file name must be requested. * When 'name NAME' is used, the log.nnn file is created, but it will miss to include some information compared with v5. * Consider using gnulib for better portability. * Include PolyGlot's book making capability. * Include PolyGlot's book merging capability. * GA/EC venture to make the chess engine stronger. * Get benefit from multiple-core processors, by sharing search across them. * End-game table * Bug: in FICS, after quiting in the middle of a game, logging in again, accepting resuming game as proposed by opponent, the opponent moved but GNU Chess never moved again. GNU Chess ran out of it. gnuchess-6.2.2/ylwrap000755 000766 000024 00000015312 12244054565 015430 0ustar00antoniostaff000000 000000 #! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2013-01-12.17; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . get_dirname () { case $1 in */*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';; # Otherwise, we want the empty string (not "."). esac } # guard FILE # ---------- # The CPP macro used to guard inclusion of FILE. guard () { printf '%s\n' "$1" \ | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g' \ -e 's/__*/_/g' } # quote_for_sed [STRING] # ---------------------- # Return STRING (or stdin) quoted to be used as a sed pattern. quote_for_sed () { case $# in 0) cat;; 1) printf '%s\n' "$1";; esac \ | sed -e 's|[][\\.*]|\\&|g' } case "$1" in '') echo "$0: No files given. Try '$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit $? ;; -v|--v*) echo "ylwrap $scriptversion" exit $? ;; esac # The input. input=$1 shift # We'll later need for a correct munging of "#line" directives. input_sub_rx=`get_dirname "$input" | quote_for_sed` case $input in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input=`pwd`/$input ;; esac input_rx=`get_dirname "$input" | quote_for_sed` # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot=false if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot=true fi # The parser itself, the first file, is the destination of the .y.c # rule in the Makefile. parser=$1 # A sed program to s/FROM/TO/g for all the FROM/TO so that, for # instance, we rename #include "y.tab.h" into #include "parse.h" # during the conversion from y.tab.c to parse.c. sed_fix_filenames= # Also rename header guards, as Bison 2.7 for instance uses its header # guard in its implementation file. sed_fix_header_guards= while test $# -ne 0; do if test x"$1" = x"--"; then shift break fi from=$1 # Handle y_tab.c and y_tab.h output by DOS if $y_tab_nodot; then case $from in "y.tab.c") from=y_tab.c;; "y.tab.h") from=y_tab.h;; esac fi shift to=$1 shift sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;" sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;" done # The program to run. prog=$1 shift # Make any relative path in $prog absolute. case $prog in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog=`pwd`/$prog ;; esac dirname=ylwrap$$ do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 mkdir $dirname || exit 1 cd $dirname case $# in 0) "$prog" "$input" ;; *) "$prog" "$@" "$input" ;; esac ret=$? if test $ret -eq 0; then for from in * do to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"` if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend '../'. case $to in [\\/]* | ?:[\\/]*) target=$to;; *) target=../$to;; esac # Do not overwrite unchanged header files to avoid useless # recompilations. Always update the parser itself: it is the # destination of the .y.c rule in the Makefile. Divert the # output of all other files to a temporary file so we can # compare them to existing versions. if test $from != $parser; then realtarget=$target target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'` fi # Munge "#line" or "#" directives. Don't let the resulting # debug information point at an absolute srcdir. Use the real # output file name, not yy.lex.c for instance. Adjust the # include guards too. sed -e "/^#/!b" \ -e "s|$input_rx|$input_sub_rx|" \ -e "$sed_fix_filenames" \ -e "$sed_fix_header_guards" \ "$from" >"$target" || ret=$? # Check whether files must be updated. if test "$from" != "$parser"; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$to is unchanged" rm -f "$target" else echo "updating $to" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the parser. This is a # blatant hack to let us support using "yacc -d". If -d is not # specified, don't fail when the header file is "missing". if test "$from" = "$parser"; then ret=1 fi fi done fi # Remove the directory. cd .. rm -rf $dirname exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: gnuchess-6.2.2/src/adapter/000755 000766 000024 00000000000 12610434563 016366 5ustar00antoniostaff000000 000000 gnuchess-6.2.2/src/components.cc000644 000766 000024 00000007270 12607036130 017442 0ustar00antoniostaff000000 000000 /* GNU Chess 6 - components.cc - Pipes shared across modules Copyright (c) 2001-2015 Free Software Foundation, Inc. GNU Chess is based on the two research programs Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Contact Info: bug-gnu-chess@gnu.org cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net */ #include #include #include #include #include #include "frontend/common.h" #include "components.h" extern unsigned int flags; /* Main loop of adapter */ namespace adapter { extern pthread_mutex_t adapter_init_mutex; extern pthread_cond_t adapter_init_cond; int main_adapter(int argc,char *argv[]); } /* Main loop of engine */ namespace engine { int main_engine(int argc,char *argv[]); } /* Adapter thread */ pthread_t adapter_thread; /* Engine thread */ pthread_t engine_thread; /* Pipes to communicate frontend and adapter */ int pipefd_f2a[2]; int pipefd_a2f[2]; /* Pipes to communicate adapter and engine */ int pipefd_a2e[2]; int pipefd_e2a[2]; /* * Entry point for the adapter thread */ void *adapter_func(void *arg) { /* Start engine */ InitEngine(); /* Start adapter main loop */ adapter::main_adapter( 0, 0 ); return 0; } /* * Starts the adapter (based on Polyglot 1.4) on a separate thread. */ void InitAdapter() { /* Create pipes to communicate frontend and adapter. */ if ( ( pipe( pipefd_f2a ) != 0 ) || ( pipe( pipefd_a2f ) != 0 ) ) { printf( "Error while creating pipes.\n" ); exit( 1 ); } pthread_mutex_init( &adapter::adapter_init_mutex, NULL ); pthread_cond_init( &adapter::adapter_init_cond, NULL ); /* Lock mutex before creating the adapter thread. Otherwise, it can happen * that the adapter thread locks the mutex before the main thread. In such a * case, the signal will be raised before the main thread can wait for it, * and the main thread will be waiting forever. */ pthread_mutex_lock( &adapter::adapter_init_mutex ); /* Start adapter thread */ pthread_create(&adapter_thread, NULL, adapter_func, NULL); /* Wait until the adapter is initialized and unlock mutex */ pthread_cond_wait( &adapter::adapter_init_cond, &adapter::adapter_init_mutex ); pthread_mutex_unlock( &adapter::adapter_init_mutex ); } /* * Entry point for the engine thread */ void *engine_func(void *arg) { /* Start engine main loop */ engine::main_engine( 0, 0 ); return 0; } /* * Starts the engine (based on Fruit 2.1) on a separate thread. */ void InitEngine() { /* Create pipes to communicate adapter and engine. */ if ( ( pipe( pipefd_a2e ) != 0 ) || ( pipe( pipefd_e2a ) != 0 ) ) { printf( "Error while creating pipes.\n" ); exit( 1 ); } /* Start engine thread */ pthread_create(&engine_thread, NULL, engine_func, NULL); } int SendToEngine( char msg[] ); void TerminateAdapterEngine() { if ( ! (flags & UCI ) ) { char data[9]; strcpy( data, "quit" ); SendToEngine( data ); } pthread_join( engine_thread, NULL ); if ( ! (flags & UCI ) ) { pthread_join( adapter_thread, NULL ); } } gnuchess-6.2.2/src/components.h000644 000766 000024 00000002770 12606163654 017317 0ustar00antoniostaff000000 000000 /* GNU Chess 6 - components.h - Pipes shared across modules Copyright (c) 2001-2015 Free Software Foundation, Inc. GNU Chess is based on the two research programs Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Contact Info: bug-gnu-chess@gnu.org cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net */ #include /* File descriptors for the pipes to be used to communicate frontend, adapter and engine */ extern int pipefd_f2a[2]; extern int pipefd_a2f[2]; extern int pipefd_a2e[2]; extern int pipefd_e2a[2]; /* Adapter thread */ extern pthread_t adapter_thread; /* * Entry point for the adapter thread */ void *adapter_func(void *arg); void *engine_func(void *arg); /* * Starts the adapter (based on Polyglot 1.4) on a separate thread. */ void InitAdapter(); void InitEngine(); void TerminateAdapterEngine(); gnuchess-6.2.2/src/config.h.in000644 000766 000024 00000012575 12606706432 017005 0ustar00antoniostaff000000 000000 /* src/config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS /* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework. */ #undef HAVE_CFLOCALECOPYCURRENT /* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework. */ #undef HAVE_CFPREFERENCESCOPYAPPVALUE /* Define if the GNU dcgettext() function is already present or preinstalled. */ #undef HAVE_DCGETTEXT /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define if you have the iconv() function and it works. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H /* Define to 1 if you have the `ncurses' library (-lncurses). */ #undef HAVE_LIBNCURSES /* Define to 1 if you have the `readline' library (-lreadline). */ #undef HAVE_LIBREADLINE /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define if you have POSIX threads libraries and header files. */ #undef HAVE_PTHREAD /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_HISTORY_H /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_READLINE_H /* Define to 1 if your system has a GNU libc compatible `realloc' function, and to 0 otherwise. */ #undef HAVE_REALLOC /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strcspn' function. */ #undef HAVE_STRCSPN /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to the necessary symbol if this constant uses a non-standard name on your system. */ #undef PTHREAD_CREATE_JOINABLE /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* The number of bytes in type char */ #undef SIZEOF_CHAR /* The number of bytes in type int */ #undef SIZEOF_INT /* The number of bytes in type long */ #undef SIZEOF_LONG /* The number of bytes in type short */ #undef SIZEOF_SHORT /* The number of bytes in type void* */ #undef SIZEOF_VOIDP /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Version number of package */ #undef VERSION /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to rpl_realloc if the replacement function should be used. */ #undef realloc /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to empty if the keyword `volatile' does not work. Warning: valid code using `volatile' can become incorrect without. Disable with care. */ #undef volatile gnuchess-6.2.2/src/engine/000755 000766 000024 00000000000 12610434563 016213 5ustar00antoniostaff000000 000000 gnuchess-6.2.2/src/frontend/000755 000766 000024 00000000000 12610434563 016565 5ustar00antoniostaff000000 000000 gnuchess-6.2.2/src/gnuchess.ini000644 000766 000024 00000000520 12365423377 017273 0ustar00antoniostaff000000 000000 [Adapter] Log = false # set to true for bug reports LogFile = adapter.log Resign = true ResignMoves = 1 # 1 is safe for Fruit Book = false BookFile = smallbook.bin [Engine] # standard UCI options Hash = 256 # in MB NalimovCache = 16 # in MB OwnBook = false # false for no book (e.g. Nunn-like matches) BookFile = smallbook.bin gnuchess-6.2.2/src/gnuchessu000755 000766 000024 00000001423 11546122712 016675 0ustar00antoniostaff000000 000000 #!/bin/sh # # Copyright (C) 2001-2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Start GNU Chess in UCI mode, i.e. to behave as a UCI chess engine. gnuchess --uci ${1+"$@"} gnuchess-6.2.2/src/gnuchessx000755 000766 000024 00000002023 11546122712 016675 0ustar00antoniostaff000000 000000 #!/bin/sh # # Copyright (C) 2001-2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Start GNU Chess, but have it use the xboard protocol. # This makes it easy for programs (like xboard) to simply invoke # "gnuchessx" and have it do the "right thing." # The final parameter is more complicated to work around a # bug in some old Unix-like systems; see the GNU autoconf documentation # for the rationale. gnuchess --xboard ${1+"$@"} gnuchess-6.2.2/src/main.cc000644 000766 000024 00000033072 12607036116 016204 0ustar00antoniostaff000000 000000 /* GNU Chess 6 - main.cc - entry point Copyright (c) 2001-2015 Free Software Foundation, Inc. GNU Chess is based on the two research programs Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Contact Info: bug-gnu-chess@gnu.org cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net */ #include "components.h" #include #include #include #include #include #include #include #include #include "frontend/common.h" #include "gettext.h" #define _(str) gettext (str) unsigned char lzArray[65536]; BitBoard BitPosArray[64]; BitBoard NotBitPosArray[64]; BitBoard MoveArray[8][64]; BitBoard Ray[64][8]; BitBoard FromToRay[64][64]; BitBoard RankBit[8]; BitBoard FileBit[8]; BitBoard Ataks[2][7]; BitBoard Rook00Atak[64][256]; BitBoard Rook90Atak[64][256]; BitBoard Bishop45Atak[64][256]; BitBoard Bishop315Atak[64][256]; short directions[64][64]; unsigned char BitCount[65536]; leaf Tree[MAXTREEDEPTH]; leaf *TreePtr[MAXPLYDEPTH]; GameRec Game[MAXGAMEDEPTH]; int GameCnt; int RealGameCnt; short RealSide; int computer; unsigned int flags; unsigned int preanalyze_flags; int cboard[64]; int Mvboard[64]; Board board; HashType hashcode[2][7][64]; HashType ephash[64]; HashType WKCastlehash; HashType WQCastlehash; HashType BKCastlehash; HashType BQCastlehash; HashType Sidehash; HashType HashKey; HashType PawnHashKey; int Game50; unsigned long GenCnt; char SANmv[SANSZ]; char id[32]; char solution[64]; float SearchTime; int MoveLimit[2]; float TimeLimit[2]; int TCMove; int TCinc; float TCTime; int phase; short bookfirstlast; short graphicmodeoutput; short pgnloaded = 0; int pgncnt = 0; char *progname; FILE *ofp; int myrating, opprating; char name[50]; int computerplays; /* Side computer is playing */ int n; /* Last mobility returned by CTL */ int ExchCnt[2]; /* How many exchanges? */ int slider[8] = { 0, 0, 0, 1, 1, 1, 0, 0 }; int Value[7] = { 0, ValueP, ValueN, ValueB, ValueR, ValueQ, ValueK}; int range[8] = { 0, 0, 0, 1, 1, 1, 0, 0 }; int ptype[2] = { pawn, bpawn }; char algbr[64][3] = { "a1", "b1", "c1", "d1", "e1", "f1", "g1", "h1", "a2", "b2", "c2", "d2", "e2", "f2", "g2", "h2", "a3", "b3", "c3", "d3", "e3", "f3", "g3", "h3", "a4", "b4", "c4", "d4", "e4", "f4", "g4", "h4", "a5", "b5", "c5", "d5", "e5", "f5", "g5", "h5", "a6", "b6", "c6", "d6", "e6", "f6", "g6", "h6", "a7", "b7", "c7", "d7", "e7", "f7", "g7", "h7", "a8", "b8", "c8", "d8", "e8", "f8", "g8", "h8" }; char algbrfile[9] = "abcdefgh"; char algbrrank[9] = "12345678"; char notation[8] = { " PNBRQK" }; char lnotation[8] = { " pnbrqk" }; short Shift00[64] = { 56, 56, 56, 56, 56, 56, 56, 56, 48, 48, 48, 48, 48, 48, 48, 48, 40, 40, 40, 40, 40, 40, 40, 40, 32, 32, 32, 32, 32, 32, 32, 32, 24, 24, 24, 24, 24, 24, 24, 24, 16, 16, 16, 16, 16, 16, 16, 16, 8, 8, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0 }; int r90[64] = { A8, A7, A6, A5, A4, A3, A2, A1, B8, B7, B6, B5, B4, B3, B2, B1, C8, C7, C6, C5, C4, C3, C2, C1, D8, D7, D6, D5, D4, D3, D2, D1, E8, E7, E6, E5, E4, E3, E2, E1, F8, F7, F6, F5, F4, F3, F2, F1, G8, G7, G6, G5, G4, G3, G2, G1, H8, H7, H6, H5, H4, H3, H2, H1 }; short Shift90[64] = { 0, 8, 16, 24, 32, 40, 48, 56, 0, 8, 16, 24, 32, 40, 48, 56, 0, 8, 16, 24, 32, 40, 48, 56, 0, 8, 16, 24, 32, 40, 48, 56, 0, 8, 16, 24, 32, 40, 48, 56, 0, 8, 16, 24, 32, 40, 48, 56, 0, 8, 16, 24, 32, 40, 48, 56, 0, 8, 16, 24, 32, 40, 48, 56 }; int r45[64] = { E4, F3, H2, C2, G1, D1, B1, A1, E5, F4, G3, A3, D2, H1, E1, C1, D6, F5, G4, H3, B3, E2, A2, F1, B7, E6, G5, H4, A4, C3, F2, B2, G7, C7, F6, H5, A5, B4, D3, G2, C8, H7, D7, G6, A6, B5, C4, E3, F8, D8, A8, E7, H6, B6, C5, D4, H8, G8, E8, B8, F7, A7, C6, D5 }; short Shift45[64] = { 28, 36, 43, 49, 54, 58, 61, 63, 21, 28, 36, 43, 49, 54, 58, 61, 15, 21, 28, 36, 43, 49, 54, 58, 10, 15, 21, 28, 36, 43, 49, 54, 6, 10, 15, 21, 28, 36, 43, 49, 3, 6, 10, 15, 21, 28, 36, 43, 1, 3, 6, 10, 15, 21, 28, 36, 0, 1, 3, 6, 10, 15, 21, 28 }; int Mask45[64] = { 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x03, 0x01, 0x7F, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x03, 0x3F, 0x7F, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x1F, 0x3F, 0x7F, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF, 0x7F, 0x3F, 0x1F, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF, 0x7F, 0x3F, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF, 0x7F, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF }; int r315[64] = { A1, C1, F1, B2, G2, E3, D4, D5, B1, E1, A2, F2, D3, C4, C5, C6, D1, H1, E2, C3, B4, B5, B6, A7, G1, D2, B3, A4, A5, A6, H6, F7, C2, A3, H3, H4, H5, G6, E7, B8, H2, G3, G4, G5, F6, D7, A8, E8, F3, F4, F5, E6, C7, H7, D8, G8, E4, E5, D6, B7, G7, C8, F8, H8 }; short Shift315[64] = { 63, 61, 58, 54, 49, 43, 36, 28, 61, 58, 54, 49, 43, 36, 28, 21, 58, 54, 49, 43, 36, 28, 21, 15, 54, 49, 43, 36, 28, 21, 15, 10, 49, 43, 36, 28, 21, 15, 10, 6, 43, 36, 28, 21, 15, 10, 6, 3, 36, 28, 21, 15, 10, 6, 3, 1, 28, 21, 15, 10, 6, 3, 1, 0 }; int Mask315[64] = { 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF, 0x7F, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF, 0x7F, 0x3F, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF, 0x7F, 0x3F, 0x1F, 0x1F, 0x3F, 0x7F, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x3F, 0x7F, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x7F, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x03, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x03, 0x01 }; extern char userinputbuf[]; int main (int argc, char *argv[]) { int i; /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); #if ENABLE_NLS /* Set the text message domain. */ bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); #endif /* * Parse command line arguments conforming with getopt_long syntax * Note: we have to support "xboard" and "post" as bare strings * for backward compatibility. */ int c; int opt_help = 0, opt_version = 0, opt_post = 0, opt_xboard = 0, opt_memory = 0, opt_easy = 0, opt_manual = 0, opt_quiet = 0, opt_uci = 0, opt_graphic = 0; char opt_addbook[MAXSTR+1] = ""; char *endptr; /*disable graphic output by default */ graphicmodeoutput = 0; progname = argv[0]; /* Save in global for cmd_usage */ while (1) { static struct option long_options[] = { {"memory", 1, 0, 'M'}, {"version", 0, 0, 'v'}, {"quiet", 0, 0, 'q'}, {"silent", 0, 0, 'q'}, {"help", 0, 0, 'h'}, {"xboard", 0, 0, 'x'}, {"post", 0, 0, 'p'}, {"easy", 0, 0, 'e'}, {"manual", 0, 0, 'm'}, {"uci", 0, 0, 'u'}, {"addbook", 1, 0, 'a'}, {"graphic", 0, 0, 'g'}, {0, 0, 0, 0} }; /* getopt_long stores the option index here. */ int option_index = 0; c = getopt_long (argc, argv, "qehmpvxgM:ua:", long_options, &option_index); /* Detect the end of the options. */ if (c == -1) break; /* * Options with a straight flag, could use getoopt_long * flag setting but this is more "obvious" and easier to * modify. */ switch (c) { case 'v': opt_version = 1; break; case 'h': opt_help = 1; break; case 'q': opt_quiet = 1; break; case 'x': opt_xboard = 1; break; case 'p': opt_post = 1; break; case 'e': opt_easy = 1; break; case 'g': opt_graphic = 1; break; case 'm': opt_manual = 1; break; case 'M': if ( optarg == NULL ){ /* we have error such as two -M */ opt_help = 1; break; } errno = 0; /* zero error indicator */ opt_memory = strtol (optarg, &endptr, 10); if ( errno != 0 || *endptr != '\0' ){ printf(_("Memory out of Range or Invalid\n")); return(1); } break; case '?': /* On error give help - getopt does a basic message. */ opt_help = 1; break; case 'u': opt_uci = 1; break; case 'a': if ( optarg == NULL ){ /* we have error such as two -a */ opt_help = 1; break; } errno = 0; /* zero error indicator */ if ( strlen( optarg ) > MAXSTR ) { printf( _("File name is too long (max = %d)\n"), MAXSTR ); return(1); } strcpy( opt_addbook, optarg ); break; default: puts (_("Option Processing Failed\n")); abort(); } } /* end of getopt_long style parsing */ /* Initialize random number generator */ srand((unsigned int) time(NULL)); /* initialize control flags */ flags = ULL(0); /* output for thinking */ ofp = stdout; /* Handle old style command line options */ if (argc > 1) { for (i = 0; i < argc; i++) { if (strcmp(argv[i],"xboard") == 0) { SET (flags, XBOARD); } else if (strcmp(argv[i],"post") == 0) { SET (flags, POST); } } } if (opt_xboard == 1) SET (flags, XBOARD); if (opt_uci == 1) SET (flags, UCI); if (opt_post == 1) { SET (flags, POST); } if (opt_manual ==1) SET (flags, MANUAL); cmd_version(); /* If the version option was specified we can exit here */ if (opt_version == 1) return(0); /* Startup output */ if ( !( flags & XBOARD ) && ( !opt_quiet ) && ( !opt_uci) ) { printf ( _("\ Copyright (C) %s Free Software Foundation, Inc.\n\ License GPLv3+: GNU GPL version 3 or later \n\ This is free software: you are free to change and redistribute it.\n\ There is NO WARRANTY, to the extent permitted by law.\n"), "2015" ); } /* If a usage statement is required output it here */ if (opt_help == 1){ cmd_usage(); return (1); /* Maybe an error if due to bad arguments. */ } dbg_open(NULL); if ( opt_memory != 0 ) ; /* TODO: to be removed - this is handled by the adapter */ Initialize (); InitFrontend(); if ( ! (flags & UCI ) ) { /* Initialize the adapter, which in turn initializes the engine */ InitAdapter(); } else { /* Initialize the engine only; no adapter */ InitEngine(); } /* Compile book if the addbook option was specified. Ignore any other options. */ if ( strlen( opt_addbook ) > 0 ) { char data[9+MAXSTR+1+4]=""; sprintf( data, "book add %s\nquit", opt_addbook ); SendToEngine( data ); } if ( opt_easy == 0 ) SET (flags, HARD); else { char data[9]; strcpy( data, "easy" ); SendToEngine( data ); } if ( opt_memory > 0 ) { char data[20]; sprintf( data, "memory %d", opt_memory ); SendToEngine( data ); } if (opt_post == 1) { SET (flags, POST); char data[9]; strcpy( data, "post" ); SendToEngine( data ); } if (opt_manual == 1) { SET (flags, MANUAL); char data[9]; strcpy( data, "force" ); SendToEngine( data ); } if (argc > 1) { for (i = 0; i < argc; i++) { if (strcmp(argv[i],"xboard") == 0) { SET (flags, XBOARD); } else if (strcmp(argv[i],"post") == 0) { SET (flags, POST); } } if ( opt_graphic == 1) { graphicmodeoutput = 1; } } bookfirstlast = 3; /* While not quit * If user input buffer not empty * Read next line from user input buffer * Process user input at front-end level * If user input must be passed to engine * Send user input to engine * If engine input buffer not empty * Read next line from engine input buffer * Process engine input at front-end level * Send user input to user (print on term) * If engine input must be passed to user * If user input is ready for reading (select) * Add user input to user input buffer * If engine input is ready for reading (select) * Add engine input to engine input buffer */ //usleep(3000); /* So that Polyglot's and Fruit's banner has enough time to be displayed */ //strcpy( userinputbuf, "protover 2\n" ); while (!(flags & QUIT)) { if ( flags & UCI ) { /* In UCI mode, just forward input/output to/from engine - no adapter */ ForwardUserInputToEngine(); ForwardEngineOutputToUser(); } else { /* Classical GNU Chess mode */ /* Prompt the user, if neither in xboard nor uci mode */ ShowPrompt(); /* Check if there is a new command from the user */ NextUserCmd(); /* Show thinking message */ if ((flags & THINK) && !(flags & MANUAL) && !(flags & ENDED)) { if (!(flags & XBOARD)) printf(_("Thinking...\n")); CLEAR (flags, THINK); } /* Check if there is a new command from the engine */ NextEngineCmd(); /* Check if user input ready for reading. If so, store it in a buffer. */ ReadFromUser(); /* Check if engine input ready for reading. If so, store it in a buffer. */ ReadFromEngine(); } /* Avoid using 100% CPU */ usleep(100); } dbg_close(); /* Termintate adapter and engine threads and join them */ TerminateAdapterEngine(); return (0); } gnuchess-6.2.2/src/Makefile.am000644 000766 000024 00000002727 12607036151 017007 0ustar00antoniostaff000000 000000 # Process this file with automake to produce Makefile.in # Makefile for gnuchess/src. # # Copyright (C) 2001-2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . bin_SCRIPTS = gnuchessx gnuchessu bin_PROGRAMS = gnuchess gnuchess_SOURCES = main.cc components.cc components.h AM_CXXFLAGS = $(PTHREAD_CXXFLAGS) AM_LDFLAGS = $(PTHREAD_LDFLAGS) $(PTHREAD_LIBS) localedir = $(datadir)/locale AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_builddir)/lib DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ DISTCLEANFILES = *~ SUBDIRS = frontend adapter engine gnuchess_LDADD = $(LIBINTL) frontend/libfrontend.a adapter/libadapter.a engine/libengine.a configmake.h: Makefile rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ echo '#define PKGDATADIR "$(pkgdatadir)"'; \ } | sed '/""/d' > $@-t mv $@-t $@ BUILT_SOURCES = configmake.h CLEANFILES = configmake.h configmake.h-t gnuchess-6.2.2/src/Makefile.in000644 000766 000024 00000067042 12610427553 017025 0ustar00antoniostaff000000 000000 # Makefile.in generated by automake 1.14 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Process this file with automake to produce Makefile.in # Makefile for gnuchess/src. # # Copyright (C) 2001-2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = gnuchess$(EXEEXT) subdir = src DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/config.h.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_gnuchess_OBJECTS = main.$(OBJEXT) components.$(OBJEXT) gnuchess_OBJECTS = $(am_gnuchess_OBJECTS) am__DEPENDENCIES_1 = gnuchess_DEPENDENCIES = $(am__DEPENDENCIES_1) frontend/libfrontend.a \ adapter/libadapter.a engine/libengine.a am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } SCRIPTS = $(bin_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(gnuchess_SOURCES) DIST_SOURCES = $(gnuchess_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HELP2MAN = @HELP2MAN@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGINSDIR = @PLUGINSDIR@ POSUB = @POSUB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXXFLAGS = @PTHREAD_CXXFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = $(datadir)/locale localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ bin_SCRIPTS = gnuchessx gnuchessu gnuchess_SOURCES = main.cc components.cc components.h AM_CXXFLAGS = $(PTHREAD_CXXFLAGS) AM_LDFLAGS = $(PTHREAD_LDFLAGS) $(PTHREAD_LIBS) AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_builddir)/lib DISTCLEANFILES = *~ SUBDIRS = frontend adapter engine gnuchess_LDADD = $(LIBINTL) frontend/libfrontend.a adapter/libadapter.a engine/libengine.a BUILT_SOURCES = configmake.h CLEANFILES = configmake.h configmake.h-t all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .cc .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) gnuchess$(EXEEXT): $(gnuchess_OBJECTS) $(gnuchess_DEPENDENCIES) $(EXTRA_gnuchess_DEPENDENCIES) @rm -f gnuchess$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(gnuchess_OBJECTS) $(gnuchess_LDADD) $(LIBS) install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/components.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(PROGRAMS) $(SCRIPTS) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-binSCRIPTS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS .MAKE: $(am__recursive_targets) all check install install-am \ install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-binPROGRAMS clean-generic cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-hdr distclean-tags distdir dvi dvi-am html html-am \ info info-am install install-am install-binPROGRAMS \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-binSCRIPTS configmake.h: Makefile rm -f $@-t $@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ echo '#define PKGDATADIR "$(pkgdatadir)"'; \ } | sed '/""/d' > $@-t mv $@-t $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: gnuchess-6.2.2/src/smallbook.bin000644 000766 000024 00000113421 12204703034 017414 0ustar00antoniostaff000000 000000 •µÜß(ìPK?yJÛgºœâŽŸ§DgºœâŽŸ§’Á’Õ¸$3 ¢cÓJ„Þ ®±ûV@„ù? ÈÙÆè<óÏås}¢Ê4šÏås}¢Ê4Rò_JXJ}K÷áÞöš‚SJ§0‡äuä êbª¯]úušb;©ïvéb;©ïvé–k¨sÄ´æµ¶zëG …Ï…in ¦¥Ãk4œ“¥Ãk4œ‘Óî܇~öPämîÂî s+…PqÊ3)D+Ø3ž¥‰ w-‚<5.ûT¬BuL˜‘8Ý -WRFf^±# ïWRFf^±#³–”жà©Þ¦×kxDjÞ¦×kxDsÞ¦×kxD ¢Þ¦×kxD ªæÍÜØÚ[ )YgI×ÂÑ6!s]ÐXÁ?mãu¨üIotv‚¾Æ8t?„a±ÂDñu ,P„a±ÂDñu ®„a±ÂDñu ¢ „a±ÂDñu ã„a±ÂDñu ë‹ã=ÝϸÑ ‘U0sÜâAZ°·ò:wÉÓ $ïŸ^ƒaKv n ùÆzMws;Òþ>ß/àY;/Š0a’…îêR¦-¶Þ}ɾõšñç +mצâ÷)´Ÿ‡Õ•è|{êGÈ?©>¥Óê°WèƒÄp…ºWR èƒÄp…ºWN5nµž˜:ÚP¦Ùúm¥d›¦›ŒŸøš.d›¦›ŒŸø•d›¦›ŒŸø¦‚]¿‹‹›ç5ÂLžGÛí`k4T|òðKxŒ5tð2-ƒH¸"lŸ¼­V¹DaŰ# ˜ÑÈ–âä , §îC&t­³6óŒ`¬¦ ÆNø©<”Ê»¹è‰€Û m í°Š€ ·?51ÇïZ’"I‹Û$2¯ØSÊ@æ+µ­±l¢ô‡ÈN|ª©V½Œ”Û„ÆÌ:”¶Èøé*ðR Ä~ê{!ŽÕÛgÄ~ê{!ŽÕa%Ä~ê{!ŽÕ’ Ä~ê{!ŽÕRÊ/¹—øá'ßèØ³cáË*a󑫨„•§ ,/ÀaƒÍëLWÛý°ŸÕd£WÛý°ŸÕd¦i;n’ é š©hã}¼Â  d¤°ì±ú¬1­'”?JÛ¯ƒ´ú„Ö×Ò« ƒ‘*%PB÷Äc £@øD²"2Ãaß+¹Ðü•y4¹ËOZà’®po'ôG/Yà6áEɇŸjåß|j¦EU ë26{áËD5Xúâ£Ó‡–5Xúâ£Ó‡š=ém¯CçD•=ém¯CçDRH+6ûoRdÁ³ ;m;RåÈçM* ¢éÄçOÊ-.Rî—x¤òÆv÷U#_øØËËU w £ËU w #?@ÿiô?@ÿi !ëÖ^ð‰A’Z13Ò?ª¦Zñ¼¯Û )šÔø¦IÒ[³»Sm-ƒÚ´ŽaÜÁ IÏÚ..t™Ëg6¡¶ý ë±$]«(C(œ±$]«(C(ʶP9¿‹a{jï—šC2hû³Hü~’3)PHü~’3) ­}@0QÁy #~&?À«8b ~&?À«8­žJ‹FX*–¥;xáŽrn a­ ÑÌÿ¤ú äÜ£!Rþ»×Z"¤†F…“s8ø íF›—gcfZ})qÒÓfc}Év‘¸¥öÔõ&?[bØÔ‰FªƒýZï‘8ÀøÈ;×û´ýKòè aT%ÿöÏo6t.ÌV£ÛÆ7Âuª*\+ò¤óiR““ ‰úwFȶ  ™žè­—tÚl55R$Úl55’Úl55•@åe¬zQ  i_ˆðöåí eä¾l¢—륺Úq(K€ \ ºÚq(K€ ãºÚq(K€ ,ºÚq(K€ ®ÄOCR‘íû ëÄOCR‘íû?Ôø|J¿V?jµÄó/ÏL¡Ý f.Á]RµP†wW~šÕbê@(0vDÜ!Ð>2ö äÞÉ@– bô 'ÛQ…NÒ +©\¢Ÿd a‹zzî’ ‰³ »ªM¶­ ™™&¹N©t ¹hÂaÎÒ \ Á*¾fº  ÂÌ^h>õ‡Ra!êµnÆ–!êµnÆ!BÍar!'_A6ÊÊt ^!-Çω²º–N!4@D¦J•ïž!:)Ùeí!AUòÄoÞ¦­!^Ðý8óú Ÿ!^Ðý8óú ­!|™%YS° ï!ˆ >}±êsä!¶›¡C @W s!Ä»[ä=C!×VÒû·IR!û˜/nÀ«–!û˜/nÀ«Û".T»{Y"Zy+Ë€c&9"^ÊñLɸ© £"«à:Ù¨Ìk"­hrÏþ˜ˆò"´àRñ«•9"´àRñ«R7"´àRñ«–"Îõ ÓŒÿ×#\ýCxn (#t„¾çsC“#t„¾çsC‘# š,è-!ys#¬Zg.ÅÐR #¬Zg.ÅÐÛ#¬Zg.ÅÐ#¬Zg.ÅЖ#­wT”k1ƒã#çŠváÏ›Ó#ù¢– ,$é0¥ÑÔÃâ$6‰U ªV±Û$i™ôô²¦$•¬;`W, ,$«˜Ž&ª]Ê–$²–î¨aÆz $Å#]]Ûþ a$â‚[·@¶ã ¢$â‚[·@¶ãt% ’ÂF™ìÛ%]n“Zd/R;%]n“Zd/U%]n“Zd/S%ro¢›šd ´%Žâ™mê}b%©žoÚÚ#C ¢%ðC´;*ªÀÜ%õ +…@›Æ Z&†‚&Â1DÉ[ &«æŽbvÆ` X&­kØoqÌ&ê>×Сô–'aZ.OÜ'aZ.OÜ’'aZ.OÜÓ'aZ.OÜ× 'aZ.OÜÛ'¯EµV ® '¯EµV ,'¯EµV­'Ð]Ñëy¥U 'Ð]Ñëy¥ã'+:b ë:µR',TkwQÍa 1'"£*8)ÑC²ì€ä••)ÒØ:%— Q’)Ø0‡Ùq«Y)âá¸-KL×* èsצ³j*)EnC¸š7N*8Ymò<+Ò2*p9ãçY ç+â5m›i+ØR¯þê©+V8ë·“Ë­+j ÿÿ%eÆÛ+x–>æ/=ÇÌ+…Ú&È=ý¬¨+!¼¶(ž+”¦‡ÊÃj$ +¬¯zÝ8è™?,_éN¼9,(.Wf ,?£Ç—B+K,B<\¢ˆQ,iØ’ªÙ\æ•,iØ’ªÙ\æR,iØ’ªÙ\æ–,jeÜ A¸öv,oq2Û'<|Ü,tQ<£,‚€·{&ÚZ,‹BúrQR,•VQµ¢| ›,•VQµ¢| ë,Ô^×ûSë #,Ô^×ûSëã-,@ör,™-SvñŸÑ·D-„€è¡1:­-¼ŒíûF¦7?C-¼ŒíûF¦7 ë.`»°F÷Bì2.fؾHEäL.ªýöût—’.ªýöût—].Ú˜[§Þ ç/&@zdV´/&.¸³”‰?/«Õãÿw²0š™œæo^Û0ÇëM.Ó0 ® 9­×r)÷9пáRr$R9Ô¦c² Ûd9𲇫ÀÅ$:Q_Ž0×Ý (:[SBÓ§õ.:[zFz1  :ze5|¾»:º£0˜:>6ú$#;Ðó¶°¬ ã;oÕhÔl– £;}Á×Á… ßj;ˆ—~R•gßK;Â= ;¥‚;Ç>IÇ|Šð£ ;ÞK ¦h_” ï<6£KmóX=nn~^/Í ­>J“k´Lt–>L쩱Ͻ í>` ¼6c²ñ$>”‘CÎ ä>¯œ~âþš>Ï•E¤ul’ >ÐÁÂe5 £>ïñ´]â[F -? D2ªV§??×íí›/ n?-²ÔqÈ´?uhNq bá?uhNq bê?|“ðöéN?‹OƒK*,’Y?-NóâL•?™îán÷Ì+ž@bH©Á+vÓ @,²n=eÅä@`vÆ{¯­R@`vÆ{¯­–@ˆ|JÚO7oÛ@ƒNAÈJ@'Ó’:ê®Ó @­0D8°‰iZ@ÒcfÄïg×@åþ_ùoljAm ΘþËAß{ÓÖçbAß{ÓÖç­AYšSwP'NAg'ÿG¬¸ lAvD|ëáè#’A˜Ûñí¨?A®—ǹòšpçAé‘ETØ!Eç’¥ $EoH»‰´Xy ›EtcüÅfl½EÆ[C?j Eå@œ­jÔ>RF î1•`§KF$Sj܈ˆF9’K ~§Ã*ÙiK ~§Ã*ÙRK ~§Ã*ÙUK ~§Ã*ÙhKÃwù:ªœãKÏþƒ"Š{ˆKäÀgDƒG” KäÀgDƒGÑKìð_3‹^ ãL;âžì[êÛL°ã#&x5M]L¾·jíïð£LÂe¶†å[LݶCŒš±Lñ[¡LüÒÄLýªtþ¤ð¨aMeãÈÅ;1eËMeïdNÀ ÕMy~´àYekMy~´àYe8M n‹/8°£M¼ òû‡¼)Mûd³º!´I \NÝúH±wôN[Š€Áb?NbØÛPqÝÍ (NºÍ’ú˜×}QN¾á뉣BNÁ·-µáß]NßÊ\>ç ëO+³{UÊ<°´O14Ÿ38ð|ëO8õs¥( ¢OXü Dб­Oƒ|}ªÌ0yYOŽ`}Z ´OÓr¨!Â?ãOæW’Ã/SvOò;æ3Žm¦Oú@ˆ…ªßP{ÌñIK0P{ÌñIRP{ÌñI$P{ÌñI#P&bÜ秃 ËP6ÜÔν µÛPUŽê6nUÕP\•ñåj\>ÚP—;!ѽÄk P°¹HÉõYˆPÄY¯@ð}•Q„skZª1Q$7Mãæƒ^Q.e¸ì£µdQ\ÈSɪç ,Qm]t—Q†ýªÀXQ†ýªÀX‹Q‘i"©¢¤ðaQΙÂþo@Z ãQΙÂþo@Z ë R)]¾[® ‹ ®R3ÖŸ"¢C¼Œ R<û¨'pŽa”RNšÑ?lºR¤Èæ_ž ( R¥%ñ~_îÑR©P«O˜Œg \Rµ ŒÃùš Ré”çuNŽ] ëS3š&l4t° £SG¥æ¿Sd×ë*‹ PSuÁ¦¯ÿ[RSˆèLˆOL­S¡o'š ´KSÜ8Í绚SÜ8Íç»T(ˆÙí¡T±g]v™^£T%‰"XXÏ€ÊT?'2ü›a]TB1o&¹ù\TdþA°Ëü)?TdþA°Ëü) \T—};”ÖYTÃcé­;O ,jTÃcé­;O ®2TÃcé­;O ¢*U'vÆ„mU" (U1 ûwüù‘ ªUŽT"?ƒxU’B+€æã–U Í ¾í< U»˽~q† ïU¼7[°Ù· TUã ?5ã)u'Uøe-]Om8Uøe-]Om8$Uú@|Ï@qjV%H{ÄŸ#8RV)S„.èÇ‹V1JÜusN âVZÃ|‘OzXžVõS?¹Û V¢?åµ½ôÓaV»:ª h aWHü¦°l¯$ ïWt3­'þ” , Wt3­'þ” ãWt3­'þ”jWŒ”! sW”½^íÞâó ·W»jÒ™¸ôÎÊ WãµtíÒk X"¦d}ý½{ß XA=°Š½Ú• XA=°Š½Ú Xp‹&‹{ ¢ X‰¤zµæ¡ cY(Á:±¹ ãY(Á:±¹ iY%t’.¦óû¨ Y%t’.¦óû±Y(SŸVœ¨˜”Y* kWS'ëv Y0¿Ž—£®òYY'þްŠ[Yƒù®våX)LYœç(ÂââM›Y®õ¹>0Ú2 Yöœ õw–dZDü̱½ÇYZV˜/ Æ m •Z‹åi‡LóvšZ‹åi‡LóvçZµÀ›ÊOéZà×"G“Œ<Zç!ÿÎ t [(Ôuüæ•[>dŸo1é[>ÖöyJ S[Jí§NÍ=„[P3œ1`Và ä[P3œ1`VÞ[P3œ1`Và ®[WÌ‘cÊ4ß \ [ÃT\\Ñ7Í a[äËàF̓¯ â[íp#çgÔ ¢[û™­¦rž[û™­¦rj[û™­¦r ª\»Ó°(±›\(zx,読\)òZê*]{\IÚ䯹gâ•\IÚ䯹gâ¦\]3J®Œ—Õ #\xŸÉÈT:£\žÚOCtD\¢ó,B¼ni j\¦Œ×¹–Þ*L \¦Œ×¹–Þ*×\Ëõ|lÎìv\ëÅÈ@ ^ ï]!ÊÚ•™”]:»-<ËU •]WšlíÁÁÏ Ÿ]Œô rQM]æ[GI3Gà^Y’e‘X/^"Y ”<)O:^F~]Š3uÑŒ^i·(û›Ø1^“ÍF^«¥K^›ŸGIüFï• ^œÑ½<|Ë—±^§š[± ådh^ÏÇNwª{ ›^î> bΦš_ ¢õç×?_ â%~ˆ _A2}”• ~_n£iÀÑ[< _œ—ÐÝ帳_øo{vyk`*¯Cr³-„ å`O?zöYº)R `yE÷š]ºK`ëOFp na\ç¼8 ¢£a_€у¹%au3s€.Jd a61tЏ)aƒj”ßÞ×eaƒj”ßÞ×e <a«²têÿÐr?aÐÃ%½ÆùŽž b†r«QS ãb†r«QS­b„cš°¦õ–b„cš°¦õ]bÁÍ uQZbÒ„ j²ßìÜbÜâùNàÜ?bæ/ÈhÏï ®bæ/ÈhÏï $cO~hÇÙ_Z c úC÷dš cüª ×ÃÀœc )̨½E6 ,c )̨½E6ÚcIꎴ)Wac‘{çv)6›c»|äƒýQcÝ >fßcìsª”îv‡cþ€\éQe ¢dÎ) z†lsd£ÞíYC[d7—¯??dMJþVJ땃dMJþVJëR+dMJþVJë’dUÿ W®n«#d{k)ÜM¯ Úd›\»ÜíJô ëd›\»ÜíJô­d›\»ÜíJôòd›\»ÜíJô (dŸ4®»?¬¦›d£®„N4ªð¬d¨&u€ûÔ¿ jdÜ;š°Ò†4’e ™ùý‘V ¥eAåF‚ e+n*&ô:Ze>õ7"ŸtœÛeP42µûa?e|J‹,”©”e}¬G‚îųfMJ¬D· ë f­ÎúÄÈ9vf5c&^u숱f>¶h­“ò ef?áG<ì JjfŒS«QeNf¯C˜‚衲 ›f¶ëþ#ÂhމfúÀŽLB‚Œ eg;¿ 3Ýwv±gW^€h%:jŒgd©;å\œ Ùgiõ<¾C¡ ,g‹TKm,ª¿ gŒú¸K´dságœ}ì Ö £gÂdÜ«*hhÿ¤^cÌ$ht£, 7×$ht£, 7Ûh‡s´Œ£–h ä«!›n°9h¾ê‹aR¡h¾ê‹aR•hÍ(@ ÛÒhÕ u–›)KShÛ"¼`:³ ëhùâILË"Ø i«¶'”z 2i"–ËwG^ßiè„ÜÑ¿ ,i.]¥ÿbY i.]¥ÿb±i6póY×ÌÙii)¨ëˆ/@tiŸ­µCvÝÙiÖ/;~ Q›iä&£È* ¢iÿÝÀHcª2 iiÿÝÀHcª2 ãj‘'e¿Y$ ,j)¡w|OY›j4Û!½×UjNó[S–@ çja%k:†”Ô $ja%k:†”Ô ¢ja%k:†”Ô ,ja%k:†”Ô ãjf®tŸò{ ëj|pE·äAw¬j„BéÚdsj¨phðrD#tjºêé|×C••jºêé|×C•šjºêé|×C•jÆPn…¿ª›jÝ-YöF$¤ ãjÝ-YöF$¤ $jÝ-YöF$¤­k_Ã?¦9™škS†§6Ç0R kS†§6Ç0’kS†§6Ç0Kkl éÐB ÞkˆÈ †žÓÝÛ1k«ÿÒK7ÎHTk÷'2F·o­l)Á ¶ð elTS[{1šŒl†º7&¬w•­lŠ ×~ݦ•[lib‡Í5+vl•ËÖ1Q&d lÅy,ÖGÇšdlÙõ=È;ÕÕÃlê™LÅÖel ¢ lê™LÅÖelsm#øõ&=R m&v«×C ªm7]ÌÞCP) ²mH¸-o –ÃmЍ<‰¥vXm‹<ÈMvv em¡ 6 CMZnýøï?¤ \n„B§ʺ gn&M _ÜöuNnT±Bóƒá]nUEK£ß¡ !nl²Þ‚qÓ‹nˆ9`£t› \nˆ9`£t›bn“t}Ö/x snµÚ°BödÔNnµæeY*þkn»L Ôç^Ò•nÐ!*PG% 5nêíCHíØ®›o¨¢d,¸Ro=×N¯ŽJ)NoLP³×"“Kok‹ðXoã´ovi¶$«ß®ov|qšÖ¿ co°¬R“ÛêK?o²¯ ¿Eo¸¸€Ô·5Û oåÒzj‰‡.^oæìîÔˆ&;#oøôƒçìЦ oøôƒç슔pì‡XóòŠpOyÏxëz ýpP·ÌªÚ¦\ $pU\æpº¯ ,p‡£âL¬Œ¶ñp¤C~‹¨˜ ¤p¸ »MÒ]¦(p¸ »MÒ]”p¸ »MÒ]Zp¸ »MÒ]–q6à]m eqO¬Ì§}Q qO¬Ì§}Kq]†.ס0'ÜqdÆîC· $q”!„*At aq”'~ŸÉ§æ¥q©nǹT;q·i1ÊüRdqÆ÷Ìí{Ö ßqï#ùŽÀtSrw<Ì–– r<µbc&?rMìšYZw¼sr‹> WF¼þ r”™{þ,²Y&sF9,Uw•sLOÆÕ%?s"ÒÐEôŽ ™s(G^Bú>]ÛsPÏW{%ßsYS»i ÒjsY\uŠÙÍÞsœ:‚fO›s¤¡^“eµù£ s¤¡^“eµù ­s¯U‘G-ìD sóµO@7”´s÷ÔW jtmÊVéÝ tñÛ:Ô{]³t~ æð=ÛtŠPìþÒ¬t™0fÖ(ií jt™YGÚ®~ t´©‘æÃÄÛtë)µøêÛtë)µøêštë)µøêu )>&ÖŸ®³u&@ÔäÇH -u7Ër{4¸Æ£u;û)h²q ïuQ¥ ¿·?u”— ÕrJE $uÞãS¢ðG¶ ´uäšë(Ø;“ ¢uæ§kþr (uæ§kþr ,uó“€Úfa'š)uó“€Úfa'¦uó“€Úfa'–uó“€Úfa'vj´¢[p¬Nv½B2þ!­v׈Á¶ÀÛËwm T¶áúÓ wsc±¨9]w—óÌÊm¡‹wQú"Ù˜o–we\=ìŸiýRwÆqLÝ£³O £wì/ZÙ2dW•x FH8e«\òx%„U6·«Rx4®Ûó(²9çx„Ÿ*§fˆ ¢x¨š‹ÏË?xº?¦lm/Ñxͧƒ}žaÿxͧƒ}žZxͧƒ}žÛ xͧƒ}žR xð¸”S;Ûjy{DY¤Œ~  (y‹¶ðY í ly®¡øŒÌäyÀÑ»CxÉ0Û z…¸êȧ?zVø`¹÷£z"¦öLÙÅ! $z6ËØÜùGšz}¬}ÜoæÛz¡5&¶å_"zªžãÌÆ” $zªžãÌÆ” ,z¯ai•Ÿ0-z¯ai•Ÿ0zÒG¾}ÌU7©zÔ,È႞•zÔ,È႞${ €Çög#v{wø°,±±›{‰‰ÿŒ‚j{,ø«ÅÄ´­({.«@0–Üš{g‡üP š {iA @D {jÑ_–ôˆÁN {‚9tãÕÓ#{ˆixË· ï{¡Qmz#ÏSÔ{Ñç†Ña i|;Õe±G×s|«s’«˜£T |º.°½„–|º.°½„R |º.°½„¦|»f¡š7SÑÛ|ÅÿAù› ­}‘¡fæOÕl}(Ëz*àb­} ”8žË˜qÔ}˜AÔ’}%jp £}CZG!#ƒÑ}gñ_ªÎEÁN}nHÛÜ1¨5 ¹}¥Ã®0-ìQ~£#2m¥SÄ~ º¦©Kÿ#~yiT.ä] ~Ü÷+/ï]˜~Oëê¯OT_–~d‡:Ù貉~w -Õõ7 ë~³"›> %¹­7~³"›> %¹ ®~Ïæÿ»yÓ³–~ÓwÇØP— ã~ø%2ý¼ ‡?ßdÈŽ#{Û›0c+kwô`žî)µÓ†‹fáðÓ^ (¤ 1¼‰¬éùöØæ^ðÑü†æØÎÿR€»Ð¤u i €4ßjY†7þ•€S9ã8§Bã€S9ã8§B×€^éSQön€ #€b㪢x>b? €nä×Ö°‡• m€nä×Ö°‡•k€nä×Ö°‡•ž€‡Òî´ÀÅ  €‡Òî´ÀÅ s€‡Òî´ÀÅ|€‡Òî´Àű€‡Òî´ÀÅ ¹€™’eó(j€Ý·_¶Îg»Ê€ù^X±d‚øß4+{Ç%âË>¼JÍÙ³”N\b„Z ß÷¦„»]µ;t©ƒ2ïü 6 Ý¿4Ňh Š ®Æ?Xý£‘› õÊSÞ¥†j \Í0‘Æ7ËÛ²rPôy|ßD±H›öÓ†=„›?Û‚ɱ±±9"‚ øŠÂi¼’ ª‚¶L>`À«?‚<›PýA– ¢‚<›PýA– $÷‚<›PýA– ªž‚<›PýA– ,Q‚<›PýA– ë)‚<›PýA– ®&‚<›PýA–­‚<›PýA– ã‚<›PýA–j‚Z©ô‹°¯Žv‚Z¬Ã·T²ÝN‚˜­¿Æ»îzj‚½.å‘5‰× ‚ê3LO"YÕ‚ãàgÃÇl–‚ùÌsV³Fƒµ”@Os¾¦ƒ¹²XÑÞ­Vƒ¹²XÑÞ ã@ƒ¹²XÑÞ ë&ƒ¹²XÑÞ ,ƒ¹²XÑÞ ® ƒ¹²XÑÞ eƒ%ÑFâ[»!­ƒAÞ’6*†äƒXGUèªÏ±ƒZ¿¬ÕaÿG­ ƒ]¬ÊM¬h Þƒh˜ùkTŠƒo ;_̃á2èZZù„“Ä#Q‡R„ECfè¥Ý?„^&̺¼þ s„^׳òfÄv„a†&&­í„k$$:L&´„{Ì¿øêL„•ÎàA.ÈY„Ã:ÑQ½K ã„ÎØS{xà ,„Òæj”¹ x±„Ó´e&4³­„Ó´e&4³ $…CŒTÿLð4…Zj U ´ä #…Qª£®ZK …½Sàˆ-Ú…ÿs±!'ÒY …ÿs±!'Òt†C>Mû™ä ã†Tl¹I¡æL†sA—ÊþÅ 5†vg³á\¢* ›†“0i¸Èb»Ûj†“0i¸Èb»a †“0i¸Èb»Z†“0i¸Èb»’†“0i¸Èb»R†›´wñj  톱œhÜÒý† ~j¯1à醶º E±Å†Â{á;ø[$ †Â{á;ø[Œ†Â‚å>ËÉV ¬†îC¥^¿Sš†ÿ®q­)‡†[‡-6Ç_ßt‡-6Ç_ß ¢‡-6Ç_ß ª‡5@²hn>â‡FNqà÷ÉG 뇆ðÆ\¦`<Û‡ŒB¬‰ßÖý±‡»àÆUÎpŒ‡¼RÞØ>ôˆÂ1T?ˆ ßø}©½K ˆU~Lït´% ¹ˆi³<ǘY ¤ˆˆÞ”T‡Qu $ˆ•A!>Æò­ˆ¹ôjj—k•ˆÎK«è™ d ˆÎK«è™ RˆÎK«è™ Û‰‹<•í8e‰Í4ý’½¨ ‰Í4ý’½¨ž‰TY±‘çYú[‰šðÑÚ§‰¨Ú V¹U¥ a‰°¢jô ë ‰ÀU ü ,‰ÁÕb›üÇ— ¤‰È¿¸©’1åÕŠ%‚õ„W:ç ¢ Š)|­RÓIŠ0îiHm 3RŠ3ª8KTä äŠG‚؃4ÿÚ"ŠG‚؃4ÿ ª ŠG‚؃4ÿ ,ŠŒ'î½p.?ŠÿèZ~œqtŠžÌ;ÖþYŠº-—rTΩ´ŠÃ¹ÒÆí½× ŠÊw!׉DŠÒú|3d*;à ŠØÇÕgš‹,tsí»BÕ â‹8yŒ=N‹ÕȈ1F#‹Ýº³Bä ‹á+jõ· ŒôÅÅÁŸ©•ŒôÅÅÁŸ©–Œºw·.Ðe ,Œ:§í'äÑ$qŒQEpg¼TŒìzW>­a3­ŒìzW>­a3vŒüœøè ?/ †¡Èº ãA‘ŽìRQr .A¤¬yB ¢ja‚”Éß‹ž|†Ð°Hõmtb|†Ð°Hõm a|†Ð°Hõmb|†Ð°Hõm \ŽàȬ‘Võ ªáuú¥ª \Ž(\V ¯‰ êŽtržó8z£޵ ¥ûÔõòŽ¶ÒŽ´“û‚ŽÍ ZM´U® +ŽïëuÊQ[gŽý—‚”dÓCšŽý—‚”dÓCQ_#y׫WÆ­j—x†ÝÛä†ÒR† h •÷ 7×!íÀ9% Ú=Cvyâ 2Ý¿ , yâ 2Ý¿ ®5Шܖ 5Шܠ ñŠø6 ”¨¤àÈÇÖ aÄ$eÔEé  Ù£7ØS·[’õ„³Í‘ö&‘ÉFïû¼‰‘3^뱋C£‘M€×ÆŒ7Ú‘]_p³9&†‘s¹aæÖg‰‘‘úyrõq<v‘ö=Éød R ‘ö=Éød •‘ö=Éød –’ ë›’(ö¬áÛÁ- ’9Œ}à*²¥ c’ºÖnIk +’« vjŽgŠÚ’¹E´gê}»–"’¹E´gê}» ’¹E´gê}»R ’Í;`ƒÑ’ö®Œžï5 #“?8KcL#-s“J™B³‹â“J™B³‹a“~îîN‹E‚Û “¨Úùö”ß›“ÇæƒÅ»éJ“Í @ñ‹ë‘K“áEý ôªN”v“lIê³”v“lIêà”H _h׎ d”YC‘7?,ú씘°¬`†®a ë ”˜°¬`†®aj”½A|ò c”Éñ¬ß»˜ s•GÐ[uhÊ ^•]ón†Y“†Ä•iº[ô£q|N•iº[ô£q|Û•iº[ô£q|Q•‘á“t‘ÐB•¤Tý olÔ•»&ªVA­••ÅR]‰ä •éÃëÇ$/•ú6<û–(øBd˜ý˜–5&ve‡ñÊ–I—F:¿Ñ°Ò –«YZâS–±n?iãUšR–ÂØd£?–Ñ|Š'ÁG‹ ³–Þ‰àŽ«l$—qÀE/·òR —H Ÿ£—p…0™ÙXH Z—ýrNò K#˜&è]•㘷1nj_ÇïR˜·1nj_Çï–™$”y¡áœ^Û ™>F²ZVTO s™bm  „‚ #™vü@ãÒ (™– ,„Êi=­™–ç…ãI­ ™X4Ð"™¥4 M§Þ ´™°õ?zãYüDl™°õ?zãYü*™°õ?zãYüÌ™ä‡R•7ÁX·™ä‡R•7Áj'™æ€Ц ¯š$!5FNlSš$X0Spe_š)oô¼"¦šA®Z†E.Pš\ìFF¦V5CšŒôo¶ ˜©šµkêE/Ås›g¿¥@q-í›)Ùû™Ad)›/uÖWÝ™Ÿ¨›W›ˆx«Ó›Í¡Vò#v›Ðøe†ü¦ ­ œÌSÃmÃYœF0øa=g­ œG$¿ÌÇÑRvœeé›ÉÞ9* ã œjúoª=öHNœ•)(·Q%N œ™{ƒÌw“ZœÊ«€ó·éôœÌ Œ®qÚÃ[œÔï7†‚!6 nœÖXjòs\Köº× “HÍïøéJû—EЕUMVGË,ÏX1ÝNŽ!%_zî~w¡­Y_zî~w¡ ®_zî~w¡ ¢ _zî~w¡ ãŠu2& ûfñú©`¶Ä ›õØéP7{Ïž†:ôÓÜ ž%…˜Òùv·YžBø“ž…ã³jžYå§ŒO:Už\ŒÕ0àNž“ì”7=X¿&ž½Ð¯Ý•DbžõN„XCmõ•ŸŠÖ#ce––Ÿ ̘'꩟ DÈ-RŸ DÈ-á Ÿ›“IŸ^ cŸMàï¥M€Ž ëŸl¨þÍËíŸoÄ›¸õZŸÙfUBN³ŸÚR\À´È2j ŸÚR\À´È2 ëŸÚR\À´È2 ,  Ú3VYÞ £ ۚÂé? o4îÿ7@¦ zh¡áå R ”×6mÖ ³ ÜCƒäÎá ã(<‘viúŽ ä\Ï/}å¿¡Xà¦vgÕ0³¡Xà¦vgÕ0 (¡{ãëjLÝ‚? ¡{ãëjLÝ‚ i¡{ãëjLÝ‚ ¢¡’˜ÉÃⰀ졜‰Ê%Üi ë¡°ñÚ ã£?¡°ñÚ 㣠¢¡á&–ÜÏN¢œ$_æN£&‚dë å{–£,v@@·Y­£J î>ÊV£¹ «’QZ£ðTæ$㺸 •£ðzØ€‡µýt¤«áΓ´¤š•:ƒ×µS¤â-lÞ«&t›¤ëâ†?Ç_¥)‰Ìé(Û­¥1õ³öµâ•¥A‹H…vÑ) ã¥Fú”øßÁ¥‚ÿùK¯¦¥È>S º !¥Öù"pŠot¥íF¤*8ߦ%“&Ë5…–¦`Ä=Ì_• ¦eÙÅF)Å/X¦vD©º©DI–¦x1ý{Ûq c¦}Õ Ý ø¦Êûî^ôaY¦ÑðÈÙä c¦Ù c@å©l¦Ý|Ó^ ,§VòŒÞŠÏZ §GUþA뙉§PF½W ®³N.(“pì \³‹ÒCÎY¥Q³•¢¹ Ãfr 㳩Ķjìºï ï ³±r‰$ʬt³ºÔÒÝ•Wó³×Ê $ÜV 3³ðJµl 9 ¦ ´dßh.² Ki´dßh.² R´dßh.² $ ´UQi{5Ø?´d(íg`2 ë´á—¼Cœ¡â9´õ‘*ÉÝEâµ"e^auÇ“ µ?-ÞÔ3?µMáÆÝ\ñ8³µO…£¹\‘ž?µd©ÅÙˆ}hµf!m$¯µ}6Êïh”µÑ “1øKÕ¶GåÀ\o•¶cW}õòA»’¶d"üf×mµ!¶l­H;Ͳ(ê ¶l­H;Ͳ(L¶n^÷b•0 £¶”èH_)[$"¶â[( Ç • , ·!Ö ÿ£U 4·GãFš. ë·GãFš. ã·LJL—c²‘š·O¾nåÑG£ ß· ¢<þ•·±ÿMû` ù£·é9eW'èʸ5²Ï=”æ*?¸DÅ:À[$ •¸DÅ:À[$ £¸«¹XTõ&d c¸¸*×8â ¸ÐYKqÜ‚ ¢¸ÐYKqÜ‚ã¸óŠ©hnù?¸ø~LÏ)5öÛ¹>¶ |Ïñ:v¹>þ"PŸ4S¹`Ôf¨"Ùþ \¹`Ôf¨"Ùþ i¹ŽI ‹þ~“ ë¹€åTÄ]¹›d€Y®ä #¹œF…Ú`tº$¬™Ÿ³Ç›–º´/ÓÕ ˜³•º´/ÓÕ ˜³º´/ÓÕ ˜³šº´/ÓÕ ˜³–ºÕûÀ‡êA \ºÝrY>o A˜ºày†µ7_Ît»(Ù8*B[»?• ¸‚Òat »† 1/iûÛ9»†¤ÂIÚFk»†¤ÂIÚFt»†¤ÂIÚFj»‡«ƒhpë\‘»å !™ÀN»ôÖ«¾ä i»÷Ô™-t­¼ îTX"œ¼ îTX"œÓ¼ îTX"œ¼ îTX"œ•¼5‘-J’1Z¼oû M¼ÇÉR ¼v¢t0ÃpäY¼¾mÅÝš@ï‘ ¼Á‰¡»íåp[ ¼Ç1Ç5"j¼â+½š™µá x¼ï¸½ÊË‚•¼õþR±är é½ ‹F 1f^;½ô|u„]ý57Ù7G1ð½OÓD\ÅiB i ½wA8’"©R6½wA8’"©•½wA8’"©U½wA8’"©–½~¨kfC ,½†j¤*Plš­½kêü„·N½œ¡­Ü l©â½Äñ‰¶E¡²b½Äñ‰¶E¡²± ½øˆ¤JPÜ  ¾Ô%ÙÌpl]¾¼Ó™Ç ª¾é‚÷Et]?¾8A-¥ŒmÉ ­¾F Þ/Â©Û ª¾MÚQüo0 š¾_þõ‡=¥ƒ¨ ¾_þõ‡=¥ƒ± ¾_þõ‡=¥ƒY¾k’ôh‘4 N¾tO¨~;¥ N¾xòç*dIŠØ¾­#„dç‡K¾³{ñ)—  ¢¾Î°´=qõ‹Ó¾ÓÖ°ñ9Ôý +¾âµjÎA)ù ã¾èÍÖiC)¾ý¼Þ®lþ3”¿)¦j°+Öjd¿)¦j°+Ö ë=¿)¦j°+Ö ,7¿)¦j°+Ö ®¿s ØÎqÖ ¿„¬¡¢â´ ã¿‘6ú1lz¿—ÀiQÚý¿¡“¦“_:=¿§™['­®Ú¿ãCÚ‡=¤N¿çhlxuÛ¿öÜ5ÖBNÀ>Ì+D0 ªÀ•©å™ÇË%À¶âà˜9³À«®+íêsãÀ°.ˆ #ªÅÀ¹¯å%‚N=­ ÁX>-*QDöÑÁjó.¬rØ ¢Ájó.¬rØ ãÁý\jTÈé)Ü/½t­?>­ -Â­Æ ¼ ¢Âx9Ù)0(«&Âx9Ù)0(«-ƒ}?¼;Å b‚q›ŠmÓ' \ÂŽ ²é‚Òc ­Â’Á»Š 6Ûš 4»ö]?¯3›bw+ÈæÃÃû¶ö ë ÃS «/L +ÃY›Ç¥†y­Ãa€ù¢*ñžÃz’5úÐcá ÈòXÄ]ÂsÊ{ŽÌeû£Ê{ŽÌeû•Õ};i,ž’Ú—`ﶨÕ?æø¢)ÚÛ‘ ,ÃÒ¹Ó…³›ÃØOÁ%(>Û ÃóV£·ŠÄBÈA ëL 4ÄKú~ôm‘dÄlÐZKÕån?Ä{Èi¹ão|Ä‚ ]S7ŠUÌÅ,Õˆv²F¼¦Å,Õˆv²F¼DÅCo¯%“$É çÅFz¡[+ã ãÅOiˆû¸ÚËÛÅe6áöT ëÅm ªXeôÅǨwß” y \ÅÓ0ÑÈèçãH Å÷÷NÜ/ˆ˜Æ:«WþìÓÆp…T -³ŒéÆu©ÚKÕs‹¬ÆŸÊíÔC ™ƱNÓÜ7š9ƱNÓÜ7–ƱNÓÜ7ÛÆÐÌvh‡²ã  ÆÖ‰«Y»vÇ2Z¯»‹ÇKÍ<**ÇNĘy6« "ÇZù¾É¤AçRÇr;¬JBe»YÇr;¬JBe» ãǨ ÌÇ&€$Ǩ ÌÇ&€RǪêä»Ô•JÇûЯQ`«DÈ2äƒn]¶È2÷ª|¹¯H×ÈA,$šð¬¯;ÈqTE²du¬È—Ò"ç#¸ ãÈ¡ÓIžCx ïȤ2l¥¸òjȤ2l¥¸ò­È˽´3aÆú ê Èîy%õKçêÉ ¥öÿ¬“éKÉ2z×:ïA>É^T9r’»„ÛPÉ^T9r’»„RÉ^T9r’»„’ÉÆÂYL!RWs+ÉÆÂYL!RW¥ÉÆÂYL!RW­Éè ¿¥¶è] Éð¹™²Ëõ (Ê ÜÔóFtWÊ ÊöLÌ—ñ $ÊöLÌ—ñ­ʪkYõ!Q $Êí‹ç†ûÚÌË}|€Û ¢Ë ë-°Iö¦Ë —"1sgŒËbåÿ¿tËq‘ZÙAK˳ú*Áx âËJVê¨ûèËX”çìé_=ËŸ½ðÒb—¤DËÌÆîÙ˜ñÛÌ3ÝÑ6=­Ì.Â\ iÌ`TÛ3,D› ̼¶+ÞqÞÌè$L”>ÔÑ|ÍÄÝoz ãÍEmõ½ Xt­Í‚‘4cõ“¬KÍ àCnÚqæ cͬ§)+ºáÍ´îìs’£–ÍÏ^a`Wd Í÷?FýÜŽä•ÎO£_”éK œΚò"ÛP¸± ήüe:ÎÄ=힌 …ÑÏ»‡¶o¸ cÏ'®«%% ›Ï)€—Œ?Ï¿@3yoh cÏÍðK«Ð‚@ ïÏç¼ä켆.±Ïö{<üȶ@jÏør9ývTJ ,Ïÿ”©9¼#ìÚÐ È#h,IxЄ ßuRÐ;в·£ËÐoáåerpÐjÐoáåerpЭÐ_(( ÌÐí-e´­¾g ©Ñg±ªE5Ù ÑS;n¬ï%ÛÑWÔïb¬.éÑggšçò"Ñ~ƒjÇhÇçц×Ú¥à?ÑñQ@j裗›EÑü‘ï³æ0[VÒ vV¡ne¦ÒöL†& \ Ò™!ˆqS›ØNÒÍ¡-!Á àÒÖ?-£/ô ¤Ò×r8qÿÓ`vBª™g”Ó ìØjÔÓ ìØ­Ó ìØ ëÓ7£øeúÌ:tÓYÜ¡.&Óe ïÓ{uÔ“jß•øJUE­ߨïX ~™sßßúÛNS.]ßÿ§1Žè­à-!©clâ•à7ƒ§âv8£”à7ƒ§âv8£àT¬/êëò‘C à–¬¼a]à¥%e£Ü’šá¦ÿc{ó áÓÅôC4$Rá!œ²œÎï cáRU­“E{+×áW²×®+— ¢ákó,¼¨Yá2 2뮞âáç#eaÛb$â!Nð?Öbž ëâ(êøÍ; ¢âPh2ÜR«â€6¤Ô*ÜÛ ¢âö_ø‘n# ããªñÏm¡e­ã¹ðÛ´ŠŽ:ãß3”ÆŒ¶›ãóÙâÙïâ cä(©DkFuL ä6Ũ¤ÌC„›äÈhªÐÈOÈ räη…Èíé ,äéÁ¸}ƒq ¢åhçøš†9å „A‹´­å‰=íþ‘›³Lå–µ®ò·ì ëå–µ®ò·ì ªåõ°=úåõ°=úãæ[¯#¸Ý-æ<*ÿ/NRæ<*ÿ/NQæ2ú¸%žæm辕òS æm辕òR æ"ÇMÉœØéYæ:NÖlßI9敵†ùä ;Ûæ™uÍ?Øè’væ™uÍ?Øè’­æ¢Ï‹nȪ (æø œJ¬~Ñœç©6+ÈL£Kçr–ï5U«jçt¤f7…Ïu#ç«W/Å‘xÚ $细å%Þ?´ç»†å%Þ?óè/–N[‹ îè,\1û™]èi¡ÔÛ èæ–Ò\Fg (èæ–Ò\Fgtèž'V[7Ù•覮}×÷íQ覮}×÷ífè¼—Q¼æPòèúqÊÑÌèæÕé!6?CÑA–é-aU–'´Z¥é.xÛ3×Éré;0ˆ1•Nésrs¿_§žKésrs¿_§žfé{¶(-X­$é{¶(-X ®é{¶(-X ,é{¶(-Xòé–6ݬìAZé–6ݬìA•é™\¢/§ÿh ›鬰Íè˜é­ mØ–X`•éµ<\ô\`Rê02ê¹Ëc>–ê02ê¹Ëc>šê02ê¹Ëc>¦êWõZ3Z ãêWõZ3Z iêpŸ¦5Á#§±êwõÙ»òêšéÔj‘ðÛê²Sò:¤ÒHœêÈ“G³oâXŒêÛëq IãtêúvyW p­ãës)—G ëjZö-R ›ëlòÀq‘îNë°)iõû 2ëÑnH3ô ãëÔùÓÊgNl|ë÷/™ê¼ \ì› 2‡‘î ™9N.d î ™9N.d Rî+ƒöR–5<• î4äÖªQzbî@Ádó%s*³îUˆ?ŠÍU¹[î]BCP\ q î_%UîìH„sî‹`p–5S îžh ÈÎÐôîÀì€ÖËÔbîÉù*zª¿ ë ï ¦RÚò£ï°Ý–z ªï –3¹L\cs ï!ÐZ+ÈrX ëï!ÐZ+ÈrX?ïSfH¹Ã ®ïSfH¹Ã ëïSfH¹Ã ,ïd‰ jf~Rïqy×é KÊ ªï·Mj’j‚NðOKw¥ÙÚð8¨0j9 $ðD Àb¥äðGûo©üÎ[ µðIÈñh¸m=­ðL*ê¼öZSðZ®¼ß<=Ñð˜<%3ãð¬Îš{ezëŠðÇp·øÆm¹JðÒ–©_#l:Ñ ðÒ–©_#l:ÕðáÆŽ4 2@NðäÂ8œCo½M<ðè–,É K³ñ£St½F añ;d¿\ÆÅ­ñUý«.51UñW#³[L ñ`Åcb,(Ö?ñ—4°Æ ÓñËÂ$`<Á ëò÷EÍ÷áÁ äò'zÙ:¶– òQÐñ.%¾,%òzjû¨JP’ò|ËWDLåç–òƒì†¹2rò¹*bcZ‚²Uó ýäÌ».}ó ýäÌ».}Ûó ýäÌ».}Óó{±›¸ÔLz cóˆùJ!\ˆ,ó@Ù€O¥Ð ló¥B¢ÿxYó¬BÈ›&8óÓ‹¸¬;y­óÓ‹¸¬;yjóû¦åóä{ô¯)ºêûôKiaå3ÑÄÛô´XTm² ,ôÊÛÍPJ¤™ËôÏV£§¹ôÏV£§¹âôü2¿¼èZÊõí(8ÏD , õ"µ3/B| õRîwe„)  õyKƒzAŒš õyKƒzAŒõyKƒzAŒ•õ¼|Ñú¾ZòÜõÔï@H„KE ,õðˆ'ýr{Àõþç#§V< aö ˜¢>ý`öï›ÓR@ ¢öJe‡t…î%›ö\d,«‡àwö]ò‘1])GÛön±«VÔÈÖö}d+f1êDö‘îwK¯,A ö˜¿„~€­qö¡˜HàâÛöª8ó}/ÔÑöÒ Ï—ÊòPs÷ 4dÂ?=Û­÷ 4dÂ?=Û ®÷Þï†ø ò÷ 90°ø ß÷*8A²õ‹Œ™÷DØU_§' ª÷bCÜþbä «÷yL†Å9ç ÷§tä ^÷Ó»èa>If›÷æàì !]®ø=Gš¯PH"øŠ=8$^Ý‹ø¥|UÓZY)ø±SBÀ"Ë]ø·.Z·)ŲàøÂBúíºöÏÑøÈ¶‘F÷¤ívøÌ[àzéy`‘øÍœ)Ãó løÖbÃQt9Rbù.JE@6Ó\ hù9€xf\Ñù|›RN½¤ \ùšÔ<ùg ëùÐ ¤™iÊ i7ùÐ ¤™iÊ Y%ùÐ ¤™iÊ ã ùÐ ¤™iÊ ¢ùä`¥vÅ[¨–ú%¹¬‰¿›Zú%¹¬‰¿›• ú%¹¬‰¿›&ú+¬‡Ž•f ¢úI+9áTÛ«? ú[5ï‘. júaHF¯ @7Rú†O«!Õêvú§¢Ìƒÿ›U úÝ¢/ȵ’š ”úîLÙ» júø—éýëûXýÑ¿@Hívû¹UÓD„@±ûÈ(Ô·uÁ= ûÊŽÂ'àz+$ ûÒeÝ=õ¥ eûÒeÝ=õ¥vûü—Y£_O²›ü uÿǹ ú?ü0ö³À¡¤­•üA•y÷êö üMW21Þ5‰ÓüT°ÛC䣛üß €ÖŽeZüß €ÖŽeRüß €ÖŽeLýyE!³ÿ9ý-˜M0ó ˜ýQ™F¦*ûí fýx€ #ìòfDý‘F©{'Òý”ö NJýéÌE‘ÌYþ½ÏLÞÈ;j þ˜žÞ‹årþŸãªC\…&þ\^ 8'H$éþ\^ 8'H$|þ›f²g8ŽR þ´¡1×è"ÛþùË?Q4m8ÿ Í%ÐÆIÈ mÿ*Ï«ä4E²éÿ>~Úý'óDÔÿZj$8\äù!ÿ\›rÜÁøãÿ·ád¸¯—®RÿÑ®PÚ™ çÿè´Fà/ôÿìŸ@F—²sa gnuchess-6.2.2/src/frontend/atak.cc000644 000766 000024 00000010516 12451350253 020013 0ustar00antoniostaff000000 000000 /* atak.c GNU Chess frontend Copyright (C) 2001-2011 Free Software Foundation, Inc. GNU Chess is based on the two research programs Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Contact Info: bug-gnu-chess@gnu.org cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net */ #include #include #include "common.h" short SqAtakd (short sq, short side) /************************************************************************** * * To determine if sq is attacked by any pieces from side. * **************************************************************************/ { register BitBoard *a, b, *c, d, blocker; int t; a = board.b[side]; /* Knights */ if (a[knight] & MoveArray[knight][sq]) return (true); /* Kings */ if (a[king] & MoveArray[king][sq]) return (true); /* Pawns */ if (a[pawn] & MoveArray[ptype[1^side]][sq]) return (true); c = FromToRay[sq]; blocker = board.blocker; /* Bishops & Queen */ b = (a[bishop] | a[queen]) & MoveArray[bishop][sq]; d = ~b & blocker; while (b) { t = leadz (b); if (!(c[t] & d)) return (true); CLEARBIT (b, t); } /* Rooks & Queen */ b = (a[rook] | a[queen]) & MoveArray[rook][sq]; d = ~b & blocker; while (b) { t = leadz (b); if (!(c[t] & d)) return (true); CLEARBIT (b, t); } return (false); } BitBoard AttackTo (int sq, int side) /*************************************************************************** * * Generate a bitboard of all squares with pieces belonging to side * which attack sq. * ***************************************************************************/ { register BitBoard *a, b, *c, e, blocker; int t; a = board.b[side]; /* Knights */ e = (a[knight] & MoveArray[knight][sq]); /* Kings */ e |= (a[king] & MoveArray[king][sq]); /* Pawns */ e |= (a[pawn] & MoveArray[ptype[1^side]][sq]); c = FromToRay[sq]; blocker = board.blocker; /* Bishops & Queen */ b = (a[bishop] | a[queen]) & MoveArray[bishop][sq]; while (b) { t = leadz (b); CLEARBIT (b, t); if (!(c[t] & blocker & NotBitPosArray[t])) e |= BitPosArray[t]; } /* Rooks & Queen */ b = (a[rook] | a[queen]) & MoveArray[rook][sq]; while (b) { t = leadz (b); CLEARBIT (b, t); if (!(c[t] & blocker & NotBitPosArray[t])) e |= BitPosArray[t]; } return (e); } int PinnedOnKing (int sq, int side) /*************************************************************************** * * Determine if the piece on sq is pinned against the King. * Side is the color of the piece. * Caveat: PinnedOnKing should only be called by GenCheckEscapes(). * The more generic FindPins() function should be used for evaluating * pins against other pieces. * ***************************************************************************/ { int xside; int KingSq, dir, sq1; BitBoard b, blocker; KingSq = board.king[side]; if ((dir = directions[KingSq][sq]) == -1) return (false); xside = 1 ^ side; blocker = board.blocker; /* Path from piece to king is blocked, so no pin */ if (FromToRay[KingSq][sq] & NotBitPosArray[sq] & blocker) return (false); b = (Ray[KingSq][dir] ^ FromToRay[KingSq][sq]) & blocker; if (b == NULLBITBOARD) return (false); sq1 = (sq > KingSq ? leadz (b) : trailz (b)); /* If diagonal */ if (dir <= 3 && BitPosArray[sq1] & (board.b[xside][queen] | board.b[xside][bishop])) return (true); /* Rank / file */ if (dir >= 4 && BitPosArray[sq1] & (board.b[xside][queen] | board.b[xside][rook])) return (true); return (false); } gnuchess-6.2.2/src/frontend/cmd.cc000644 000766 000024 00000103640 12451350260 017635 0ustar00antoniostaff000000 000000 /* cmd.c GNU Chess frontend Copyright (C) 2001-2013 Free Software Foundation, Inc. GNU Chess is based on the two research programs Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Contact Info: bug-gnu-chess@gnu.org cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net */ #include #include #include #include #include #include #include "version.h" #include "common.h" #include "gettext.h" #define _(str) gettext (str) static char logfile[MAXSTR]; static char gamefile[MAXSTR]; /* * Splitting input is actually not neccessary, but we find * tokens separated by whitespace and put pointers on them. * How many do we need? We just take 3 for now. Check if the * fact that tokens are not 0-terminated but whitespace-terminated * generates bugs. (Already killed one bug in move.c) * We also kill trailing whitespace. (The trailing '\n' might * be really annoying otherwise.) */ #define TOKENS 3 static char *token[TOKENS]; char *endptr; static int hardFlag=0; static int postFlag=0; static void split_input(void) { /* r points to the last non-space character */ char *s, *r; int k; for (k = 0, s = r = inputstr; k < TOKENS; ++k) { /* Skip leading whitespace */ while (isspace(*s)) s++; token[k] = s; /* Skip token */ while (*s && !isspace(*s)) r = s++; } while (*s) { while (isspace(*s)) s++; while (*s && !isspace(*s)) r = s++; } r[1] = '\0'; } /* * Compares two tokens, returns 1 on equality. Tokens * are separated by whitespace. */ static int tokeneq(const char *s, const char *t) { while (*s && *t && !isspace(*s) && !isspace(*t)) { if (*s++ != *t++) return 0; } return (!*s || isspace(*s)) && (!*t || isspace(*t)); } void cmd_accepted(void) { SetDataToEngine( token[0] ); } void cmd_activate(void) { printf( _("Command 'activate' is currently not supported.\n") ); } void cmd_analyze(void) { /* * "analyze" mode is similar to force, hard and post together * in that it produces a text output like post, but must * think indefinitely like ponder. * * Some additional output is expected in command ".\n" but if ignored * this should not be sent any more */ /* TODO correct output, add fail high low */ SET (flags, ANALYZE); SetDataToEngine( "hard\npost\nanalyze" ); } void cmd_bk(void) { SetDataToEngine( "bk" ); } void cmd_black(void) { /* * No longer used by Xboard but requested as a feature */ printf( _("Command 'black' is currently not supported.\n") ); } void cmd_book(void) { char data[MAXSTR]=""; strcpy( data, "book " ); if (tokeneq(token[1], "add")) { if (access(token[2], F_OK) < 0) { printf(_("The syntax to add a new book is:\n\n\tbook add file.pgn\n")); } else { strcat( data, "add " ); strcat( data, token[2] ); } } else if (tokeneq (token[1], "on") || tokeneq(token[1], "prefer")) { strcpy( data, "book on" ); printf(_("book is now on\n")); } else if (tokeneq (token[1], "off")) { strcpy( data, "book off" ); printf(_("book is now off\n")); } else if (tokeneq (token[1], "best")) { strcpy( data, "book best" ); printf(_("book is now best\n")); } else if (tokeneq (token[1], "worst")) { strcpy( data, "book worst" ); printf(_("book is now worst\n")); } else if (tokeneq (token[1], "random")) { strcpy( data, "book random" ); printf(_("book is now random\n")); } else { printf( _("Incorrect book option\n") ); return; } SetDataToEngine( data ); } void cmd_depth(void) { char data[MAXSTR]=""; int searchDepth=0; searchDepth = atoi( token[1] ); sprintf( data, "sd %d", searchDepth ); SetDataToEngine( data ); printf(_("Search to a depth of %d\n"),searchDepth); } void cmd_easy(void) { SetDataToEngine( token[0] ); } /* Predecessor to setboard */ void cmd_edit(void) { if ( flags & XBOARD ) { printf("tellusererror command 'edit' not implemented\n"); fflush(stdout); } } void cmd_exit(void) { /* * "exit" is a synonym for quit except in engine mode * when it means leave analyze mode */ if ( flags & ANALYZE ){ flags = preanalyze_flags ; /* this implicitly clears ANALYZE flag */ SetDataToEngine( token[0] ); } else { cmd_quit(); } } void cmd_force(void) { SET (flags, MANUAL); SetDataToEngine( token[0] ); } void cmd_go(void) { SET (flags, THINK); CLEAR (flags, MANUAL); CLEAR (flags, TIMEOUT); CLEAR (flags, ENDED); computer = board.side; ExpectAnswerFromEngine( true ); ChangeColor( true ); SetDataToEngine( token[0] ); pgnloaded = 0; } void cmd_hard(void) { SetDataToEngine( token[0] ); } void cmd_hash(void) { if (tokeneq (token[1], "off")) { CLEAR (flags, USEHASH); SetDataToEngine( "hashoff" ); } else if (tokeneq (token[1], "on")) { SET (flags, USEHASH); SetDataToEngine( "hashon" ); } if ( flags & USEHASH ) { printf( _("Hashing is on.\n") ); } else { printf( _("Hashing is off.\n") ); } } /* Give a possible move for the player to play */ void cmd_hint(void) { SetDataToEngine( token[0] ); /* TODO if no hint, inform on stdout */ } void cmd_ics(void) { SetDataToEngine( token[0] ); } void cmd_level(void) { SetDataToEngine( token[0] ); sscanf (token[1], "%d %f %d", &TCMove, &TCTime, &TCinc); if (TCMove == 0) { TCMove = 35 /* MIN((5*(GameCnt+1)/2)+1,60) */; printf("TCMove = %d\n",TCMove); } if (TCTime == 0) { SearchTime = TCinc / 2.0f ; printf(_("Fischer increment of %d seconds\n"),TCinc); } else { MoveLimit[white] = MoveLimit[black] = TCMove - (GameCnt+1)/2; TimeLimit[white] = TimeLimit[black] = TCTime * 60; if (!(flags & XBOARD)) { /* TRANSLATORS: Please be aware that the word 'move' is sometimes used as a synonym of 'ply', and sometimes in the sense of a full 2-ply move. */ printf (_("Time Control: %d moves in %.2f secs\n"), MoveLimit[white], TimeLimit[white]); printf(_("Fischer increment of %d seconds\n"),TCinc); } } } void cmd_list(void) { if (token[1][0] == '?') { printf(_("name - list known players alphabetically\n")); printf(_("score - list by GNU best result first \n")); printf(_("reverse - list by GNU worst result first\n")); } else { if (token[1][0] == '\0') DBListPlayer("rscore"); else DBListPlayer(token[1]); } } void cmd_load(void) { char data[MAXSTR]=""; LoadEPD (token[1]); pgnloaded = 0; check_board(); if (!ValidateBoard()) { SET (flags, ENDED); printf (_("Board is wrong!\n")); } else { /* Read EPD file and send contents to engine */ FILE *epdfile = fopen( token[1], "r" ); char epdline[MAXSTR]=""; if ( epdfile == NULL ) { printf(_("Error reading file '%s'\n"), token[1] ); } else { if ( fgets( epdline, MAXSTR, epdfile ) == NULL ) { printf(_("Error reading file '%s'\n"), token[1] ); } else { strcpy( data, "setboard " ); int i=0; while ( epdline[i] != '\n' ) { data[i+9] = epdline[i]; ++i; } data[i+9] = '\0'; SetDataToEngine( data ); SetAutoGo( true ); } } } } void cmd_manual(void) { SetDataToEngine( "force" ); SET (flags, MANUAL); } void cmd_memory(void) { if (token[1][0] == 0) { SetDataToEngine( "memory" ); ExpectAnswerFromEngine( true ); } else { unsigned int memory; if ( sscanf( token[1], "%d", &memory ) == 1 ) { char data[MAXSTR]=""; sprintf( data, "memory %d\nmemory", memory ); SetDataToEngine( data ); } } } /* Move now, not applicable */ void cmd_movenow(void) { SetDataToEngine( "?" ); } /* * TODO: Add a logpath variable or macro, not always dump into current * dir. Again, how does one handle paths portably across Unix/Windows? * -- Lukas */ void cmd_name(void) { SetDataToEngine( token[0] ); int suffix = 0; /* name[sizeof name - 1] should always be 0 */ strncpy(name, token[1], sizeof name - 1); for (suffix = 0; suffix < 1000; suffix++) { sprintf(logfile,"log.%03d",suffix); sprintf(gamefile,"game.%03d",suffix); /* * There is an obvious race condition here but who cares, we just * bail out in case of failure... --Lukas */ if (access(logfile,F_OK) < 0) { ofp = fopen(logfile,"w"); if (ofp == NULL) { ofp = stdout; fprintf(stderr, _("Failed to open %s for writing: %s\n"), logfile, strerror(errno)); } return; } } fprintf(stderr, _("Could not create logfile, all slots occupied.\n")); fprintf(stderr, _("You may consider deleting or renaming your existing logfiles.\n")); } void cmd_new(void) { InitVars (); NewPosition (); /* Protocol specification for ANALYZE says "new" does not end analysis */ if (!(flags & ANALYZE)) CLEAR (flags, MANUAL); CLEAR (flags, THINK); myrating = opprating = 0; SetDataToEngine( token[0] ); } void cmd_nopost(void) { CLEAR (flags, POST); postFlag = 0; SetDataToEngine( token[0] ); } void cmd_null(void) { if (tokeneq (token[1], "off")) { CLEAR (flags, USENULL); SetDataToEngine( "nulloff" ); } else if (tokeneq (token[1], "on")) { SET (flags, USENULL); SetDataToEngine( "nullon" ); } if ( flags & USENULL ) { printf( _("Null-move heuristic is on.\n") ); } else { printf( _("Null-move heuristic is off.\n") ); } } void cmd_otim(void) { SetDataToEngine( token[0] ); } void cmd_pgnload(void) { char tmp_epd[]=".tmp.epd"; char data[MAXSTR]=""; FILE *epdfile=NULL; char epdline[MAXSTR]=""; PGNReadFromFile (token[1],0); SaveEPD( tmp_epd ); epdfile = fopen( tmp_epd, "r" ); if ( fgets( epdline, MAXSTR, epdfile ) == NULL ) { printf( _("Incorrect epd file\n") ); return; } strcpy( data, "setboard " ); int i=0; while ( epdline[i] != '\n' ) { data[i+9] = epdline[i]; ++i; } data[i+9] = '\0'; SetDataToEngine( data ); SetAutoGo( true ); pgnloaded = 0; } void cmd_pgnreplay(void) { char tmp_epd[]=".tmp.epd"; char data[MAXSTR]=""; FILE *epdfile=NULL; char epdline[MAXSTR]=""; PGNReadFromFile (token[1],1); SaveEPD( tmp_epd ); epdfile = fopen( tmp_epd, "r" ); if ( fgets( epdline, MAXSTR, epdfile ) == NULL ) { printf( _("Incorrect epd file\n") ); return; } strcpy( data, "setboard " ); int i=0; while ( epdline[i] != '\n' ) { data[i+9] = epdline[i]; ++i; } data[i+9] = '\0'; SetDataToEngine( data ); SetAutoGo( true ); pgnloaded = 1; pgncnt = GameCnt; while (GameCnt >= 0) { if (GameCnt >= 0) { CLEAR (flags, ENDED); CLEAR (flags, TIMEOUT); ChangeColor( true ); SetAutoGo( true ); UnmakeMove (board.side, &Game[GameCnt].move); if (GameCnt >= 0) { UnmakeMove (board.side, &Game[GameCnt].move); } } } cmd_first(); } void cmd_next(void) { if (!pgnloaded) return; if ((GameCnt+1) <= pgncnt) { ChangeColor( true ); SetAutoGo( true ); MakeMove (board.side, &Game[GameCnt+1].move); } else { printf(_("No more moves. Game reached the end.\n")); return; } printf("%d. ",GameCnt/2+1); printf("%s\n", Game[GameCnt].SANmv); ShowBoard (); } void cmd_previous(void) { if (!pgnloaded) return; if (GameCnt >= 0) { ChangeColor( true ); SetAutoGo( true ); UnmakeMove (board.side, &Game[GameCnt].move); } else { printf(_("Initial position reached. There are no earlier moves.\n")); return; } printf("%d. ",GameCnt/2+1); printf("%s\n", Game[GameCnt].SANmv); ShowBoard (); } void cmd_last(void) { if (!pgnloaded) return; while (GameCnt+1 <= pgncnt) { ChangeColor( true ); SetAutoGo( true ); MakeMove (board.side, &Game[GameCnt+1].move); } printf("%d. ",GameCnt/2+1); printf("%s\n", Game[GameCnt].SANmv); ShowBoard (); } void cmd_first(void) { if (!pgnloaded) return; while (GameCnt >= 0) { if (GameCnt >= 0) { CLEAR (flags, ENDED); CLEAR (flags, TIMEOUT); ChangeColor( true ); SetAutoGo( true ); UnmakeMove (board.side, &Game[GameCnt].move); if (GameCnt >= 0) { UnmakeMove (board.side, &Game[GameCnt].move); } } } ShowBoard (); } /* * XXX - Filenames with spaces will break here, * do we want to support them? I vote for "no" * - Lukas */ void cmd_pgnsave(void) { if ( strlen(token[1]) > 0 ) PGNSaveToFile (token[1], ""); else printf(_("Invalid filename.\n")); } void cmd_graphic(void) { graphicmodeoutput = 1; printf(_("Graphic mode is enabled.\n")); } void cmd_nographic(void) { graphicmodeoutput = 0; printf(_("Graphic mode is disabled.\n")); } void cmd_ping(void) { SetDataToEngine( token[0] ); /* If ping is received when we are on move, we are supposed to reply only after moving. In this version of GNU Chess, we never read commands while we are on move, so we don't have to worry about that here. */ printf("pong %s\n", token[1]); fflush(stdout); } void cmd_post(void) { SET (flags, POST); postFlag = 1; if ( hardFlag && postFlag ) ExpectAnswerFromEngine( true ); ExpectAnswerFromEngine( true ); SetDataToEngine( token[0] ); } void cmd_protover(void) { SetDataToEngine( token[0] ); return; if (flags & XBOARD) { /* Note: change this if "draw" command is added, etc. */ printf("feature setboard=1 analyze=1 ping=1 draw=0 sigint=0\ variants=\"normal\" myname=\"%s %s\" done=1\n", PROGRAM, VERSION); fflush(stdout); } } void cmd_quit(void) { SET (flags, QUIT); } void cmd_random(void) { printf( _("Command 'random' is currently not supported.\n") ); SetDataToEngine( token[0] ); } void cmd_rating(void) { myrating = atoi(token[1]); opprating = atoi(token[2]); fprintf(ofp,_("my rating = %d, opponent rating = %d\n"),myrating,opprating); /* Change randomness of book based on opponent rating. */ /* Basically we play narrower book the higher the opponent */ if (opprating >= 1700) bookfirstlast = 2; else if (opprating >= 1700) bookfirstlast = 2; else bookfirstlast = 2; } void cmd_rejected(void) {} void cmd_remove(void) { SetDataToEngine( token[0] ); if (GameCnt >= 0) { CLEAR (flags, ENDED); CLEAR (flags, TIMEOUT); UnmakeMove (board.side, &Game[GameCnt].move); if (GameCnt >= 0) { UnmakeMove (board.side, &Game[GameCnt].move); if (!(flags & XBOARD)) ShowBoard (); } PGNSaveToFile ("game.log",""); } else printf (_("No moves to undo!\n")); } void cmd_result(void) { SetDataToEngine( token[0] ); if (ofp != stdout) { fprintf(ofp, "result: %s\n",token[1]); fclose(ofp); ofp = stdout; printf(_("Save to %s\n"),gamefile); PGNSaveToFile (gamefile, token[1]); DBUpdatePlayer (name, token[1]); } } void cmd_save(void) { if ( strlen(token[1]) > 0 ) SaveEPD (token[1]); else printf(_("Invalid filename.\n")); } void cmd_setboard(void) { /* setboard uses FEN, not EPD, but ParseEPD will accept FEN too */ char data[MAXSTR]=""; ParseEPD (token[1]); NewPosition(); check_board(); snprintf(data, sizeof(data), "setboard %s", token[1]); SetDataToEngine(data); } void cmd_solve(void) { Solve (token[1]); } /* Set total time for move to be N seconds is "st N" */ void cmd_st(void) { char data[MAXSTR]=""; /* Approximately level 1 0 N */ sscanf(token[1],"%d",&TCinc); /* Allow a little fussiness for failing low etc */ SearchTime = TCinc * 0.90f ; sprintf( data, "st %d", atoi( token[1] ) ); SetDataToEngine( data ); } void cmd_switch(void) { printf( _("Command 'switch' is currently not supported.\n") ); } void cmd_time(void) { SetDataToEngine( token[0] ); printf( _("Old TimeLimit = %g\n"), TimeLimit[1^board.side] ); TimeLimit[1^board.side] = atoi(token[1]) / 100.0f ; printf( _("New TimeLimit = %g\n"), TimeLimit[1^board.side] ); } void cmd_undo(void) { SetDataToEngine( "force\nundo" ); ChangeColor( true ); SetAutoGo( !(flags & MANUAL) ); if (GameCnt >= 0) UnmakeMove (board.side, &Game[GameCnt].move); else printf (_("No moves to undo!\n")); MoveLimit[board.side]++; TimeLimit[board.side] += Game[GameCnt+1].et; if (!(flags & XBOARD)) ShowBoard (); } void cmd_usage(void) { printf ( "\n" ); printf ( _("\ Usage: %s [OPTION]...\n\n"), progname ); fputs( _("\ Play the game of chess\n\n"), stdout ); fputs( _("Options:\n"), stdout ); fputs( _("\ -h, --help display this help and exit\n"), stdout ); fputs( _("\ -v, --version display version information and exit\n"), stdout ); fputs( _("\ -q, --quiet make the program silent on startup\n"), stdout ); fputs( _("\ --silent same as -q\n"), stdout ); fputs( _("\ \n"), stdout ); fputs( _("\ -x, --xboard start in engine mode\n"), stdout ); fputs( _("\ -p, --post start up showing thinking\n"), stdout ); fputs( _("\ -e, --easy disable thinking in opponents time\n"), stdout ); fputs( _("\ -m, --manual enable manual mode\n"), stdout ); fputs( _("\ -u, --uci enable UCI protocol (externally behave as UCI engine)\n"), stdout ); fputs( _("\ -M size, --memory=size specify memory usage in MB for hashtable\n"), stdout ); fputs( _("\ -a filename, --addbook=filename compile book.bin from pgn book 'filename'\n"), stdout ); fputs( _("\ -g, --graphic enable graphic mode\n"), stdout ); fputs( _("\ \n"), stdout ); fputs( _("\ Options xboard and post are accepted without leading dashes\n\ for backward compatibility.\n\ \n"), stdout ); fputs( _("\ Moves are accepted either in standard algebraic notation (SAN) or\n\ in coordinate algebraic notation.\n\ \n"), stdout ); fputs( _("\ The file 'gnuchess.ini' allows setting config options. See\n\ 'info gnuchess' for details. The file will be looked up in the current\n\ directory or, if not found there, in the directory pointed to by\n\ environment variable GNUCHESS_PKGDATADIR.\n\ \n"), stdout ); fputs( _("\ Report bugs to .\n\ \n"), stdout ); } /* Play variant, we instruct interface in protover we play normal */ void cmd_variant(void) {} void cmd_usermove(void) { /* TODO: Remove the first SetDataToEngine */ /*SetDataToEngine( token[0] );*/ leaf *ptr; ptr = ValidateMove (token[1]); if (ptr != NULL) { /* Since the user entered a move: * 1. The move must be sent to the engine. * 2. A reply is expected from the engine. */ SetUserInputValidMove( 1 ); SetDataToEngine( token[0] ); pgnloaded = 0; ExpectAnswerFromEngine( true ); SANMove (ptr->move, 1); MakeMove (board.side, &ptr->move); strcpy (Game[GameCnt].SANmv, SANmv); printf("%d. ",GameCnt/2+1); printf("%s",token[1]); if (ofp != stdout) { fprintf(ofp,"%d. ",GameCnt/2+1); fprintf(ofp,"%s",token[1]); } putchar('\n'); fflush(stdout); if (ofp != stdout) { fputc('\n',ofp); fflush(ofp); } if (!(flags & XBOARD)) ShowBoard (); SET (flags, THINK); } else { /* * Must Output Illegal move to prevent Xboard accepting illegal * en passant captures and other subtle mistakes */ printf(_("Invalid move: %s\n"),token[1]); fflush(stdout); } } void cmd_version(void) { if (!(flags & XBOARD)) printf ("%s %s\n", PROGRAM, VERSION); else printf ("Chess\n"); } void cmd_white(void) { /* * No longer used by Xboard but requested as a feature */ printf( _("Command 'white' is currently not supported.\n") ); } void cmd_xboard(void) { SetDataToEngine( "xboard" ); if (tokeneq (token[1], "off")) CLEAR (flags, XBOARD); else if (tokeneq (token[1], "on")) SET (flags, XBOARD); else if (!(flags & XBOARD)) { /* set if unset and only xboard called */ SET (flags, XBOARD); /* like in xboard/winboard usage */ } } /* * Command with subcommands, could write secondary method * tables here */ void cmd_show (void) /************************************************************************ * * The show command driver section. * ************************************************************************/ { if (tokeneq (token[1], "board")) ShowBoard (); else if (tokeneq (token[1], "rating")) { printf(_("My rating = %d\n"),myrating); printf(_("Opponent rating = %d\n"),opprating); } else if (tokeneq (token[1], _("time"))) ShowTime (); else if (tokeneq (token[1], _("moves"))) { GenCnt = 0; TreePtr[2] = TreePtr[1]; GenMoves (1); ShowMoveList (1); printf (_("No. of moves generated = %ld\n"), GenCnt); } else if (tokeneq (token[1], "escape")) { GenCnt = 0; TreePtr[2] = TreePtr[1]; GenCheckEscapes (1); ShowMoveList (1); printf (_("No. of moves generated = %ld\n"), GenCnt); } else if (tokeneq (token[1], "noncapture")) { GenCnt = 0; TreePtr[2] = TreePtr[1]; GenNonCaptures (1); FilterIllegalMoves (1); ShowMoveList (1); printf (_("No. of moves generated = %ld\n"), GenCnt); } else if (tokeneq (token[1], "capture")) { GenCnt = 0; TreePtr[2] = TreePtr[1]; GenCaptures (1); FilterIllegalMoves (1); ShowMoveList (1); printf (_("No. of moves generated = %ld\n"), GenCnt); } else if (tokeneq (token[1], "eval") || tokeneq (token[1], "score")) { printf( _("Command 'show eval/score' is currently not supported.\n") ); return; } else if (tokeneq (token[1], "game")) ShowGame (); else if (tokeneq (token[1], "pin")) { printf( _("Command 'show pin' is currently not supported.\n") ); return; } } void cmd_test (void) /************************************************************************* * * The test command driver section. * *************************************************************************/ { printf( _("Command 'test' is currently not supported.\n") ); } /* * This is more or less copied from the readme, and the * parser is not very clever, so the lines containing * command names should not be indented, the lines with * explanations following them should be indented. Do not * use tabs for indentation, only spaces. CAPITALS are * reserved for parameters in the command names. The * array must be terminated by two NULLs. * * This one should be integrated in the method table. * (Very much like docstrings in Lisp.) */ static const char * const helpstr[] = { "quit", gettext_noop(" Quits the program."), "exit", gettext_noop(" In analysis mode this stops analysis, otherwise it quits the program."), "help", gettext_noop(" Produces a help blurb corresponding to this list of commands."), "book", gettext_noop(" add - compiles book.bin from a pgn book file"), gettext_noop(" on - enables use of book (default)"), gettext_noop(" off - disables use of book"), gettext_noop(" worst - plays worst move from book"), gettext_noop(" best - plays best move from book"), gettext_noop(" prefer - same as 'book on' (default)"), gettext_noop(" random - plays any move from book"), "version", gettext_noop(" Prints out the version of this program."), "previous", "p", gettext_noop(" Backs up one move in pgn loaded game."), "pgnsave FILENAME", gettext_noop(" Saves the game so far from memory to the file."), "pgnload FILENAME", gettext_noop(" Loads the game in the file into memory."), "pgnreplay FILENAME", gettext_noop(" Loads the game in the file into memory, and enables\n" " the commands 'first', 'last', 'next', 'previous'."), "next", "n", gettext_noop(" Advances one move in pgn loaded game."), "first", gettext_noop(" Goes to begin position of pgn loaded game."), "last", gettext_noop(" Goes to end position of pgn loaded game."), "force", "manual", gettext_noop(" Makes the program stop moving. You may now enter moves\n" " to reach some position in the future."), " ", "white", gettext_noop(" Program plays white."), "black", gettext_noop(" Program plays black."), "go", gettext_noop(" Computer takes whichever side is on move and begins its\n" " thinking immediately."), "post", gettext_noop(" Arranges for verbose thinking output showing variation, score,\n" " time, depth, etc."), "nopost", gettext_noop(" Turns off verbose thinking output."), "name NAME", gettext_noop(" Lets you input your name. Also writes the log.nnn and\n" " corresponding game.nnn files. For details please see\n" " the auxiliary file format sections."), "result", gettext_noop(" Mostly used by Internet Chess Server."), "activate", gettext_noop(" This command reactivates a game that has been terminated automatically\n" " due to checkmate or no more time on the clock. However, it does not\n" " alter those conditions. So you would have to undo a move or two, or\n" " add time to the clock with 'level' or 'time'."), "rating COMPUTERRATING OPPONENTRATING", gettext_noop(" Inputs the estimated rating for computer and for its opponent."), "new", gettext_noop(" Sets up a new game (i.e. pieces in original positions)."), "time", gettext_noop(" Inputs time left in game for computer in hundredths of a second.\n" " Mostly used by Internet Chess Server."), "hash", gettext_noop(" on - enables using the memory hash table to speed up search"), gettext_noop(" off - disables the memory hash table"), "memory N", gettext_noop(" Sets the hash table to permit storage of N MB."), "null", gettext_noop(" on - enables using the null-move heuristic to speed up search"), gettext_noop(" off - disables using the null-move heuristic"), "xboard", gettext_noop(" on - enables use of xboard/winboard"), gettext_noop(" off - disables use of xboard/winboard"), "depth N", gettext_noop(" Sets the program to look N ply (half-moves) deep for every\n" " search it performs. If there is a checkmate or other condition\n" " that does not allow that depth, then it will not be."), "level MOVES MINUTES INCREMENT", gettext_noop(" Sets time control to be MOVES in MINUTES, with each move giving\n" " an INCREMENT (in seconds, i.e. a Fischer-style clock)."), "load", "epdload", gettext_noop(" Loads a position in EPD format from disk into memory."), "save", "epdsave", gettext_noop(" Saves game position into EPD format from memory to disk."), "switch", gettext_noop(" Switches side to move."), "solve FILENAME", "solveepd FILENAME", gettext_noop(" Solves the positions in FILENAME."), "remove", gettext_noop(" Backs up two moves in game history."), "undo", gettext_noop(" Backs up one move in game history."), "usage", gettext_noop(" Displays command line syntax."), "show", gettext_noop(" board - displays the current board"), gettext_noop(" time - displays the time settings"), gettext_noop(" moves - shows all moves using one call to routine"), gettext_noop(" escape - shows moves that escape from check using one call to routine"), gettext_noop(" noncapture - shows non-capture moves"), gettext_noop(" capture - shows capture moves"), gettext_noop(" eval [or score] - shows the evaluation per piece and overall"), gettext_noop(" game - shows moves in game history"), gettext_noop(" pin - shows pinned pieces"), "test", gettext_noop(" movelist - reads in an epd file and shows legal moves for its entries"), gettext_noop(" capture - reads in an epd file and shows legal captures for its entries"), gettext_noop(" movegenspeed - tests speed of move generator"), gettext_noop(" capturespeed - tests speed of capture move generator"), gettext_noop(" eval - reads in an epd file and shows evaluation for its entries"), gettext_noop(" evalspeed - tests speed of the evaluator"), "bk", gettext_noop(" Shows moves from opening book."), "graphic", gettext_noop(" Enables display board in graphic mode."), "nographic", gettext_noop(" Disables graphic mode and display classical view."), NULL, NULL }; void cmd_help (void) /************************************************************************** * * Display all the help commands. * **************************************************************************/ { const char * const *p; int count, len; if (strlen(token[1])>0) { for (p=helpstr, count=0; *p; p++) { if (strncmp(*p, token[1], strlen(token[1])) == 0) { puts(*p); while (*++p && **p != ' ') /* Skip aliases */ ; for (; *p && **p == ' '; p++) { puts(_(*p)); } return; } } printf(_("Help for command %s not found\n\n"), token[1]); } printf(_("List of commands: (help COMMAND to get more help)\n")); for (p=helpstr, count=0; *p; p++) { len = strcspn(*p, " "); if (len > 0) { count += printf("%.*s ", len, *p); if (count > 60) { count = 0; puts(""); } } } puts(""); } /* * Try a method table, one could also include the documentation * strings here */ struct methodtable { const char *name; void (*method) (void); }; /* Last entry contains two NULL pointers */ /* List commands we don't implement to avoid illegal moving them */ const struct methodtable commands[] = { { "?", cmd_movenow }, { "accepted", cmd_accepted }, { "activate", cmd_activate }, { "analyze", cmd_analyze }, { "bk", cmd_bk }, { "black", cmd_black }, { "book", cmd_book }, { "depth", cmd_depth }, { "easy", cmd_easy }, { "edit", cmd_edit }, { "epdload", cmd_load }, { "epdsave", cmd_save }, { "exit", cmd_exit }, { "force", cmd_force }, { "go", cmd_go }, { "graphic", cmd_graphic }, { "hard", cmd_hard }, { "hash", cmd_hash }, { "help", cmd_help }, { "hint", cmd_hint }, { "ics", cmd_ics }, { "last", cmd_last }, { "level", cmd_level }, { "list", cmd_list }, { "load", cmd_load }, { "manual", cmd_manual }, { "memory", cmd_memory }, { "name", cmd_name }, { "new", cmd_new }, { "next", cmd_next }, { "n", cmd_next }, { "nographic", cmd_nographic }, { "nopost", cmd_nopost }, { "null", cmd_null }, { "otim", cmd_otim }, { "pgnload", cmd_pgnload }, { "pgnreplay", cmd_pgnreplay }, { "pgnsave", cmd_pgnsave }, { "ping", cmd_ping }, { "post", cmd_post }, { "previous", cmd_previous }, { "p", cmd_previous }, { "first", cmd_first }, { "protover", cmd_protover }, { "quit", cmd_quit }, { "random", cmd_random }, { "rating", cmd_rating }, { "rejected", cmd_rejected }, { "remove", cmd_remove }, { "result", cmd_result }, { "save", cmd_save }, { "setboard", cmd_setboard }, { "show", cmd_show }, { "solve", cmd_solve }, { "solveepd", cmd_solve }, { "st", cmd_st }, { "switch", cmd_switch }, { "test", cmd_test }, { "time", cmd_time }, { "undo", cmd_undo }, { "usage", cmd_usage }, { "usermove", cmd_usermove }, { "variant", cmd_variant }, { "version", cmd_version }, { "white", cmd_white }, { "xboard", cmd_xboard }, { NULL, NULL } }; void parse_input(void) /************************************************************************* * * This is the main user command interface driver. * *************************************************************************/ { leaf *ptr; const struct methodtable * meth; dbg_printf("parse_input() called, inputstr = *%s*\n", inputstr); /* Initialize variables used to send messages to the engine */ SetDataToEngine( "" ); ExpectAnswerFromEngine( false ); SetUserInputValidMove( 0 ); ChangeColor( false ); split_input(); for (meth = commands; meth->name != NULL; meth++) { if (tokeneq(token[0], meth->name)) { meth->method(); return; } } /* OK, no known command, this should be a move */ ptr = ValidateMove (token[0]); if (ptr != NULL) { /* Since the user entered a move: * 1. The move must be sent to the engine. * 2. A reply is expected from the engine. */ SetUserInputValidMove( 1 ); SetDataToEngine( token[0] ); pgnloaded = 0; ExpectAnswerFromEngine( true ); SANMove (ptr->move, 1); MakeMove (board.side, &ptr->move); strcpy (Game[GameCnt].SANmv, SANmv); printf("%d. ",GameCnt/2+1); printf("%s",token[0]); if (ofp != stdout) { fprintf(ofp,"%d. ",GameCnt/2+1); fprintf(ofp,"%s",token[0]); } putchar('\n'); fflush(stdout); if (ofp != stdout) { fputc('\n',ofp); fflush(ofp); } if (!(flags & XBOARD)) ShowBoard (); SET (flags, THINK); } else { /* * Must Output Illegal move to prevent Xboard accepting illegal * en passant captures and other subtle mistakes */ printf(_("Invalid move: %s\n"),token[0]); fflush(stdout); } } void check_board() /************************************************************************* * * When the board is changed by commands, call the Validation * routine, and if it fails set flags to prevent the analysis of * illegal positions, as the code is not robust against the * analysis of such positions (To Do). * *************************************************************************/ { if (!ValidateBoard()) { SET (flags, ENDED); if (flags & XBOARD) { printf ("telluser Board is wrong!\n"); fflush(stdout); } else { printf (_("Board is wrong!\n")); } } } gnuchess-6.2.2/src/frontend/common.h000644 000766 000024 00000044110 12606676130 020231 0ustar00antoniostaff000000 000000 /* common.h GNU Chess frontend Copyright (C) 2001-2011 Free Software Foundation, Inc. GNU Chess is based on the two research programs Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Contact Info: bug-gnu-chess@gnu.org cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net */ #ifndef COMMON_H #define COMMON_H #include #ifndef __GNUC__ # define __attribute__(x) #endif /* * Include "uint64_t" and similar types using the ac_need_stdint_h ac macro */ #include "GCint.h" #include #include /* * Define time structures to get timeval for Timer */ #include /* * Define macro for declaring 64bit constants for compilers not using ULL */ #ifdef _MSC_VER #define ULL(x) ((uint64_t)(x)) #else #define ULL(x) x ## ULL #endif /* * BitBoard is a key data type. It is a 64-bit value, in which each * bit represents a square on the board as defined by "enum Square". * Thus, bit position 0 represents a fact about square a1, and bit * position 63 represents a fact about square h8. For example, the * bitboard representing "white rook" positions will have a bit set * for every position occupied on the board by a white rook. */ typedef uint64_t BitBoard; typedef uint64_t HashType; typedef uint32_t KeyType; /* * Board represents an entire board's state, and is structured to * simplify analysis: */ typedef struct { BitBoard b[2][7]; /* piece/pawn positions by side (0=white, 1=black) and then by piece (1=pawn..6=king). For example, b[white][knight] has bits set for every board position occupied by a White Knight. */ BitBoard friends[2]; /* Friendly (this side's) pieces */ BitBoard blocker; BitBoard blockerr90; /* rotated 90 degrees */ BitBoard blockerr45; /* rotated 45 degrees */ BitBoard blockerr315; /* rotated 315 degrees */ short ep; /* Location of en passant square */ short flag; /* Flags related to castle privileges */ short side; /* Color of side on move: 0=white, 1=black */ short material[2]; /* Total material by side not inc. king */ short pmaterial[2]; /* Total pawn material by side not inc. king */ short castled[2]; /* True (1) if side is castled */ short king[2]; /* Location of king 0 - a1 .. 63 - h8 */ } Board; /* leaf describes a leaf-level analysis result */ typedef struct { int move; /* the move that produced this particular board */ int score; /* the scored value of this leaf */ } leaf; /* * GameRec records an individual move made in the game; an entire * Game is a set of GameRec's: */ #define SANSZ 8 /* longest move is "exf8=Q+" so 7+1 */ typedef struct { int move; /* The actual move made; this is NOT the move count! */ short epsq; /* en passant square */ short bflag; /* Flags for castle privs, see Board.flag */ short Game50; /* The last value of GameCnt (a count of half-moves) that castled, captured, or moved a pawn */ short mvboard; float et; /* elapsed time */ HashType hashkey; HashType phashkey; char SANmv[SANSZ]; /* The move in SAN notation */ char *comments; } GameRec; /* MACRO definitions */ #ifndef MAX #define MAX(a,b) ((a) > (b) ? (a) : (b)) #endif #ifndef MIN #define MIN(a,b) ((a) < (b) ? (a) : (b)) #endif #define SET(a,b) \ do { \ (a) |= (b); \ dbg_printf("Set 0x%x\n", (b)); \ } while (0) #define CLEAR(a,b) \ do { \ (a) &= ~(b); \ dbg_printf("Clear 0x%x\n", (b)); \ } while (0) /* Draw score can be used to penalise draws if desired */ #define PHASE (8 - (board.material[white]+board.material[black]) / 1150) /* Attack MACROS */ #define BishopAttack(sq) \ (Bishop45Atak[sq][(board.blockerr45 >> Shift45[sq]) & Mask45[sq]] | \ Bishop315Atak[sq][(board.blockerr315 >> Shift315[sq]) & Mask315[sq]]) #define RookAttack(sq) \ (Rook00Atak[sq][(board.blocker >> Shift00[sq]) & 0xFF] | \ Rook90Atak[sq][(board.blockerr90 >> Shift90[sq]) & 0xFF]) #define QueenAttack(sq) \ (BishopAttack(sq) | RookAttack(sq)) /* Some bit macros */ /* * gcc 2.95.4 completely screws up the macros with lookup tables * with -O2 on PPC, maybe this check has to be refined. (I don't know * whether other architectures also suffer from this gcc bug.) However, * with gcc 3.0, the lookup tables are _much_ faster than this direct * calculation. */ #if defined(__GNUC__) && defined(__PPC__) && __GNUC__ < 3 # define SETBIT(b,i) ((b) |= ((ULL(1)<<63)>>(i))) # define CLEARBIT(b,i) ((b) &= ~((ULL(1)<<63)>>(i))) #else # define SETBIT(b,i) ((b) |= BitPosArray[i]) # define CLEARBIT(b,i) ((b) &= NotBitPosArray[i]) #endif #define RANK(i) ((i) >> 3) #define ROW(i) ((i) & 7) #define trailz(b) (leadz ((b) & ((~b) + 1))) /* Move Descriptions (moves) are represented internally as integers. * The lowest 6 bits define the destination ("TO") square, and * the next lowest 6 bits define the source ("FROM") square, * using the values defined by "enum Square" (0=a1, 63=h8). * Upper bits are used to identify other move information such as * a promotion (and to what), a capture (and of what), * CASTLING moves, and ENPASSANT moves; see the "constants for * move description" below for more information on these upper bits. */ #define PROMOTEPIECE(a) ((a >> 12) & 0x0007) #define CAPTUREPIECE(a) ((a >> 15) & 0x0007) #define TOSQ(a) ((a) & 0x003F) #define FROMSQ(a) ((a >> 6) & 0x003F) #define MOVE(a,b) (((a) << 6) | (b)) /* constants for move description */ #define KNIGHTPRM 0x00002000 #define BISHOPPRM 0x00003000 #define ROOKPRM 0x00004000 #define QUEENPRM 0x00005000 #define PROMOTION 0x00007000 #define PAWNCAP 0x00008000 #define KNIGHTCAP 0x00010000 #define BISHOPCAP 0x00018000 #define ROOKCAP 0x00020000 #define QUEENCAP 0x00028000 #define CAPTURE 0x00038000 #define NULLMOVE 0x00100000 #define CASTLING 0x00200000 #define ENPASSANT 0x00400000 #define MOVEMASK (CASTLING | ENPASSANT | PROMOTION | 0x0FFF) #define white 0 #define black 1 #define false 0 #define true 1 #define ks 0 #define qs 1 #define MATE 32767 #define MATESCORE(a) ((a) > MATE-255 || (a) < -MATE+255) /* constants for Board */ #define WKINGCASTLE 0x0001 #define WQUEENCASTLE 0x0002 #define BKINGCASTLE 0x0004 #define BQUEENCASTLE 0x0008 #define WCASTLE (WKINGCASTLE | WQUEENCASTLE) #define BCASTLE (BKINGCASTLE | BQUEENCASTLE) /* Material values */ #define ValueP 100 #define ValueN 350 #define ValueB 350 #define ValueR 550 #define ValueQ 1100 #define ValueK 2000 /* Some special BitBoards */ #define NULLBITBOARD ( ULL(0x0000000000000000)) #define WHITESQUARES ( ULL(0x55AA55AA55AA55AA)) #define BLACKSQUARES ( ULL(0xAA55AA55AA55AA55)) #define CENTRESQUARES ( ULL(0x0000001818000000)) #define COMPUTERHALF ( ULL(0xFFFFFFFF00000000)) #define OPPONENTHALF ( ULL(0x00000000FFFFFFFF)) /* Game flags */ #define QUIT 0x0001 #define TESTT 0x0002 #define THINK 0x0004 #define MANUAL 0x0008 #define TIMEOUT 0x0010 #define UCI 0x0020 #define WEAK 0x0020 #define ENDED 0x0040 #define USEHASH 0x0080 #define SOLVE 0x0100 #define USENULL 0x0200 #define XBOARD 0x0400 #define TIMECTL 0x0800 #define POST 0x1000 #define PONDER 0x2000 /* We are in pondering (during search) */ #define HARD 0x4000 /* Pondering is turned on */ #define ANALYZE 0x8000 /* In ANALYZE mode */ /* Book modes */ #define BOOKOFF 0 #define BOOKRAND 1 #define BOOKBEST 2 #define BOOKWORST 3 #define BOOKPREFER 4 #define MAXTREEDEPTH 2000 #define MAXPLYDEPTH 65 #define MAXGAMEDEPTH 600 #define R_WHITE_WINS 1 #define R_BLACK_WINS 2 #define R_DRAW 3 #define R_NORESULT 4 extern unsigned char lzArray[65536]; extern short Shift00[64]; extern short Shift90[64]; extern short Shift45[64]; extern short Shift315[64]; extern BitBoard BitPosArray[64]; extern BitBoard NotBitPosArray[64]; extern BitBoard MoveArray[8][64]; extern BitBoard Ray[64][8]; extern BitBoard FromToRay[64][64]; extern BitBoard RankBit[8]; extern BitBoard FileBit[8]; extern BitBoard Ataks[2][7]; extern BitBoard Rook00Atak[64][256]; extern BitBoard Rook90Atak[64][256]; extern BitBoard Bishop45Atak[64][256]; extern BitBoard Bishop315Atak[64][256]; extern short directions[64][64]; extern unsigned char BitCount[65536]; extern leaf Tree[MAXTREEDEPTH]; extern leaf *TreePtr[MAXPLYDEPTH]; extern GameRec Game[MAXGAMEDEPTH]; extern int RealGameCnt; extern short RealSide; extern int GameCnt; extern int computer; extern unsigned int flags; extern unsigned int preanalyze_flags; extern Board board; extern int cboard[64]; extern int Mvboard[64]; extern HashType hashcode[2][7][64]; extern HashType ephash[64]; extern HashType WKCastlehash; extern HashType WQCastlehash; extern HashType BKCastlehash; extern HashType BQCastlehash; extern HashType Sidehash; extern HashType HashKey; extern HashType PawnHashKey; extern int Game50; extern unsigned long GenCnt; extern int slider[8]; extern int Value[7]; extern char SANmv[SANSZ]; extern char id[32]; extern char solution[64]; extern float SearchTime; extern int MoveLimit[2]; extern float TimeLimit[2]; extern int TCMove; extern int TCinc; extern float TCTime; extern int phase; extern short bookfirstlast; extern short graphicmodeoutput; extern short pgnloaded; /* was pgn game loaded by command pgnreplay */ extern int pgncnt; /* total moves loaded in pgn game */ extern int range[8]; extern int ptype[2]; extern char algbr[64][3]; extern char algbrfile[9]; extern char algbrrank[9]; extern char notation[8]; extern char lnotation[8]; extern int r90[64]; extern int r45[64]; extern int r315[64]; extern int Mask45[64]; extern int Mask315[64]; extern char *progname; extern FILE *ofp; extern int myrating, opprating; #define MAXNAMESZ 50 extern char name[MAXNAMESZ]; extern int computerplays; extern int n; /* Last mobility returned by CTL */ extern int ExchCnt[2]; enum Piece { empty, pawn, knight, bishop, rook, queen, king, bpawn }; enum Square { A1, B1, C1, D1, E1, F1, G1, H1, A2, B2, C2, D2, E2, F2, G2, H2, A3, B3, C3, D3, E3, F3, G3, H3, A4, B4, C4, D4, E4, F4, G4, H4, A5, B5, C5, D5, E5, F5, G5, H5, A6, B6, C6, D6, E6, F6, G6, H6, A7, B7, C7, D7, E7, F7, G7, H7, A8, B8, C8, D8, E8, F8, G8, H8 }; enum File { A_FILE, B_FILE, C_FILE, D_FILE, E_FILE, F_FILE, G_FILE, H_FILE }; /**************************************************************************** * * The various function prototypes. They are group into the *.c files * in which they are defined. * ****************************************************************************/ /* * Explanation of the #ifdef NO_INLINE conditionals: * * Define NO_INLINE only if you really must, implementations will be * provided by the corresponding *.c files. The better solution is to * not define it, in which case inlines.h will be included which * provides static inline version of these functions. */ /* The initialization routines */ void Initialize (void); void InitLzArray (void); void InitBitPosArray (void); void InitMoveArray (void); void InitRay (void); void InitFromToRay (void); void InitRankFileBit (void); void InitBitCount (void); void InitPassedPawnMask (void); void InitIsolaniMask (void); void InitSquarePawnMask (void); void InitRandomMasks (void); void InitRotAtak (void); void InitDistance (void); void InitVars (void); void InitHashCode (void); void InitHashTable (void); void NewPosition (void); void InitInput (void); /* The move generation routines */ void GenMoves (short); void GenCaptures (short); void GenNonCaptures (short); void GenCheckEscapes (short); void FilterIllegalMoves (short); /* The move routines */ void MakeMove (int, int *); void UnmakeMove (int, int *); void SANMove (int, int); leaf *ValidateMove (char *); leaf *IsInMoveList (int, int, int, char); char *AlgbrMove (int); /* The attack routines */ short SqAtakd (short sq, short side); BitBoard AttackTo (int, int); int PinnedOnKing (int, int); /* The swap routines */ int SwapOff (int); void AddXrayPiece (int, int, int, BitBoard *, BitBoard *); /* The EPD routines */ short ReadEPDFile (const char *, short); int ParseEPD (char *); void LoadEPD (char *); void SaveEPD (char *); /* Error codes for ParseEPD */ enum { EPD_SUCCESS, EPD_ERROR }; void UpdateFriends (void); void UpdateCBoard (void); void UpdateMvboard (void); short ValidateBoard (void); /* PGN routines */ void PGNSaveToFile (const char *, const char *); void PGNReadFromFile (const char *, int showheading); /* Some output routines */ void ShowMoveList (int); void ShowSmallBoard (void); void ShowBoard (void); void ShowCBoard (void); void ShowMvboard (void); void ShowGame (void); void ShowTime (void); /* Solver routines */ void Solve (char *); /* Player database */ void DBSortPlayer (const char *style); void DBListPlayer (const char *style); void DBReadPlayer (void); void DBWritePlayer (void); int DBSearchPlayer (const char *player); void DBUpdatePlayer (const char *player, const char *resultstr); #define BUF_SIZE 4096 #define MAXSTR 128 extern char inputstr[BUF_SIZE]; /* Input parser */ void parse_input(void); /* Check Board to avoid analysis of incorrectly input positions */ void check_board(void); /* Commands from the input engine */ void cmd_activate(void); void cmd_analyze(void); void cmd_bk(void); void cmd_black(void); void cmd_book(void); void cmd_computer(void); void cmd_depth(void); void cmd_draw(void); void cmd_easy(void); void cmd_edit(void); void cmd_epd(void); void cmd_exit(void); void cmd_force(void); void cmd_go(void); void cmd_graphic(void); void cmd_hard(void); void cmd_hash(void); void cmd_help (void); void cmd_hint(void); void cmd_last(void); void cmd_level(void); void cmd_list(void); void cmd_load(void); void cmd_manual(void); void cmd_movenow(void); void cmd_name(void); void cmd_next(void); void cmd_new(void); void cmd_nographic(void); void cmd_nopost(void); void cmd_null(void); void cmd_otim(void); void cmd_pgnload(void); void cmd_pgnreplay(void); void cmd_pgnsave(void); void cmd_ping(void); void cmd_post(void); void cmd_previous(void); void cmd_first(void); void cmd_protover(void); void cmd_quit(void); void cmd_random(void); void cmd_rating(void); void cmd_rejected(void); void cmd_remove(void); void cmd_result(void); void cmd_save(void); void cmd_setboard(void); void cmd_show (void); void cmd_solve(void); void cmd_st(void); void cmd_switch(void); void cmd_test (void); void cmd_time(void); void cmd_undo(void); void cmd_usage(void); void cmd_variant(void); void cmd_version(void); void cmd_white(void); void cmd_xboard(void); /* * Define NO_INLINE only if you really must, implementations will be * provided by the corresponding *.c files. The better solution is to * not define it, in which case inlines.h will be included which * provides static inline version of these functions. */ /* Some utility routines */ #ifdef NO_INLINE unsigned char leadz (BitBoard); unsigned char nbits (BitBoard); #else # include "inlines.h" #endif /* More elaborate debugging output to logfile */ /* All the following functions are no-ops if DEBUG is not defined */ /* * dbg_open() can be called with NULL as argument, using a default * filename, defined in debug.c, for the debug log. Otherwise the * argument is the filename. If dbg_open() fails or is not called at * all, debugging output goes to stderr by default. */ int dbg_open(const char *name); /* Same format rules as printf() */ int dbg_printf(const char *fmt, ...); /* Closes the debugging log, if it is not stderr */ int dbg_close(void); # ifdef DEBUG # include # define ASSERT(x) assert(x) # else # define ASSERT(x) # endif /* * Initializes data used in the frontend. */ void InitFrontend( void ); /* * Reads a char string entered by the user. */ void ReadFromUser( void ); /* * Sends a message to the adapter/engine. */ int SendToEngine( char msg[] ); /* * Reads a char string message from the adapter/engine. */ int ReadFromEngine( void ); /* * Saves in global variable 'dataToEngine' the data to be sent to the engine. */ void SetDataToEngine( const char data[] ); /* * Stores in a global flag variable whether an answer is expected from * the engine (1) or not (0). */ void ExpectAnswerFromEngine( int ); /* * If the prompt must be displayed on the standard output, according to * the current state, it is displayed. */ void ShowPrompt( void ); /* * Extracts a command from the user input buffer. */ void NextUserCmd( void ); /* * Extracts a command from the engine input buffer. */ void NextEngineCmd( void ); /* * Stores in a global flag variable whether an input from the user is a * valid move (1) or not (0). */ void SetUserInputValidMove( int valid ); /* * Flags whether the color must be changed, e.g. due to an undo command. */ void ChangeColor( int change ); /* * Sets the autoGo flag, meaning that after a user move a go command will be * sent to the engine. This may be necessary after an undo. */ void SetAutoGo( int go ); /* * Checks whether the autoGo flag is set or not. */ int GetAutoGo( void ); /* * Reads a char string entered by the user. * The string must be a command or a move. * The string is sent to the engine straight away. */ void ForwardUserInputToEngine( void ); /* * Reads a char string message from the engine. * The message is output'd straight away. */ void ForwardEngineOutputToUser( void ); #endif /* !COMMON_H */ gnuchess-6.2.2/src/frontend/debug.cc000644 000766 000024 00000004660 12451350270 020163 0ustar00antoniostaff000000 000000 /* debug.c GNU Chess frontend Copyright (C) 2001-2014 Free Software Foundation, Inc. GNU Chess is based on the two research programs Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Contact Info: bug-gnu-chess@gnu.org cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net */ #include "common.h" #ifdef DEBUG #include #include #include #include #include #include #include #define MAX_DEBUG 1000 #define DEBUG_FILENAME "gnuchess.debug" /* Default to stderr */ static int debug_fd = 2; int dbg_open(const char *name) { int flags = O_WRONLY | O_CREAT | O_APPEND; int mode = 0777; if (name == NULL) { debug_fd = open(DEBUG_FILENAME, flags, mode); } else { debug_fd = open(name, flags, mode); } if (-1 == debug_fd) { debug_fd = 2; return -1; } dbg_printf("--- Opening debug log ---\n"); return debug_fd; } int dbg_close(void) { /* We don't want to close stderr */ if (debug_fd == 2) { return -1; } dbg_printf("--- Closing debug log ---\n"); return close(debug_fd); } int dbg_printf(const char *fmt, ...) { va_list ap; char buf[MAX_DEBUG]; struct timeval tv; gettimeofday(&tv, NULL); #ifdef __APPLE__ sprintf(buf, "%010ld.%06d: ", tv.tv_sec, tv.tv_usec); #else sprintf(buf, "%010ld.%06ld: ", tv.tv_sec, tv.tv_usec); #endif write(debug_fd, buf, strlen(buf)); va_start(ap, fmt); vsnprintf(buf, MAX_DEBUG, fmt, ap); va_end(ap); return write(debug_fd, buf, strlen(buf)); } #else /* !DEBUG */ int dbg_open(const char *name __attribute__((unused)) ) { return 0; } int dbg_printf(const char *fmt __attribute__((unused)), ...) { return 0; } int dbg_close(void) { return 0; } #endif /* DEBUG */ gnuchess-6.2.2/src/frontend/engine.cc000644 000766 000024 00000036360 12606676130 020354 0ustar00antoniostaff000000 000000 /* engine.c GNU Chess frontend Copyright (C) 2001-2015 Free Software Foundation, Inc. GNU Chess is based on the two research programs Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Contact Info: bug-gnu-chess@gnu.org cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net */ #include #include #include #include #include #include #include #include #include "common.h" #include "components.h" #include "gettext.h" #define _(str) gettext (str) /* Message to be sent to the engine */ char inputstr[BUF_SIZE]=""; /* Message to be sent to the engine */ char dataToEngine[BUF_SIZE]=""; /* Whether an answer is expected from the engine or not, as a result of a command send to it. */ static int answerFromEngineExpected=false; /* A BUF_SIZE long char string made up of null characters */ static char zerochar[BUF_SIZE]; /* Whether the prompt must be displayed or not. */ static int showprompt=1; /* Buffer storing the input entered by the user */ char userinputbuf[BUF_SIZE]=""; /* Buffer storing the input coming from the engine */ static char engineinputbuf[BUF_SIZE]=""; /* Whether the input is a move or not (if not, it is expected to be a command). */ static int userInputIsAMove=0; /* Flags that the color must be changed */ static int changeColor=false; /* Flags whether a go command must be sent after a user move. */ static int autoGo=false; /* * Forward declaration of functions */ int SendToEngine( char msg[] ); static int GetNextLine( char buf[], char line[] ); static int GetDataToEngine( char data[] ); static int AnswerFromEngineExpected( void ); static int UserInputIsAValidMove( void ); /* * Initializes data used in the frontend. */ void InitFrontend( void ) { /* Initialized a null char string that will be used later on. */ int i; for ( i=0; itv_sec = 0; time_val->tv_usec = 0; engineinputready = select( pipefd_a2f[0]+1, set, NULL, NULL, time_val ); if ( engineinputready == -1 ) { printf( "Error reading engine input.\n" ); } else if ( engineinputready > 0 ) { /* There are some data from the engine. Store it in buffer */ strncpy( engineinputaux, zerochar, BUF_SIZE ); nread = read( pipefd_a2f[0], engineinputaux, BUF_SIZE ); /*write( STDOUT_FILENO, engineinputaux, BUF_SIZE );*/ strcat( engineinputbuf, engineinputaux ); engineinputbuf[strlen( engineinputbuf ) + nread] = '\0'; } return ( engineinputready ); } /* * Reads a char string entered by the user. * The string must be a command or a move. * The string is not processed straight away, but saved in buffer 'userinputbuf'. * The buffer will be read later from function nextUserCmd(); */ void ReadFromUser( void ) { int nread=0; fd_set set[1]; struct timeval time_val[1]; int userinputready=0; char userinputaux[BUF_SIZE]=""; /* Poll input from user in non-blocking mode */ FD_ZERO(set); FD_SET(STDIN_FILENO,set); time_val->tv_sec = 0; time_val->tv_usec = 0; userinputready = select( STDIN_FILENO+1, set, NULL, NULL, time_val ); if ( userinputready == -1 ) { printf( "Error reading user input.\n" ); } else if ( userinputready > 0 ) { /* There are some data from the user. Store it in buffer */ strncpy( userinputaux, zerochar, BUF_SIZE ); nread = read( STDIN_FILENO, userinputaux, BUF_SIZE ); strcat( userinputbuf, userinputaux ); userinputbuf[strlen( userinputbuf ) + nread] = '\0'; } } /* * Saves in global variable 'dataToEngine' the data to be sent to the engine. */ void SetDataToEngine( const char data[] ) { strcpy( dataToEngine, data ); } /* * Writes in the (output) parameter the data that must be sent to the engine. * * Return value: * 1 - if there are some data to be sent * 0 - if there are no data to be sent */ static int GetDataToEngine( char data[] ) { if ( strcmp( dataToEngine, "" ) == 0 ) { strcpy( data, "" ); return 0; } else { strcpy( data, dataToEngine ); return 1; } } /* * Stores in a global flag variable whether an answer is expected from * the engine (1) or not (0). */ void ExpectAnswerFromEngine( int answerExpected ) { answerFromEngineExpected = answerExpected; } /* * Return value: * 1 - an answer is expected from the engine * 0 - an answer is not expected from the engine */ static int AnswerFromEngineExpected( void ) { return ( answerFromEngineExpected ); } /* * If the prompt must be displayed on the standard output, according to * the current state, it is displayed. */ void ShowPrompt( void ) { char prompt[MAXSTR] = ""; if ( showprompt && !(flags & XBOARD) ) { sprintf(prompt,"%s (%d) : ", RealSide ? _("Black") : _("White"), (RealGameCnt+1)/2 + 1 ); fprintf( stdout, "%s", prompt ); fflush( stdout ); showprompt = 0; } } /* * Extracts a command from the user input buffer. * * The command is removed from the buffer. * If the command must be sent to the engine, it is sent. * This function relies on parse_input(). */ void NextUserCmd( void ) { char userinput[BUF_SIZE]=""; if ( strlen( userinputbuf ) > 0 ) { printf("TimeLimit[0] = %g\n", TimeLimit[0]); printf("TimeLimit[1] = %g\n", TimeLimit[1]); if ( flags & XBOARD ) { fflush( stdout ); } if ( GetNextLine( userinputbuf, userinput ) > 0 ) { strcpy( inputstr, "" ); strcpy( inputstr, userinput ); dbg_printf( "USER >: %s\n", userinput ); parse_input(); /* Check if command/move must be sent to engine */ if ( GetDataToEngine( dataToEngine ) ) { dbg_printf( "> ENGINE: %s\n", dataToEngine ); SendToEngine( dataToEngine ); if ( GetAutoGo() && UserInputIsAValidMove() ) { strcpy( userinputbuf, "go\n" ); SetAutoGo( false ); } } showprompt = !AnswerFromEngineExpected(); /* Check if command was entered in manual mode */ if ( (flags & MANUAL) && UserInputIsAValidMove() ) { RealGameCnt = GameCnt; RealSide = board.side; showprompt = 1; } /* Check if the color must be changed, e.g. after an undo command. */ if ( changeColor ) { RealGameCnt = GameCnt; RealSide = board.side; } } } } /* * Extracts a command from the engine input buffer. * * The command is removed from the buffer. * If the command is a move, the move is made. */ void NextEngineCmd( void ) { char engineinput[BUF_SIZE]=""; char enginemovestr[BUF_SIZE]=""; leaf* enginemove; if ( strlen( engineinputbuf ) > 0 ) { if ( GetNextLine( engineinputbuf, engineinput ) > 0 ) { dbg_printf("< ENGINE: %s\n", engineinput); if ( strncmp( engineinput, "move", 4 ) == 0 ) { /* Input from engine is a move */ sscanf( engineinput, "move %s", enginemovestr ); enginemove = ValidateMove( enginemovestr ); if ( enginemove == (leaf *) NULL ) { dbg_printf( "Bad move from engine\n" ); } else { dbg_printf( "Engine move: <%s> (%d,%d)\n", enginemovestr, (enginemove!=NULL ? enginemove->move : -1), (enginemove!=NULL ? enginemove->score : -1) ); SANMove (enginemove->move, 1); MakeMove( board.side, &(enginemove->move) ); strcpy (Game[GameCnt].SANmv, SANmv); if ( !(flags & XBOARD) ) { ShowBoard(); dbg_printf("USER <: My move is : %s\n", SANmv); printf( _("\nMy move is : %s\n"), SANmv ); fflush( stdout ); } else { dbg_printf("USER <: %d. ... %s\n", GameCnt/2 + 1, enginemovestr ); printf ("%d. ... %s\n", GameCnt/2 + 1, enginemovestr ); fflush( stdout ); dbg_printf("USER <: My move is : %s\n", enginemovestr); printf( "My move is : %s\n", enginemovestr ); fflush( stdout ); } RealGameCnt = GameCnt; showprompt = 1; /* Check if the color must be changed, e.g. after a go command. */ if ( changeColor ) { RealGameCnt = GameCnt; RealSide = board.side; } } } else { dbg_printf( "USER <: %s\n",engineinput ); printf( "%s", engineinput ); if ( flags & XBOARD ) { fflush( stdout ); } } } } } /* * Stores in a global flag variable whether an input from the user is a * valid move (1) or not (0). */ void SetUserInputValidMove( int valid ) { userInputIsAMove = valid; } /* * Return value: * 1 - user input is a valid move * 0 - user input is not a valid move */ static int UserInputIsAValidMove(void) { return ( userInputIsAMove ); } /* * Extracts a line from 'buf' and copies it to 'line'. * * The end-of-line character is also copied. */ static int GetNextLine( char buf[], char line[] ) { char bufaux[BUF_SIZE]=""; int i=0; int found=0; for ( i=0; i 0 ) { strcpy( buf, &(bufaux[i+1]) ); } break; } } return found; } /* * Gets a line from 'buf' and copies it to 'line'. * Unlike GetNextLine, it will not remove the line from the * original buffer. * * The end-of-line character is also copied. */ static int GetNextLineNoRemove( char buf[], char line[] ) { int i=0; int found=0; for ( i=0; i 0 ) { GetNextLineNoRemove( engineinputbuf, engineinput ); assert( strlen( engineinput ) > 0 ); if ( strncmp( engineinput, "move", 4 ) == 0 ) { solved = 1; break; } else { GetNextLine( engineinputbuf, engineinput ); printf( "%s\n", engineinput ); } } sleep( 0 ); } NextEngineCmd(); strcpy( move, SANmv ); } /* * Reads a char string entered by the user. * The string must be a command or a move. * The string is sent to the engine straight away. */ void ForwardUserInputToEngine( void ) { int nread=0; fd_set set[1]; struct timeval time_val[1]; int userinputready=0; char userinputaux[BUF_SIZE]=""; /* Poll input from user in non-blocking mode */ FD_ZERO(set); FD_SET(STDIN_FILENO,set); time_val->tv_sec = 0; time_val->tv_usec = 0; userinputready = select( STDIN_FILENO+1, set, NULL, NULL, time_val ); if ( userinputready == -1 ) { printf( "Error reading user input.\n" ); } else if ( userinputready > 0 ) { /* There are some data from the user. Read the data */ strncpy( userinputaux, zerochar, BUF_SIZE ); nread = read( STDIN_FILENO, userinputaux, BUF_SIZE ); /* Send the data to the engine */ assert( nread+1 < BUF_SIZE-1 ); if ( strcmp(userinputaux,"quit") == 0 || strcmp(userinputaux,"quit\n") == 0 ) { SET (flags, QUIT); } userinputaux[nread] = '\n'; userinputaux[nread+1] = '\0'; int outError=0; int msg_count=0; msg_count = write( pipefd_a2e[1], userinputaux, nread+1 ); if (msg_count == -1) outError = errno; else outError = 0; if ( ! ( ( msg_count == nread+1 ) && ( outError == 0 ) ) ) { printf( "Error sending message to engine.\n" ); assert( 0 ); } } } /* * Reads a char string message from the engine. * The message is output'd straight away. */ void ForwardEngineOutputToUser( void ) { int nread=0; fd_set set[1]; struct timeval time_val[1]; int engineinputready=0; char engineinputaux[BUF_SIZE]=""; /* Poll input from engine in non-blocking mode */ FD_ZERO(set); FD_SET( pipefd_e2a[0],set); time_val->tv_sec = 0; time_val->tv_usec = 0; engineinputready = select( pipefd_e2a[0]+1, set, NULL, NULL, time_val ); if ( engineinputready == -1 ) { printf( "Error reading engine input.\n" ); } else if ( engineinputready > 0 ) { /* There are some data from the engine. Read the data */ strncpy( engineinputaux, zerochar, BUF_SIZE ); nread = read( pipefd_e2a[0], engineinputaux, BUF_SIZE ); /* Write data to output */ assert( nread < BUF_SIZE-1 ); engineinputaux[nread] = '\0'; write( STDOUT_FILENO, engineinputaux, nread ); } } gnuchess-6.2.2/src/frontend/epd.cc000644 000766 000024 00000025034 12451350277 017652 0ustar00antoniostaff000000 000000 /* epd.c GNU Chess frontend Copyright (C) 2001-2011 Free Software Foundation, Inc. GNU Chess is based on the two research programs Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Contact Info: bug-gnu-chess@gnu.org cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net */ #include #include #include #include "common.h" #define EPDCLOSE 1 /* A line read from an EPD file, used in solve.c */ char epd_line[MAXSTR]=""; short ReadEPDFile (const char *file, short op) /**************************************************************************** * * Reads in an EPD file. The first call will read the first EPD line, * the second call will read the 2nd line and so on. To improve * performance, the file is never closed. Closing of the file happens * only on 2 conditions: (i) A ReadEPDFile failed because there is no * more lines to read. (ii) A called to ReadEPDFile to explicitly * request that the file is closed (op = EPDCLOSE); * If op == 2, then we work silently. * Comment lines are stripped off. Comment mark is '#'. * ****************************************************************************/ { static FILE *fp = NULL; char line[MAXSTR]; /* If first time through, must open file */ if (fp == NULL) { fp = fopen (file, "r"); if (fp == NULL) { printf ("Error opening file %s\n", file); return (false); } } /* Is this a close request? */ if (op == EPDCLOSE) { fclose (fp); fp = NULL; return (false); } next_line: /* Okay, we read in an EPD entry */ fgets (line, MAXSTR-1, fp); strcpy( epd_line, line ); if (!feof(fp)) { /* Skip comment lines */ int i=0; for (i = 0; i < strlen( line ); ++i) { if ( isblank( line[i] ) ) { continue; } if ( line[i] == '#' ) { goto next_line; } else { break; } } int ret = ParseEPD (line); /* For now just ignore malformed lines */ if (ret != EPD_SUCCESS) goto next_line; if (op != 2) printf ("\n%s : Best move = %s\n", id, solution); return (true); } /* finished, must close file */ else { fclose (fp); fp = NULL; return (false); } } /* * Returns EPD_SUCCESS on success, EPD_ERROR on error. We try to be * quite tough on the format. However, as of yet no legality checking * is done and the board is not reset on error, this should be done by * the caller. */ int ParseEPD (char *p) /************************************************************************** * * Parses an EPD input line. A few global variables are updated e.g. * current board, side to move, en passant, castling status, etc. * **************************************************************************/ { int r, c, sq; char *str_p; r = 56; c = 0; memset (&board, 0, sizeof (board)); while (p && *p != ' ') { sq = r + c; switch (*p) { case 'P' : SETBIT (board.b[white][pawn], sq); SETBIT (board.blockerr90, r90[sq]); SETBIT (board.blockerr45, r45[sq]); SETBIT (board.blockerr315, r315[sq]); board.material[white] += ValueP; break; case 'N' : SETBIT (board.b[white][knight], sq); SETBIT (board.blockerr90, r90[sq]); SETBIT (board.blockerr45, r45[sq]); SETBIT (board.blockerr315, r315[sq]); board.material[white] += ValueN; break; case 'B' : SETBIT (board.b[white][bishop], sq); SETBIT (board.blockerr90, r90[sq]); SETBIT (board.blockerr45, r45[sq]); SETBIT (board.blockerr315, r315[sq]); board.material[white] += ValueB; break; case 'R' : SETBIT (board.b[white][rook], sq); SETBIT (board.blockerr90, r90[sq]); SETBIT (board.blockerr45, r45[sq]); SETBIT (board.blockerr315, r315[sq]); board.material[white] += ValueR; break; case 'Q' : SETBIT (board.b[white][queen], sq); SETBIT (board.blockerr90, r90[sq]); SETBIT (board.blockerr45, r45[sq]); SETBIT (board.blockerr315, r315[sq]); board.material[white] += ValueQ; break; case 'K' : SETBIT (board.b[white][king], sq); SETBIT (board.blockerr90, r90[sq]); SETBIT (board.blockerr45, r45[sq]); SETBIT (board.blockerr315, r315[sq]); break; case 'p' : SETBIT (board.b[black][pawn], sq); SETBIT (board.blockerr90, r90[sq]); SETBIT (board.blockerr45, r45[sq]); SETBIT (board.blockerr315, r315[sq]); board.material[black] += ValueP; break; case 'n' : SETBIT (board.b[black][knight], sq); SETBIT (board.blockerr90, r90[sq]); SETBIT (board.blockerr45, r45[sq]); SETBIT (board.blockerr315, r315[sq]); board.material[black] += ValueN; break; case 'b' : SETBIT (board.b[black][bishop], sq); SETBIT (board.blockerr90, r90[sq]); SETBIT (board.blockerr45, r45[sq]); SETBIT (board.blockerr315, r315[sq]); board.material[black] += ValueB; break; case 'r' : SETBIT (board.b[black][rook], sq); SETBIT (board.blockerr90, r90[sq]); SETBIT (board.blockerr45, r45[sq]); SETBIT (board.blockerr315, r315[sq]); board.material[black] += ValueR; break; case 'q' : SETBIT (board.b[black][queen], sq); SETBIT (board.blockerr90, r90[sq]); SETBIT (board.blockerr45, r45[sq]); SETBIT (board.blockerr315, r315[sq]); board.material[black] += ValueQ; break; case 'k' : SETBIT (board.b[black][king], sq); SETBIT (board.blockerr90, r90[sq]); SETBIT (board.blockerr45, r45[sq]); SETBIT (board.blockerr315, r315[sq]); break; case '/' : r -= 8; c = -1; break; default : break; } if (isdigit (*p)) c += (*p - '0'); else c++; /* * Special case, a trailing "/" is accepted on the * end of the board settings. */ if (r == -8 && p[1] == ' ') r = 0; if (r < 0 || c > 8) return EPD_ERROR; if (c == 8 && p[1] != '/' && p[1] != ' ') return EPD_ERROR; p++; } board.pmaterial[white] = board.material[white] - nbits(board.b[white][pawn]) * ValueP; board.pmaterial[black] = board.material[black] - nbits(board.b[black][pawn]) * ValueP; board.king[white] = leadz (board.b[white][king]); board.king[black] = leadz (board.b[black][king]); UpdateFriends (); UpdateCBoard (); UpdateMvboard (); /* Get side to move */ if (!++p) return EPD_ERROR; if (*p == 'w') board.side = white; else if (*p == 'b') board.side = black; else return EPD_ERROR; /* Isn't this one cute? */ if (!++p || *p != ' ' || !++p) return EPD_ERROR; /* Castling status */ while (p && *p != ' ') { if (*p == 'K') board.flag |= WKINGCASTLE; else if (*p == 'Q') board.flag |= WQUEENCASTLE; else if (*p == 'k') board.flag |= BKINGCASTLE; else if (*p == 'q') board.flag |= BQUEENCASTLE; else if (*p == '-') { p++; break; } else return EPD_ERROR; p++; } if (!p || *p != ' ' || !++p) return EPD_ERROR; /* * En passant square, can only be '-' or [a-h][36] * In fact, one could add more sanity checks here. */ if (*p != '-') { if (!p[1] || *p < 'a' || *p > 'h' || !(p[1] == '3' || p[1] == '6')) return EPD_ERROR; board.ep = (*p - 'a') + (p[1] - '1')*8; p++; } else { board.ep = -1; } solution[0] = '\0'; id[0] = '\0'; if (!++p) return EPD_SUCCESS; /* The opcodes are optional, so we should not generate errors here */ /* Read in best move; "bm" operator */ str_p = strstr(p, "bm"); if (str_p) sscanf (str_p, "bm %63[^;];", solution); /* Read in the description; "id" operator */ str_p = strstr(p, "id"); if (str_p) sscanf (p, "id %31[^;];", id); phase = PHASE; return EPD_SUCCESS; } void LoadEPD (char *p) /************************************************************************** * * This routine reads in the next or the Nth position in the file. * **************************************************************************/ { char file[MAXSTR]; int N = 1; sscanf (p, "%127s %d ", file, &N); if (strcmp (file, "next") == 0) { ReadEPDFile (file, 0); } else { ReadEPDFile (file, 1); while (--N) { if (ReadEPDFile (file, 2) == false) { printf ("File position exceeded\n"); return; } } ReadEPDFile (file, 0); } ShowBoard (); NewPosition (); } void SaveEPD (char *p) /************************************************************************** * * This routine appends the current position in EPD format into a file. * **************************************************************************/ { char file[MAXSTR]; FILE *fp; int r, c, sq, k; char c1; sscanf (p, "%s ", file); fp = fopen (file, "a"); for (r = A8; r >= A1; r -= 8) { k = 0; for (c = 0; c < 8; c++) { sq = r + c; if (cboard[sq] == empty) k++; else { if (k) fprintf (fp, "%1d", k); k = 0; c1 = notation[cboard[sq]]; if (BitPosArray[sq] & board.friends[black]) c1 = tolower (c1); fprintf (fp, "%c", c1); } } if (k) fprintf (fp, "%1d", k); if (r > A1) fprintf (fp, "/"); } /* Print other stuff */ fprintf (fp, (board.side == white ? " w " : " b ")); if (board.flag & WKINGCASTLE) fprintf (fp, "K"); if (board.flag & WQUEENCASTLE) fprintf (fp, "Q"); if (board.flag & BKINGCASTLE) fprintf (fp, "k"); if (board.flag & BQUEENCASTLE) fprintf (fp, "q"); if (!(board.flag & (WCASTLE | BCASTLE))) fprintf (fp, "-"); fprintf (fp, " %s", (board.ep > -1 ? algbr[board.ep] : "-")); fprintf (fp, " bm 1; id 1;"); fprintf (fp, "\n"); fclose (fp); } gnuchess-6.2.2/src/frontend/genmove.cc000644 000766 000024 00000044766 12451350306 020550 0ustar00antoniostaff000000 000000 /* genmove.c GNU Chess frontend Copyright (C) 2001-2011 Free Software Foundation, Inc. GNU Chess is based on the two research programs Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Contact Info: bug-gnu-chess@gnu.org cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net */ #include #include "common.h" static leaf *node; #define ADDMOVE(a,b,c) \ do { \ node->move = MOVE(a,b) | (c); \ node++; \ } while (0) #define ADDPROMOTE(a,b) \ do { \ ADDMOVE (a, b, QUEENPRM); \ ADDMOVE (a, b, KNIGHTPRM); \ ADDMOVE (a, b, ROOKPRM); \ ADDMOVE (a, b, BISHOPPRM); \ } while (0) static inline void BitToMove (short f, BitBoard b) /*************************************************************************** * * Convert a bitboard into a list of moves. These are stored * into the tree. f is the origin square. * ***************************************************************************/ { int t; while (b) { t = leadz (b); CLEARBIT (b, t); ADDMOVE (f, t, 0); } } void GenMoves (short ply) /**************************************************************************** * * My bitboard move generator. Let's see how fast we can go! * This routine generates pseudo-legal moves. * ****************************************************************************/ { int side; int piece, sq, t, ep; BitBoard b, c, d, e, friends, notfriends, blocker, notblocker; BitBoard *a; side = board.side; a = board.b[side]; friends = board.friends[side]; notfriends = ~friends; blocker = board.blocker; notblocker = ~blocker; node = TreePtr[ply + 1]; ep = board.ep; /* Knight & King */ for (piece = knight; piece <= king; piece += 4) { b = a[piece]; while (b) { sq = leadz (b); CLEARBIT (b, sq); BitToMove (sq, MoveArray[piece][sq] & notfriends); } } /* Bishops */ b = a[bishop]; while (b) { sq = leadz (b); CLEARBIT (b, sq); d = BishopAttack(sq); BitToMove (sq, d & notfriends); } /* Rooks */ b = a[rook]; while (b) { sq = leadz (b); CLEARBIT (b, sq); d = RookAttack(sq); BitToMove (sq, d & notfriends); } /* Queen */ b = a[queen]; while (b) { sq = leadz (b); CLEARBIT (b, sq); d = QueenAttack(sq); BitToMove (sq, d & notfriends); } /* White pawn moves */ e = (board.friends[1^side] | (ep > -1 ? BitPosArray[ep] : NULLBITBOARD)); if (side == white) { c = (a[pawn] >> 8) & notblocker; /* 1 square forward */ while (c) { t = leadz (c); CLEARBIT (c, t); if (t >= 56) /* promotion */ { ADDPROMOTE (t-8, t); } else ADDMOVE (t-8, t, 0); } b = a[pawn] & RankBit[1]; /* all pawns on 2nd rank */ c = (b >> 8) & notblocker; c = (c >> 8) & notblocker; /* 2 squares forward */ while (c) { t = leadz (c); CLEARBIT (c, t); ADDMOVE (t-16, t, 0); } b = a[pawn] & ~FileBit[0]; /* captures to the left */ c = (b >> 7) & e; while (c) { t = leadz (c); CLEARBIT (c, t); if (t >= 56) /* promotion */ { ADDPROMOTE (t-7, t); } else if (ep == t) { ADDMOVE (t-7, t, ENPASSANT); } else { ADDMOVE (t-7, t, 0); } } b = a[pawn] & ~FileBit[7]; /* captures to the right */ c = (b >> 9) & e; while (c) { t = leadz (c); CLEARBIT (c, t); if (t >= 56) /* promotion */ { ADDPROMOTE (t-9, t); } else if (ep == t) { ADDMOVE (t-9, t, ENPASSANT); } else { ADDMOVE (t-9, t, 0); } } } /* Black pawn forward moves */ if (side == black) { c = (a[pawn] << 8) & notblocker; while (c) { t = leadz (c); CLEARBIT (c, t); if (t <= 7) /* promotion */ { ADDPROMOTE (t+8, t); } else ADDMOVE (t+8, t, 0); } b = a[pawn] & RankBit[6]; /* all pawns on 7th rank */ c = (b << 8) & notblocker; c = (c << 8) & notblocker; while (c) { t = leadz (c); CLEARBIT (c, t); ADDMOVE (t+16, t, 0); } b = a[pawn] & ~FileBit[7]; /* captures to the left */ c = (b << 7) & e; while (c) { t = leadz (c); CLEARBIT (c, t); if (t <= 7) /* promotion */ { ADDPROMOTE (t+7, t); } else if (ep == t) { ADDMOVE (t+7, t, ENPASSANT); } else { ADDMOVE (t+7, t, 0); } } b = a[pawn] & ~FileBit[0]; /* captures to the right */ c = (b << 9) & e; while (c) { t = leadz (c); CLEARBIT (c, t); if (t <= 7) /* promotion */ { ADDPROMOTE (t+9, t); } else if (ep == t) { ADDMOVE (t+9, t, ENPASSANT); } else { ADDMOVE (t+9, t, 0); } } } /* Castling code */ b = board.b[side][rook]; if (side == white && (board.flag & WKINGCASTLE) && (b & BitPosArray[H1]) && !(FromToRay[E1][G1] & blocker) && !SqAtakd (E1, black) && !SqAtakd (F1, black) && !SqAtakd (G1, black)) { ADDMOVE (E1, G1, CASTLING); } if (side == white && (board.flag & WQUEENCASTLE) && (b & BitPosArray[A1]) && !(FromToRay[E1][B1] & blocker) && !SqAtakd (E1, black) && !SqAtakd (D1, black) && !SqAtakd (C1, black)) { ADDMOVE (E1, C1, CASTLING); } if (side == black && (board.flag & BKINGCASTLE) && (b & BitPosArray[H8]) && !(FromToRay[E8][G8] & blocker) && !SqAtakd (E8, white) && !SqAtakd (F8, white) && !SqAtakd (G8, white)) { ADDMOVE (E8, G8, CASTLING); } if (side == black && (board.flag & BQUEENCASTLE) && (b & BitPosArray[A8]) && !(FromToRay[E8][B8] & blocker) && !SqAtakd (E8, white) && !SqAtakd (D8, white) && !SqAtakd (C8, white)) { ADDMOVE (E8, C8, CASTLING); } /* Update tree pointers and count */ TreePtr[ply + 1] = node; GenCnt += TreePtr[ply + 1] - TreePtr[ply]; } void GenNonCaptures (short ply) /**************************************************************************** * * Here I generate only non-captures. Promotions are considered * as captures and are not generated. * ****************************************************************************/ { int side; int piece, sq, t, ep; BitBoard b, c, d, friends, notfriends, blocker, notblocker; BitBoard *a; side = board.side; a = board.b[side]; friends = board.friends[side]; notfriends = ~friends; blocker = board.blocker; notblocker = ~blocker; node = TreePtr[ply + 1]; ep = board.ep; /* Knight & King */ for (piece = knight; piece <= king; piece += 4) { b = a[piece]; while (b) { sq = leadz (b); CLEARBIT (b, sq); BitToMove (sq, MoveArray[piece][sq] & notblocker); } } /* Bishops */ b = a[bishop]; while (b) { sq = leadz (b); CLEARBIT (b, sq); d = BishopAttack(sq); BitToMove (sq, d & notblocker); } /* Rooks */ b = a[rook]; while (b) { sq = leadz (b); CLEARBIT (b, sq); d = RookAttack(sq); BitToMove (sq, d & notblocker); } /* Queen */ b = a[queen]; while (b) { sq = leadz (b); CLEARBIT (b, sq); d = QueenAttack(sq); BitToMove (sq, d & notblocker); } /* White pawn moves */ if (side == white) { c = (a[pawn] >> 8) & notblocker; /* 1 square forward */ while (c) { t = leadz (c); CLEARBIT (c, t); if (t < 56) ADDMOVE (t-8, t, 0); } b = a[pawn] & RankBit[1]; /* all pawns on 2nd rank */ c = (b >> 8) & notblocker; c = (c >> 8) & notblocker; /* 2 squares forward */ while (c) { t = leadz (c); CLEARBIT (c, t); ADDMOVE (t-16, t, 0); } } /* Black pawn forward moves */ if (side == black) { c = (a[pawn] << 8) & notblocker; while (c) { t = leadz (c); CLEARBIT (c, t); if ( t > 7) ADDMOVE (t+8, t, 0); } b = a[pawn] & RankBit[6]; /* all pawns on 7th rank */ c = (b << 8) & notblocker; c = (c << 8) & notblocker; while (c) { t = leadz (c); CLEARBIT (c, t); ADDMOVE (t+16, t, 0); } } /* Castling code */ b = board.b[side][rook]; if (side == white && (board.flag & WKINGCASTLE) && (b & BitPosArray[7]) && !(FromToRay[4][6] & blocker) && !SqAtakd (4, black) && !SqAtakd (5, black) && !SqAtakd (6, black)) { ADDMOVE (4, 6, CASTLING); } if (side == white && (board.flag & WQUEENCASTLE) && (b & BitPosArray[0]) && !(FromToRay[4][1] & blocker) && !SqAtakd (4, black) && !SqAtakd (3, black) && !SqAtakd (2, black)) { ADDMOVE (4, 2, CASTLING); } if (side == black && (board.flag & BKINGCASTLE) && (b & BitPosArray[63]) && !(FromToRay[60][62] & blocker) && !SqAtakd (60, white) && !SqAtakd (61, white) && !SqAtakd (62, white)) { ADDMOVE (60, 62, CASTLING); } if (side == black && (board.flag & BQUEENCASTLE) && (b & BitPosArray[56]) && !(FromToRay[60][57] & blocker) && !SqAtakd (60, white) && !SqAtakd (59, white) && !SqAtakd (58, white)) { ADDMOVE (60, 58, CASTLING); } /* Update tree pointers and count */ TreePtr[ply + 1] = node; GenCnt += TreePtr[ply + 1] - TreePtr[ply]; } void GenCaptures (short ply) /**************************************************************************** * * This routine generates captures. En passant and pawn promotions * are included. * ****************************************************************************/ { int side; int piece, sq, t, ep; BitBoard b, c, friends, notfriends, enemy, blocker; BitBoard *a; side = board.side; a = board.b[side]; friends = board.friends[side]; notfriends = ~friends; enemy = board.friends[1^side]; blocker = board.blocker; node = TreePtr[ply + 1]; ep = board.ep; /* Knight & King */ for (piece = knight; piece <= king; piece += 4) { b = a[piece]; while (b) { sq = leadz (b); CLEARBIT (b, sq); BitToMove (sq, MoveArray[piece][sq] & enemy); } } /* Bishop */ b = a[bishop]; while (b) { sq = leadz (b); CLEARBIT (b, sq); c = BishopAttack(sq); BitToMove (sq, c & enemy); } /* Rook */ b = a[rook]; while (b) { sq = leadz (b); CLEARBIT (b, sq); c = RookAttack(sq); BitToMove (sq, c & enemy); } /* Queen */ b = a[queen]; while (b) { sq = leadz (b); CLEARBIT (b, sq); c = QueenAttack(sq); BitToMove (sq, c & enemy); } /* White pawn moves */ if (side == white) { b = a[pawn] & RankBit[6]; /* all pawns on 7 rank */ c = (b >> 8) & ~blocker; /* 1 square forward */ while (c) { t = leadz (c); CLEARBIT (c, t); ADDPROMOTE (t-8, t); } b = a[pawn] & ~FileBit[0]; /* captures to the left */ c = (b >> 7) & (board.friends[1^side] | (ep > -1 ? BitPosArray[ep] : ULL(0))); while (c) { t = leadz (c); CLEARBIT (c, t); if (t >= 56) /* promotion */ { ADDPROMOTE (t-7, t); } else if (ep == t) { ADDMOVE (t-7, t, ENPASSANT); } else { ADDMOVE (t-7, t, 0); } } b = a[pawn] & ~FileBit[7]; /* captures to the right */ c = (b >> 9) & (board.friends[1^side] | (ep > -1 ? BitPosArray[ep] : ULL(0))); while (c) { t = leadz (c); CLEARBIT (c, t); if (t >= 56) /* promotion */ { ADDPROMOTE (t-9, t); } else if (ep == t) { ADDMOVE (t-9, t, ENPASSANT); } else { ADDMOVE (t-9, t, 0); } } } /* Black pawn forward moves */ if (side == black) { b = a[pawn] & RankBit[1]; /* all pawns on 2nd rank */ c = (b << 8) & ~blocker; while (c) { t = leadz (c); CLEARBIT (c, t); ADDPROMOTE (t+8, t); } b = a[pawn] & ~FileBit[7]; /* captures to the left */ c = (b << 7) & (board.friends[1^side] | (ep > -1 ? BitPosArray[ep] : ULL(0))); while (c) { t = leadz (c); CLEARBIT (c, t); if (t <= 7) /* promotion */ { ADDPROMOTE (t+7, t); } else if (ep == t) { ADDMOVE (t+7, t, ENPASSANT); } else { ADDMOVE (t+7, t, 0); } } b = a[pawn] & ~FileBit[0]; /* captures to the right */ c = (b << 9) & (board.friends[1^side] | (ep > -1 ? BitPosArray[ep] : ULL(0))); while (c) { t = leadz (c); CLEARBIT (c, t); if (t <= 7) /* promotion */ { ADDPROMOTE (t+9, t); } else if (ep == t) { ADDMOVE (t+9, t, ENPASSANT); } else { ADDMOVE (t+9, t, 0); } } } /* Update tree pointers and count */ TreePtr[ply + 1] = node; GenCnt += TreePtr[ply + 1] - TreePtr[ply]; } void GenCheckEscapes (short ply) /************************************************************************** * * The king is in check, so generate only moves which get the king out * of check. * Caveat: The special case of an enpassant capture must be taken into * account too as the captured pawn could be the checking piece. * **************************************************************************/ { int side, xside; int kingsq, chksq, sq, sq1, epsq, dir; BitBoard checkers, b, c, p, escapes; escapes = NULLBITBOARD; side = board.side; xside = 1 ^ side; /* TreePtr[ply + 1] = TreePtr[ply]; */ node = TreePtr[ply + 1]; kingsq = board.king[side]; checkers = AttackTo (kingsq, xside); p = board.b[side][pawn]; if (nbits (checkers) == 1) { /* Captures of checking pieces (except by king) */ chksq = leadz (checkers); b = AttackTo (chksq, side); b &= ~board.b[side][king]; while (b) { sq = leadz (b); CLEARBIT (b, sq); if (!PinnedOnKing (sq, side)) { if (cboard[sq] == pawn && (chksq <= H1 || chksq >= A8)) { ADDPROMOTE (sq, chksq); } else ADDMOVE (sq, chksq, 0); } } /* Maybe enpassant can help */ if (board.ep > -1) { epsq = board.ep; if (epsq + (side == white ? -8 : 8) == chksq) { b = MoveArray[ptype[1^side]][epsq] & p; while (b) { sq = leadz (b); CLEARBIT (b, sq); if (!PinnedOnKing (sq, side)) ADDMOVE (sq, epsq, ENPASSANT); } } } /* Lets block/capture the checking piece */ if (slider[cboard[chksq]]) { c = FromToRay[kingsq][chksq] & NotBitPosArray[chksq]; while (c) { sq = leadz (c); CLEARBIT (c, sq); b = AttackTo (sq, side); b &= ~(board.b[side][king] | p); /* Add in pawn advances */ if (side == white && sq > H2) { if (BitPosArray[sq-8] & p) b |= BitPosArray[sq-8]; if (RANK(sq) == 3 && cboard[sq-8] == empty && (BitPosArray[sq-16] & p)) b |= BitPosArray[sq-16]; } if (side == black && sq < H7) { if (BitPosArray[sq+8] & p) b |= BitPosArray[sq+8]; if (RANK(sq) == 4 && cboard[sq+8] == empty && (BitPosArray[sq+16] & p)) b |= BitPosArray[sq+16]; } while (b) { sq1 = leadz (b); CLEARBIT (b, sq1); if (!PinnedOnKing (sq1, side)) { if (cboard[sq1] == pawn && (sq > H7 || sq < A2)) { ADDPROMOTE (sq1, sq); } else ADDMOVE (sq1, sq, 0); } } } } } /* If more than one checkers, move king to get out of check */ if (checkers) escapes = MoveArray[king][kingsq] & ~board.friends[side]; while (checkers) { chksq = leadz (checkers); CLEARBIT (checkers, chksq); dir = directions[chksq][kingsq]; if (slider[cboard[chksq]]) escapes &= ~Ray[chksq][dir]; } while (escapes) { sq = leadz (escapes); CLEARBIT (escapes, sq); if (!SqAtakd (sq, xside)) ADDMOVE (kingsq, sq, 0); } /* Update tree pointers and count */ TreePtr[ply + 1] = node; GenCnt += TreePtr[ply + 1] - TreePtr[ply]; return; } void FilterIllegalMoves (short ply) /************************************************************************** * * All the illegal moves in the current ply is removed. * **************************************************************************/ { leaf *p; int side, xside; int check, sq; side = board.side; xside = 1^side; sq = board.king[side]; for (p = TreePtr[ply]; p < TreePtr[ply+1]; p++) { MakeMove (side, &p->move); if (cboard[TOSQ(p->move)] != king) check = SqAtakd (sq, xside); else check = SqAtakd (TOSQ(p->move), xside); UnmakeMove (xside, &p->move); if (check) /* its an illegal move */ { --TreePtr[ply+1]; *p = *TreePtr[ply+1]; --p; GenCnt--; } } } gnuchess-6.2.2/src/frontend/init.cc000644 000766 000024 00000031563 12451350311 020036 0ustar00antoniostaff000000 000000 /* init.c GNU Chess frontend Copyright (C) 2001-2011 Free Software Foundation, Inc. GNU Chess is based on the two research programs Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Contact Info: bug-gnu-chess@gnu.org cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net */ #include #include #include #include #include "common.h" #include "version.h" #include "lexpgn.h" void Initialize (void) /************************************************************************** * * The main initialization driver. * **************************************************************************/ { InitLzArray (); InitBitPosArray (); InitMoveArray (); InitRay (); InitFromToRay (); InitRankFileBit (); InitBitCount (); InitRotAtak (); InitVars (); } #define NBITS 16 void InitLzArray (void) /*************************************************************************** * * The lzArray is created. This array is used when the position * of the leading non-zero bit is required. The convention used * is that the leftmost bit is considered as position 0 and the * rightmost bit position 63. * ***************************************************************************/ { int i, j, s, n; s = n = 1; for (i = 0; i < NBITS; i++) { for (j = s; j < s + n; j++) lzArray[j] = NBITS - 1 - i; s += n; n += n; } } void InitBitPosArray (void) /*************************************************************************** * * BitPosArray[i] returns the bitboard whose ith bit is set to 1 * and every other bits 0. This ought to be faster than doing * shifting all the time (I think). * Also compute the NotBitPosArray = ~BitPosArray. * ***************************************************************************/ { BitBoard b; int i; b = (BitBoard) 1; for (i = 63; i >= 0; i--, b <<= 1) { BitPosArray[i] = b; NotBitPosArray[i] = ~b; } } /* Data used for generating MoveArray */ static const int dir[8][8] = { { 0, 0, 0, 0, 0, 0, 0, 0 }, { 9, 11, 0, 0, 0, 0, 0, 0 }, { -21, -19, -12, -8, 8, 12, 19, 21 }, { -11, -9, 9, 11, 0, 0, 0, 0 }, { -10, -1, 1, 10, 0, 0, 0, 0 }, { -11, -10, -9, -1, 1, 9, 10, 11 }, { -11, -10, -9, -1, 1, 9, 10, 11 }, { -9, -11, 0, 0, 0, 0, 0, 0 } }; static const int ndir[8] = { 0, 2, 8, 4, 4, 8, 8, 2 }; static const int map[120] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, -1, -1, 8, 9, 10, 11, 12, 13, 14, 15, -1, -1, 16, 17, 18, 19, 20, 21, 22, 23, -1, -1, 24, 25, 26, 27, 28, 29, 30, 31, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, -1, -1, 40, 41, 42, 43, 44, 45, 46, 47, -1, -1, 48, 49, 50, 51, 52, 53, 54, 55, -1, -1, 56, 57, 58, 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; void InitMoveArray (void) /*************************************************************************** * * Generate the move bitboards. For e.g. the bitboard for all * the moves of a knight on f3 is given by MoveArray[knight][21]. * ***************************************************************************/ { int piece, fsq, tsq, f, t, n; BitBoard *b; for (piece = pawn; piece <= bpawn; piece++) { for (fsq = 0; fsq < 120; fsq++) { if ((f = map[fsq]) == -1) continue; b = &MoveArray[piece][f]; *b = NULLBITBOARD; for (n = 0; n < ndir[piece]; n++) { tsq = fsq; do { tsq += dir[piece][n]; if ((t = map[tsq]) != -1) SETBIT (*b, t); } while (range[piece] && t != -1); } } } } void InitRay (void) /************************************************************************** * * For each square, there are 8 rays. The first 4 rays are diagonals * for the bishops and the next 4 are file/rank for the rooks. * The queen uses all 8 rays. * These rays are used for move generation rather than MoveArray[]. * Also initialize the directions[][] array. directions[f][t] returns * the index into Ray[f] array allow us to find the ray in that direction. * **************************************************************************/ { int piece, fsq, tsq, f, t, n, ray; BitBoard *b; memset (directions, -1, sizeof (directions)); for (fsq = 0; fsq < 120; fsq++) { if ((f = map[fsq]) == -1) continue; ray = -1; for (piece = bishop; piece <= rook; piece++) { for (n = 0; n < ndir[piece]; n++) { b = &Ray[f][++ray]; *b = NULLBITBOARD; tsq = fsq; do { tsq += dir[piece][n]; if ((t = map[tsq]) != -1) { SETBIT (*b, t); directions[f][t] = ray; } } while (t != -1); } } } } void InitFromToRay (void) /*************************************************************************** * * The FromToRay[b2][f6] gives the diagonal ray from c3 to f6; * It also produces horizontal/vertical rays as well. If no * ray is possible, then a 0 is returned. * ***************************************************************************/ { int piece, fsq, tsq, f, t, n; BitBoard *b; memset (FromToRay, 0, sizeof (FromToRay)); for (piece = bishop; piece <= rook; piece++) { for (fsq = 0; fsq < 120; fsq++) { if ((f = map[fsq]) == -1) continue; for (n = 0; n < ndir[piece]; n++) { tsq = fsq; t = map[tsq]; do { b = &FromToRay[f][t]; tsq += dir[piece][n]; if ((t = map[tsq]) != -1) { SETBIT (FromToRay[f][t], t); FromToRay[f][t] |= *b; } } while (t != -1); } } } } void InitRankFileBit (void) /*************************************************************************** * * RankBit[2] has all the bits on the 3rd rank 1 and others 0. * FileBit[2] has all the bits on the 3rd file 1 and others 0. * ***************************************************************************/ { BitBoard b; int i; i = 8; b = (BitBoard) 255; while (i--) { RankBit[i] = b; b <<= 8; } i = 8; b = ULL(0x0101010101010101); while (i--) { FileBit[i] = b; b <<= 1; } } void InitBitCount (void) /************************************************************************** * * The BitCount array returns the no. of bits present in the 16 bit * input argument. This is use for counting the number of bits set * in a BitBoard (e.g. for mobility count). * **************************************************************************/ { int i, j, n; BitCount[0] = 0; BitCount[1] = 1; i = 1; for (n = 2; n <= 16; n++) { i <<= 1; for (j = i; j <= i + (i-1); j++) BitCount[j] = 1 + BitCount[j - i]; } } void InitRotAtak (void) /************************************************************************** * * The attack tables for a normal chessboard and the rotated chess board * are calculated here. * **************************************************************************/ { int sq, map, sq1, sq2; int cmap[8] = { 128, 64, 32, 16, 8, 4, 2, 1 }; int rot1[8] = { A1, A2, A3, A4, A5, A6, A7, A8 }; int rot2[8] = { A1, B2, C3, D4, E5, F6, G7, H8 }; int rot3[8] = { A8, B7, C6, D5, E4, F3, G2, H1 }; for (sq = A1; sq <= H1; sq++) { for (map = 0; map < 256; map++) { Rook00Atak[sq][map] = 0; Rook90Atak[rot1[sq]][map] = 0; Bishop45Atak[rot2[sq]][map] = 0; Bishop315Atak[rot3[sq]][map] = 0; sq1 = sq2 = sq; while (sq1 > 0) { if (cmap[--sq1] & map) break; } while (sq2 < 7) { if (cmap[++sq2] & map) break; } Rook00Atak[sq][map] = FromToRay[sq][sq1] | FromToRay[sq][sq2]; Rook90Atak[rot1[sq]][map] = FromToRay[rot1[sq]][rot1[sq1]] | FromToRay[rot1[sq]][rot1[sq2]]; Bishop45Atak[rot2[sq]][map] = FromToRay[rot2[sq]][rot2[sq1]] | FromToRay[rot2[sq]][rot2[sq2]]; Bishop315Atak[rot3[sq]][map] = FromToRay[rot3[sq]][rot3[sq1]] | FromToRay[rot3[sq]][rot3[sq2]]; } } for (map = 0; map < 256; map++) { for (sq = A2; sq <= H8; sq++) { Rook00Atak[sq][map] = Rook00Atak[sq-8][map] >> 8; } for (sq1 = B_FILE; sq1 <= H_FILE; sq1++) { for (sq2 = 0; sq2 < 64; sq2+=8) { sq = sq2 + sq1; Rook90Atak[sq][map] = Rook90Atak[sq-1][map] >> 1; } } for (sq1 = B1, sq2 = H7; sq1 <= H1; sq1++, sq2-=8) { for (sq = sq1; sq <= sq2; sq += 9) { Bishop45Atak[sq][map] = Bishop45Atak[sq+8][map] << 8; } } for (sq1 = A2, sq2 = G8; sq1 <= A8; sq1+=8, sq2--) { for (sq = sq1; sq <= sq2; sq += 9) { Bishop45Atak[sq][map] = (Bishop45Atak[sq+1][map] & NotBitPosArray[sq1-8]) << 1; } } for (sq1 = H2, sq2 = B8; sq1 <= H8; sq1+=8, sq2++) { for (sq = sq1; sq <= sq2; sq += 7) { Bishop315Atak[sq][map] = Bishop315Atak[sq-8][map] >> 8; } } for (sq1 = G1, sq2 = A7; sq1 >= A1; sq1--, sq2-=8) { for (sq = sq1; sq <= sq2; sq += 7) { Bishop315Atak[sq][map] = (Bishop315Atak[sq+1][map] & NotBitPosArray[sq2+8]) << 1; } } } } void InitVars (void) /*************************************************************************** * * Initialize various variables, especially for new game. * ***************************************************************************/ { int i; /* Initialize board */ memset (&board, 0, sizeof (board)); for (i = 8; i < 16; i++) SETBIT (board.b[white][pawn], i); SETBIT (board.b[white][rook], 0); SETBIT (board.b[white][knight], 1); SETBIT (board.b[white][bishop], 2); SETBIT (board.b[white][queen], 3); SETBIT (board.b[white][king], 4); SETBIT (board.b[white][bishop], 5); SETBIT (board.b[white][knight], 6); SETBIT (board.b[white][rook], 7); for (i = 48; i < 56; i++) SETBIT (board.b[black][pawn], i); SETBIT (board.b[black][rook], 56); SETBIT (board.b[black][knight], 57); SETBIT (board.b[black][bishop], 58); SETBIT (board.b[black][queen], 59); SETBIT (board.b[black][king], 60); SETBIT (board.b[black][bishop], 61); SETBIT (board.b[black][knight], 62); SETBIT (board.b[black][rook], 63); board.flag |= (WCASTLE | BCASTLE); RealSide = board.side = white; board.ep = -1; board.king[white] = E1; board.king[black] = E8; RealGameCnt = GameCnt = -1; Game50 = 0; computer = black; Game[0].hashkey = HashKey; board.pmaterial[white] = board.pmaterial[black] = 2*ValueR + 2*ValueN + 2*ValueB + ValueQ; board.material[white] = board.material[black] = board.pmaterial[white] + 8*ValueP; /* Initialize pgn values */ initial_comments = NULL; /* Reset values; doing this again will cause a trivial memory leak * when reloading PGN files as games, but it's not worth fixing. */ pgn_event = pgn_site = pgn_date = pgn_round = pgn_white = pgn_black = pgn_whiteELO = pgn_blackELO = pgn_result = pgn_othertags = NULL; UpdateFriends (); UpdateCBoard (); UpdateMvboard (); for (i = A1; i <= H8; i++) { if (cboard[i]) { SETBIT (board.blockerr90, r90[i]); SETBIT (board.blockerr45, r45[i]); SETBIT (board.blockerr315, r315[i]); } } /* TreePtr[0] is practically unused. TreePtr[1] points to the * base of the tree. */ TreePtr[0] = TreePtr[1] = Tree; /* Initialize some of the game flags */ SET (flags, USEHASH); SET (flags, USENULL); SearchTime = 5; board.castled[white] = board.castled[black] = false; phase = PHASE; } void NewPosition (void) /**************************************************************************** * * Reset some flags for a new game/position. * ****************************************************************************/ { CLEAR (flags, ENDED); Game50 = 0; RealGameCnt = GameCnt = -1; Game[0].hashkey = HashKey; ExchCnt[white] = ExchCnt[black] = 0; } gnuchess-6.2.2/src/frontend/inlines.h000644 000766 000024 00000003765 12451350316 020406 0ustar00antoniostaff000000 000000 /* inlines.h GNU Chess frontend This file constains static inline version of performance-critical functions. Is included by common.h unless NO_INLINE is defined. Copyright (C) 2001-2011 Free Software Foundation, Inc. GNU Chess is based on the two research programs Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Contact Info: bug-gnu-chess@gnu.org cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net */ #ifndef INLINES_H #define INLINES_H static inline unsigned char leadz (BitBoard b) /************************************************************************** * * Returns the leading bit in a bitboard. Leftmost bit is 0 and * rightmost bit is 63. Thanks to Robert Hyatt for this algorithm. * ***************************************************************************/ { if (b >> 48) return lzArray[b >> 48]; if (b >> 32) return lzArray[b >> 32] + 16; if (b >> 16) return lzArray[b >> 16] + 32; return lzArray[b] + 48; } static inline unsigned char nbits (BitBoard b) /*************************************************************************** * * Count the number of bits in b. * ***************************************************************************/ { return BitCount[b>>48] + BitCount[(b>>32) & 0xffff] + BitCount[(b>>16) & 0xffff] + BitCount[b & 0xffff]; } #endif /* !INLINES_H */ gnuchess-6.2.2/src/frontend/lexpgn.cc000644 000766 000024 00000364455 12244064231 020404 0ustar00antoniostaff000000 000000 #line 3 "lexpgn.cc" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; #endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! FLEXINT_H */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST #endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart(yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #define YY_BUF_SIZE 16384 #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif extern yy_size_t yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ yy_size_t yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart (FILE *input_file ); void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); void yy_delete_buffer (YY_BUFFER_STATE b ); void yy_flush_buffer (YY_BUFFER_STATE b ); void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); void yypop_buffer_state (void ); static void yyensure_buffer_stack (void ); static void yy_load_buffer_state (void ); static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); void *yyalloc (yy_size_t ); void *yyrealloc (void *,yy_size_t ); void yyfree (void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ #define yywrap(n) 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern int yylineno; int yylineno = 1; extern char *yytext; #define yytext_ptr yytext static yyconst flex_int16_t yy_nxt[][64] = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 17, 18, 19, 20, 19, 19, 18, 18, 21, 22, 23, 18, 24, 18, 25, 18, 26, 27, 28, 28, 29, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 31, 18, 18, 18, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 32, 18 }, { 17, 18, 19, 20, 19, 19, 18, 18, 21, 22, 23, 18, 24, 18, 25, 18, 26, 27, 28, 28, 29, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 31, 18, 18, 18, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 32, 18 }, { 17, 33, 33, 34, 33, 34, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33 }, { 17, 33, 33, 34, 33, 34, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33 }, { 17, 35, 36, 37, 35, 38, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 39, 39, 39, 39, 35, 39, 40, 39, 41, 42, 43, 39, 39, 39, 39, 39, 39, 39, 44, 45, 39, 39, 39, 46, 35, 35, 47, 39, 39, 40, 39, 41, 42, 43, 39, 39, 39, 39, 39, 39, 44, 45, 39, 39, 39, 46, 35, 35 }, { 17, 35, 36, 37, 35, 38, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 39, 39, 39, 39, 35, 39, 40, 39, 41, 42, 43, 39, 39, 39, 39, 39, 39, 39, 44, 45, 39, 39, 39, 46, 35, 35, 47, 39, 39, 40, 39, 41, 42, 43, 39, 39, 39, 39, 39, 39, 44, 45, 39, 39, 39, 46, 35, 35 }, { 17, 48, 49, 34, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48 }, { 17, 48, 49, 34, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48 }, { 17, 50, 50, 51, 50, 52, 50, 53, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 54, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50 }, { 17, 50, 50, 51, 50, 52, 50, 53, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 54, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50 }, { 17, 55, 55, 34, 55, 34, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55 }, { 17, 55, 55, 34, 55, 34, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55 }, { 17, 56, 56, 57, 56, 58, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 59 }, { 17, 56, 56, 57, 56, 58, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 59 }, { 17, 60, 60, 60, 60, 60, 60, 60, 60, 60, 61, 62, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 63, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60 }, { 17, 60, 60, 60, 60, 60, 60, 60, 60, 60, 61, 62, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 64, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60 }, { -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17 }, { 17, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18 }, { 17, -19, 65, 65, 65, 65, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, -19 }, { 17, -20, 65, 65, 65, 65, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20 }, { 17, 66, -21, -21, -21, -21, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66 }, { 17, 67, 67, -22, 67, -22, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67 }, { 17, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, -23 }, { 17, -24, 68, 68, 68, 68, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, -24 }, { 17, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, 69, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25 }, { 17, -26, -26, -26, -26, -26, 70, -26, -26, -26, -26, -26, -26, 71, -26, -26, 70, 70, 70, 70, -26, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, -26, -26, -26, -26, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, -26, -26 }, { 17, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, 72, 73, 74, 75, 75, 75, 75, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, -27 }, { 17, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, 73, -28, 75, 75, 75, 75, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, -28 }, { 17, 76, 76, -29, 76, -29, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76 }, { 17, -30, -30, -30, -30, -30, 70, -30, -30, -30, -30, -30, -30, 70, -30, -30, 70, 70, 70, 70, -30, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, -30, -30, -30, -30, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, -30, -30 }, { 17, -31, 77, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, -31 }, { 17, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32 }, { 17, 78, 78, -33, 78, -33, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78 }, { 17, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, -34 }, { 17, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, -35 }, { 17, -36, 79, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, 80, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, -36 }, { 17, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, -37 }, { 17, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, -38 }, { 17, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, 81, 81, 81, 81, -39, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -39, -39, -39, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -39, -39 }, { 17, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, -40, 81, 81, 81, 81, -40, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 82, 81, 81, 81, 81, 81, 81, 81, 81, -40, -40, -40, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 82, 81, 81, 81, 81, 81, 81, 81, 81, -40, -40 }, { 17, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, -41, 81, 81, 81, 81, -41, 83, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -41, -41, -41, 81, 83, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -41, -41 }, { 17, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, -42, 81, 81, 81, 81, -42, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 84, 81, -42, -42, -42, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 84, 81, -42, -42 }, { 17, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, 81, 81, 81, 81, -43, 81, 81, 81, 81, 85, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -43, -43, -43, 81, 81, 81, 81, 81, 85, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -43, -43 }, { 17, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, 81, 81, 81, 81, -44, 81, 81, 81, 81, 86, 81, 81, 81, 81, 81, 81, 81, 87, 81, 81, 81, 81, 81, 81, -44, -44, -44, 81, 81, 81, 81, 81, 86, 81, 81, 81, 81, 81, 81, 87, 81, 81, 81, 81, 81, 81, -44, -44 }, { 17, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, 81, 81, 81, 81, -45, 81, 81, 81, 81, 81, 81, 81, 81, 88, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -45, -45, -45, 81, 81, 81, 81, 81, 81, 81, 81, 88, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -45, -45 }, { 17, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, 81, 81, 81, 81, -46, 81, 81, 81, 81, 81, 81, 81, 89, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -46, -46, -46, 81, 81, 81, 81, 81, 81, 81, 89, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -46, -46 }, { 17, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47 }, { 17, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48 }, { 17, -49, 90, -49, -49, -49, -49, 91, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49 }, { 17, 92, 92, -50, 92, -50, 92, -50, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 93, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92 }, { 17, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51, -51 }, { 17, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, -52 }, { 17, 94, 95, -53, 94, -53, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 96, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94 }, { 17, 92, 92, -54, 92, -54, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 93, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92 }, { 17, 97, 97, -55, 97, -55, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97 }, { 17, 98, 98, 99, 98, -56, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, -56 }, { 17, -57, -57, -57, -57, 100, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57, -57 }, { 17, -58, -58, 101, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58, -58 }, { 17, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59 }, { 17, 102, 102, 102, 102, 102, 102, 102, 102, 102, -60, -60, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, -60, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102 }, { 17, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, -61 }, { 17, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -62 }, { 17, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63, -63 }, { 17, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, 103, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, 103, -64, -64 }, { 17, -65, 65, 65, 65, 65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65, -65 }, { 17, 66, -66, -66, -66, -66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66 }, { 17, 67, 67, -67, 67, -67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67 }, { 17, -68, 68, 68, 68, 68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68 }, { 17, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, 69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69, -69 }, { 17, -70, -70, -70, -70, -70, 70, -70, -70, -70, -70, -70, -70, 70, -70, -70, 70, 70, 70, 70, -70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, -70, -70, -70, -70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, -70, -70 }, { 17, -71, -71, -71, -71, -71, 70, -71, -71, -71, -71, -71, -71, 70, -71, -71, 70, 104, 70, 70, -71, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, -71, -71, -71, -71, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, -71, -71 }, { 17, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, 105, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, -72 }, { 17, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73, -73 }, { 17, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, 106, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74, -74 }, { 17, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, 73, -75, 75, 75, 75, 75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75, -75 }, { 17, 76, 76, -76, 76, -76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76 }, { 17, -77, 77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77, -77 }, { 17, 78, 78, -78, 78, -78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78 }, { 17, -79, 79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, 80, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79, -79 }, { 17, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, -80 }, { 17, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, -81, 81, 81, 81, 81, -81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -81, -81, -81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -81, -81 }, { 17, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, -82, 81, 81, 81, 81, -82, 107, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -82, -82, -82, 81, 107, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -82, -82 }, { 17, -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, 81, 81, 81, 81, -83, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 108, 81, 81, 81, -83, -83, -83, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 108, 81, 81, 81, -83, -83 }, { 17, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, -84, 81, 81, 81, 81, -84, 81, 81, 81, 81, 109, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -84, -84, -84, 81, 81, 81, 81, 81, 109, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -84, -84 }, { 17, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, 81, 81, 81, 81, -85, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 110, 81, 81, 81, 81, 81, 81, 81, -85, -85, -85, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 110, 81, 81, 81, 81, 81, 81, 81, -85, -85 }, { 17, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, -86, 81, 81, 81, 81, -86, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 111, 81, 81, 81, 81, -86, -86, -86, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 111, 81, 81, 81, 81, -86, -86 }, { 17, -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, -87, 81, 81, 81, 81, -87, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 112, 81, 81, -87, -87, -87, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 112, 81, 81, -87, -87 }, { 17, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, 81, 81, 81, 81, -88, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 113, 81, 81, 81, -88, -88, -88, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 113, 81, 81, 81, -88, -88 }, { 17, -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, 81, 81, 81, 81, -89, 81, 81, 81, 81, 81, 81, 81, 81, 114, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -89, -89, -89, 81, 81, 81, 81, 81, 81, 81, 81, 114, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -89, -89 }, { 17, -90, 90, -90, -90, -90, -90, 91, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, -90 }, { 17, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91 }, { 17, 92, 92, -92, 92, -92, 92, -92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 93, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92 }, { 17, 92, 92, -93, 92, -93, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 93, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92 }, { 17, 94, 94, -94, 94, -94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94 }, { 17, 94, 95, -95, 94, -95, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 96, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94 }, { 17, 94, 94, 115, 94, 115, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94 }, { 17, 97, 97, -97, 97, -97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97 }, { 17, 98, 98, 99, 98, -98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, -98 }, { 17, 116, 116, 99, 116, -99, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, -99 }, { 17, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100 }, { 17, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101, -101 }, { 17, 102, 102, 102, 102, 102, 102, 102, 102, 102, -102, -102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, -102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102 }, { 17, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, 117, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, 117, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, -103 }, { 17, -104, 118, 118, 118, 118, 70, -104, -104, -104, -104, -104, -104, 70, -104, -104, 70, 70, 70, 70, -104, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, -104, -104, -104, -104, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, -104, -104 }, { 17, -105, 119, 119, 119, 119, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, -105 }, { 17, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, 120, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106 }, { 17, -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, -107, 81, 81, 81, 81, -107, 81, 81, 121, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -107, -107, -107, 81, 81, 81, 121, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -107, -107 }, { 17, -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, 81, 81, 81, 81, -108, 81, 81, 81, 81, 122, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -108, -108, -108, 81, 81, 81, 81, 81, 122, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -108, -108 }, { 17, -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, 81, 81, 81, 81, -109, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 123, 81, 81, 81, 81, 81, 81, 81, -109, -109, -109, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 123, 81, 81, 81, 81, 81, 81, 81, -109, -109 }, { 17, -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, -110, 81, 81, 81, 81, -110, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -110, -110, -110, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -110, -110 }, { 17, -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, 81, 81, 81, 81, -111, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 124, 81, 81, -111, -111, -111, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 124, 81, 81, -111, -111 }, { 17, -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, -112, 81, 81, 81, 81, -112, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 125, 81, 81, 81, 81, 81, 81, 81, -112, -112, -112, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 125, 81, 81, 81, 81, 81, 81, 81, -112, -112 }, { 17, -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, -113, 81, 81, 81, 81, -113, 81, 81, 81, 81, 126, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -113, -113, -113, 81, 81, 81, 81, 81, 126, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -113, -113 }, { 17, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, 81, 81, 81, 81, -114, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 127, 81, 81, 81, -114, -114, -114, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 127, 81, 81, 81, -114, -114 }, { 17, -115, -115, 115, -115, 115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115, -115 }, { 17, 116, 116, 99, 116, -116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, -116 }, { 17, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, 128, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, 128, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117, -117 }, { 17, -118, 118, 118, 118, 118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, -118 }, { 17, -119, 119, 119, 119, 119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119, -119 }, { 17, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, 129, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120, -120 }, { 17, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, 81, 81, 81, 81, -121, 81, 81, 81, 81, 81, 81, 81, 81, 81, 130, 81, 81, 81, 81, 81, 81, 81, 81, 81, -121, -121, -121, 81, 81, 81, 81, 81, 81, 81, 81, 81, 130, 81, 81, 81, 81, 81, 81, 81, 81, 81, -121, -121 }, { 17, -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, -122, 81, 81, 81, 81, -122, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -122, -122, -122, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -122, -122 }, { 17, -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, -123, 81, 81, 81, 81, -123, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 131, 81, 81, 81, -123, -123, -123, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 131, 81, 81, 81, -123, -123 }, { 17, -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, -124, 81, 81, 81, 81, -124, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 132, 81, 81, 81, 81, 81, 81, 81, 81, -124, -124, -124, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 132, 81, 81, 81, 81, 81, 81, 81, 81, -124, -124 }, { 17, -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, -125, 81, 81, 81, 81, -125, 81, 81, 81, 133, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -125, -125, -125, 81, 81, 81, 81, 133, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -125, -125 }, { 17, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, 81, 81, 81, 81, -126, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -126, -126, -126, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -126, -126 }, { 17, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, 81, 81, 81, 81, -127, 81, 81, 81, 81, 134, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -127, -127, -127, 81, 81, 81, 81, 81, 134, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -127, -127 }, { 17, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, 135, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, 135, -128, -128, -128, -128, -128 }, { 17, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, 136, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, -129 }, { 17, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, 81, 81, 81, 81, -130, 81, 81, 81, 81, 137, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 138, 81, 81, 81, -130, -130, -130, 81, 81, 81, 81, 81, 137, 81, 81, 81, 81, 81, 81, 81, 81, 81, 138, 81, 81, 81, -130, -130 }, { 17, -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, 81, 81, 81, 81, -131, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -131, -131, -131, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -131, -131 }, { 17, -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, -132, 81, 81, 81, 81, -132, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 139, 81, 81, 81, -132, -132, -132, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 139, 81, 81, 81, -132, -132 }, { 17, -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, -133, 81, 81, 81, 81, -133, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -133, -133, -133, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -133, -133 }, { 17, -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, 81, 81, 81, 81, -134, 81, 81, 81, 81, 140, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 141, 81, 81, 81, -134, -134, -134, 81, 81, 81, 81, 81, 140, 81, 81, 81, 81, 81, 81, 81, 81, 81, 141, 81, 81, 81, -134, -134 }, { 17, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, 142, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, 142, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, -135 }, { 17, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, 143, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136, -136 }, { 17, -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, -137, 81, 81, 81, 81, -137, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 144, 81, 81, 81, 81, 81, 81, 81, 81, -137, -137, -137, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 144, 81, 81, 81, 81, 81, 81, 81, 81, -137, -137 }, { 17, -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, -138, 81, 81, 81, 81, -138, 81, 81, 81, 81, 81, 81, 81, 81, 145, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -138, -138, -138, 81, 81, 81, 81, 81, 81, 81, 81, 145, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -138, -138 }, { 17, -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, -139, 81, 81, 81, 81, -139, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -139, -139, -139, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -139, -139 }, { 17, -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, -140, 81, 81, 81, 81, -140, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 146, 81, 81, 81, 81, 81, 81, 81, 81, -140, -140, -140, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 146, 81, 81, 81, 81, 81, 81, 81, 81, -140, -140 }, { 17, -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, 81, 81, 81, 81, -141, 81, 81, 81, 81, 81, 81, 81, 81, 147, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -141, -141, -141, 81, 81, 81, 81, 81, 81, 81, 81, 147, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -141, -141 }, { 17, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142, -142 }, { 17, -143, 148, 148, 148, 148, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143, -143 }, { 17, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, -144, 81, 81, 81, 81, -144, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 149, 81, 81, 81, 81, 81, 81, -144, -144, -144, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 149, 81, 81, 81, 81, 81, 81, -144, -144 }, { 17, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, -145, 81, 81, 81, 81, -145, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 150, 81, 81, 81, -145, -145, -145, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 150, 81, 81, 81, -145, -145 }, { 17, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, -146, 81, 81, 81, 81, -146, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 151, 81, 81, 81, 81, 81, 81, -146, -146, -146, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 151, 81, 81, 81, 81, 81, 81, -146, -146 }, { 17, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, 81, 81, 81, 81, -147, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 152, 81, 81, 81, -147, -147, -147, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 152, 81, 81, 81, -147, -147 }, { 17, -148, 148, 148, 148, 148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148, -148 }, { 17, -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, -149, 81, 81, 81, 81, -149, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -149, -149, -149, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -149, -149 }, { 17, -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, -150, 81, 81, 81, 81, -150, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 153, 81, 81, 81, 81, 81, 81, 81, 81, -150, -150, -150, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 153, 81, 81, 81, 81, 81, 81, 81, 81, -150, -150 }, { 17, -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, -151, 81, 81, 81, 81, -151, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -151, -151, -151, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -151, -151 }, { 17, -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, -152, 81, 81, 81, 81, -152, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 154, 81, 81, 81, 81, 81, 81, 81, 81, -152, -152, -152, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 154, 81, 81, 81, 81, 81, 81, 81, 81, -152, -152 }, { 17, -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, -153, 81, 81, 81, 81, -153, 81, 81, 81, 81, 155, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -153, -153, -153, 81, 81, 81, 81, 81, 155, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -153, -153 }, { 17, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, 81, 81, 81, 81, -154, 81, 81, 81, 81, 156, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -154, -154, -154, 81, 81, 81, 81, 81, 156, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -154, -154 }, { 17, -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, -155, 81, 81, 81, 81, -155, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -155, -155, -155, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -155, -155 }, { 17, -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, -156, 81, 81, 81, 81, -156, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -156, -156, -156, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, -156, -156 }, } ; static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ yyleng = (size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 51 #define YY_END_OF_BUFFER 52 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static yyconst flex_int16_t yy_accept[157] = { 0, 0, 0, 4, 4, 0, 0, 0, 0, 23, 23, 27, 27, 0, 0, 0, 0, 52, 50, 1, 1, 36, 2, 44, 37, 50, 43, 41, 41, 28, 43, 3, 29, 4, 51, 20, 20, 19, 19, 17, 17, 17, 17, 17, 17, 17, 17, 18, 22, 21, 23, 26, 26, 25, 23, 27, 30, 35, 34, 31, 47, 45, 46, 49, 49, 1, 36, 2, 37, 42, 43, 43, 0, 41, 0, 41, 28, 3, 4, 0, 18, 17, 17, 17, 17, 17, 17, 17, 17, 17, 21, 21, 23, 23, 25, 25, 24, 27, 30, 30, 32, 33, 47, 0, 39, 40, 0, 17, 17, 17, 10, 17, 17, 17, 17, 24, 30, 0, 39, 40, 0, 17, 13, 17, 17, 17, 12, 17, 0, 0, 6, 11, 17, 14, 5, 0, 0, 17, 17, 7, 17, 17, 48, 38, 17, 17, 17, 17, 38, 16, 17, 15, 17, 17, 17, 9, 8 } ; static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 4, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 6, 7, 6, 8, 9, 1, 1, 10, 11, 12, 6, 6, 13, 14, 15, 16, 17, 18, 19, 19, 19, 19, 19, 19, 19, 1, 20, 1, 6, 1, 6, 1, 21, 22, 23, 24, 25, 26, 27, 28, 29, 27, 30, 31, 27, 32, 33, 27, 27, 34, 35, 36, 37, 38, 39, 27, 27, 27, 40, 41, 42, 1, 43, 1, 44, 45, 46, 47, 48, 49, 27, 50, 51, 27, 52, 53, 27, 54, 55, 27, 27, 56, 57, 58, 59, 60, 61, 27, 27, 27, 62, 1, 63, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; extern int yy_flex_debug; int yy_flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "lexpgn.ll" #line 2 "lexpgn.ll" /* lexpgn by David A. Wheeler (http://www.dwheeler.com). GNU Chess frontend Copyright (C) 2001-2011 Free Software Foundation, Inc. GNU Chess is based on the two research programs Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Contact Info: bug-gnu-chess@gnu.org cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net ****************** This code processes files formatted using PGN, as defined in "Standard Portable Game Notation Specification and Implementation Guide" Revised 1994.03.12 by Steven J. Edwards. This code lexically analyzes PGN files as an import format; since it's importing, it tries to accept nonstandard formats as much as it can and figure out the "intent". It handles varying newlines (e.g. \r), etc. It will accept a great deal of misformatting that isn't, strictly speaking, legal PGN, but the point is to be able to figure out what was intended. Calling the lexer will process ONE game in a file, starting with 0 or more tags, followed by 0 or more moves. It returns 0 if no erors, 1 if errors, 2 if terminated (normally). It will place data somewhere depending on the value of data_dest; if data_dest is DEST_TRASH, it skips the game (not fully implemented), if data_dest is DEST_GAME, it stores into Game[], if data_dest is DEST_BOOK, it's stored into the book material. To process a multi-game PGN file, call it again and again. Some of the funny ordering (e.g., for bracecomment) is to make it high speed. Flex/lex can produce high speed lexers, but only if it gets some help, in particular by defining patterns that maximally match. TODO: prevent buffer overflow for FEN. */ #include #include #include #include #include "common.h" #include "lexpgn.h" enum tagtype { NO_TAG, EVENT_TAG, SITE_TAG, DATE_TAG, ROUND_TAG, WHITE_TAG, BLACK_TAG, RESULT_TAG, WHITE_ELO_TAG, BLACK_ELO_TAG, WHITETITLE_TAG, BLACKTITLE_TAG, FEN_TAG, OTHER_TAG }; enum data_destination_t data_dest; #define yyterminate() { if ( seen_tags || seen_moves) return 1; \ return 2; } char *pgn_event; char *pgn_site; char *pgn_date; char *pgn_round; char *pgn_white; char *pgn_black; char *pgn_result; char *pgn_whiteELO; char *pgn_blackELO; char *pgn_othertags; char *initial_comments; /* PGN comments before any moves */ char *return_append_str(char *dest, const char *s) { /* Append text s to dest, and return new result. */ char *newloc; size_t newlen; /* This doesn't have buffer overflow vulnerabilities, because we always allocate for enough space before appending. */ if (!dest) { newloc = (char *) malloc(strlen(s))+1; strcpy(newloc, s); return newloc; } newlen = strlen(dest) + strlen(s) + 1; newloc = (char *) malloc(newlen); strcpy(newloc, dest); if (!newloc) return dest; /* Can't do it, throw away the data */ strcat(newloc, s); return newloc; } void append_str(char **dest, const char *s) { /* Append text s to *dest, and modify *dest to new location. */ char *temp; temp = return_append_str(*dest, s); *dest = temp; } void append_comment(const char *t) { /* Append PGN text t after the current move */ if (data_dest == DEST_GAME) { /* TODO */ if (GameCnt < 1) { append_str(&initial_comments,t); } else { append_str(&(Game[GameCnt].comments),t); } } } #line 2263 "lexpgn.cc" #define INITIAL 0 #define tag_gobble 1 #define tagsymbol 2 #define tagsep 3 #define tagdata 4 #define tagend 5 #define bracecomment 6 #define RAV 7 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif static int yy_init_globals (void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int yylex_destroy (void ); int yyget_debug (void ); void yyset_debug (int debug_flag ); YY_EXTRA_TYPE yyget_extra (void ); void yyset_extra (YY_EXTRA_TYPE user_defined ); FILE *yyget_in (void ); void yyset_in (FILE * in_str ); FILE *yyget_out (void ); void yyset_out (FILE * out_str ); yy_size_t yyget_leng (void ); char *yyget_text (void ); int yyget_lineno (void ); void yyset_lineno (int line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap (void ); #else extern int yywrap (void ); #endif #endif static void yyunput (int c,char *buf_ptr ); #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void ); #else static int input (void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ errno=0; \ while ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int yylex (void); #define YY_DECL int yylex (void) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ if ( yyleng > 0 ) \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ (yytext[yyleng - 1] == '\n'); \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 153 "lexpgn.ll" /* These are executed on each entry to the code */ int seen_tags = 0; int seen_moves = 0; enum tagtype ctag = NO_TAG; int firstmovenum = -1; int side = white; int rav_count = 0; int result = R_NORESULT; char tagname[80]; /* Name of tag currently being processed */ leaf *p; #line 2453 "lexpgn.cc" if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_load_buffer_state( ); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); yy_match: while ( (yy_current_state = yy_nxt[yy_current_state][ yy_ec[YY_SC_TO_UI(*yy_cp)] ]) > 0 ) { if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } ++yy_cp; } yy_current_state = -yy_current_state; yy_find_action: yy_act = yy_accept[yy_current_state]; YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = (yy_hold_char); yy_cp = (yy_last_accepting_cpos) + 1; yy_current_state = (yy_last_accepting_state); goto yy_find_action; case 1: /* rule 1 can match eol */ YY_RULE_SETUP #line 166 "lexpgn.ll" { /* Ignore whitespace */ } YY_BREAK case 2: YY_RULE_SETUP #line 167 "lexpgn.ll" { /* Ignore PGN escape. We'll allow initial space. */ } YY_BREAK case 3: YY_RULE_SETUP #line 169 "lexpgn.ll" { /* Handle "[". If we've already seen a move, return "[" to the stream and return. */ /* We rashly match on any SC to avoid trouble with unmatched brackets of various types */ seen_tags = 1; ctag = NO_TAG; if (seen_moves) { BEGIN(INITIAL); yyless(0); /* put the "[" back. */ return 0; } if (data_dest == DEST_TRASH) {BEGIN(tag_gobble);} else { BEGIN(tagsymbol); } } YY_BREAK case 4: YY_RULE_SETUP #line 186 "lexpgn.ll" {BEGIN(INITIAL);} YY_BREAK case 5: YY_RULE_SETUP #line 188 "lexpgn.ll" {ctag = WHITE_TAG; BEGIN(tagsep);} YY_BREAK case 6: YY_RULE_SETUP #line 189 "lexpgn.ll" {ctag = BLACK_TAG; BEGIN(tagsep);} YY_BREAK case 7: YY_RULE_SETUP #line 190 "lexpgn.ll" {ctag = RESULT_TAG; BEGIN(tagsep);} YY_BREAK case 8: YY_RULE_SETUP #line 191 "lexpgn.ll" {ctag = WHITETITLE_TAG; BEGIN(tagsep);} YY_BREAK case 9: YY_RULE_SETUP #line 192 "lexpgn.ll" {ctag = BLACKTITLE_TAG; BEGIN(tagsep);} YY_BREAK case 10: YY_RULE_SETUP #line 193 "lexpgn.ll" {ctag = FEN_TAG; BEGIN(tagsep);} YY_BREAK case 11: YY_RULE_SETUP #line 194 "lexpgn.ll" {ctag = EVENT_TAG; BEGIN(tagsep);} YY_BREAK case 12: YY_RULE_SETUP #line 195 "lexpgn.ll" {ctag = SITE_TAG; BEGIN(tagsep);} YY_BREAK case 13: YY_RULE_SETUP #line 196 "lexpgn.ll" {ctag = DATE_TAG; BEGIN(tagsep);} YY_BREAK case 14: YY_RULE_SETUP #line 197 "lexpgn.ll" {ctag = ROUND_TAG; BEGIN(tagsep);} YY_BREAK case 15: YY_RULE_SETUP #line 198 "lexpgn.ll" {ctag = WHITE_ELO_TAG; BEGIN(tagsep);} YY_BREAK case 16: YY_RULE_SETUP #line 199 "lexpgn.ll" {ctag = BLACK_ELO_TAG; BEGIN(tagsep);} YY_BREAK case 17: YY_RULE_SETUP #line 200 "lexpgn.ll" { ctag = OTHER_TAG; if (yyleng >= (sizeof(tagname)-1)) { printf("Error, tagname too long: %s", yytext); return 1; } strncpy(tagname, yytext, sizeof(tagname)-1); BEGIN(tagsep); } YY_BREAK case 18: YY_RULE_SETUP #line 209 "lexpgn.ll" {BEGIN(INITIAL); /* No tag name, skip. */} YY_BREAK case 19: /* rule 19 can match eol */ YY_RULE_SETUP #line 210 "lexpgn.ll" {BEGIN(INITIAL); /* Line ended early. */} YY_BREAK case 20: YY_RULE_SETUP #line 211 "lexpgn.ll" { printf("Bad character as tag name: %s\n", yytext); return 1; } YY_BREAK case 21: YY_RULE_SETUP #line 216 "lexpgn.ll" {BEGIN(tagdata);} YY_BREAK case 22: YY_RULE_SETUP #line 217 "lexpgn.ll" { printf("Bad character as tag separator: %s\n", yytext); return 1; } YY_BREAK case 23: YY_RULE_SETUP #line 222 "lexpgn.ll" { /* tag data */ /* We start at first " in tag, and must match till we reach an unprotected " or end of line */ BEGIN(tagend); /* TODO: if DEST_GAME, store tag symbol and data for later saving */ switch(ctag) { case WHITE_TAG: /* printf("White = %s\n", yytext); */ if (data_dest == DEST_GAME) pgn_white = strdup(yytext); break; case BLACK_TAG: /* printf("Black = %s\n", yytext); */ if (data_dest == DEST_GAME) pgn_black = strdup(yytext); break; case RESULT_TAG: /* printf("Result = %s\n", yytext); */ if (!strcmp(yytext, "1-0")) result = R_WHITE_WINS; else if (!strcmp(yytext, "0-1")) result = R_BLACK_WINS; else if (!strcmp(yytext, "1/2-1/2")) result = R_DRAW; if (data_dest == DEST_GAME) pgn_result = strdup(yytext); break; case WHITETITLE_TAG: /* We'll trust GM, IM, FMs */ if (data_dest == DEST_GAME) { append_str(&pgn_othertags, "[WhiteTitle \""); append_str(&pgn_othertags, yytext); append_str(&pgn_othertags, "\"]\n"); } break; case BLACKTITLE_TAG: if (data_dest == DEST_GAME) { append_str(&pgn_othertags, "[BlackTitle \""); append_str(&pgn_othertags, yytext); append_str(&pgn_othertags, "\"]\n"); } break; case FEN_TAG: /* Legal FEN is no more than 81 chars long, because 71 (a character for every board cell, plus separators) + 1 (space) + 1 (side, w or b) + 1 (space) + 4 (castling, KQkq) + 1 (space) + 2 (en passant) = 71. We'll leave one char for miscount/whitespace. This doesn't fully protect against buffer overflow attacks; the parsing routine still has to check to make sure its input don't force it to walk off the end of any arrays. Still, it helps as a sanity check. */ /* printf("FEN tag encountered \"%s\"\n",yytext); */ if (yyleng > 82) { printf("Error: FEN too long: %s\n", yytext); return 1; } /* Doesn't return failure/success; just do the best you can */ ParseEPD(yytext); /* Remember it can be black to move now */ side = board.side; if (data_dest == DEST_GAME) { append_str(&pgn_othertags, "[FEN \""); append_str(&pgn_othertags, yytext); append_str(&pgn_othertags, "\"]\n"); } break; case EVENT_TAG: if (data_dest == DEST_GAME) pgn_event = strdup(yytext); break; case SITE_TAG: if (data_dest == DEST_GAME) pgn_site = strdup(yytext); break; case DATE_TAG: if (data_dest == DEST_GAME) pgn_date = strdup(yytext); break; case ROUND_TAG: if (data_dest == DEST_GAME) pgn_round = strdup(yytext); break; case WHITE_ELO_TAG: if (data_dest == DEST_GAME) pgn_whiteELO = strdup(yytext); break; case BLACK_ELO_TAG: if (data_dest == DEST_GAME) pgn_blackELO = strdup(yytext); break; case OTHER_TAG: if (data_dest == DEST_GAME) { append_str(&pgn_othertags, "["); append_str(&pgn_othertags, tagname); append_str(&pgn_othertags, " \""); append_str(&pgn_othertags, yytext); append_str(&pgn_othertags, "\"]\n"); } break; } } YY_BREAK case 24: /* rule 24 can match eol */ YY_RULE_SETUP #line 326 "lexpgn.ll" {BEGIN(INITIAL);} YY_BREAK case 25: YY_RULE_SETUP #line 327 "lexpgn.ll" {BEGIN(INITIAL); /* Garbage, do what can. */} YY_BREAK case 26: /* rule 26 can match eol */ YY_RULE_SETUP #line 328 "lexpgn.ll" {BEGIN(INITIAL); /* End-of-line. */} YY_BREAK case 27: YY_RULE_SETUP #line 330 "lexpgn.ll" {BEGIN(INITIAL); /* Consume leftover */} YY_BREAK case 28: YY_RULE_SETUP #line 332 "lexpgn.ll" { /* PGN comment */ seen_moves = 1; append_comment(yytext); append_comment("\n"); } YY_BREAK case 29: YY_RULE_SETUP #line 338 "lexpgn.ll" { /* PGN comment */ seen_moves = 1; append_comment(yytext); BEGIN(bracecomment); } YY_BREAK case 30: /* rule 30 can match eol */ YY_RULE_SETUP #line 343 "lexpgn.ll" { /* PGN comment; may embed \n */ append_comment(yytext); } YY_BREAK case 31: YY_RULE_SETUP #line 346 "lexpgn.ll" { append_comment(yytext); BEGIN(INITIAL); } YY_BREAK case 32: /* rule 32 can match eol */ YY_RULE_SETUP #line 350 "lexpgn.ll" { append_comment("\n"); } YY_BREAK case 33: /* rule 33 can match eol */ YY_RULE_SETUP #line 351 "lexpgn.ll" { append_comment("\n"); } YY_BREAK case 34: YY_RULE_SETUP #line 352 "lexpgn.ll" { append_comment("\n"); } YY_BREAK case 35: /* rule 35 can match eol */ YY_RULE_SETUP #line 353 "lexpgn.ll" { append_comment("\n"); } YY_BREAK case 36: YY_RULE_SETUP #line 356 "lexpgn.ll" { seen_moves = 1; /* Numeric Annotation Glyph */ append_comment(yytext); } YY_BREAK case 37: /* rule 37 can match eol */ YY_RULE_SETUP #line 360 "lexpgn.ll" { return 0; /* could check if consistent w/Result */ } YY_BREAK case 38: /* rule 38 can match eol */ YY_RULE_SETUP #line 361 "lexpgn.ll" { return 0; } YY_BREAK case 39: /* rule 39 can match eol */ YY_RULE_SETUP #line 362 "lexpgn.ll" { return 0; } YY_BREAK case 40: /* rule 40 can match eol */ YY_RULE_SETUP #line 363 "lexpgn.ll" { return 0; } YY_BREAK case 41: YY_RULE_SETUP #line 365 "lexpgn.ll" { seen_moves = 1; /* Move number */ if (firstmovenum == -1) { /* TODO: Use this info somehow */ sscanf(yytext, "%d", &firstmovenum); if (firstmovenum < 0 || firstmovenum > 32000) firstmovenum = -1; /* printf("First move num=%d\n", firstmovenum); */ } } YY_BREAK case 42: YY_RULE_SETUP #line 375 "lexpgn.ll" { seen_moves = 1; side = black; } YY_BREAK case 43: YY_RULE_SETUP #line 378 "lexpgn.ll" { /* Process a move */ seen_moves = 1; if (data_dest != DEST_TRASH) { /* printf("Seen move %s\n", yytext); */ /* SAN moves can be at most 7 characters, and Game[].SANmv must be able to store the result. */ if (yyleng > 7) { printf("Error: move too long: %s\n", yytext); return 1; } p = ValidateMove(yytext); if (!p) { printf ("Invalid move: %s\n", yytext); return 1; } /* MakeMove increments GameCnt */ MakeMove(side, &p->move); strcpy(Game[GameCnt].SANmv, yytext); side = 1^side; } } YY_BREAK case 44: YY_RULE_SETUP #line 400 "lexpgn.ll" { rav_count = 1; append_comment(yytext); BEGIN(RAV); } YY_BREAK case 45: YY_RULE_SETUP #line 401 "lexpgn.ll" { rav_count++; append_comment(yytext); } YY_BREAK case 46: YY_RULE_SETUP #line 402 "lexpgn.ll" { rav_count--; append_comment(yytext); if (rav_count <=0) BEGIN(INITIAL); } YY_BREAK case 47: /* rule 47 can match eol */ YY_RULE_SETUP #line 404 "lexpgn.ll" { append_comment(yytext); /* We escape [ to avoid problems with unclosed RAV */ } YY_BREAK case 48: YY_RULE_SETUP #line 408 "lexpgn.ll" { yyless(0) ; BEGIN(INITIAL); return(0) ; /* Damn humans */} YY_BREAK case 49: YY_RULE_SETUP #line 409 "lexpgn.ll" { append_comment(yytext); } YY_BREAK case 50: YY_RULE_SETUP #line 412 "lexpgn.ll" { printf("Invalid character %c in input stream.\n", yytext[0]); return 1; } YY_BREAK case 51: YY_RULE_SETUP #line 417 "lexpgn.ll" ECHO; YY_BREAK #line 2973 "lexpgn.cc" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(tag_gobble): case YY_STATE_EOF(tagsymbol): case YY_STATE_EOF(tagsep): case YY_STATE_EOF(tagdata): case YY_STATE_EOF(tagend): case YY_STATE_EOF(bracecomment): case YY_STATE_EOF(RAV): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = (yy_c_buf_p); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart(yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { yy_current_state = yy_nxt[yy_current_state][(*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1)]; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { register int yy_is_jam; register char *yy_cp = (yy_c_buf_p); yy_current_state = yy_nxt[yy_current_state][1]; yy_is_jam = (yy_current_state <= 0); if ( ! yy_is_jam ) { if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } } return yy_is_jam ? 0 : yy_current_state; } static void yyunput (int c, register char * yy_bp ) { register char *yy_cp; yy_cp = (yy_c_buf_p); /* undo effects of setting up yytext */ *yy_cp = (yy_hold_char); if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register yy_size_t number_to_move = (yy_n_chars) + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; (yytext_ptr) = yy_bp; (yy_hold_char) = *yy_cp; (yy_c_buf_p) = yy_cp; } #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart(yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void yyrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_init_buffer(YY_CURRENT_BUFFER,input_file ); yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); */ yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer(b,file ); return b; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ void yy_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yyfree((void *) b->yy_ch_buf ); yyfree((void *) b ); } #ifndef __cplusplus extern int isatty (int ); #endif /* __cplusplus */ /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; yy_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void yyensure_buffer_stack (void) { yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer(b ); return b; } /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) { return yy_scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param bytes the byte buffer to scan * @param len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n, i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) yyalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer(buf,n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yy_fatal_error (yyconst char* msg ) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int yyget_lineno (void) { return yylineno; } /** Get the input stream. * */ FILE *yyget_in (void) { return yyin; } /** Get the output stream. * */ FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. * */ yy_size_t yyget_leng (void) { return yyleng; } /** Get the current token. * */ char *yyget_text (void) { return yytext; } /** Set the current line number. * @param line_number * */ void yyset_lineno (int line_number ) { yylineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. * * @see yy_switch_to_buffer */ void yyset_in (FILE * in_str ) { yyin = in_str ; } void yyset_out (FILE * out_str ) { yyout = out_str ; } int yyget_debug (void) { return yy_flex_debug; } void yyset_debug (int bdebug ) { yy_flex_debug = bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here. */ (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = (char *) 0; (yy_init) = 0; (yy_start) = 0; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = (FILE *) 0; yyout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by * yylex_init() */ return 0; } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } /* Destroy the stack itself. */ yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *yyalloc (yy_size_t size ) { return (void *) malloc( size ); } void *yyrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } void yyfree (void * ptr ) { free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 417 "lexpgn.ll" gnuchess-6.2.2/src/frontend/lexpgn.h000644 000766 000024 00000001341 11517375747 020247 0ustar00antoniostaff000000 000000 #ifndef LEXPGNX_H #define LEXPGNX_H /* lexpgnx.h - This header file defines the types and global variables * exported from the generated lexpgn file to others. * It's named "lexpgnx" and not "lexpgn", because some lex-like program * might automatically generate a file named lexpgn.h and we don't * want this file to be overwritten. */ enum data_destination_t { DEST_TRASH, DEST_GAME, DEST_BOOK }; extern enum data_destination_t data_dest; extern char *initial_comments; extern char *pgn_event; extern char *pgn_site; extern char *pgn_date; extern char *pgn_round; extern char *pgn_white; extern char *pgn_black; extern char *pgn_whiteELO; extern char *pgn_blackELO; extern char *pgn_result; extern char *pgn_othertags; #endif gnuchess-6.2.2/src/frontend/lexpgn.ll000644 000766 000024 00000027162 12244055717 020426 0ustar00antoniostaff000000 000000 %{ /* lexpgn by David A. Wheeler (http://www.dwheeler.com). GNU Chess frontend Copyright (C) 2001-2011 Free Software Foundation, Inc. GNU Chess is based on the two research programs Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Contact Info: bug-gnu-chess@gnu.org cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net ****************** This code processes files formatted using PGN, as defined in "Standard Portable Game Notation Specification and Implementation Guide" Revised 1994.03.12 by Steven J. Edwards. This code lexically analyzes PGN files as an import format; since it's importing, it tries to accept nonstandard formats as much as it can and figure out the "intent". It handles varying newlines (e.g. \r), etc. It will accept a great deal of misformatting that isn't, strictly speaking, legal PGN, but the point is to be able to figure out what was intended. Calling the lexer will process ONE game in a file, starting with 0 or more tags, followed by 0 or more moves. It returns 0 if no erors, 1 if errors, 2 if terminated (normally). It will place data somewhere depending on the value of data_dest; if data_dest is DEST_TRASH, it skips the game (not fully implemented), if data_dest is DEST_GAME, it stores into Game[], if data_dest is DEST_BOOK, it's stored into the book material. To process a multi-game PGN file, call it again and again. Some of the funny ordering (e.g., for bracecomment) is to make it high speed. Flex/lex can produce high speed lexers, but only if it gets some help, in particular by defining patterns that maximally match. TODO: prevent buffer overflow for FEN. */ #include #include #include #include #include "common.h" #include "lexpgn.h" enum tagtype { NO_TAG, EVENT_TAG, SITE_TAG, DATE_TAG, ROUND_TAG, WHITE_TAG, BLACK_TAG, RESULT_TAG, WHITE_ELO_TAG, BLACK_ELO_TAG, WHITETITLE_TAG, BLACKTITLE_TAG, FEN_TAG, OTHER_TAG }; enum data_destination_t data_dest; #define yyterminate() { if ( seen_tags || seen_moves) return 1; \ return 2; } char *pgn_event; char *pgn_site; char *pgn_date; char *pgn_round; char *pgn_white; char *pgn_black; char *pgn_result; char *pgn_whiteELO; char *pgn_blackELO; char *pgn_othertags; char *initial_comments; /* PGN comments before any moves */ char *return_append_str(char *dest, const char *s) { /* Append text s to dest, and return new result. */ char *newloc; size_t newlen; /* This doesn't have buffer overflow vulnerabilities, because we always allocate for enough space before appending. */ if (!dest) { newloc = (char *) malloc(strlen(s))+1; strcpy(newloc, s); return newloc; } newlen = strlen(dest) + strlen(s) + 1; newloc = (char *) malloc(newlen); strcpy(newloc, dest); if (!newloc) return dest; /* Can't do it, throw away the data */ strcat(newloc, s); return newloc; } void append_str(char **dest, const char *s) { /* Append text s to *dest, and modify *dest to new location. */ char *temp; temp = return_append_str(*dest, s); *dest = temp; } void append_comment(const char *t) { /* Append PGN text t after the current move */ if (data_dest == DEST_GAME) { /* TODO */ if (GameCnt < 1) { append_str(&initial_comments,t); } else { append_str(&(Game[GameCnt].comments),t); } } } %} %option case-insensitive %option full %option ecs %option pointer %option noyywrap SPACE [ \t\n\r\f] NONSPACE [^ \t\n\r\f] %x tag_gobble %x tagsymbol %x tagsep %x tagdata %x tagend %x bracecomment %x RAV %% /* These are executed on each entry to the code */ int seen_tags = 0; int seen_moves = 0; enum tagtype ctag = NO_TAG; int firstmovenum = -1; int side = white; int rav_count = 0; int result = R_NORESULT; char tagname[80]; /* Name of tag currently being processed */ leaf *p; {SPACE}+ { /* Ignore whitespace */ } \%[^\r\n]* { /* Ignore PGN escape. We'll allow initial space. */ } \[[ \t]* { /* Handle "[". If we've already seen a move, return "[" to the stream and return. */ /* We rashly match on any SC to avoid trouble with unmatched brackets of various types */ seen_tags = 1; ctag = NO_TAG; if (seen_moves) { BEGIN(INITIAL); yyless(0); /* put the "[" back. */ return 0; } if (data_dest == DEST_TRASH) {BEGIN(tag_gobble);} else { BEGIN(tagsymbol); } } [^\n\r]* {BEGIN(INITIAL);} white {ctag = WHITE_TAG; BEGIN(tagsep);} black {ctag = BLACK_TAG; BEGIN(tagsep);} result {ctag = RESULT_TAG; BEGIN(tagsep);} whitetitle {ctag = WHITETITLE_TAG; BEGIN(tagsep);} blacktitle {ctag = BLACKTITLE_TAG; BEGIN(tagsep);} fen {ctag = FEN_TAG; BEGIN(tagsep);} event {ctag = EVENT_TAG; BEGIN(tagsep);} site {ctag = SITE_TAG; BEGIN(tagsep);} date {ctag = DATE_TAG; BEGIN(tagsep);} round {ctag = ROUND_TAG; BEGIN(tagsep);} whiteELO {ctag = WHITE_ELO_TAG; BEGIN(tagsep);} blackELO {ctag = BLACK_ELO_TAG; BEGIN(tagsep);} [a-z0-9_]+ { ctag = OTHER_TAG; if (yyleng >= (sizeof(tagname)-1)) { printf("Error, tagname too long: %s", yytext); return 1; } strncpy(tagname, yytext, sizeof(tagname)-1); BEGIN(tagsep); } [ \t]*\] {BEGIN(INITIAL); /* No tag name, skip. */} [\n\r] {BEGIN(INITIAL); /* Line ended early. */} . { printf("Bad character as tag name: %s\n", yytext); return 1; } [ \t]+\"? {BEGIN(tagdata);} . { printf("Bad character as tag separator: %s\n", yytext); return 1; } ("\\\""|[^\n\r\"])* { /* tag data */ /* We start at first " in tag, and must match till we reach an unprotected " or end of line */ BEGIN(tagend); /* TODO: if DEST_GAME, store tag symbol and data for later saving */ switch(ctag) { case WHITE_TAG: /* printf("White = %s\n", yytext); */ if (data_dest == DEST_GAME) pgn_white = strdup(yytext); break; case BLACK_TAG: /* printf("Black = %s\n", yytext); */ if (data_dest == DEST_GAME) pgn_black = strdup(yytext); break; case RESULT_TAG: /* printf("Result = %s\n", yytext); */ if (!strcmp(yytext, "1-0")) result = R_WHITE_WINS; else if (!strcmp(yytext, "0-1")) result = R_BLACK_WINS; else if (!strcmp(yytext, "1/2-1/2")) result = R_DRAW; if (data_dest == DEST_GAME) pgn_result = strdup(yytext); break; case WHITETITLE_TAG: /* We'll trust GM, IM, FMs */ if (data_dest == DEST_GAME) { append_str(&pgn_othertags, "[WhiteTitle \""); append_str(&pgn_othertags, yytext); append_str(&pgn_othertags, "\"]\n"); } break; case BLACKTITLE_TAG: if (data_dest == DEST_GAME) { append_str(&pgn_othertags, "[BlackTitle \""); append_str(&pgn_othertags, yytext); append_str(&pgn_othertags, "\"]\n"); } break; case FEN_TAG: /* Legal FEN is no more than 81 chars long, because 71 (a character for every board cell, plus separators) + 1 (space) + 1 (side, w or b) + 1 (space) + 4 (castling, KQkq) + 1 (space) + 2 (en passant) = 71. We'll leave one char for miscount/whitespace. This doesn't fully protect against buffer overflow attacks; the parsing routine still has to check to make sure its input don't force it to walk off the end of any arrays. Still, it helps as a sanity check. */ /* printf("FEN tag encountered \"%s\"\n",yytext); */ if (yyleng > 82) { printf("Error: FEN too long: %s\n", yytext); return 1; } /* Doesn't return failure/success; just do the best you can */ ParseEPD(yytext); /* Remember it can be black to move now */ side = board.side; if (data_dest == DEST_GAME) { append_str(&pgn_othertags, "[FEN \""); append_str(&pgn_othertags, yytext); append_str(&pgn_othertags, "\"]\n"); } break; case EVENT_TAG: if (data_dest == DEST_GAME) pgn_event = strdup(yytext); break; case SITE_TAG: if (data_dest == DEST_GAME) pgn_site = strdup(yytext); break; case DATE_TAG: if (data_dest == DEST_GAME) pgn_date = strdup(yytext); break; case ROUND_TAG: if (data_dest == DEST_GAME) pgn_round = strdup(yytext); break; case WHITE_ELO_TAG: if (data_dest == DEST_GAME) pgn_whiteELO = strdup(yytext); break; case BLACK_ELO_TAG: if (data_dest == DEST_GAME) pgn_blackELO = strdup(yytext); break; case OTHER_TAG: if (data_dest == DEST_GAME) { append_str(&pgn_othertags, "["); append_str(&pgn_othertags, tagname); append_str(&pgn_othertags, " \""); append_str(&pgn_othertags, yytext); append_str(&pgn_othertags, "\"]\n"); } break; } } \"[ \t]*\][\n\r]* {BEGIN(INITIAL);} \"[^\n\r]* {BEGIN(INITIAL); /* Garbage, do what can. */} [\n\r] {BEGIN(INITIAL); /* End-of-line. */} [^\n\r]* {BEGIN(INITIAL); /* Consume leftover */} \;[^\n\r]* { /* PGN comment */ seen_moves = 1; append_comment(yytext); append_comment("\n"); } \{ { /* PGN comment */ seen_moves = 1; append_comment(yytext); BEGIN(bracecomment); } [^\r\n}]+(\n+[^\r\n}]*)* { /* PGN comment; may embed \n */ append_comment(yytext); } \} { append_comment(yytext); BEGIN(INITIAL); } \n\r { append_comment("\n"); } \r\n { append_comment("\n"); } \r { append_comment("\n"); } \n { append_comment("\n"); } \${NONSPACE}* { seen_moves = 1; /* Numeric Annotation Glyph */ append_comment(yytext); } \*{SPACE}* { return 0; /* could check if consistent w/Result */ } 1\/2-1\/2{SPACE}* { return 0; } 0-1{SPACE}* { return 0; } 1-0{SPACE}* { return 0; } [1-9][0-9]*\.? { seen_moves = 1; /* Move number */ if (firstmovenum == -1) { /* TODO: Use this info somehow */ sscanf(yytext, "%d", &firstmovenum); if (firstmovenum < 0 || firstmovenum > 32000) firstmovenum = -1; /* printf("First move num=%d\n", firstmovenum); */ } } \.\.+ { seen_moves = 1; side = black; } [a-z0][a-z0-9\-=\+\#\?\!\,]* { /* Process a move */ seen_moves = 1; if (data_dest != DEST_TRASH) { /* printf("Seen move %s\n", yytext); */ /* SAN moves can be at most 7 characters, and Game[].SANmv must be able to store the result. */ if (yyleng > 7) { printf("Error: move too long: %s\n", yytext); return 1; } p = ValidateMove(yytext); if (!p) { printf ("Invalid move: %s\n", yytext); return 1; } /* MakeMove increments GameCnt */ MakeMove(side, &p->move); strcpy(Game[GameCnt].SANmv, yytext); side = 1^side; } } \( { rav_count = 1; append_comment(yytext); BEGIN(RAV); } \( { rav_count++; append_comment(yytext); } \) { rav_count--; append_comment(yytext); if (rav_count <=0) BEGIN(INITIAL); } [^\(\)\[]+ { append_comment(yytext); /* We escape [ to avoid problems with unclosed RAV */ } ^\[[wW]hite { yyless(0) ; BEGIN(INITIAL); return(0) ; /* Damn humans */} \[ { append_comment(yytext); } . { printf("Invalid character %c in input stream.\n", yytext[0]); return 1; } %% gnuchess-6.2.2/src/frontend/Makefile.am000644 000766 000024 00000002165 12606676130 020630 0ustar00antoniostaff000000 000000 # Process this file with automake to produce Makefile.in # Makefile for gnuchess/src/frontend. # # Copyright (C) 2001-2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . noinst_LIBRARIES = libfrontend.a libfrontend_a_SOURCES = atak.cc cmd.cc debug.cc epd.cc genmove.cc \ init.cc move.cc output.cc players.cc\ pgn.cc solve.cc \ swap.cc util.cc engine.cc common.h \ inlines.h version.h lexpgn.ll lexpgn.h AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/lib AM_LDFLAGS = $(PTHREAD_LDFLAGS) $(PTHREAD_LIBS) DISTCLEANFILES = *~ gnuchess-6.2.2/src/frontend/Makefile.in000644 000766 000024 00000047015 12606706417 020646 0ustar00antoniostaff000000 000000 # Makefile.in generated by automake 1.14 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Process this file with automake to produce Makefile.in # Makefile for gnuchess/src/frontend. # # Copyright (C) 2001-2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/frontend DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am lexpgn.cc \ $(top_srcdir)/depcomp $(top_srcdir)/ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libfrontend_a_AR = $(AR) $(ARFLAGS) libfrontend_a_LIBADD = am_libfrontend_a_OBJECTS = atak.$(OBJEXT) cmd.$(OBJEXT) \ debug.$(OBJEXT) epd.$(OBJEXT) genmove.$(OBJEXT) init.$(OBJEXT) \ move.$(OBJEXT) output.$(OBJEXT) players.$(OBJEXT) \ pgn.$(OBJEXT) solve.$(OBJEXT) swap.$(OBJEXT) util.$(OBJEXT) \ engine.$(OBJEXT) lexpgn.$(OBJEXT) libfrontend_a_OBJECTS = $(am_libfrontend_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) AM_V_LEX = $(am__v_LEX_@AM_V@) am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) am__v_LEX_0 = @echo " LEX " $@; am__v_LEX_1 = YLWRAP = $(top_srcdir)/ylwrap COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libfrontend_a_SOURCES) DIST_SOURCES = $(libfrontend_a_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HELP2MAN = @HELP2MAN@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGINSDIR = @PLUGINSDIR@ POSUB = @POSUB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXXFLAGS = @PTHREAD_CXXFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libfrontend.a libfrontend_a_SOURCES = atak.cc cmd.cc debug.cc epd.cc genmove.cc \ init.cc move.cc output.cc players.cc\ pgn.cc solve.cc \ swap.cc util.cc engine.cc common.h \ inlines.h version.h lexpgn.ll lexpgn.h AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/lib AM_LDFLAGS = $(PTHREAD_LDFLAGS) $(PTHREAD_LIBS) DISTCLEANFILES = *~ all: all-am .SUFFIXES: .SUFFIXES: .cc .ll .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/frontend/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/frontend/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libfrontend.a: $(libfrontend_a_OBJECTS) $(libfrontend_a_DEPENDENCIES) $(EXTRA_libfrontend_a_DEPENDENCIES) $(AM_V_at)-rm -f libfrontend.a $(AM_V_AR)$(libfrontend_a_AR) libfrontend.a $(libfrontend_a_OBJECTS) $(libfrontend_a_LIBADD) $(AM_V_at)$(RANLIB) libfrontend.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atak.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/engine.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genmove.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lexpgn.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pgn.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/players.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/solve.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .ll.cc: $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f lexpgn.cc clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: gnuchess-6.2.2/src/frontend/move.cc000644 000766 000024 00000052525 12451350325 020047 0ustar00antoniostaff000000 000000 /* move.c GNU Chess frontend Copyright (C) 2001-2011 Free Software Foundation, Inc. GNU Chess is based on the two research programs Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Contact Info: bug-gnu-chess@gnu.org cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net */ #include #include #include #include #include "common.h" void MakeMove (int side, int *move) /************************************************************************** * * To make a move on the board and update the various game information. * **************************************************************************/ { BitBoard *a; int f, t, fpiece, tpiece; int rookf, rookt, epsq, sq; int xside; GameRec *g; xside = 1^side; f = FROMSQ(*move); t = TOSQ(*move); fpiece = cboard[f]; tpiece = cboard[t]; a = &board.b[side][fpiece]; CLEARBIT (*a, f); SETBIT (*a, t); CLEARBIT (board.blockerr90, r90[f]); SETBIT (board.blockerr90, r90[t]); CLEARBIT (board.blockerr45, r45[f]); SETBIT (board.blockerr45, r45[t]); CLEARBIT (board.blockerr315, r315[f]); SETBIT (board.blockerr315, r315[t]); cboard[f] = empty; cboard[t] = fpiece; GameCnt++; g = &Game[GameCnt]; g->epsq = board.ep; g->bflag = board.flag; g->Game50 = Game50; g->hashkey = HashKey; g->phashkey = PawnHashKey; g->mvboard = Mvboard[t]; g->comments = NULL; Mvboard[t] = Mvboard[f]+1; Mvboard[f] = 0; if (board.ep > -1) HashKey ^= ephash[board.ep]; HashKey ^= hashcode[side][fpiece][f]; HashKey ^= hashcode[side][fpiece][t]; if (fpiece == king) board.king[side] = t; if (fpiece == pawn) { PawnHashKey ^= hashcode[side][pawn][f]; PawnHashKey ^= hashcode[side][pawn][t]; } if (tpiece != 0) /* Capture */ { ExchCnt[side]++; CLEARBIT (board.b[xside][tpiece], t); *move |= (tpiece << 15); HashKey ^= hashcode[xside][tpiece][t]; if (tpiece == pawn) PawnHashKey ^= hashcode[xside][pawn][t]; board.material[xside] -= Value[tpiece]; if (tpiece != pawn) board.pmaterial[xside] -= Value[tpiece]; } if (*move & PROMOTION) /* Promotion */ { SETBIT (board.b[side][PROMOTEPIECE (*move)], t); CLEARBIT (*a, t); cboard[t] = PROMOTEPIECE (*move); HashKey ^= hashcode[side][pawn][t]; HashKey ^= hashcode[side][cboard[t]][t]; PawnHashKey ^= hashcode[side][pawn][t]; board.material[side] += (Value[cboard[t]] - ValueP); board.pmaterial[side] += Value[cboard[t]]; } if (*move & ENPASSANT) /* En passant */ { ExchCnt[side]++; epsq = board.ep + (side == white ? - 8 : 8); CLEARBIT (board.b[xside][pawn], epsq); CLEARBIT (board.blockerr90, r90[epsq]); CLEARBIT (board.blockerr45, r45[epsq]); CLEARBIT (board.blockerr315, r315[epsq]); cboard[epsq] = empty; HashKey ^= hashcode[xside][pawn][epsq]; PawnHashKey ^= hashcode[xside][pawn][epsq]; board.material[xside] -= ValueP; } if (*move & (CAPTURE | CASTLING) || fpiece == pawn) Game50 = GameCnt; if (*move & CASTLING) /* Castling */ { if (t & 0x04) /* King side */ { rookf = t + 1; rookt = t - 1; } else /* Queen side */ { rookf = t - 2; rookt = t + 1; } a = &board.b[side][rook]; CLEARBIT (*a, rookf); SETBIT (*a, rookt); CLEARBIT (board.blockerr90, r90[rookf]); SETBIT (board.blockerr90, r90[rookt]); CLEARBIT (board.blockerr45, r45[rookf]); SETBIT (board.blockerr45, r45[rookt]); CLEARBIT (board.blockerr315, r315[rookf]); SETBIT (board.blockerr315, r315[rookt]); cboard[rookf] = empty; cboard[rookt] = rook; Mvboard[rookf] = 0; Mvboard[rookt] = 1; HashKey ^= hashcode[side][rook][rookf]; HashKey ^= hashcode[side][rook][rookt]; board.castled[side] = true; } /* If king or rook move, clear castle flag. */ if (side == white) { if (fpiece == king && board.flag & WCASTLE) { if (board.flag & WKINGCASTLE) HashKey ^= WKCastlehash; if (board.flag & WQUEENCASTLE) HashKey ^= WQCastlehash; board.flag &= ~WCASTLE; } else if (fpiece == rook) { if (f == H1) { if (board.flag & WKINGCASTLE) HashKey ^= WKCastlehash; board.flag &= ~WKINGCASTLE; } else if (f == A1) { if (board.flag & WQUEENCASTLE) HashKey ^= WQCastlehash; board.flag &= ~WQUEENCASTLE; } } if (tpiece == rook) { if (t == H8) { if (board.flag & BKINGCASTLE) HashKey ^= BKCastlehash; board.flag &= ~BKINGCASTLE; } else if (t == A8) { if (board.flag & BQUEENCASTLE) HashKey ^= BQCastlehash; board.flag &= ~BQUEENCASTLE; } } } else { if (fpiece == king && board.flag & BCASTLE) { if (board.flag & BKINGCASTLE) HashKey ^= BKCastlehash; if (board.flag & BQUEENCASTLE) HashKey ^= BQCastlehash; board.flag &= ~BCASTLE; } else if (fpiece == rook) { if (f == H8) { if (board.flag & BKINGCASTLE) HashKey ^= BKCastlehash; board.flag &= ~BKINGCASTLE; } else if (f == A8) { if (board.flag & BQUEENCASTLE) HashKey ^= BQCastlehash; board.flag &= ~BQUEENCASTLE; } } if (tpiece == rook) { if (t == H1) { if (board.flag & WKINGCASTLE) HashKey ^= WKCastlehash; board.flag &= ~WKINGCASTLE; } else if (t == A1) { if (board.flag & WQUEENCASTLE) HashKey ^= WQCastlehash; board.flag &= ~WQUEENCASTLE; } } } /* If pawn move 2 squares, set ep passant square. */ if (fpiece == pawn && abs(f-t) == 16) { sq = (f + t) / 2; board.ep = sq; HashKey ^= ephash[sq]; } else board.ep = -1; board.side = xside; HashKey ^= Sidehash; UpdateFriends (); /* Update game record */ g->move = *move; return; } void UnmakeMove (int side, int *move) /**************************************************************************** * * To unmake a move on the board and update the various game information. * Note that if side is black, then black is about to move, but we will be * undoing a move by white, not black. * ****************************************************************************/ { BitBoard *a; int f, t, fpiece, cpiece; int rookf, rookt, epsq; int xside; GameRec *g; side = 1^side; xside = 1^side; f = FROMSQ(*move); t = TOSQ(*move); fpiece = cboard[t]; cpiece = CAPTUREPIECE (*move); a = &board.b[side][fpiece]; CLEARBIT (*a, t); SETBIT (*a, f); CLEARBIT (board.blockerr90, r90[t]); SETBIT (board.blockerr90, r90[f]); CLEARBIT (board.blockerr45, r45[t]); SETBIT (board.blockerr45, r45[f]); CLEARBIT (board.blockerr315, r315[t]); SETBIT (board.blockerr315, r315[f]); cboard[f] = cboard[t]; cboard[t] = empty; g = &Game[GameCnt]; Mvboard[f] = Mvboard[t]-1; Mvboard[t] = g->mvboard; if (fpiece == king) board.king[side] = f; /* if capture, put back the captured piece */ if (*move & CAPTURE) { ExchCnt[side]--; SETBIT (board.b[xside][cpiece], t); SETBIT (board.blockerr90, r90[t]); SETBIT (board.blockerr45, r45[t]); SETBIT (board.blockerr315, r315[t]); cboard[t] = cpiece; board.material[xside] += Value[cpiece]; if (cpiece != pawn) board.pmaterial[xside] += Value[cpiece]; } /* Undo promotion */ if (*move & PROMOTION) { CLEARBIT (*a, f); SETBIT (board.b[side][pawn], f); cboard[f] = pawn; board.material[side] += (ValueP - Value[PROMOTEPIECE (*move)]); board.pmaterial[side] -= Value[PROMOTEPIECE (*move)]; } /* Undo enpassant */ if (*move & ENPASSANT) { ExchCnt[side]--; epsq = (side == white ? g->epsq - 8 : g->epsq + 8); SETBIT (board.b[xside][pawn], epsq); SETBIT (board.blockerr90, r90[epsq]); SETBIT (board.blockerr45, r45[epsq]); SETBIT (board.blockerr315, r315[epsq]); cboard[epsq] = pawn; board.material[xside] += ValueP; } /* if castling, undo rook move */ if (*move & CASTLING) { if (t & 0x04) /* King side */ { rookf = t + 1; rookt = t - 1; } else /* Queen side */ { rookf = t - 2; rookt = t + 1; } a = &board.b[side][rook]; CLEARBIT (*a, rookt); SETBIT (*a, rookf); CLEARBIT (board.blockerr90, r90[rookt]); SETBIT (board.blockerr90, r90[rookf]); CLEARBIT (board.blockerr45, r45[rookt]); SETBIT (board.blockerr45, r45[rookf]); CLEARBIT (board.blockerr315, r315[rookt]); SETBIT (board.blockerr315, r315[rookf]); cboard[rookf] = rook; cboard[rookt] = empty; Mvboard[rookf] = 0; Mvboard[rookt] = 0; board.castled[side] = false; } UpdateFriends (); board.side = side; board.ep = g->epsq; board.flag = g->bflag; HashKey = g->hashkey; PawnHashKey = g->phashkey; Game50 = g->Game50; GameCnt--; return; } void SANMove (int move, int ply) /**************************************************************************** * * Convert the move to a SAN format. GenMoves (ply) needs to be called * by the calling routine for this to work. * ****************************************************************************/ { int side; int piece, ambiguous; int f, t; BitBoard b; leaf *node1; char *s; side = board.side; s = SANmv; f = FROMSQ(move); t = TOSQ(move); /* Check some special moves like castling */ if (move & CASTLING) { if (t == 6 || t == 62) strcpy (s, "O-O"); else strcpy (s, "O-O-O"); return; } /**************************************************************************** * * Here split the code into 2 parts for clarity sake. First part deals * with pawn moves only, 2nd part only piece moves. However before doing * that, see if the move is ambiguous. * ****************************************************************************/ /* AMBIGUITY CHECK */ piece = cboard[f]; side = board.side; b = board.b[side][piece]; ambiguous = false; node1 = TreePtr[ply]; if (nbits (b) > 1) { /* * Scan the movelist to see if another same-type piece is * also moving to that particular to-square. */ for (node1 = TreePtr[ply]; node1 < TreePtr[ply + 1]; node1++) { if (FROMSQ(node1->move) == f) continue; /* original piece, skip */ if (TOSQ(node1->move) != t) continue; /* diff to-square, skip */ if (cboard[FROMSQ(node1->move)] != piece) continue; /* diff piece */ ambiguous = true; break; } } if (piece == pawn) { /* Capture or enpassant */ if (cboard[t] != 0 || board.ep == t) { *s++ = algbrfile [ROW (f)]; *s++ = 'x'; } strcpy (s, algbr[t]); s += 2; /* Promotion */ if (move & PROMOTION) { *s++ = '='; *s++ = notation[PROMOTEPIECE (move)]; } } else /* its not pawn */ { *s++ = notation[piece]; if (ambiguous) { if (ROW (f) == ROW (FROMSQ(node1->move))) *s++ = algbrrank[RANK (f)]; else *s++ = algbrfile[ROW (f)]; } if (cboard[t] != 0) /* capture */ *s++ = 'x'; strcpy (s, algbr[t]); s += 2; } /* See if it is a checking or mating move */ MakeMove (side, &move); if (SqAtakd (board.king[1^side], side)) { TreePtr[ply+2] = TreePtr[ply+1]; GenCheckEscapes (ply+1); if (TreePtr[ply+1] == TreePtr[ply+2]) *s++ = '#'; else *s++ = '+'; GenCnt -= TreePtr[ply+2] - TreePtr[ply+1]; } UnmakeMove (1^side, &move); *s = '\0'; return; } #define ASCIITOFILE(a) ((a) - 'a') #define ASCIITORANK(a) ((a) - '1') #define ASCIITOSQ(a,b) (ASCIITOFILE(a)) + (ASCIITORANK(b)) * 8 #define ATOH(a) ((a) >= 'a' && (a) <= 'h') #define ITO8(a) ((a) >= '1' && (a) <= '8') inline int piece_id(const char c) { /* Given c, what is the piece id. This only takes one char, which * isn't enough to handle two-character names (common in Russian text * and old English notation that used Kt), but we're not supposed to * see such text here anyway. This will * accept "P" for pawn, and it used to accept many lowercase chars * (but not "b" for Bishop). However, lowercase chars are no longer * accepted, since they are not allowed by the Fruit engine. */ switch (c) { case 'N': return knight; case 'B': return bishop; case 'R': return rook; case 'Q': return queen; case 'K': return king; case 'P': return pawn; } return empty; } leaf * ValidateMove (char *s) /************************************************************************* * * This routine takes a string and check to see if it is a legal move. * Note. At the moment, we accept 2 types of moves notation. * 1. e2e4 format. 2. SAN format. (e4) * **************************************************************************/ { short f, t, side, rank, file, fileto; short piece, piece2, kount; char promote; char mvstr[MAXSTR], *p; BitBoard b, b2; leaf *n1, *n2; TreePtr[2] = TreePtr[1]; GenMoves (1); FilterIllegalMoves (1); side = board.side; /************************************************************************ * The thing to do now is to clean up the move string. This * gets rid of things like 'x', '+', '=' and so forth. ************************************************************************/ p = mvstr; do { if (*s != 'x' && *s != '+' && *s != '=' && !isspace(*s)) *p++ = *s; } while (*s++ != '\0' ); /* Flush castles that check */ if (mvstr[strlen(mvstr)-1] == '+' || mvstr[strlen(mvstr)-1] == '#' || mvstr[strlen(mvstr)-1] == '=') mvstr[strlen(mvstr)-1] = '\000'; /* Check for castling */ if (strcmp (mvstr, "O-O") == 0 || strcmp (mvstr, "o-o") == 0 || strcmp (mvstr, "0-0") == 0) { if (side == white) { f = 4; t = 6; } else { f = 60; t = 62; } return (IsInMoveList (1, f, t, ' ')); } if (strcmp (mvstr, "O-O-O") == 0 || strcmp (mvstr, "o-o-o") == 0 || strcmp (mvstr, "0-0-0") == 0) { if (side == white) { f = 4; t = 2; } else { f = 60; t = 58; } return (IsInMoveList (1, f, t, ' ')); } /* Test to see if it is e2e4 type notation */ if (ATOH (mvstr[0]) && ITO8 (mvstr[1]) && ATOH (mvstr[2]) && ITO8 (mvstr[3])) { f = ASCIITOSQ (mvstr[0], mvstr[1]); t = ASCIITOSQ (mvstr[2], mvstr[3]); piece = (strlen (mvstr) == 5 ? mvstr[4] : ' '); return (IsInMoveList (1, f, t, piece)); } /*********************************************************************** * Its a SAN notation move. More headache! * We generate all the legal moves and start comparing them with * the input move. ***********************************************************************/ if (ATOH (mvstr[0])) /* pawn move */ { if (ITO8 (mvstr[1])) /* e4 type */ { t = ASCIITOSQ (mvstr[0], mvstr[1]); f = t + (side == white ? -8 : 8); /* Add Sanity Check */ if ( f > 0 && f < 64 ) { if (BitPosArray[f] & board.b[side][pawn]) { if (mvstr[2] != '\0') return (IsInMoveList (1, f, t, mvstr[2])); else return (IsInMoveList (1, f, t, ' ')); } f = t + (side == white ? -16 : 16); if ( f > 0 && f < 64 ) { if (BitPosArray[f] & board.b[side][pawn]) return (IsInMoveList (1, f, t, ' ')); } /* End bound check +/- 16 */ } /* End bound check +/- 8 */ } else if (ATOH (mvstr[1]) && ITO8 (mvstr[2])) /* ed4 type */ { t = ASCIITOSQ (mvstr[1], mvstr[2]); rank = ASCIITORANK (mvstr[2]) + (side == white ? -1 : 1); f = rank * 8 + ASCIITOFILE (mvstr[0]); piece = (strlen (mvstr) == 4 ? mvstr[3] : ' '); return (IsInMoveList (1, f, t, piece)); } else if (ATOH (mvstr[1])) /* ed type */ { file = ASCIITOFILE (mvstr[0]); fileto = ASCIITOFILE (mvstr[1]); b = board.b[side][pawn] & FileBit[file]; if (side == white) b = b >> (fileto < file ? 7 : 9); else b = b << (fileto < file ? 9 : 7); if (board.ep > -1) b = b & (board.friends[1^side] | BitPosArray[board.ep]); else b = b & (board.friends[1^side]); switch (nbits (b)) { case 0 : return ((leaf *) NULL); case 1 : t = leadz (b); f = t - (side == white ? 8 : -8) + (file - fileto); piece = (strlen (mvstr) == 3 ? mvstr[2] : ' '); return (IsInMoveList (1, f, t, piece)); default : printf ("Ambiguous move: %s %s\n",s,mvstr); ShowBoard(); /* getchar(); */ return ((leaf *) NULL); } } } else if ((piece = piece_id(mvstr[0])) != empty && (piece_id(mvstr[1]) == empty)) /* Is a piece move */ { /* Since piece_id accepts P as pawns, this will correctly * handle malformed commands like Pe4 */ b = board.b[side][piece]; t = -1; if (ITO8 (mvstr[1])) /* N1d2 type move */ { rank = ASCIITORANK (mvstr[1]); b &= RankBit[rank]; t = ASCIITOSQ (mvstr[2], mvstr[3]); } else if (ATOH (mvstr[1]) && ATOH (mvstr[2])) /* Nbd2 type move */ { file = ASCIITOFILE (mvstr[1]); b &= FileBit[file]; t = ASCIITOSQ (mvstr[2], mvstr[3]); } else if (ATOH (mvstr[1]) && ITO8 (mvstr[2])) /* Nd2 type move */ { t = ASCIITOSQ (mvstr[1], mvstr[2]); } kount = 0; n1 = n2 = (leaf *) NULL; while (b) { f = leadz (b); CLEARBIT (b, f); if ((n1 = IsInMoveList (1, f, t, ' ')) != (leaf *) NULL ) { n2 = n1; kount++; } } if (kount > 1) { printf ("Ambiguous move: %s %s\n",s,mvstr); ShowBoard(); /* getchar(); */ return ((leaf *) NULL); } else if (kount == 0) return ((leaf *) NULL); else return (n2); } else if (((piece = piece_id(mvstr[0])) != empty) && ((piece2 = piece_id(mvstr[1])) != empty) && ( (mvstr[2] == '\0') || ((piece_id(mvstr[2]) != empty) && mvstr[3] == '\0'))) { /* KxP format */ promote = ' '; if (piece_id(mvstr[2] != empty)) { promote = mvstr[2]; } kount = 0; n1 = n2 = (leaf *) NULL; b = board.b[side][piece]; while (b) { f = leadz (b); CLEARBIT (b, f); b2 = board.b[1^side][piece2]; while (b2) { t = leadz (b2); CLEARBIT (b2, t); printf("Trying %s: ", AlgbrMove(MOVE(f,t))); if ((n1 = IsInMoveList (1, f, t, promote)) != (leaf *) NULL) { n2 = n1; kount++; printf("Y "); } else printf("N "); } } if (kount > 1) { printf ("Ambiguous move: %s %s\n",s,mvstr); ShowBoard(); /* getchar(); */ return ((leaf *) NULL); } else if (kount == 0) return ((leaf *) NULL); else return (n2); } /* Fall through. Nothing worked, return that no move was performed. */ return ((leaf *) NULL); } leaf * IsInMoveList (int ply, int f, int t, char piece) /************************************************************************** * * Checks to see if from and to square can be found in the movelist * and is legal. * **************************************************************************/ { leaf *node; for (node = TreePtr[ply]; node < TreePtr[ply + 1]; node++) { if ((int) (node->move & 0x0FFF) == MOVE(f,t) && toupper(piece) == notation[PROMOTEPIECE (node->move)]) return (node); } return ((leaf *) NULL); } char *AlgbrMove (int move) /***************************************************************************** * * Convert an int move format to algebraic format of g1f3. * *****************************************************************************/ { int f, t; static char s[6]; f = FROMSQ(move); t = TOSQ(move); strcpy (s, algbr[f]); strcpy (s+2, algbr[t]); if (move & PROMOTION) { if (flags & XBOARD) s[4] = lnotation[PROMOTEPIECE (move)]; else s[4] = notation[PROMOTEPIECE (move)]; s[5] = '\0'; } else s[4] = '\0'; return (s); } gnuchess-6.2.2/src/frontend/output.cc000644 000766 000024 00000026305 12451350330 020432 0ustar00antoniostaff000000 000000 /* output.c GNU Chess frontend Copyright (C) 2001-2013 Free Software Foundation, Inc. GNU Chess is based on the two research programs Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Contact Info: bug-gnu-chess@gnu.org cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net */ #include #include #include "common.h" #define MAX_BOARD_RANGE 65 #define PIECE_SIZE 8 const char w_pieces[6][PIECE_SIZE] = {"\u2654 ", "\u2655 ", "\u2656 ", "\u2657 ", "\u2658 ", "\u2659 "}; const char b_pieces[6][PIECE_SIZE] = {"\u265A ", "\u265B ", "\u265C ", "\u265D ", "\u265E ", "\u265F "}; const unsigned ui_king = 0; const unsigned ui_queen = 1; const unsigned ui_rook = 2; const unsigned ui_bishop = 3; const unsigned ui_knight = 4; const unsigned ui_pawn = 5; const char white_square[] = "\033[7;37m"; const char black_square[] = "\033[7;35m"; const char default_console[] = "\033[0m"; const char blank_place[] = " "; /************************************************************************** * Print out the board in a new style way. **************************************************************************/ static void ShowStylishBoard(const char *boardmap); /************************************************************************** * Fill the array piece with the new style piece code **************************************************************************/ static void GetPiece(const char orig_piece, char *piece); /************************************************************************** * Print out the classical gnuchess board. **************************************************************************/ static void ShowClassicalBoard(const char *boardmap); void ShowTime (void) /************************************************************************** * * Print out the time settings. * **************************************************************************/ { } void ShowMoveList (int ply) /************************************************************************** * * Print out the move list. * **************************************************************************/ { leaf *node; int i = 0; for (node = TreePtr[ply]; node < TreePtr[ply+1]; node++) { SANMove (node->move, ply); printf ("%5s %3d\t", SANmv, SwapOff(node->move)); if (++i == 5) { printf ("\n"); i = 0; } } printf ("\n"); } void ShowSmallBoard (void) /***************************************************************************** * * Display the board. Not only that but display some useful information * like whether enpassant is legal and castling state. * *****************************************************************************/ { int r, c, sq; printf ("\n"); if (board.side == white) printf ("white "); else printf ("black "); if (board.flag & WKINGCASTLE) printf ("K"); if (board.flag & WQUEENCASTLE) printf ("Q"); if (board.flag & BKINGCASTLE) printf ("k"); if (board.flag & BQUEENCASTLE) printf ("q"); if (board.ep > -1) printf (" %s", algbr[board.ep]); printf ("\n"); for (r = 56; r >= 0; r -= 8) { for (c = 0; c < 8; c++) { sq = r + c; if (board.b[white][pawn] & BitPosArray[sq]) printf ("P "); else if (board.b[white][knight] & BitPosArray[sq]) printf ("N "); else if (board.b[white][bishop] & BitPosArray[sq]) printf ("B "); else if (board.b[white][rook] & BitPosArray[sq]) printf ("R "); else if (board.b[white][queen] & BitPosArray[sq]) printf ("Q "); else if (board.b[white][king] & BitPosArray[sq]) printf ("K "); else if (board.b[black][pawn] & BitPosArray[sq]) printf ("p "); else if (board.b[black][knight] & BitPosArray[sq]) printf ("n "); else if (board.b[black][bishop] & BitPosArray[sq]) printf ("b "); else if (board.b[black][rook] & BitPosArray[sq]) printf ("r "); else if (board.b[black][queen] & BitPosArray[sq]) printf ("q "); else if (board.b[black][king] & BitPosArray[sq]) printf ("k "); else printf (". "); } printf ("\n"); } printf ("\n"); } void ShowBoard (void) /***************************************************************************** * * Display the board. Not only that but display some useful information * like whether enpassant is legal and castling state. * *****************************************************************************/ { int r, c, sq; fprintf (ofp, "\n"); if ( graphicmodeoutput == 1) { fprintf(ofp, " "); } if (board.side == white) fprintf (ofp, "white "); else fprintf (ofp, "black "); if (board.flag & WKINGCASTLE) fprintf (ofp, "K"); if (board.flag & WQUEENCASTLE) fprintf (ofp, "Q"); if (board.flag & BKINGCASTLE) fprintf (ofp, "k"); if (board.flag & BQUEENCASTLE) fprintf (ofp, "q"); if (board.ep > -1) fprintf (ofp, " %s", algbr[board.ep]); fprintf (ofp, "\n"); char arr_board[MAX_BOARD_RANGE]; unsigned bIndex = 0; memset(arr_board, '\0', MAX_BOARD_RANGE); for (r = 56; r >= 0; r -= 8) { for (c = 0; c < 8; c++) { sq = r + c; if (board.b[white][pawn] & BitPosArray[sq]) arr_board[bIndex++] = 'P'; else if (board.b[white][knight] & BitPosArray[sq]) arr_board[bIndex++] = 'N'; else if (board.b[white][bishop] & BitPosArray[sq]) arr_board[bIndex++] = 'B'; else if (board.b[white][rook] & BitPosArray[sq]) arr_board[bIndex++] = 'R'; else if (board.b[white][queen] & BitPosArray[sq]) arr_board[bIndex++] = 'Q'; else if (board.b[white][king] & BitPosArray[sq]) arr_board[bIndex++] = 'K'; else if (board.b[black][pawn] & BitPosArray[sq]) arr_board[bIndex++] = 'p'; else if (board.b[black][knight] & BitPosArray[sq]) arr_board[bIndex++] = 'n'; else if (board.b[black][bishop] & BitPosArray[sq]) arr_board[bIndex++] = 'b'; else if (board.b[black][rook] & BitPosArray[sq]) arr_board[bIndex++] = 'r'; else if (board.b[black][queen] & BitPosArray[sq]) arr_board[bIndex++] = 'q'; else if (board.b[black][king] & BitPosArray[sq]) arr_board[bIndex++] = 'k'; else arr_board[bIndex++] = '.'; } } if ( graphicmodeoutput == 1) { ShowStylishBoard(arr_board); } else { ShowClassicalBoard(arr_board); } fprintf (ofp, "\n"); } void ShowStylishBoard(const char *boardmap) { unsigned i = 0; unsigned row = 8; const char column[8] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'}; int b_white = 1; char tmp_piece[PIECE_SIZE]; memset(tmp_piece, '\0', PIECE_SIZE); fprintf(ofp, "%d ", row--); for (i =0; i < MAX_BOARD_RANGE; ++i) { fprintf(ofp, "%s", default_console); if ((i > 0) && (i % 8 == 0)) { fprintf(ofp, "\n"); b_white = !b_white; if (row >=1) fprintf(ofp, "%d ", row--); else break; } GetPiece(boardmap[i], tmp_piece); if (b_white) { fprintf(ofp, "%s%s", white_square, tmp_piece); } else { fprintf(ofp, "%s%s", black_square, tmp_piece); } b_white = !b_white; } fprintf(ofp, "%s ", default_console); for (i = 0; i < 8; ++i) { fprintf(ofp, "%c ", column[i]); } } void GetPiece(const char orig_piece, char *piece) { if (orig_piece == 'p') strcpy(piece, b_pieces[ui_pawn]); else if (orig_piece == 'P') strcpy(piece, w_pieces[ui_pawn]); else if (orig_piece == 'n') strcpy(piece, b_pieces[ui_knight]); else if (orig_piece == 'N') strcpy(piece, w_pieces[ui_knight]); else if (orig_piece == 'b') strcpy(piece, b_pieces[ui_bishop]); else if (orig_piece == 'B') strcpy(piece, w_pieces[ui_bishop]); else if (orig_piece == 'r') strcpy(piece, b_pieces[ui_rook]); else if (orig_piece == 'R') strcpy(piece, w_pieces[ui_rook]); else if (orig_piece == 'q') strcpy(piece, b_pieces[ui_queen]); else if (orig_piece == 'Q') strcpy(piece, w_pieces[ui_queen]); else if (orig_piece == 'k') strcpy(piece, b_pieces[ui_king]); else if (orig_piece == 'K') strcpy(piece, w_pieces[ui_king]); else if (orig_piece == '.') strcpy(piece, blank_place); } void ShowClassicalBoard(const char *boardmap) { unsigned i = 0; for (i =0; i < MAX_BOARD_RANGE; ++i) { if ((i > 0) && (i % 8 == 0)) { fprintf(ofp, "\n"); } fprintf(ofp, "%c ", boardmap[i]); } } void ShowCBoard (void) /***************************************************************************** * * * *****************************************************************************/ { int r, c; for (r = 56; r >= 0; r -= 8) { for (c = 0; c < 8; c++) { printf ("%2c ", cboard[r + c] ? notation[cboard[r+c]] : '.'); } printf ("\n"); } printf ("\n"); } void ShowMvboard (void) /***************************************************************************** * * Print the Mvboard[] array. * *****************************************************************************/ { int r, c; for (r = 56; r >= 0; r -= 8) { for (c = 0; c < 8; c++) { printf ("%2d ", Mvboard[r + c]); } printf ("\n"); } printf ("\n"); } void ShowGame (void) { int i; /* ********************************************* * We must handle the special case of an EPD * * game where the first move is by black * ********************************************* */ if ( GameCnt >= 0 ) { printf (" White Black\n"); if ( ( board.side == white && GameCnt % 2 == 1 ) || ( board.side == black && GameCnt % 2 == 0 )) { for (i = 0; i <= GameCnt; i += 2) { printf ("%3d. %-7s %-7s\n", i/2 + 1, Game[i].SANmv, Game[i + 1].SANmv); } } else { printf (" 1. %-7s\n", Game[0].SANmv); for (i = 1; i <= GameCnt; i += 2) { printf ("%3d. %-7s %-7s\n", i/2 + 2, Game[i].SANmv, Game[i + 1].SANmv); } } printf ("\n"); } } gnuchess-6.2.2/src/frontend/pgn.cc000644 000766 000024 00000017074 12451350333 017664 0ustar00antoniostaff000000 000000 /* pgn.c GNU Chess frontend Copyright (C) 2001-2011 Free Software Foundation, Inc. GNU Chess is based on the two research programs Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Contact Info: bug-gnu-chess@gnu.org cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net */ #include #include #include #include #include #include #include "common.h" #include "version.h" #include "lexpgn.h" #define NULL2EMPTY(x) ( (x) ? (x) : "") extern FILE *yyin; extern int yylex (void); void PGNSaveToFile (const char *file, const char *resultstr) /**************************************************************************** * * To save a game into PGN format to a file. If the file does not exist, * it will create it. If the file exists, the game is appended to the file. * ****************************************************************************/ { FILE *fp; char s[100]; int len; char *p; int i; time_t secs; struct tm *timestruct; fp = fopen (file, "a"); /* Can we append to it? */ if (fp == NULL) { printf ("Cannot write to file %s\n", file); return; } /* Write the seven tags */ fprintf (fp, "[Event \"%s\"]\n", NULL2EMPTY(pgn_event)); fprintf (fp, "[Site \"%s\"]\n", NULL2EMPTY(pgn_site)); secs=time(0); if (pgn_date) fprintf(fp,"[Date \"%s\"]\n", pgn_date); else { timestruct=localtime((time_t*) &secs); fprintf(fp,"[Date \"%4d.%02d.%02d\"]\n",timestruct->tm_year+1900, timestruct->tm_mon+1,timestruct->tm_mday); } fprintf (fp, "[Round \"%s\"]\n", NULL2EMPTY(pgn_round)); if (pgn_white) fprintf (fp, "[White \"%s\"]\n", pgn_white); else if (computer == white) fprintf (fp, "[White \"%s %s\"]\n",PROGRAM,VERSION); else fprintf (fp, "[White \"%s\"]\n",name); if (pgn_black) fprintf (fp, "[Black \"%s\"]\n", pgn_black); else if (computer == black) fprintf (fp, "[Black \"%s %s\"]\n",PROGRAM,VERSION); else fprintf (fp, "[Black \"%s\"]\n",name); if (pgn_whiteELO) fprintf (fp, "[WhiteELO \"%s\"]\n", NULL2EMPTY(pgn_white)); else fprintf(fp, "[WhiteELO \"%d\"]\n",computer==white?myrating:opprating); if (pgn_blackELO) fprintf (fp, "[BlackELO \"%s\"]\n", NULL2EMPTY(pgn_black)); else fprintf (fp, "[BlackELO \"%d\"]\n",computer==white?opprating:myrating); if (pgn_result) fprintf (fp, "[Result \"%s\"]\n", pgn_result); else { /* Revive the little-known standard functions! */ len = strcspn(resultstr," {"); fprintf (fp, "[Result \"%.*s\"]\n", len, resultstr); } if (pgn_othertags) { fprintf (fp, "%s", pgn_othertags); } fprintf (fp, "\n"); if (initial_comments) { fprintf(fp, "\n%s\n", initial_comments); /* If it doesn't end in \n, add it */ if (initial_comments[0] && initial_comments[strlen(initial_comments)-1] != '\n') fprintf(fp, "\n"); } s[0] = '\0'; for (i = 0; i <= GameCnt; i++) { if (! (i % 2)) { sprintf (s, "%s%d. ", s, i/2 + 1); } sprintf (s, "%s%s ", s, Game[i].SANmv); if (strlen (s) > 80) { p = s + 79; while (*p-- != ' '); *++p = '\0'; fprintf (fp, "%s\n", s); strcpy (s, p+1); } if (Game[i].comments) { fprintf (fp, "%s\n", s); fprintf (fp, "%s", Game[i].comments); if (Game[i].comments[0] && Game[i].comments[strlen(Game[i].comments)-1] != '\n') fprintf(fp, "\n"); s[0] = '\0'; } } fprintf (fp, "%s", s); fprintf (fp, "%s", resultstr); fprintf (fp, "\n\n"); fclose (fp); } void PGNReadFromFile (const char *file, int showheading) /**************************************************************************** * * To read a game from a PGN file. * ****************************************************************************/ { FILE *fp; fp = fopen (file, "r"); if (fp == NULL) { printf ("Cannot open file %s\n", file); return; } yyin = fp; InitVars (); data_dest = DEST_GAME; (void) yylex(); fclose (fp); ShowBoard (); if ( showheading ) { printf("\n--------------------------------------------------\n"); printf("%s (%s) x %s (%s) - %s\nSite: %s\nDate: %s\n", pgn_white != NULL ? pgn_white : "Unknown", pgn_whiteELO != NULL ? pgn_whiteELO : "Unknown", pgn_black != NULL ? pgn_black : "Unknown", pgn_blackELO != NULL ? pgn_blackELO : "Unknown", pgn_result != NULL ? pgn_result : "Unknown", pgn_site != NULL ? pgn_site : "Unknown", pgn_date != NULL ? pgn_date : "Unknown"); printf("--------------------------------------------------\n"); } } /* Only players in the table below are permitted into the opening book from the PGN files. Please expand the table as needed. Generally, I would recommend only acknowledged GM's and IM's and oneself, but because of the self-changing nature of the book, anything inferior will eventually be eliminated through automatic play as long as you feed the games the program plays back to itself with "book add pgnfile" */ /* TODO: Fix this so the list isn't hardcoded. */ static const char *const trusted_players[] = { "Alekhine", "Adams", "Anand", "Anderssen", "Andersson", "Aronin", "Averbakh", "Balashov", "Beliavsky", "Benko", "Bernstein", "Bird", "Bogoljubow", "Bolbochan", "Boleslavsky", "Byrne", "Botvinnik", "Bronstein", "Browne", "Capablanca", "Chigorin", "Christiansen", "De Firmian", "Deep Blue", "Deep Thought", "Donner", "Dreev", "Duras", "Euwe", "Evans", "Filip", "Fine", "Fischer", "Flohr", "Furman", "Gelfand", "Geller", "Gereben", "Glek", "Gligoric", "GNU", "Golombek", "Gruenfeld", "Guimard", "Hodgson", "Ivanchuk", "Ivkov", "Janowsky", "Kamsky", "Kan", "Karpov", "Kasparov", "Keres", "Korchnoi", "Kortschnoj", "Kotov", "Kramnik", "Kupreich", "Lasker", "Lautier", "Letelier", "Lilienthal", "Ljubojevic", "Marshall", "Maroczy", "Mieses", "Miles", "Morphy", "Mueller", /* Every other German has this name... */ "Nimzowitsch", "Nunn", "Opocensky", "Pachman", "Petrosian", "Piket", "Pilnik", "Pirc", "Polgar", "Portisch", "Psakhis", "Ragozin", "Reshevsky", "Reti", "Romanish", "Rubinstein", "Saemisch", "Seirawan", "Shirov", "Short", "Silman", "Smyslov", "Sokolsky", "Spassky", "Sveshnikov", "Stahlberg", "Steinitz", "Tal", "Tarjan", "Tartakower", "Timman", "Topalov", "Torre", "Vidmar" }; int IsTrustedPlayer(const char *name) /* Return 1 if name in trusted_players list, else 0 */ { int i; for (i = 0; i < (sizeof(trusted_players) / sizeof(*trusted_players)); i++) { if (strstr(name, trusted_players[i]) != NULL) return 1; } return 0; } gnuchess-6.2.2/src/frontend/players.cc000644 000766 000024 00000013154 12451350344 020554 0ustar00antoniostaff000000 000000 /* players.c GNU Chess frontend Copyright (C) 2001-2011 Free Software Foundation, Inc. GNU Chess is based on the two research programs Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Contact Info: bug-gnu-chess@gnu.org cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net */ #include #include #include #include "common.h" #define PLAYERFILE "players.dat" int totalplayers = 0; #define MAXPLAYERS 500 typedef struct { char player[MAXNAMESZ]; int wins; int losses; int draws; } playerentry; playerentry playerdb[MAXPLAYERS]; static char lname[MAXNAMESZ]; static int rscorecompare(const void *aa, const void *bb) { const playerentry *a = (const playerentry *)aa; const playerentry *b = (const playerentry *)bb; float ascore, bscore; ascore = (a->wins+(a->draws/2))/(a->wins+a->draws+a->losses); bscore = (b->wins+(b->draws/2))/(b->wins+b->draws+b->losses); if (ascore > bscore) return(-1); else if (bscore > ascore) return(1); else return(0); } static int scorecompare(const void *aa, const void *bb) { const playerentry *a = (const playerentry *)aa; const playerentry *b = (const playerentry *)bb; int ascore, bscore; ascore = 100*(a->wins+(a->draws/2))/(a->wins+a->draws+a->losses); bscore = 100*(b->wins+(b->draws/2))/(b->wins+b->draws+b->losses); if (bscore > ascore) return(1); else if (bscore < ascore) return(-1); else return(0); } static int namecompare(const void *aa, const void *bb) { const playerentry *a = (const playerentry *)aa; const playerentry *b = (const playerentry *)bb; if (strcmp(a->player,b->player) > 0) return(1); else if (strcmp(a->player,b->player) < 0) return(-1); else return(0); } void DBSortPlayer (const char *style) { if (strncmp(style,"score",5) == 0) { qsort(&playerdb,totalplayers,sizeof(playerentry),scorecompare); } else if (strncmp(style,"name",4) == 0) { qsort(&playerdb,totalplayers,sizeof(playerentry),namecompare); } else if (strncmp(style,"reverse",7) == 0) { qsort(&playerdb,totalplayers,sizeof(playerentry),rscorecompare); } } void DBListPlayer (const char *style) { int i; DBReadPlayer (); DBSortPlayer (style); for (i = 0; i < totalplayers; i++) { printf("%s %2.0f%% %d %d %d\n", playerdb[i].player, 100.0*(playerdb[i].wins+((float)playerdb[i].draws/2))/ (playerdb[i].wins+playerdb[i].draws+playerdb[i].losses), playerdb[i].wins, playerdb[i].losses, playerdb[i].draws); if ((i+1) % 10 == 0) {printf("[Type a character to continue.]\n"); getchar();} } } void DBWritePlayer (void) { int i; float result1; int result2; FILE *wfp; DBSortPlayer ("reverse"); if ((wfp = fopen(PLAYERFILE,"w")) != NULL) { for (i = 0; i < totalplayers; i++) { result1 = 100.0*(playerdb[i].wins+((float)playerdb[i].draws/2))/ (playerdb[i].wins+playerdb[i].draws+playerdb[i].losses), result2 = (int) result1; fprintf(wfp,"%s %d %d %d\n", playerdb[i].player, playerdb[i].wins, playerdb[i].losses, playerdb[i].draws); } } fclose(wfp); } void DBReadPlayer (void) { FILE *rfp; int n; totalplayers = 0; if ((rfp = fopen(PLAYERFILE,"r")) != NULL) { while (!feof(rfp)) { n = fscanf(rfp,"%49s %d %d %d\n", /* 49 MAXNAMESZ-1 */ playerdb[totalplayers].player, &playerdb[totalplayers].wins, &playerdb[totalplayers].losses, &playerdb[totalplayers].draws); if (n == 4) totalplayers++; } fclose(rfp); } } int DBSearchPlayer (const char *player) { int index = -1; int i; for (i = 0; i < totalplayers; i++) if (strncmp(playerdb[i].player,player,strlen(playerdb[i].player)) == 0) { index = i; break; } return (index); } void DBUpdatePlayer (const char *player, const char *resultstr) { const char *p; char *x; int index; int result = R_NORESULT; p = player; x = lname; strcpy(lname,player); do { if (*p != ' ') *x++ = *p++; else p++; } while (*p != '\0'); *x = '\000'; memset(playerdb,0,sizeof(playerdb)); DBReadPlayer (); index = DBSearchPlayer (lname); if (index == -1) { strcpy(playerdb[totalplayers].player,lname); playerdb[totalplayers].wins = 0; playerdb[totalplayers].losses = 0; playerdb[totalplayers].draws = 0; index = totalplayers; totalplayers++; } if (strncmp(resultstr,"1-0",3) == 0) result = R_WHITE_WINS; else if (strncmp(resultstr,"0-1",3) == 0) result = R_BLACK_WINS; else if (strncmp(resultstr,"1/2-1/2",7) == 0) result = R_DRAW; if ((computerplays == white && result == R_WHITE_WINS)|| (computerplays == black && result == R_BLACK_WINS)) playerdb[index].wins++; else if ((computerplays == white && result == R_BLACK_WINS)|| (computerplays == black && result == R_WHITE_WINS)) playerdb[index].losses++; else /* Shouln't one check for draw here? Broken PGN files surely exist */ playerdb[index].draws++; DBWritePlayer (); } gnuchess-6.2.2/src/frontend/solve.cc000644 000766 000024 00000004137 12451350346 020230 0ustar00antoniostaff000000 000000 /* solve.c GNU Chess frontend Copyright (C) 2001-2011 Free Software Foundation, Inc. GNU Chess is based on the two research programs Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Contact Info: bug-gnu-chess@gnu.org cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net */ #include #include #include "common.h" /* A line read from an EPD file */ extern char epd_line[]; void SolvePosition( char move[], const char position[] ); void Solve (char *file) /***************************************************************************** * * * *****************************************************************************/ { int total, correct, found; char *p; char myMove[100]=""; int elo; total = correct = 0; SET (flags, SOLVE); while (ReadEPDFile (file, 0)) { NewPosition (); total++; ShowBoard (); SolvePosition( myMove, epd_line ); p = solution; found = false; while (*p != '\0') { if ( (*myMove != '\0') && (!strncmp (p, myMove, strlen(myMove))) ) { correct++; found = true; break; } while (*p != ' ' && *p != '\0') p++; while (*p == ' ' && *p != '\0') p++; } printf ("id: %s : ", id); printf (found ? "Correct: " : "Incorrect: "); printf ("<%s> %s\n", myMove, solution); printf ("Correct=%d Total=%d\n", correct, total); } CLEAR (flags, SOLVE); } gnuchess-6.2.2/src/frontend/swap.cc000644 000766 000024 00000011353 12451350351 020044 0ustar00antoniostaff000000 000000 /* swap.c GNU Chess frontend Copyright (C) 2001-2011 Free Software Foundation, Inc. GNU Chess is based on the two research programs Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Contact Info: bug-gnu-chess@gnu.org cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net */ #include #include #include "common.h" static const int xray[7] = { 0, 1, 0, 1, 1, 1, 0 }; int SwapOff (int move) /**************************************************************************** * * A Static Exchange Evaluator (or SEE for short). * First determine the target square. Create a bitboard of all squares * attacking the target square for both sides. Using these 2 bitboards, * we take turn making captures from smallest piece to largest piece. * When a sliding piece makes a capture, we check behind it to see if * another attacker piece has been exposed. If so, add this to the bitboard * as well. When performing the "captures", we stop if one side is ahead * and doesn't need to capture, a form of pseudo-minimaxing. * ****************************************************************************/ { int f, t, sq, piece, lastval; int side, xside; int swaplist[MAXPLYDEPTH], n; BitBoard b, c, *d, *e, r; f = FROMSQ (move); t = TOSQ (move); side = ((board.friends[white] & BitPosArray[f]) ? white : black); xside = 1^side; /* Squares attacking t for side and xside */ b = AttackTo (t, side); c = AttackTo (t, xside); CLEARBIT(b, f); if (xray[cboard[f]]) AddXrayPiece (t, f, side, &b, &c); d = board.b[side]; e = board.b[xside]; if (move & PROMOTION) { swaplist[0] = Value[PROMOTEPIECE (move)] - ValueP; lastval = -Value[PROMOTEPIECE (move)]; } else { swaplist[0] = (move & ENPASSANT ? ValueP : Value[cboard[t]]); lastval = -Value[cboard[f]]; } n = 1; while (1) { if (c == NULLBITBOARD) break; for (piece = pawn; piece <= king; piece++) { r = c & e[piece]; if (r) { sq = leadz (r); CLEARBIT (c, sq); if (xray[piece]) AddXrayPiece (t, sq, xside, &c, &b); swaplist[n] = swaplist[n-1] + lastval; n++; lastval = Value[piece]; break; } } if (b == NULLBITBOARD) break; for (piece = pawn; piece <= king; piece++) { r = b & d[piece]; if (r) { sq = leadz (r); CLEARBIT (b, sq); if (xray[piece]) AddXrayPiece (t, sq, side, &b, &c); swaplist[n] = swaplist[n-1] + lastval; n++; lastval = -Value[piece]; break; } } } /**************************************************************************** * * At this stage, we have the swap scores in a list. We just need to * mini-max the scores from the bottom up to the top of the list. * ****************************************************************************/ --n; while (n) { if (n & 1) { if (swaplist[n] <= swaplist[n-1]) swaplist[n-1] = swaplist[n]; } else { if (swaplist[n] >= swaplist[n-1]) swaplist[n-1] = swaplist[n]; } --n; } return (swaplist[0]); } void AddXrayPiece (int t, int sq, int side, BitBoard *b, BitBoard *c) /*************************************************************************** * * The purpose of this routine is to find a piece which attack through * another piece (e.g. two rooks, Q+B, B+P, etc.) Side is the side attacking * the square where the swapping is to be done. * ***************************************************************************/ { int dir, nsq, piece; BitBoard a; dir = directions[t][sq]; a = Ray[sq][dir] & board.blocker; if (a == NULLBITBOARD) return; nsq = (t < sq ? leadz (a) : trailz (a)); piece = cboard[nsq]; if ((piece == queen) || (piece == rook && dir > 3) || (piece == bishop && dir < 4)) { if (BitPosArray[nsq] & board.friends[side]) *b |= BitPosArray[nsq]; else *c |= BitPosArray[nsq]; } return; } gnuchess-6.2.2/src/frontend/util.cc000644 000766 000024 00000013621 12451350354 020052 0ustar00antoniostaff000000 000000 /* util.c GNU Chess frontend Copyright (C) 2001-2011 Free Software Foundation, Inc. GNU Chess is based on the two research programs Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Contact Info: bug-gnu-chess@gnu.org cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net */ #include #include #include "common.h" /* * We actually do not have this configuration variable yet, * should be manually added when inlining is not possible. * If inlining is possible, these functions have now moved * to util.h which must be included by all callers of * leadz() and nbits(). */ #ifdef NO_INLINE unsigned char leadz (BitBoard b) /************************************************************************** * * Returns the leading bit in a bitboard. Leftmost bit is 0 and * rightmost bit is 63. Thanks to Robert Hyatt for this algorithm. * ***************************************************************************/ { if (b >> 48) return lzArray[b >> 48]; if (b >> 32) return lzArray[b >> 32] + 16; if (b >> 16) return lzArray[b >> 16] + 32; return lzArray[b] + 48; } unsigned char nbits (BitBoard b) /*************************************************************************** * * Count the number of bits in b. * ***************************************************************************/ { return BitCount[b>>48] + BitCount[(b>>32) & 0xffff] + BitCount[(b>>16) & 0xffff] + BitCount[b & 0xffff]; } #endif /* NO_INLINE */ void UpdateFriends (void) /*************************************************************************** * * Update friend and enemy bitboard. * ***************************************************************************/ { register BitBoard *w, *b; w = board.b[white]; b = board.b[black]; board.friends[white] = w[pawn] | w[knight] | w[bishop] | w[rook] | w[queen] | w[king]; board.friends[black] = b[pawn] | b[knight] | b[bishop] | b[rook] | b[queen] | b[king]; board.blocker = board.friends[white] | board.friends[black]; } void UpdateCBoard (void) /************************************************************************** * * Updates cboard[]. cboard[i] returns the piece on square i. * **************************************************************************/ { BitBoard b; int piece, sq; memset (cboard, 0, sizeof (cboard)); for (piece = pawn; piece <= king; piece++) { b = board.b[white][piece] | board.b[black][piece]; while (b) { sq = leadz (b); CLEARBIT (b, sq); cboard[sq] = piece; } } } static const int OrigCboard[64] = { rook, knight, bishop, queen, king, bishop, knight, rook, pawn, pawn, pawn, pawn, pawn, pawn, pawn, pawn, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, empty, pawn, pawn, pawn, pawn, pawn, pawn, pawn, pawn, rook, knight, bishop, queen, king, bishop, knight, rook }; void UpdateMvboard (void) /************************************************************************** * * Updates Mvboard[]. Mvboard[i] returns the number of times the piece * on square i have moved. When loading from EPD, if a piece is not on * its original square, set it to 1, otherwise set to 0. * **************************************************************************/ { int sq; for (sq = 0; sq < 64; sq++) { if (cboard[sq] == empty || cboard[sq] == OrigCboard[sq]) Mvboard[sq] = 0; else Mvboard[sq] = 1; } } short ValidateBoard (void) /*************************************************************************** * * Check the board to make sure that its valid. Some things to check are * a. Both sides have only 1 king. * b. Side not on the move must not be in check. * c. If en passant square is set, check it is possible. * d. Check if castling status are all correct. * ***************************************************************************/ { int side, xside, sq; if (nbits (board.b[white][king]) != 1) return (false); if (nbits (board.b[black][king]) != 1) return (false); side = board.side; xside = 1^side; if (SqAtakd (board.king[xside], side)) return (false); if (board.ep > -1) { sq = board.ep + (xside == white ? 8 : -8); if (!(BitPosArray[sq] & board.b[xside][pawn])) return (false); } if (board.flag & WKINGCASTLE) { if (!(BitPosArray[E1] & board.b[white][king])) return (false); if (!(BitPosArray[H1] & board.b[white][rook])) return (false); } if (board.flag & WQUEENCASTLE) { if (!(BitPosArray[E1] & board.b[white][king])) return (false); if (!(BitPosArray[A1] & board.b[white][rook])) return (false); } if (board.flag & BKINGCASTLE) { if (!(BitPosArray[E8] & board.b[black][king])) return (false); if (!(BitPosArray[H8] & board.b[black][rook])) return (false); } if (board.flag & BQUEENCASTLE) { if (!(BitPosArray[E8] & board.b[black][king])) return (false); if (!(BitPosArray[A8] & board.b[black][rook])) return (false); } return (true); } gnuchess-6.2.2/src/frontend/version.h000644 000766 000024 00000002041 12451350360 020413 0ustar00antoniostaff000000 000000 /* version.h GNU Chess frontend Copyright (C) 2001-2011 Free Software Foundation, Inc. GNU Chess is based on the two research programs Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Contact Info: bug-gnu-chess@gnu.org cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net */ #define PROGRAM "GNU Chess" #define AUTHOR "Chua Kong Sian / Stuart Cracraft" gnuchess-6.2.2/src/engine/attack.cpp000644 000766 000024 00000026737 11517375750 020214 0ustar00antoniostaff000000 000000 /* attack.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // attack.cpp // includes #include "attack.h" #include "board.h" #include "colour.h" #include "move.h" #include "piece.h" #include "util.h" #include "vector.h" namespace engine { // variables int DeltaIncLine[DeltaNb]; int DeltaIncAll[DeltaNb]; int DeltaMask[DeltaNb]; int IncMask[IncNb]; static int PieceCode[PieceNb]; static int PieceDeltaSize[4][256]; // 4kB static int PieceDeltaDelta[4][256][4]; // 16 kB // prototypes static void add_attack (int piece, int king, int target); // functions // attack_init() void attack_init() { int delta, inc; int piece; int dir, dist; int size; int king; int from, to; int pos; // clear for (delta = 0; delta < DeltaNb; delta++) { DeltaIncLine[delta] = IncNone; DeltaIncAll[delta] = IncNone; DeltaMask[delta] = 0; } for (inc = 0; inc < IncNb; inc++) { IncMask[inc] = 0; } // pawn attacks DeltaMask[DeltaOffset-17] |= BlackPawnFlag; DeltaMask[DeltaOffset-15] |= BlackPawnFlag; DeltaMask[DeltaOffset+15] |= WhitePawnFlag; DeltaMask[DeltaOffset+17] |= WhitePawnFlag; // knight attacks for (dir = 0; dir < 8; dir++) { delta = KnightInc[dir]; ASSERT(delta_is_ok(delta)); ASSERT(DeltaIncAll[DeltaOffset+delta]==IncNone); DeltaIncAll[DeltaOffset+delta] = delta; DeltaMask[DeltaOffset+delta] |= KnightFlag; } // bishop/queen attacks for (dir = 0; dir < 4; dir++) { inc = BishopInc[dir]; ASSERT(inc!=IncNone); IncMask[IncOffset+inc] |= BishopFlag; for (dist = 1; dist < 8; dist++) { delta = inc*dist; ASSERT(delta_is_ok(delta)); ASSERT(DeltaIncLine[DeltaOffset+delta]==IncNone); DeltaIncLine[DeltaOffset+delta] = inc; ASSERT(DeltaIncAll[DeltaOffset+delta]==IncNone); DeltaIncAll[DeltaOffset+delta] = inc; DeltaMask[DeltaOffset+delta] |= BishopFlag; } } // rook/queen attacks for (dir = 0; dir < 4; dir++) { inc = RookInc[dir]; ASSERT(inc!=IncNone); IncMask[IncOffset+inc] |= RookFlag; for (dist = 1; dist < 8; dist++) { delta = inc*dist; ASSERT(delta_is_ok(delta)); ASSERT(DeltaIncLine[DeltaOffset+delta]==IncNone); DeltaIncLine[DeltaOffset+delta] = inc; ASSERT(DeltaIncAll[DeltaOffset+delta]==IncNone); DeltaIncAll[DeltaOffset+delta] = inc; DeltaMask[DeltaOffset+delta] |= RookFlag; } } // king attacks for (dir = 0; dir < 8; dir++) { delta = KingInc[dir]; ASSERT(delta_is_ok(delta)); DeltaMask[DeltaOffset+delta] |= KingFlag; } // PieceCode[] for (piece = 0; piece < PieceNb; piece++) { PieceCode[piece] = -1; } PieceCode[WN] = 0; PieceCode[WB] = 1; PieceCode[WR] = 2; PieceCode[WQ] = 3; PieceCode[BN] = 0; PieceCode[BB] = 1; PieceCode[BR] = 2; PieceCode[BQ] = 3; // PieceDeltaSize[][] & PieceDeltaDelta[][][] for (piece = 0; piece < 4; piece++) { for (delta = 0; delta < 256; delta++) { PieceDeltaSize[piece][delta] = 0; } } for (king = 0; king < SquareNb; king++) { if (SQUARE_IS_OK(king)) { for (from = 0; from < SquareNb; from++) { if (SQUARE_IS_OK(from)) { // knight for (pos = 0; (inc=KnightInc[pos]) != IncNone; pos++) { to = from + inc; if (SQUARE_IS_OK(to) && DISTANCE(to,king) == 1) { add_attack(0,king-from,to-from); } } // bishop for (pos = 0; (inc=BishopInc[pos]) != IncNone; pos++) { for (to = from+inc; SQUARE_IS_OK(to); to += inc) { if (DISTANCE(to,king) == 1) { add_attack(1,king-from,to-from); break; } } } // rook for (pos = 0; (inc=RookInc[pos]) != IncNone; pos++) { for (to = from+inc; SQUARE_IS_OK(to); to += inc) { if (DISTANCE(to,king) == 1) { add_attack(2,king-from,to-from); break; } } } // queen for (pos = 0; (inc=QueenInc[pos]) != IncNone; pos++) { for (to = from+inc; SQUARE_IS_OK(to); to += inc) { if (DISTANCE(to,king) == 1) { add_attack(3,king-from,to-from); break; } } } } } } } for (piece = 0; piece < 4; piece++) { for (delta = 0; delta < 256; delta++) { size = PieceDeltaSize[piece][delta]; ASSERT(size>=0&&size<3); PieceDeltaDelta[piece][delta][size] = DeltaNone; } } } // add_attack() static void add_attack(int piece, int king, int target) { int size; int i; ASSERT(piece>=0&&piece<4); ASSERT(delta_is_ok(king)); ASSERT(delta_is_ok(target)); size = PieceDeltaSize[piece][DeltaOffset+king]; ASSERT(size>=0&&size<3); for (i = 0; i < size; i++) { if (PieceDeltaDelta[piece][DeltaOffset+king][i] == target) return; // already in the table } if (size < 2) { PieceDeltaDelta[piece][DeltaOffset+king][size] = target; size++; PieceDeltaSize[piece][DeltaOffset+king] = size; } } // is_attacked() bool is_attacked(const board_t * board, int to, int colour) { int inc; int pawn; const sq_t * ptr; int from; int piece; int delta; int sq; ASSERT(board!=NULL); ASSERT(SQUARE_IS_OK(to)); ASSERT(COLOUR_IS_OK(colour)); // pawn attack inc = PAWN_MOVE_INC(colour); pawn = PAWN_MAKE(colour); if (board->square[to-(inc-1)] == pawn) return true; if (board->square[to-(inc+1)] == pawn) return true; // piece attack for (ptr = &board->piece[colour][0]; (from=*ptr) != SquareNone; ptr++) { piece = board->square[from]; delta = to - from; if (PSEUDO_ATTACK(piece,delta)) { inc = DELTA_INC_ALL(delta); ASSERT(inc!=IncNone); sq = from; do { sq += inc; if (sq == to) return true; } while (board->square[sq] == Empty); } } return false; } // line_is_empty() bool line_is_empty(const board_t * board, int from, int to) { int delta; int inc, sq; ASSERT(board!=NULL); ASSERT(SQUARE_IS_OK(from)); ASSERT(SQUARE_IS_OK(to)); delta = to - from; ASSERT(delta_is_ok(delta)); inc = DELTA_INC_ALL(delta); ASSERT(inc!=IncNone); sq = from; do { sq += inc; if (sq == to) return true; } while (board->square[sq] == Empty); return false; // blocker } // is_pinned() bool is_pinned(const board_t * board, int square, int colour) { int from, to; int inc; int sq, piece; ASSERT(board!=NULL); ASSERT(SQUARE_IS_OK(square)); ASSERT(COLOUR_IS_OK(colour)); from = square; to = KING_POS(board,colour); inc = DELTA_INC_LINE(to-from); if (inc == IncNone) return false; // not a line sq = from; do sq += inc; while (board->square[sq] == Empty); if (sq != to) return false; // blocker sq = from; do sq -= inc; while ((piece=board->square[sq]) == Empty); return COLOUR_IS(piece,COLOUR_OPP(colour)) && SLIDER_ATTACK(piece,inc); } // attack_is_ok() bool attack_is_ok(const attack_t * attack) { int i; int sq, inc; if (attack == NULL) return false; // checks if (attack->dn < 0 || attack->dn > 2) return false; for (i = 0; i < attack->dn; i++) { sq = attack->ds[i]; if (!SQUARE_IS_OK(sq)) return false; inc = attack->di[i]; if (inc != IncNone && !inc_is_ok(inc)) return false; } if (attack->ds[attack->dn] != SquareNone) return false; if (attack->di[attack->dn] != IncNone) return false; return true; } // attack_set() void attack_set(attack_t * attack, const board_t * board) { int me, opp; const sq_t * ptr; int from, to; int inc; int pawn; int delta, piece; int sq; ASSERT(attack!=NULL); ASSERT(board!=NULL); // init attack->dn = 0; me = board->turn; opp = COLOUR_OPP(me); to = KING_POS(board,me); // pawn attacks inc = PAWN_MOVE_INC(opp); pawn = PAWN_MAKE(opp); from = to - (inc-1); if (board->square[from] == pawn) { attack->ds[attack->dn] = from; attack->di[attack->dn] = IncNone; attack->dn++; } from = to - (inc+1); if (board->square[from] == pawn) { attack->ds[attack->dn] = from; attack->di[attack->dn] = IncNone; attack->dn++; } // piece attacks for (ptr = &board->piece[opp][1]; (from=*ptr) != SquareNone; ptr++) { // HACK: no king piece = board->square[from]; delta = to - from; ASSERT(delta_is_ok(delta)); if (PSEUDO_ATTACK(piece,delta)) { inc = IncNone; if (PIECE_IS_SLIDER(piece)) { // check for blockers inc = DELTA_INC_LINE(delta); ASSERT(inc!=IncNone); sq = from; do sq += inc; while (board->square[sq] == Empty); if (sq != to) continue; // blocker => next attacker } attack->ds[attack->dn] = from; attack->di[attack->dn] = -inc; // HACK attack->dn++; } } attack->ds[attack->dn] = SquareNone; attack->di[attack->dn] = IncNone; // debug ASSERT(attack_is_ok(attack)); } // piece_attack_king() bool piece_attack_king(const board_t * board, int piece, int from, int king) { const inc_t * inc_ptr; int code; const int * delta_ptr; int delta, inc; int to; int sq; ASSERT(board!=NULL); ASSERT(piece_is_ok(piece)); ASSERT(SQUARE_IS_OK(from)); ASSERT(SQUARE_IS_OK(king)); inc_ptr = PIECE_INC(piece); code = PieceCode[piece]; ASSERT(code>=0&&code<4); if (PIECE_IS_SLIDER(piece)) { for (delta_ptr = PieceDeltaDelta[code][DeltaOffset+(king-from)]; (delta=*delta_ptr) != DeltaNone; delta_ptr++) { ASSERT(delta_is_ok(delta)); inc = DeltaIncLine[DeltaOffset+delta]; ASSERT(inc!=IncNone); to = from + delta; sq = from; do { sq += inc; if (sq == to && SQUARE_IS_OK(to)) { ASSERT(DISTANCE(to,king)==1); return true; } } while (board->square[sq] == Empty); } } else { // non-slider for (delta_ptr = PieceDeltaDelta[code][DeltaOffset+(king-from)]; (delta=*delta_ptr) != DeltaNone; delta_ptr++) { ASSERT(delta_is_ok(delta)); to = from + delta; if (SQUARE_IS_OK(to)) { ASSERT(DISTANCE(to,king)==1); return true; } } } return false; } } // namespace engine // end of attack.cpp gnuchess-6.2.2/src/engine/attack.h000644 000766 000024 00000004527 11517375750 017652 0ustar00antoniostaff000000 000000 /* attack.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // attack.h #ifndef ATTACK_H #define ATTACK_H // includes #include "board.h" #include "util.h" #include "vector.h" // macros #define IS_IN_CHECK(board,colour) (is_attacked((board),KING_POS((board),(colour)),COLOUR_OPP((colour)))) #define DELTA_INC_LINE(delta) (DeltaIncLine[DeltaOffset+(delta)]) #define DELTA_INC_ALL(delta) (DeltaIncAll[DeltaOffset+(delta)]) #define DELTA_MASK(delta) (DeltaMask[DeltaOffset+(delta)]) #define INC_MASK(inc) (IncMask[IncOffset+(inc)]) #define PIECE_ATTACK(board,piece,from,to) (PSEUDO_ATTACK((piece),(to)-(from))&&line_is_empty((board),(from),(to))) #define PSEUDO_ATTACK(piece,delta) (((piece)&DELTA_MASK(delta))!=0) #define SLIDER_ATTACK(piece,inc) (((piece)&INC_MASK(inc))!=0) #define ATTACK_IN_CHECK(attack) ((attack)->dn!=0) namespace engine { // types struct attack_t { int dn; int ds[2+1]; int di[2+1]; }; // variables extern int DeltaIncLine[DeltaNb]; extern int DeltaIncAll[DeltaNb]; extern int DeltaMask[DeltaNb]; extern int IncMask[IncNb]; // functions extern void attack_init (); extern bool is_attacked (const board_t * board, int to, int colour); extern bool line_is_empty (const board_t * board, int from, int to); extern bool is_pinned (const board_t * board, int square, int colour); extern bool attack_is_ok (const attack_t * attack); extern void attack_set (attack_t * attack, const board_t * board); extern bool piece_attack_king (const board_t * board, int piece, int from, int king); } // namespace engine #endif // !defined ATTACK_H // end of attack.h gnuchess-6.2.2/src/engine/board.cpp000644 000766 000024 00000030272 11517375750 020021 0ustar00antoniostaff000000 000000 /* board.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // board.cpp // includes #include "attack.h" #include "board.h" #include "colour.h" #include "fen.h" #include "hash.h" #include "list.h" #include "move.h" #include "move_do.h" #include "move_evasion.h" #include "move_gen.h" #include "move_legal.h" #include "pawn.h" // TODO: bit.h #include "piece.h" #include "pst.h" #include "util.h" #include "value.h" namespace engine { // constants static const bool UseSlowDebug = false; // functions // board_is_ok() bool board_is_ok(const board_t * board) { int sq, piece, colour; int size, pos; if (board == NULL) return false; // optional heavy DEBUG mode if (!UseSlowDebug) return true; // squares for (sq = 0; sq < SquareNb; sq++) { piece = board->square[sq]; pos = board->pos[sq]; if (SQUARE_IS_OK(sq)) { // inside square if (piece == Empty) { if (pos != -1) return false; } else { if (!piece_is_ok(piece)) return false; if (!PIECE_IS_PAWN(piece)) { colour = PIECE_COLOUR(piece); if (pos < 0 || pos >= board->piece_size[colour]) return false; if (board->piece[colour][pos] != sq) return false; } else { // pawn if (SQUARE_IS_PROMOTE(sq)) return false; colour = PIECE_COLOUR(piece); if (pos < 0 || pos >= board->pawn_size[colour]) return false; if (board->pawn[colour][pos] != sq) return false; } } } else { // edge square if (piece != Edge) return false; if (pos != -1) return false; } } // piece lists for (colour = 0; colour < ColourNb; colour++) { // piece list size = board->piece_size[colour]; if (size < 1 || size > 16) return false; for (pos = 0; pos < size; pos++) { sq = board->piece[colour][pos]; if (!SQUARE_IS_OK(sq)) return false; if (board->pos[sq] != pos) return false; piece = board->square[sq]; if (!COLOUR_IS(piece,colour)) return false; if (pos == 0 && !PIECE_IS_KING(piece)) return false; if (pos != 0 && PIECE_IS_KING(piece)) return false; if (pos != 0 && PIECE_ORDER(piece) > PIECE_ORDER(board->square[board->piece[colour][pos-1]])) { return false; } } sq = board->piece[colour][size]; if (sq != SquareNone) return false; // pawn list size = board->pawn_size[colour]; if (size < 0 || size > 8) return false; for (pos = 0; pos < size; pos++) { sq = board->pawn[colour][pos]; if (!SQUARE_IS_OK(sq)) return false; if (SQUARE_IS_PROMOTE(sq)) return false; if (board->pos[sq] != pos) return false; piece = board->square[sq]; if (!COLOUR_IS(piece,colour)) return false; if (!PIECE_IS_PAWN(piece)) return false; } sq = board->pawn[colour][size]; if (sq != SquareNone) return false; // piece total if (board->piece_size[colour] + board->pawn_size[colour] > 16) return false; } // material if (board->piece_nb != board->piece_size[White] + board->pawn_size[White] + board->piece_size[Black] + board->pawn_size[Black]) { return false; } if (board->number[WhitePawn12] != board->pawn_size[White]) return false; if (board->number[BlackPawn12] != board->pawn_size[Black]) return false; if (board->number[WhiteKing12] != 1) return false; if (board->number[BlackKing12] != 1) return false; // misc if (!COLOUR_IS_OK(board->turn)) return false; if (board->ply_nb < 0) return false; if (board->sp < board->ply_nb) return false; if (board->cap_sq != SquareNone && !SQUARE_IS_OK(board->cap_sq)) return false; if (board->opening != board_opening(board)) return false; if (board->endgame != board_endgame(board)) return false; if (board->key != hash_key(board)) return false; if (board->pawn_key != hash_pawn_key(board)) return false; if (board->material_key != hash_material_key(board)) return false; return true; } // board_clear() void board_clear(board_t * board) { int sq, sq_64; ASSERT(board!=NULL); // edge squares for (sq = 0; sq < SquareNb; sq++) { board->square[sq] = Edge; } // empty squares for (sq_64 = 0; sq_64 < 64; sq_64++) { sq = SQUARE_FROM_64(sq_64); board->square[sq] = Empty; } // misc board->turn = ColourNone; board->flags = FlagsNone; board->ep_square = SquareNone; board->ply_nb = 0; } // board_copy() void board_copy(board_t * dst, const board_t * src) { ASSERT(dst!=NULL); ASSERT(board_is_ok(src)); *dst = *src; } // board_init_list() void board_init_list(board_t * board) { int sq_64, sq, piece; int colour, pos; int i, size; int square; int order; int file; ASSERT(board!=NULL); // init for (sq = 0; sq < SquareNb; sq++) { board->pos[sq] = -1; } board->piece_nb = 0; for (piece = 0; piece < 12; piece++) board->number[piece] = 0; // piece lists for (colour = 0; colour < ColourNb; colour++) { // piece list pos = 0; for (sq_64 = 0; sq_64 < 64; sq_64++) { sq = SQUARE_FROM_64(sq_64); piece = board->square[sq]; if (piece != Empty && !piece_is_ok(piece)) my_fatal("board_init_list(): illegal position\n"); if (COLOUR_IS(piece,colour) && !PIECE_IS_PAWN(piece)) { if (pos >= 16) my_fatal("board_init_list(): illegal position\n"); ASSERT(pos>=0&&pos<16); board->pos[sq] = pos; board->piece[colour][pos] = sq; pos++; board->piece_nb++; board->number[PIECE_TO_12(piece)]++; } } if (board->number[COLOUR_IS_WHITE(colour)?WhiteKing12:BlackKing12] != 1) my_fatal("board_init_list(): illegal position\n"); ASSERT(pos>=1&&pos<=16); board->piece[colour][pos] = SquareNone; board->piece_size[colour] = pos; // MV sort size = board->piece_size[colour]; for (i = 1; i < size; i++) { square = board->piece[colour][i]; piece = board->square[square]; order = PIECE_ORDER(piece); for (pos = i; pos > 0 && order > PIECE_ORDER(board->square[(sq=board->piece[colour][pos-1])]); pos--) { ASSERT(pos>0&&pospiece[colour][pos] = sq; ASSERT(board->pos[sq]==pos-1); board->pos[sq] = pos; } ASSERT(pos>=0&&pospiece[colour][pos] = square; ASSERT(board->pos[square]==i); board->pos[square] = pos; } // debug if (DEBUG) { for (i = 0; i < board->piece_size[colour]; i++) { sq = board->piece[colour][i]; ASSERT(board->pos[sq]==i); if (i == 0) { // king ASSERT(PIECE_IS_KING(board->square[sq])); } else { ASSERT(!PIECE_IS_KING(board->square[sq])); ASSERT(PIECE_ORDER(board->square[board->piece[colour][i]])<=PIECE_ORDER(board->square[board->piece[colour][i-1]])); } } } // pawn list for (file = 0; file < FileNb; file++) { board->pawn_file[colour][file] = 0; } pos = 0; for (sq_64 = 0; sq_64 < 64; sq_64++) { sq = SQUARE_FROM_64(sq_64); piece = board->square[sq]; if (COLOUR_IS(piece,colour) && PIECE_IS_PAWN(piece)) { if (pos >= 8 || SQUARE_IS_PROMOTE(sq)) my_fatal("board_init_list(): illegal position\n"); ASSERT(pos>=0&&pos<8); board->pos[sq] = pos; board->pawn[colour][pos] = sq; pos++; board->piece_nb++; board->number[PIECE_TO_12(piece)]++; board->pawn_file[colour][SQUARE_FILE(sq)] |= BIT(PAWN_RANK(sq,colour)); } } ASSERT(pos>=0&&pos<=8); board->pawn[colour][pos] = SquareNone; board->pawn_size[colour] = pos; if (board->piece_size[colour] + board->pawn_size[colour] > 16) my_fatal("board_init_list(): illegal position\n"); } // last square board->cap_sq = SquareNone; // PST board->opening = board_opening(board); board->endgame = board_endgame(board); // hash key for (i = 0; i < board->ply_nb; i++) board->stack[i] = 0; // HACK board->sp = board->ply_nb; board->key = hash_key(board); board->pawn_key = hash_pawn_key(board); board->material_key = hash_material_key(board); // legality if (!board_is_legal(board)) my_fatal("board_init_list(): illegal position\n"); // debug ASSERT(board_is_ok(board)); } // board_is_legal() bool board_is_legal(const board_t * board) { ASSERT(board!=NULL); return !IS_IN_CHECK(board,COLOUR_OPP(board->turn)); } // board_is_check() bool board_is_check(const board_t * board) { ASSERT(board!=NULL); return IS_IN_CHECK(board,board->turn); } // board_is_mate() bool board_is_mate(const board_t * board) { attack_t attack[1]; ASSERT(board!=NULL); attack_set(attack,board); if (!ATTACK_IN_CHECK(attack)) return false; // not in check => not mate if (legal_evasion_exist(board,attack)) return false; // legal move => not mate return true; // in check and no legal move => mate } // board_is_stalemate() bool board_is_stalemate(board_t * board) { list_t list[1]; int i, move; ASSERT(board!=NULL); // init if (IS_IN_CHECK(board,board->turn)) return false; // in check => not stalemate // move loop gen_moves(list,board); for (i = 0; i < LIST_SIZE(list); i++) { move = LIST_MOVE(list,i); if (pseudo_is_legal(move,board)) return false; // legal move => not stalemate } return true; // in check and no legal move => mate } // board_is_repetition() bool board_is_repetition(const board_t * board) { int i; ASSERT(board!=NULL); // 50-move rule if (board->ply_nb >= 100) { // potential draw if (board->ply_nb > 100) return true; ASSERT(board->ply_nb==100); return !board_is_mate(board); } // position repetition ASSERT(board->sp>=board->ply_nb); for (i = 4; i <= board->ply_nb; i += 2) { if (board->stack[board->sp-i] == board->key) return true; } return false; } // board_opening() int board_opening(const board_t * board) { int opening; int colour; const sq_t * ptr; int sq, piece; ASSERT(board!=NULL); opening = 0; for (colour = 0; colour < ColourNb; colour++) { for (ptr = &board->piece[colour][0]; (sq=*ptr) != SquareNone; ptr++) { piece = board->square[sq]; opening += PST(PIECE_TO_12(piece),SQUARE_TO_64(sq),Opening); } for (ptr = &board->pawn[colour][0]; (sq=*ptr) != SquareNone; ptr++) { piece = board->square[sq]; opening += PST(PIECE_TO_12(piece),SQUARE_TO_64(sq),Opening); } } return opening; } // board_endgame() int board_endgame(const board_t * board) { int endgame; int colour; const sq_t * ptr; int sq, piece; ASSERT(board!=NULL); endgame = 0; for (colour = 0; colour < ColourNb; colour++) { for (ptr = &board->piece[colour][0]; (sq=*ptr) != SquareNone; ptr++) { piece = board->square[sq]; endgame += PST(PIECE_TO_12(piece),SQUARE_TO_64(sq),Endgame); } for (ptr = &board->pawn[colour][0]; (sq=*ptr) != SquareNone; ptr++) { piece = board->square[sq]; endgame += PST(PIECE_TO_12(piece),SQUARE_TO_64(sq),Endgame); } } return endgame; } } // namespace engine // end of board.cpp gnuchess-6.2.2/src/engine/board.h000644 000766 000024 00000005633 11517375750 017471 0ustar00antoniostaff000000 000000 /* board.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // board.h #ifndef BOARD_H #define BOARD_H // includes #include "colour.h" #include "piece.h" #include "square.h" #include "util.h" namespace engine { // constants const int Empty = 0; const int Edge = Knight64; // HACK: uncoloured knight const int WP = WhitePawn256; const int WN = WhiteKnight256; const int WB = WhiteBishop256; const int WR = WhiteRook256; const int WQ = WhiteQueen256; const int WK = WhiteKing256; const int BP = BlackPawn256; const int BN = BlackKnight256; const int BB = BlackBishop256; const int BR = BlackRook256; const int BQ = BlackQueen256; const int BK = BlackKing256; const int FlagsNone = 0; const int FlagsWhiteKingCastle = 1 << 0; const int FlagsWhiteQueenCastle = 1 << 1; const int FlagsBlackKingCastle = 1 << 2; const int FlagsBlackQueenCastle = 1 << 3; const int StackSize = 4096; // macros #define KING_POS(board,colour) ((board)->piece[colour][0]) // types struct board_t { int square[SquareNb]; int pos[SquareNb]; sq_t piece[ColourNb][32]; // only 17 are needed int piece_size[ColourNb]; sq_t pawn[ColourNb][16]; // only 9 are needed int pawn_size[ColourNb]; int piece_nb; int number[16]; // only 12 are needed int pawn_file[ColourNb][FileNb]; int turn; int flags; int ep_square; int ply_nb; int sp; // TODO: MOVE ME? int cap_sq; int opening; int endgame; uint64 key; uint64 pawn_key; uint64 material_key; uint64 stack[StackSize]; }; // functions extern bool board_is_ok (const board_t * board); extern void board_clear (board_t * board); extern void board_copy (board_t * dst, const board_t * src); extern void board_init_list (board_t * board); extern bool board_is_legal (const board_t * board); extern bool board_is_check (const board_t * board); extern bool board_is_mate (const board_t * board); extern bool board_is_stalemate (board_t * board); extern bool board_is_repetition (const board_t * board); extern int board_material (const board_t * board); extern int board_opening (const board_t * board); extern int board_endgame (const board_t * board); } // namespace engine #endif // !defined BOARD_H // end of board.h gnuchess-6.2.2/src/engine/book.cpp000644 000766 000024 00000013371 12451350241 017647 0ustar00antoniostaff000000 000000 /* book.cpp GNU Chess engine Copyright (C) 2001-2014 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // book.cpp // includes #include #include #include #include #include "board.h" #include "book.h" #include "move.h" #include "move_gen.h" #include "util.h" #include "configmake.h" namespace engine { // constants static const int MaxFileNameSize = 256; // types struct entry_t { uint64 key; uint16 move; uint16 count; uint16 n; uint16 sum; }; // variables static FILE * BookFile; static int BookSize; // prototypes static int find_pos (uint64 key); static void read_entry (entry_t * entry, int n); static uint64 read_integer (FILE * file, int size); static char const * compute_pkgdatadir (); // functions // book_init() void book_init() { BookFile = NULL; BookSize = 0; } // book_open() void book_open(const char file_name[]) { ASSERT(file_name!=NULL); char full_file_name[MaxFileNameSize+1]; FILE *bf; if ( ( bf = fopen(file_name, "r") ) != NULL ) { fclose(bf); strcpy(full_file_name,""); } else { strcpy(full_file_name,compute_pkgdatadir()); strcat(full_file_name,"/"); } strcat(full_file_name,file_name); BookFile = fopen(full_file_name,"rb"); if (BookFile != NULL) { if (fseek(BookFile,0,SEEK_END) == -1) { my_fatal("book_open(): fseek(): %s\n",strerror(errno)); } BookSize = ftell(BookFile) / 16; if (BookSize == -1) my_fatal("book_open(): ftell(): %s\n",strerror(errno)); } } // book_close() void book_close() { if (BookFile != NULL && fclose(BookFile) == EOF) { my_fatal("book_close(): fclose(): %s\n",strerror(errno)); } } // book_move() int book_move(board_t * board) { int best_move; int best_score; int pos; entry_t entry[1]; int move; int score; list_t list[1]; int i; ASSERT(board!=NULL); if (BookFile != NULL && BookSize != 0) { // draw a move according to a fixed probability distribution best_move = MoveNone; best_score = 0; for (pos = find_pos(board->key); pos < BookSize; pos++) { read_entry(entry,pos); if (entry->key != board->key) break; move = entry->move; score = entry->count; // pick this move? ASSERT(score>0); best_score += score; if (my_random(best_score) < score) best_move = move; } if (best_move != MoveNone) { // convert PolyGlot move into Fruit move; TODO: handle promotes gen_legal_moves(list,board); for (i = 0; i < list->size; i++) { move = list->move[i]; // fix for correct handling of castling moves - PK if (MOVE_FROM(move) == E1 && MOVE_TO(move) == G1 && MOVE_FROM(best_move) == E1 && MOVE_TO(best_move) == H1 ) return move; if (MOVE_FROM(move) == E1 && MOVE_TO(move) == C1 && MOVE_FROM(best_move) == E1 && MOVE_TO(best_move) == A1 ) return move; if (MOVE_FROM(move) == E8 && MOVE_TO(move) == G8 && MOVE_FROM(best_move) == E8 && MOVE_TO(best_move) == H8 ) return move; if (MOVE_FROM(move) == E8 && MOVE_TO(move) == C8 && MOVE_FROM(best_move) == E8 && MOVE_TO(best_move) == A8 ) return move; if ((move & 07777) == best_move) return move; } } } return MoveNone; } // find_pos() static int find_pos(uint64 key) { int left, right, mid; entry_t entry[1]; // binary search (finds the leftmost entry) left = 0; right = BookSize-1; ASSERT(left<=right); while (left < right) { mid = (left + right) / 2; ASSERT(mid>=left&&midkey) { right = mid; } else { left = mid+1; } } ASSERT(left==right); read_entry(entry,left); return (entry->key == key) ? left : BookSize; } // read_entry() static void read_entry(entry_t * entry, int n) { ASSERT(entry!=NULL); ASSERT(n>=0&&nkey = read_integer(BookFile,8); entry->move = read_integer(BookFile,2); entry->count = read_integer(BookFile,2); entry->n = read_integer(BookFile,2); entry->sum = read_integer(BookFile,2); } // read_integer() static uint64 read_integer(FILE * file, int size) { uint64 n; int i; int b; ASSERT(file!=NULL); ASSERT(size>0&&size<=8); n = 0; for (i = 0; i < size; i++) { b = fgetc(file); if (b == EOF) { if (feof(file)) { my_fatal("read_integer(): fgetc(): EOF reached\n"); } else { // error my_fatal("read_integer(): fgetc(): %s\n",strerror(errno)); } } ASSERT(b>=0&&b<256); n = (n << 8) | b; } return n; } // compute_pkgdatadir() static char const * compute_pkgdatadir () { char const *pkgdatadir = getenv ("GNUCHESS_PKGDATADIR"); return pkgdatadir ? pkgdatadir : PKGDATADIR; } } // namespace engine // end of book.cpp gnuchess-6.2.2/src/engine/book.h000644 000766 000024 00000002072 11517375750 017326 0ustar00antoniostaff000000 000000 /* book.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // book.h #ifndef BOOK_H #define BOOK_H // includes #include "board.h" #include "util.h" namespace engine { // functions extern void book_init (); extern void book_open (const char file_name[]); extern void book_close (); extern int book_move (board_t * board); } // namespace engine #endif // !defined BOOK_H // end of book.h gnuchess-6.2.2/src/engine/colour.h000644 000766 000024 00000002713 11517375750 017701 0ustar00antoniostaff000000 000000 /* colour.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // colour.h #ifndef COLOUR_H #define COLOUR_H // includes #include "util.h" namespace engine { // constants const int ColourNone = -1; const int White = 0; const int Black = 1; const int ColourNb = 2; const int WhiteFlag = 1 << White; const int BlackFlag = 1 << Black; } // namespace engine // macros #define COLOUR_IS_OK(colour) (((colour)&~1)==0) #define COLOUR_IS_WHITE(colour) ((colour)==White) #define COLOUR_IS_BLACK(colour) ((colour)!=White) #define COLOUR_IS(piece,colour) (FLAG_IS((piece),COLOUR_FLAG(colour))) #define FLAG_IS(piece,flag) (((piece)&(flag))!=0) #define COLOUR_OPP(colour) ((colour)^(White^Black)) #define COLOUR_FLAG(colour) ((colour)+1) #endif // !defined COLOUR_H // end of colour.h gnuchess-6.2.2/src/engine/eval.cpp000644 000766 000024 00000126251 12434150461 017651 0ustar00antoniostaff000000 000000 /* eval.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // eval.cpp // includes #include // for abs() #include "attack.h" #include "board.h" #include "colour.h" #include "eval.h" #include "material.h" #include "move.h" #include "option.h" #include "pawn.h" #include "piece.h" #include "see.h" #include "util.h" #include "value.h" #include "vector.h" // macros #define THROUGH(piece) ((piece)==Empty) namespace engine { // constants and variables static /* const */ int PieceActivityWeight = 256; // 100% static /* const */ int KingSafetyWeight = 256; // 100% static /* const */ int PassedPawnWeight = 256; // 100% static const int KnightUnit = 4; static const int BishopUnit = 6; static const int RookUnit = 7; static const int QueenUnit = 13; static const int MobMove = 1; static const int MobAttack = 1; static const int MobDefense = 0; static const int KnightMobOpening = 4; static const int KnightMobEndgame = 4; static const int BishopMobOpening = 5; static const int BishopMobEndgame = 5; static const int RookMobOpening = 2; static const int RookMobEndgame = 4; static const int QueenMobOpening = 1; static const int QueenMobEndgame = 2; static const int KingMobOpening = 0; static const int KingMobEndgame = 0; static const bool UseOpenFile = true; static const int RookSemiOpenFileOpening = 10; static const int RookSemiOpenFileEndgame = 10; static const int RookOpenFileOpening = 20; static const int RookOpenFileEndgame = 20; static const int RookSemiKingFileOpening = 10; static const int RookKingFileOpening = 20; static const bool UseKingAttack = true; static const int KingAttackOpening = 20; static const bool UseShelter = true; static const int ShelterOpening = 256; // 100% static const bool UseStorm = true; static const int StormOpening = 10; static const int Rook7thOpening = 20; static const int Rook7thEndgame = 40; static const int Queen7thOpening = 10; static const int Queen7thEndgame = 20; static const int TrappedBishop = 100; static const int BlockedBishop = 50; static const int BlockedRook = 50; static const int PassedOpeningMin = 10; static const int PassedOpeningMax = 70; static const int PassedEndgameMin = 20; static const int PassedEndgameMax = 140; static const int UnstoppablePasser = 800; static const int FreePasser = 60; static const int AttackerDistance = 5; static const int DefenderDistance = 20; // "constants" static const int KingAttackWeight[16] = { 0, 0, 128, 192, 224, 240, 248, 252, 254, 255, 256, 256 ,256, 256, 256, 256, }; // variables static int MobUnit[ColourNb][PieceNb]; static int KingAttackUnit[PieceNb]; // prototypes static void eval_draw (const board_t * board, const material_info_t * mat_info, const pawn_info_t * pawn_info, int mul[2]); static void eval_piece (const board_t * board, const material_info_t * mat_info, const pawn_info_t * pawn_info, int * opening, int * endgame); static void eval_king (const board_t * board, const material_info_t * mat_info, int * opening, int * endgame); static void eval_passer (const board_t * board, const pawn_info_t * pawn_info, int * opening, int * endgame); static void eval_pattern (const board_t * board, int * opening, int * endgame); static bool unstoppable_passer (const board_t * board, int pawn, int colour); static bool king_passer (const board_t * board, int pawn, int colour); static bool free_passer (const board_t * board, int pawn, int colour); static int pawn_att_dist (int pawn, int king, int colour); static int pawn_def_dist (int pawn, int king, int colour); static void draw_init_list (int list[], const board_t * board, int pawn_colour); static bool draw_kpkq (const int list[], int turn); static bool draw_kpkr (const int list[], int turn); static bool draw_kpkb (const int list[], int turn); static bool draw_kpkn (const int list[], int turn); static bool draw_knpk (const int list[], int turn); static bool draw_krpkr (const int list[], int turn); static bool draw_kbpkb (const int list[], int turn); static int shelter_square (const board_t * board, int square, int colour); static int shelter_file (const board_t * board, int file, int rank, int colour); static int storm_file (const board_t * board, int file, int colour); static bool bishop_can_attack (const board_t * board, int to, int colour); // functions // eval_init() void eval_init() { int colour; int piece; // UCI options PieceActivityWeight = (option_get_int("Piece Activity") * 256 + 50) / 100; KingSafetyWeight = (option_get_int("King Safety") * 256 + 50) / 100; PassedPawnWeight = (option_get_int("Passed Pawns") * 256 + 50) / 100; // mobility table for (colour = 0; colour < ColourNb; colour++) { for (piece = 0; piece < PieceNb; piece++) { MobUnit[colour][piece] = 0; } } MobUnit[White][Empty] = MobMove; MobUnit[White][BP] = MobAttack; MobUnit[White][BN] = MobAttack; MobUnit[White][BB] = MobAttack; MobUnit[White][BR] = MobAttack; MobUnit[White][BQ] = MobAttack; MobUnit[White][BK] = MobAttack; MobUnit[White][WP] = MobDefense; MobUnit[White][WN] = MobDefense; MobUnit[White][WB] = MobDefense; MobUnit[White][WR] = MobDefense; MobUnit[White][WQ] = MobDefense; MobUnit[White][WK] = MobDefense; MobUnit[Black][Empty] = MobMove; MobUnit[Black][WP] = MobAttack; MobUnit[Black][WN] = MobAttack; MobUnit[Black][WB] = MobAttack; MobUnit[Black][WR] = MobAttack; MobUnit[Black][WQ] = MobAttack; MobUnit[Black][WK] = MobAttack; MobUnit[Black][BP] = MobDefense; MobUnit[Black][BN] = MobDefense; MobUnit[Black][BB] = MobDefense; MobUnit[Black][BR] = MobDefense; MobUnit[Black][BQ] = MobDefense; MobUnit[Black][BK] = MobDefense; // KingAttackUnit[] for (piece = 0; piece < PieceNb; piece++) { KingAttackUnit[piece] = 0; } KingAttackUnit[WN] = 1; KingAttackUnit[WB] = 1; KingAttackUnit[WR] = 2; KingAttackUnit[WQ] = 4; KingAttackUnit[BN] = 1; KingAttackUnit[BB] = 1; KingAttackUnit[BR] = 2; KingAttackUnit[BQ] = 4; } // eval() int eval(const board_t * board) { int opening, endgame; material_info_t mat_info[1]; pawn_info_t pawn_info[1]; int mul[ColourNb]; int phase; int eval; int wb, bb; ASSERT(board!=NULL); ASSERT(board_is_legal(board)); ASSERT(!board_is_check(board)); // exceptions are extremely rare // init opening = 0; endgame = 0; // material material_get_info(mat_info,board); opening += mat_info->opening; endgame += mat_info->endgame; mul[White] = mat_info->mul[White]; mul[Black] = mat_info->mul[Black]; // PST opening += board->opening; endgame += board->endgame; // pawns pawn_get_info(pawn_info,board); opening += pawn_info->opening; endgame += pawn_info->endgame; // draw eval_draw(board,mat_info,pawn_info,mul); if (mat_info->mul[White] < mul[White]) mul[White] = mat_info->mul[White]; if (mat_info->mul[Black] < mul[Black]) mul[Black] = mat_info->mul[Black]; if (mul[White] == 0 && mul[Black] == 0) return ValueDraw; // eval eval_piece(board,mat_info,pawn_info,&opening,&endgame); eval_king(board,mat_info,&opening,&endgame); eval_passer(board,pawn_info,&opening,&endgame); eval_pattern(board,&opening,&endgame); // phase mix phase = mat_info->phase; eval = ((opening * (256 - phase)) + (endgame * phase)) / 256; // drawish bishop endgames if ((mat_info->flags & DrawBishopFlag) != 0) { wb = board->piece[White][1]; ASSERT(PIECE_IS_BISHOP(board->square[wb])); bb = board->piece[Black][1]; ASSERT(PIECE_IS_BISHOP(board->square[bb])); if (SQUARE_COLOUR(wb) != SQUARE_COLOUR(bb)) { if (mul[White] == 16) mul[White] = 8; // 1/2 if (mul[Black] == 16) mul[Black] = 8; // 1/2 } } // draw bound if (eval > ValueDraw) { eval = (eval * mul[White]) / 16; } else if (eval < ValueDraw) { eval = (eval * mul[Black]) / 16; } // value range if (eval < -ValueEvalInf) eval = -ValueEvalInf; if (eval > +ValueEvalInf) eval = +ValueEvalInf; ASSERT(eval>=-ValueEvalInf&&eval<=+ValueEvalInf); // turn if (COLOUR_IS_BLACK(board->turn)) eval = -eval; ASSERT(!value_is_mate(eval)); return eval; } // eval_draw() static void eval_draw(const board_t * board, const material_info_t * mat_info, const pawn_info_t * pawn_info, int mul[2]) { int colour; int me, opp; int pawn, king; int pawn_file; int prom; int list[7+1]; ASSERT(board!=NULL); ASSERT(mat_info!=NULL); ASSERT(pawn_info!=NULL); ASSERT(mul!=NULL); // draw patterns for (colour = 0; colour < ColourNb; colour++) { me = colour; opp = COLOUR_OPP(me); // KB*P+K* draw if ((mat_info->cflags[me] & MatRookPawnFlag) != 0) { pawn = pawn_info->single_file[me]; if (pawn != SquareNone) { // all pawns on one file pawn_file = SQUARE_FILE(pawn); if (pawn_file == FileA || pawn_file == FileH) { king = KING_POS(board,opp); prom = PAWN_PROMOTE(pawn,me); if (DISTANCE(king,prom) <= 1 && !bishop_can_attack(board,prom,me)) { mul[me] = 0; } } } } // K(B)P+K+ draw if ((mat_info->cflags[me] & MatBishopFlag) != 0) { pawn = pawn_info->single_file[me]; if (pawn != SquareNone) { // all pawns on one file king = KING_POS(board,opp); if (SQUARE_FILE(king) == SQUARE_FILE(pawn) && PAWN_RANK(king,me) > PAWN_RANK(pawn,me) && !bishop_can_attack(board,king,me)) { mul[me] = 1; // 1/16 } } } // KNPK* draw if ((mat_info->cflags[me] & MatKnightFlag) != 0) { pawn = board->pawn[me][0]; king = KING_POS(board,opp); if (SQUARE_FILE(king) == SQUARE_FILE(pawn) && PAWN_RANK(king,me) > PAWN_RANK(pawn,me) && PAWN_RANK(pawn,me) <= Rank6) { mul[me] = 1; // 1/16 } } } // recognisers, only heuristic draws here! if (false) { } else if (mat_info->recog == MAT_KPKQ) { // KPKQ (white) draw_init_list(list,board,White); if (draw_kpkq(list,board->turn)) { mul[White] = 1; // 1/16; mul[Black] = 1; // 1/16; } } else if (mat_info->recog == MAT_KQKP) { // KPKQ (black) draw_init_list(list,board,Black); if (draw_kpkq(list,COLOUR_OPP(board->turn))) { mul[White] = 1; // 1/16; mul[Black] = 1; // 1/16; } } else if (mat_info->recog == MAT_KPKR) { // KPKR (white) draw_init_list(list,board,White); if (draw_kpkr(list,board->turn)) { mul[White] = 1; // 1/16; mul[Black] = 1; // 1/16; } } else if (mat_info->recog == MAT_KRKP) { // KPKR (black) draw_init_list(list,board,Black); if (draw_kpkr(list,COLOUR_OPP(board->turn))) { mul[White] = 1; // 1/16; mul[Black] = 1; // 1/16; } } else if (mat_info->recog == MAT_KPKB) { // KPKB (white) draw_init_list(list,board,White); if (draw_kpkb(list,board->turn)) { mul[White] = 1; // 1/16; mul[Black] = 1; // 1/16; } } else if (mat_info->recog == MAT_KBKP) { // KPKB (black) draw_init_list(list,board,Black); if (draw_kpkb(list,COLOUR_OPP(board->turn))) { mul[White] = 1; // 1/16; mul[Black] = 1; // 1/16; } } else if (mat_info->recog == MAT_KPKN) { // KPKN (white) draw_init_list(list,board,White); if (draw_kpkn(list,board->turn)) { mul[White] = 1; // 1/16; mul[Black] = 1; // 1/16; } } else if (mat_info->recog == MAT_KNKP) { // KPKN (black) draw_init_list(list,board,Black); if (draw_kpkn(list,COLOUR_OPP(board->turn))) { mul[White] = 1; // 1/16; mul[Black] = 1; // 1/16; } } else if (mat_info->recog == MAT_KNPK) { // KNPK (white) draw_init_list(list,board,White); if (draw_knpk(list,board->turn)) { mul[White] = 1; // 1/16; mul[Black] = 1; // 1/16; } } else if (mat_info->recog == MAT_KKNP) { // KNPK (black) draw_init_list(list,board,Black); if (draw_knpk(list,COLOUR_OPP(board->turn))) { mul[White] = 1; // 1/16; mul[Black] = 1; // 1/16; } } else if (mat_info->recog == MAT_KRPKR) { // KRPKR (white) draw_init_list(list,board,White); if (draw_krpkr(list,board->turn)) { mul[White] = 1; // 1/16; mul[Black] = 1; // 1/16; } } else if (mat_info->recog == MAT_KRKRP) { // KRPKR (black) draw_init_list(list,board,Black); if (draw_krpkr(list,COLOUR_OPP(board->turn))) { mul[White] = 1; // 1/16; mul[Black] = 1; // 1/16; } } else if (mat_info->recog == MAT_KBPKB) { // KBPKB (white) draw_init_list(list,board,White); if (draw_kbpkb(list,board->turn)) { mul[White] = 1; // 1/16; mul[Black] = 1; // 1/16; } } else if (mat_info->recog == MAT_KBKBP) { // KBPKB (black) draw_init_list(list,board,Black); if (draw_kbpkb(list,COLOUR_OPP(board->turn))) { mul[White] = 1; // 1/16; mul[Black] = 1; // 1/16; } } } // eval_piece() static void eval_piece(const board_t * board, const material_info_t * mat_info, const pawn_info_t * pawn_info, int * opening, int * endgame) { int colour; int op[ColourNb], eg[ColourNb]; int me, opp; int opp_flag; const sq_t * ptr; int from, to; int piece; int mob; int capture; const int * unit; int rook_file, king_file; int king; int delta; ASSERT(board!=NULL); ASSERT(mat_info!=NULL); ASSERT(pawn_info!=NULL); ASSERT(opening!=NULL); ASSERT(endgame!=NULL); // init for (colour = 0; colour < ColourNb; colour++) { op[colour] = 0; eg[colour] = 0; } // eval for (colour = 0; colour < ColourNb; colour++) { me = colour; opp = COLOUR_OPP(me); opp_flag = COLOUR_FLAG(opp); unit = MobUnit[me]; // piece loop for (ptr = &board->piece[me][1]; (from=*ptr) != SquareNone; ptr++) { // HACK: no king piece = board->square[from]; switch (PIECE_TYPE(piece)) { case Knight64: // mobility mob = -KnightUnit; mob += unit[board->square[from-33]]; mob += unit[board->square[from-31]]; mob += unit[board->square[from-18]]; mob += unit[board->square[from-14]]; mob += unit[board->square[from+14]]; mob += unit[board->square[from+18]]; mob += unit[board->square[from+31]]; mob += unit[board->square[from+33]]; op[me] += mob * KnightMobOpening; eg[me] += mob * KnightMobEndgame; break; case Bishop64: // mobility mob = -BishopUnit; for (to = from-17; capture=board->square[to], THROUGH(capture); to -= 17) mob += MobMove; mob += unit[capture]; for (to = from-15; capture=board->square[to], THROUGH(capture); to -= 15) mob += MobMove; mob += unit[capture]; for (to = from+15; capture=board->square[to], THROUGH(capture); to += 15) mob += MobMove; mob += unit[capture]; for (to = from+17; capture=board->square[to], THROUGH(capture); to += 17) mob += MobMove; mob += unit[capture]; op[me] += mob * BishopMobOpening; eg[me] += mob * BishopMobEndgame; break; case Rook64: // mobility mob = -RookUnit; for (to = from-16; capture=board->square[to], THROUGH(capture); to -= 16) mob += MobMove; mob += unit[capture]; for (to = from- 1; capture=board->square[to], THROUGH(capture); to -= 1) mob += MobMove; mob += unit[capture]; for (to = from+ 1; capture=board->square[to], THROUGH(capture); to += 1) mob += MobMove; mob += unit[capture]; for (to = from+16; capture=board->square[to], THROUGH(capture); to += 16) mob += MobMove; mob += unit[capture]; op[me] += mob * RookMobOpening; eg[me] += mob * RookMobEndgame; // open file if (UseOpenFile) { op[me] -= RookOpenFileOpening / 2; eg[me] -= RookOpenFileEndgame / 2; rook_file = SQUARE_FILE(from); if (board->pawn_file[me][rook_file] == 0) { // no friendly pawn op[me] += RookSemiOpenFileOpening; eg[me] += RookSemiOpenFileEndgame; if (board->pawn_file[opp][rook_file] == 0) { // no enemy pawn op[me] += RookOpenFileOpening - RookSemiOpenFileOpening; eg[me] += RookOpenFileEndgame - RookSemiOpenFileEndgame; } if ((mat_info->cflags[opp] & MatKingFlag) != 0) { king = KING_POS(board,opp); king_file = SQUARE_FILE(king); delta = abs(rook_file-king_file); // file distance if (delta <= 1) { op[me] += RookSemiKingFileOpening; if (delta == 0) op[me] += RookKingFileOpening - RookSemiKingFileOpening; } } } } // 7th rank if (PAWN_RANK(from,me) == Rank7) { if ((pawn_info->flags[opp] & BackRankFlag) != 0 // opponent pawn on 7th rank || PAWN_RANK(KING_POS(board,opp),me) == Rank8) { op[me] += Rook7thOpening; eg[me] += Rook7thEndgame; } } break; case Queen64: // mobility mob = -QueenUnit; for (to = from-17; capture=board->square[to], THROUGH(capture); to -= 17) mob += MobMove; mob += unit[capture]; for (to = from-16; capture=board->square[to], THROUGH(capture); to -= 16) mob += MobMove; mob += unit[capture]; for (to = from-15; capture=board->square[to], THROUGH(capture); to -= 15) mob += MobMove; mob += unit[capture]; for (to = from- 1; capture=board->square[to], THROUGH(capture); to -= 1) mob += MobMove; mob += unit[capture]; for (to = from+ 1; capture=board->square[to], THROUGH(capture); to += 1) mob += MobMove; mob += unit[capture]; for (to = from+15; capture=board->square[to], THROUGH(capture); to += 15) mob += MobMove; mob += unit[capture]; for (to = from+16; capture=board->square[to], THROUGH(capture); to += 16) mob += MobMove; mob += unit[capture]; for (to = from+17; capture=board->square[to], THROUGH(capture); to += 17) mob += MobMove; mob += unit[capture]; op[me] += mob * QueenMobOpening; eg[me] += mob * QueenMobEndgame; // 7th rank if (PAWN_RANK(from,me) == Rank7) { if ((pawn_info->flags[opp] & BackRankFlag) != 0 // opponent pawn on 7th rank || PAWN_RANK(KING_POS(board,opp),me) == Rank8) { op[me] += Queen7thOpening; eg[me] += Queen7thEndgame; } } break; } } } // update *opening += ((op[White] - op[Black]) * PieceActivityWeight) / 256; *endgame += ((eg[White] - eg[Black]) * PieceActivityWeight) / 256; } // eval_king() static void eval_king(const board_t * board, const material_info_t * mat_info, int * opening, int * endgame) { int colour; int op[ColourNb], eg[ColourNb]; int me, opp; int from; int penalty_1, penalty_2; int tmp; int penalty; int king; const sq_t * ptr; int piece; int attack_tot; int piece_nb; ASSERT(board!=NULL); ASSERT(mat_info!=NULL); ASSERT(opening!=NULL); ASSERT(endgame!=NULL); // init for (colour = 0; colour < ColourNb; colour++) { op[colour] = 0; eg[colour] = 0; } // king attacks if (UseKingAttack) { for (colour = 0; colour < ColourNb; colour++) { if ((mat_info->cflags[colour] & MatKingFlag) != 0) { me = colour; opp = COLOUR_OPP(me); king = KING_POS(board,me); // piece attacks attack_tot = 0; piece_nb = 0; for (ptr = &board->piece[opp][1]; (from=*ptr) != SquareNone; ptr++) { // HACK: no king piece = board->square[from]; if (piece_attack_king(board,piece,from,king)) { piece_nb++; attack_tot += KingAttackUnit[piece]; } } // scoring ASSERT(piece_nb>=0&&piece_nb<16); op[colour] -= (attack_tot * KingAttackOpening * KingAttackWeight[piece_nb]) / 256; } } } // white pawn shelter if (UseShelter && (mat_info->cflags[White] & MatKingFlag) != 0) { me = White; // king penalty_1 = shelter_square(board,KING_POS(board,me),me); // castling penalty_2 = penalty_1; if ((board->flags & FlagsWhiteKingCastle) != 0) { tmp = shelter_square(board,G1,me); if (tmp < penalty_2) penalty_2 = tmp; } if ((board->flags & FlagsWhiteQueenCastle) != 0) { tmp = shelter_square(board,B1,me); if (tmp < penalty_2) penalty_2 = tmp; } ASSERT(penalty_2>=0&&penalty_2<=penalty_1); // penalty penalty = (penalty_1 + penalty_2) / 2; ASSERT(penalty>=0); op[me] -= (penalty * ShelterOpening) / 256; } // black pawn shelter if (UseShelter && (mat_info->cflags[Black] & MatKingFlag) != 0) { me = Black; // king penalty_1 = shelter_square(board,KING_POS(board,me),me); // castling penalty_2 = penalty_1; if ((board->flags & FlagsBlackKingCastle) != 0) { tmp = shelter_square(board,G8,me); if (tmp < penalty_2) penalty_2 = tmp; } if ((board->flags & FlagsBlackQueenCastle) != 0) { tmp = shelter_square(board,B8,me); if (tmp < penalty_2) penalty_2 = tmp; } ASSERT(penalty_2>=0&&penalty_2<=penalty_1); // penalty penalty = (penalty_1 + penalty_2) / 2; ASSERT(penalty>=0); op[me] -= (penalty * ShelterOpening) / 256; } // update *opening += ((op[White] - op[Black]) * KingSafetyWeight) / 256; *endgame += ((eg[White] - eg[Black]) * KingSafetyWeight) / 256; } // eval_passer() static void eval_passer(const board_t * board, const pawn_info_t * pawn_info, int * opening, int * endgame) { int colour; int op[ColourNb], eg[ColourNb]; int att, def; int bits; int file, rank; int sq; int min, max; int delta; ASSERT(board!=NULL); ASSERT(pawn_info!=NULL); ASSERT(opening!=NULL); ASSERT(endgame!=NULL); // init for (colour = 0; colour < ColourNb; colour++) { op[colour] = 0; eg[colour] = 0; } // passed pawns for (colour = 0; colour < ColourNb; colour++) { att = colour; def = COLOUR_OPP(att); for (bits = pawn_info->passed_bits[att]; bits != 0; bits &= bits-1) { file = BIT_FIRST(bits); ASSERT(file>=FileA&&file<=FileH); rank = BIT_LAST(board->pawn_file[att][file]); ASSERT(rank>=Rank2&&rank<=Rank7); sq = SQUARE_MAKE(file,rank); if (COLOUR_IS_BLACK(att)) sq = SQUARE_RANK_MIRROR(sq); ASSERT(PIECE_IS_PAWN(board->square[sq])); ASSERT(COLOUR_IS(board->square[sq],att)); // opening scoring op[att] += quad(PassedOpeningMin,PassedOpeningMax,rank); // endgame scoring init min = PassedEndgameMin; max = PassedEndgameMax; delta = max - min; ASSERT(delta>0); // "dangerous" bonus if (board->piece_size[def] <= 1 // defender has no piece && (unstoppable_passer(board,sq,att) || king_passer(board,sq,att))) { delta += UnstoppablePasser; } else if (free_passer(board,sq,att)) { delta += FreePasser; } // king-distance bonus delta -= pawn_att_dist(sq,KING_POS(board,att),att) * AttackerDistance; delta += pawn_def_dist(sq,KING_POS(board,def),att) * DefenderDistance; // endgame scoring eg[att] += min; if (delta > 0) eg[att] += quad(0,delta,rank); } } // update *opening += ((op[White] - op[Black]) * PassedPawnWeight) / 256; *endgame += ((eg[White] - eg[Black]) * PassedPawnWeight) / 256; } // eval_pattern() static void eval_pattern(const board_t * board, int * opening, int * endgame) { ASSERT(board!=NULL); ASSERT(opening!=NULL); ASSERT(endgame!=NULL); // trapped bishop (7th rank) if ((board->square[A7] == WB && board->square[B6] == BP) || (board->square[B8] == WB && board->square[C7] == BP)) { *opening -= TrappedBishop; *endgame -= TrappedBishop; } if ((board->square[H7] == WB && board->square[G6] == BP) || (board->square[G8] == WB && board->square[F7] == BP)) { *opening -= TrappedBishop; *endgame -= TrappedBishop; } if ((board->square[A2] == BB && board->square[B3] == WP) || (board->square[B1] == BB && board->square[C2] == WP)) { *opening += TrappedBishop; *endgame += TrappedBishop; } if ((board->square[H2] == BB && board->square[G3] == WP) || (board->square[G1] == BB && board->square[F2] == WP)) { *opening += TrappedBishop; *endgame += TrappedBishop; } // trapped bishop (6th rank) if (board->square[A6] == WB && board->square[B5] == BP) { *opening -= TrappedBishop / 2; *endgame -= TrappedBishop / 2; } if (board->square[H6] == WB && board->square[G5] == BP) { *opening -= TrappedBishop / 2; *endgame -= TrappedBishop / 2; } if (board->square[A3] == BB && board->square[B4] == WP) { *opening += TrappedBishop / 2; *endgame += TrappedBishop / 2; } if (board->square[H3] == BB && board->square[G4] == WP) { *opening += TrappedBishop / 2; *endgame += TrappedBishop / 2; } // blocked bishop if (board->square[D2] == WP && board->square[D3] != Empty && board->square[C1] == WB) { *opening -= BlockedBishop; } if (board->square[E2] == WP && board->square[E3] != Empty && board->square[F1] == WB) { *opening -= BlockedBishop; } if (board->square[D7] == BP && board->square[D6] != Empty && board->square[C8] == BB) { *opening += BlockedBishop; } if (board->square[E7] == BP && board->square[E6] != Empty && board->square[F8] == BB) { *opening += BlockedBishop; } // blocked rook if ((board->square[C1] == WK || board->square[B1] == WK) && (board->square[A1] == WR || board->square[A2] == WR || board->square[B1] == WR)) { *opening -= BlockedRook; } if ((board->square[F1] == WK || board->square[G1] == WK) && (board->square[H1] == WR || board->square[H2] == WR || board->square[G1] == WR)) { *opening -= BlockedRook; } if ((board->square[C8] == BK || board->square[B8] == BK) && (board->square[A8] == BR || board->square[A7] == BR || board->square[B8] == BR)) { *opening += BlockedRook; } if ((board->square[F8] == BK || board->square[G8] == BK) && (board->square[H8] == BR || board->square[H7] == BR || board->square[G8] == BR)) { *opening += BlockedRook; } } // unstoppable_passer() static bool unstoppable_passer(const board_t * board, int pawn, int colour) { int me, opp; int file, rank; int king; int prom; const sq_t * ptr; int sq; int dist; ASSERT(board!=NULL); ASSERT(SQUARE_IS_OK(pawn)); ASSERT(COLOUR_IS_OK(colour)); me = colour; opp = COLOUR_OPP(me); file = SQUARE_FILE(pawn); rank = PAWN_RANK(pawn,me); king = KING_POS(board,opp); // clear promotion path? for (ptr = &board->piece[me][0]; (sq=*ptr) != SquareNone; ptr++) { if (SQUARE_FILE(sq) == file && PAWN_RANK(sq,me) > rank) { return false; // "friendly" blocker } } // init if (rank == Rank2) { pawn += PAWN_MOVE_INC(me); rank++; ASSERT(rank==PAWN_RANK(pawn,me)); } ASSERT(rank>=Rank3&&rank<=Rank7); prom = PAWN_PROMOTE(pawn,me); dist = DISTANCE(pawn,prom); ASSERT(dist==Rank8-rank); if (board->turn == opp) dist++; if (DISTANCE(king,prom) > dist) return true; // not in the square return false; } // king_passer() static bool king_passer(const board_t * board, int pawn, int colour) { int me; int king; int file; int prom; ASSERT(board!=NULL); ASSERT(SQUARE_IS_OK(pawn)); ASSERT(COLOUR_IS_OK(colour)); me = colour; king = KING_POS(board,me); file = SQUARE_FILE(pawn); prom = PAWN_PROMOTE(pawn,me); if (DISTANCE(king,prom) <= 1 && DISTANCE(king,pawn) <= 1 && (SQUARE_FILE(king) != file || (file != FileA && file != FileH))) { return true; } return false; } // free_passer() static bool free_passer(const board_t * board, int pawn, int colour) { int me, opp; int inc; int sq; int move; ASSERT(board!=NULL); ASSERT(SQUARE_IS_OK(pawn)); ASSERT(COLOUR_IS_OK(colour)); me = colour; opp = COLOUR_OPP(me); inc = PAWN_MOVE_INC(me); sq = pawn + inc; ASSERT(SQUARE_IS_OK(sq)); if (board->square[sq] != Empty) return false; move = MOVE_MAKE(pawn,sq); if (see_move(move,board) < 0) return false; return true; } // pawn_att_dist() static int pawn_att_dist(int pawn, int king, int colour) { int me; int inc; int target; ASSERT(SQUARE_IS_OK(pawn)); ASSERT(SQUARE_IS_OK(king)); ASSERT(COLOUR_IS_OK(colour)); me = colour; inc = PAWN_MOVE_INC(me); target = pawn + inc; return DISTANCE(king,target); } // pawn_def_dist() static int pawn_def_dist(int pawn, int king, int colour) { int me; int inc; int target; ASSERT(SQUARE_IS_OK(pawn)); ASSERT(SQUARE_IS_OK(king)); ASSERT(COLOUR_IS_OK(colour)); me = colour; inc = PAWN_MOVE_INC(me); target = pawn + inc; return DISTANCE(king,target); } // draw_init_list() static void draw_init_list(int list[], const board_t * board, int pawn_colour) { int pos; int att, def; const sq_t * ptr; int sq; int pawn; int i; ASSERT(list!=NULL); ASSERT(board!=NULL); ASSERT(COLOUR_IS_OK(pawn_colour)); // init pos = 0; att = pawn_colour; def = COLOUR_OPP(att); ASSERT(board->pawn_size[att]==1); ASSERT(board->pawn_size[def]==0); // att for (ptr = &board->piece[att][0]; (sq=*ptr) != SquareNone; ptr++) { list[pos++] = sq; } for (ptr = &board->pawn[att][0]; (sq=*ptr) != SquareNone; ptr++) { list[pos++] = sq; } // def for (ptr = &board->piece[def][0]; (sq=*ptr) != SquareNone; ptr++) { list[pos++] = sq; } for (ptr = &board->pawn[def][0]; (sq=*ptr) != SquareNone; ptr++) { list[pos++] = sq; } // end marker ASSERT(pos==board->piece_nb); list[pos] = SquareNone; // file flip? pawn = board->pawn[att][0]; if (SQUARE_FILE(pawn) >= FileE) { for (i = 0; i < pos; i++) { list[i] = SQUARE_FILE_MIRROR(list[i]); } } // rank flip? if (COLOUR_IS_BLACK(pawn_colour)) { for (i = 0; i < pos; i++) { list[i] = SQUARE_RANK_MIRROR(list[i]); } } } // draw_kpkq() static bool draw_kpkq(const int list[], int turn) { int wk, wp, bk, bq; int prom; int dist; // int wp_file, wp_rank; ASSERT(list!=NULL); ASSERT(COLOUR_IS_OK(turn)); // load wk = *list++; ASSERT(SQUARE_IS_OK(wk)); wp = *list++; ASSERT(SQUARE_IS_OK(wp)); ASSERT(SQUARE_FILE(wp)<=FileD); bk = *list++; ASSERT(SQUARE_IS_OK(bk)); bq = *list++; ASSERT(SQUARE_IS_OK(bq)); ASSERT(*list==SquareNone); // test if (false) { } else if (wp == A7) { prom = A8; dist = 4; if (wk == B7 || wk == B8) { // best case if (COLOUR_IS_WHITE(turn)) dist--; } else if (wk == A8 || ((wk == C7 || wk == C8) && bq != A8)) { // white loses a tempo if (COLOUR_IS_BLACK(turn) && SQUARE_FILE(bq) != FileB) return false; } else { return false; } ASSERT(bq!=prom); if (DISTANCE(bk,prom) > dist) return true; } else if (wp == C7) { prom = C8; dist = 4; if (false) { } else if (wk == C8) { // dist = 0 dist++; // self-blocking penalty if (COLOUR_IS_WHITE(turn)) dist--; // right-to-move bonus } else if (wk == B7 || wk == B8) { // dist = 1, right side dist--; // right-side bonus if (DELTA_INC_LINE(wp-bq) == wk-wp) dist++; // pinned-pawn penalty if (COLOUR_IS_WHITE(turn)) dist--; // right-to-move bonus } else if (wk == D7 || wk == D8) { // dist = 1, wrong side if (DELTA_INC_LINE(wp-bq) == wk-wp) dist++; // pinned-pawn penalty if (COLOUR_IS_WHITE(turn)) dist--; // right-to-move bonus } else if ((wk == A7 || wk == A8) && bq != C8) { // dist = 2, right side if (COLOUR_IS_BLACK(turn) && SQUARE_FILE(bq) != FileB) return false; dist--; // right-side bonus } else if ((wk == E7 || wk == E8) && bq != C8) { // dist = 2, wrong side if (COLOUR_IS_BLACK(turn) && SQUARE_FILE(bq) != FileD) return false; } else { return false; } ASSERT(bq!=prom); if (DISTANCE(bk,prom) > dist) return true; } return false; } // draw_kpkr() static bool draw_kpkr(const int list[], int turn) { int wk, wp, bk, br; int wk_file, wk_rank; int wp_file, wp_rank; int br_file, br_rank; int inc; int prom; int dist; ASSERT(list!=NULL); ASSERT(COLOUR_IS_OK(turn)); // load wk = *list++; ASSERT(SQUARE_IS_OK(wk)); wp = *list++; ASSERT(SQUARE_IS_OK(wp)); ASSERT(SQUARE_FILE(wp)<=FileD); bk = *list++; ASSERT(SQUARE_IS_OK(bk)); br = *list++; ASSERT(SQUARE_IS_OK(br)); ASSERT(*list==SquareNone); // init wk_file = SQUARE_FILE(wk); wk_rank = SQUARE_RANK(wk); wp_file = SQUARE_FILE(wp); wp_rank = SQUARE_RANK(wp); br_file = SQUARE_FILE(br); br_rank = SQUARE_RANK(br); inc = PAWN_MOVE_INC(White); prom = PAWN_PROMOTE(wp,White); // conditions if (false) { } else if (DISTANCE(wk,wp) == 1) { ASSERT(abs(wk_file-wp_file)<=1); ASSERT(abs(wk_rank-wp_rank)<=1); // no-op } else if (DISTANCE(wk,wp) == 2 && abs(wk_rank-wp_rank) <= 1) { ASSERT(abs(wk_file-wp_file)==2); ASSERT(abs(wk_rank-wp_rank)<=1); if (COLOUR_IS_BLACK(turn) && br_file != (wk_file + wp_file) / 2) return false; } else { return false; } // white features dist = DISTANCE(wk,prom) + DISTANCE(wp,prom); if (wk == prom) dist++; if (wk == wp+inc) { // king on pawn's "front square" if (wp_file == FileA) return false; dist++; // self-blocking penalty } // black features if (br_file != wp_file && br_rank != Rank8) { dist--; // misplaced-rook bonus } // test if (COLOUR_IS_WHITE(turn)) dist--; // right-to-move bonus if (DISTANCE(bk,prom) > dist) return true; return false; } // draw_kpkb() static bool draw_kpkb(const int list[], int turn) { int wk, wp, bk, bb; int inc; int end, to; int delta, inc_2; int sq; ASSERT(list!=NULL); ASSERT(COLOUR_IS_OK(turn)); // load wk = *list++; ASSERT(SQUARE_IS_OK(wk)); wp = *list++; ASSERT(SQUARE_IS_OK(wp)); ASSERT(SQUARE_FILE(wp)<=FileD); bk = *list++; ASSERT(SQUARE_IS_OK(bk)); bb = *list++; ASSERT(SQUARE_IS_OK(bb)); ASSERT(*list==SquareNone); // blocked pawn? inc = PAWN_MOVE_INC(White); end = PAWN_PROMOTE(wp,White) + inc; for (to = wp+inc; to != end; to += inc) { ASSERT(SQUARE_IS_OK(to)); if (to == bb) return true; // direct blockade delta = to - bb; ASSERT(delta_is_ok(delta)); if (PSEUDO_ATTACK(BB,delta)) { inc_2 = DELTA_INC_ALL(delta); ASSERT(inc_2!=IncNone); sq = bb; do { sq += inc_2; ASSERT(SQUARE_IS_OK(sq)); ASSERT(sq!=wk); ASSERT(sq!=wp); ASSERT(sq!=bb); if (sq == to) return true; // indirect blockade } while (sq != bk); } } return false; } // draw_kpkn() static bool draw_kpkn(const int list[], int turn) { int wk, wp, bk, bn; int inc; int end; int file; int sq; ASSERT(list!=NULL); ASSERT(COLOUR_IS_OK(turn)); // load wk = *list++; ASSERT(SQUARE_IS_OK(wk)); wp = *list++; ASSERT(SQUARE_IS_OK(wp)); ASSERT(SQUARE_FILE(wp)<=FileD); bk = *list++; ASSERT(SQUARE_IS_OK(bk)); bn = *list++; ASSERT(SQUARE_IS_OK(bn)); ASSERT(*list==SquareNone); // blocked pawn? inc = PAWN_MOVE_INC(White); end = PAWN_PROMOTE(wp,White) + inc; file = SQUARE_FILE(wp); if (file == FileA || file == FileH) end -= inc; for (sq = wp+inc; sq != end; sq += inc) { ASSERT(SQUARE_IS_OK(sq)); if (sq == bn || PSEUDO_ATTACK(BN,sq-bn)) return true; // blockade } return false; } // draw_knpk() static bool draw_knpk(const int list[], int turn) { int wk, wn, wp, bk; ASSERT(list!=NULL); ASSERT(COLOUR_IS_OK(turn)); // load wk = *list++; ASSERT(SQUARE_IS_OK(wk)); wn = *list++; ASSERT(SQUARE_IS_OK(wn)); wp = *list++; ASSERT(SQUARE_IS_OK(wp)); ASSERT(SQUARE_FILE(wp)<=FileD); bk = *list++; ASSERT(SQUARE_IS_OK(bk)); ASSERT(*list==SquareNone); // test if (wp == A7 && DISTANCE(bk,A8) <= 1) return true; return false; } // draw_krpkr() static bool draw_krpkr(const int list[], int turn) { int wk, wr, wp, bk, br; int wp_file, wp_rank; int bk_file, bk_rank; int br_file, br_rank; int prom; ASSERT(list!=NULL); ASSERT(COLOUR_IS_OK(turn)); // load wk = *list++; ASSERT(SQUARE_IS_OK(wk)); wr = *list++; ASSERT(SQUARE_IS_OK(wr)); wp = *list++; ASSERT(SQUARE_IS_OK(wp)); ASSERT(SQUARE_FILE(wp)<=FileD); bk = *list++; ASSERT(SQUARE_IS_OK(bk)); br = *list++; ASSERT(SQUARE_IS_OK(br)); ASSERT(*list==SquareNone); // test wp_file = SQUARE_FILE(wp); wp_rank = SQUARE_RANK(wp); bk_file = SQUARE_FILE(bk); bk_rank = SQUARE_RANK(bk); br_file = SQUARE_FILE(br); br_rank = SQUARE_RANK(br); prom = PAWN_PROMOTE(wp,White); if (false) { } else if (bk == prom) { // TODO: rook near Rank1 if wp_rank == Rank6? if (br_file > wp_file) return true; } else if (bk_file == wp_file && bk_rank > wp_rank) { return true; } else if (wr == prom && wp_rank == Rank7 && (bk == G7 || bk == H7) && br_file == wp_file) { if (br_rank <= Rank3) { if (DISTANCE(wk,wp) > 1) return true; } else { // br_rank >= Rank4 if (DISTANCE(wk,wp) > 2) return true; } } return false; } // draw_kbpkb() static bool draw_kbpkb(const int list[], int turn) { int wk, wb, wp, bk, bb; int inc; int end, to; int delta, inc_2; int sq; ASSERT(list!=NULL); ASSERT(COLOUR_IS_OK(turn)); // load wk = *list++; ASSERT(SQUARE_IS_OK(wk)); wb = *list++; ASSERT(SQUARE_IS_OK(wb)); wp = *list++; ASSERT(SQUARE_IS_OK(wp)); ASSERT(SQUARE_FILE(wp)<=FileD); bk = *list++; ASSERT(SQUARE_IS_OK(bk)); bb = *list++; ASSERT(SQUARE_IS_OK(bb)); ASSERT(*list==SquareNone); // opposit colour? if (SQUARE_COLOUR(wb) == SQUARE_COLOUR(bb)) return false; // TODO // blocked pawn? inc = PAWN_MOVE_INC(White); end = PAWN_PROMOTE(wp,White) + inc; for (to = wp+inc; to != end; to += inc) { ASSERT(SQUARE_IS_OK(to)); if (to == bb) return true; // direct blockade delta = to - bb; ASSERT(delta_is_ok(delta)); if (PSEUDO_ATTACK(BB,delta)) { inc_2 = DELTA_INC_ALL(delta); ASSERT(inc_2!=IncNone); sq = bb; do { sq += inc_2; ASSERT(SQUARE_IS_OK(sq)); ASSERT(sq!=wk); ASSERT(sq!=wb); ASSERT(sq!=wp); ASSERT(sq!=bb); if (sq == to) return true; // indirect blockade } while (sq != bk); } } return false; } // shelter_square() static int shelter_square(const board_t * board, int square, int colour) { int penalty; int file, rank; ASSERT(board!=NULL); ASSERT(SQUARE_IS_OK(square)); ASSERT(COLOUR_IS_OK(colour)); penalty = 0; file = SQUARE_FILE(square); rank = PAWN_RANK(square,colour); penalty += shelter_file(board,file,rank,colour) * 2; if (file != FileA) penalty += shelter_file(board,file-1,rank,colour); if (file != FileH) penalty += shelter_file(board,file+1,rank,colour); if (penalty == 0) penalty = 11; // weak back rank if (UseStorm) { penalty += storm_file(board,file,colour); if (file != FileA) penalty += storm_file(board,file-1,colour); if (file != FileH) penalty += storm_file(board,file+1,colour); } return penalty; } // shelter_file() static int shelter_file(const board_t * board, int file, int rank, int colour) { int dist; int penalty; ASSERT(board!=NULL); ASSERT(file>=FileA&&file<=FileH); ASSERT(rank>=Rank1&&rank<=Rank8); ASSERT(COLOUR_IS_OK(colour)); dist = BIT_FIRST(board->pawn_file[colour][file]&BitGE[rank]); ASSERT(dist>=Rank2&&dist<=Rank8); dist = Rank8 - dist; ASSERT(dist>=0&&dist<=6); penalty = 36 - dist * dist; ASSERT(penalty>=0&&penalty<=36); return penalty; } // storm_file() static int storm_file(const board_t * board, int file, int colour) { int dist; int penalty; ASSERT(board!=NULL); ASSERT(file>=FileA&&file<=FileH); ASSERT(COLOUR_IS_OK(colour)); dist = BIT_LAST(board->pawn_file[COLOUR_OPP(colour)][file]); ASSERT(dist>=Rank1&&dist<=Rank7); penalty = 0; switch (dist) { case Rank4: penalty = StormOpening * 1; break; case Rank5: penalty = StormOpening * 3; break; case Rank6: penalty = StormOpening * 6; break; } return penalty; } // bishop_can_attack() static bool bishop_can_attack(const board_t * board, int to, int colour) { const sq_t * ptr; int from; int piece; ASSERT(board!=NULL); ASSERT(SQUARE_IS_OK(to)); ASSERT(COLOUR_IS_OK(colour)); for (ptr = &board->piece[colour][1]; (from=*ptr) != SquareNone; ptr++) { // HACK: no king piece = board->square[from]; if (PIECE_IS_BISHOP(piece) && SQUARE_COLOUR(from) == SQUARE_COLOUR(to)) { return true; } } return false; } } // namespace engine // end of eval.cpp gnuchess-6.2.2/src/engine/eval.h000644 000766 000024 00000001761 11517375750 017327 0ustar00antoniostaff000000 000000 /* eval.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // eval.h #ifndef EVAL_H #define EVAL_H // includes #include "board.h" #include "util.h" namespace engine { // functions extern void eval_init (); extern int eval (const board_t * board); } // namespace engine #endif // !defined EVAL_H // end of eval.h gnuchess-6.2.2/src/engine/fen.cpp000644 000766 000024 00000014602 11517375750 017501 0ustar00antoniostaff000000 000000 /* fen.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // fen.cpp // includes #include #include #include #include "board.h" #include "colour.h" #include "fen.h" #include "piece.h" #include "square.h" #include "util.h" namespace engine { // "constants" const char * const StartFen = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"; // variables static const bool Strict = false; // functions // board_from_fen() void board_from_fen(board_t * board, const char fen[]) { int pos; int file, rank, sq; int c; int i, len; int piece; int pawn; ASSERT(board!=NULL); ASSERT(fen!=NULL); board_clear(board); pos = 0; c = fen[pos]; // piece placement for (rank = Rank8; rank >= Rank1; rank--) { for (file = FileA; file <= FileH;) { if (c >= '1' && c <= '8') { // empty square(s) len = c - '0'; for (i = 0; i < len; i++) { if (file > FileH) my_fatal("board_from_fen(): bad FEN (pos=%d)\n",pos); board->square[SQUARE_MAKE(file,rank)] = Empty; file++; } } else { // piece piece = piece_from_char(c); if (piece == PieceNone256) my_fatal("board_from_fen(): bad FEN (pos=%d)\n",pos); board->square[SQUARE_MAKE(file,rank)] = piece; file++; } c = fen[++pos]; } if (rank > Rank1) { if (c != '/') my_fatal("board_from_fen(): bad FEN (pos=%d)\n",pos); c = fen[++pos]; } } // active colour if (c != ' ') my_fatal("board_from_fen(): bad FEN (pos=%d)\n",pos); c = fen[++pos]; switch (c) { case 'w': board->turn = White; break; case 'b': board->turn = Black; break; default: my_fatal("board_from_fen(): bad FEN (pos=%d)\n",pos); break; } c = fen[++pos]; // castling if (c != ' ') my_fatal("board_from_fen(): bad FEN (pos=%d)\n",pos); c = fen[++pos]; board->flags = FlagsNone; if (c == '-') { // no castling rights c = fen[++pos]; } else { if (c == 'K') { if (board->square[E1] == WK && board->square[H1] == WR) board->flags |= FlagsWhiteKingCastle; c = fen[++pos]; } if (c == 'Q') { if (board->square[E1] == WK && board->square[A1] == WR) board->flags |= FlagsWhiteQueenCastle; c = fen[++pos]; } if (c == 'k') { if (board->square[E8] == BK && board->square[H8] == BR) board->flags |= FlagsBlackKingCastle; c = fen[++pos]; } if (c == 'q') { if (board->square[E8] == BK && board->square[A8] == BR) board->flags |= FlagsBlackQueenCastle; c = fen[++pos]; } } // en-passant if (c != ' ') my_fatal("board_from_fen(): bad FEN (pos=%d)\n",pos); c = fen[++pos]; if (c == '-') { // no en-passant sq = SquareNone; c = fen[++pos]; } else { if (c < 'a' || c > 'h') my_fatal("board_from_fen(): bad FEN (pos=%d)\n",pos); file = file_from_char(c); c = fen[++pos]; if (c != (COLOUR_IS_WHITE(board->turn) ? '6' : '3')) my_fatal("board_from_fen(): bad FEN (pos=%d)\n",pos); rank = rank_from_char(c); c = fen[++pos]; sq = SQUARE_MAKE(file,rank); pawn = SQUARE_EP_DUAL(sq); if (board->square[sq] != Empty || board->square[pawn] != PAWN_MAKE(COLOUR_OPP(board->turn)) || (board->square[pawn-1] != PAWN_MAKE(board->turn) && board->square[pawn+1] != PAWN_MAKE(board->turn))) { sq = SquareNone; } } board->ep_square = sq; // halfmove clock board->ply_nb = 0; if (c != ' ') { if (!Strict) goto update; my_fatal("board_from_fen(): bad FEN (pos=%d)\n",pos); } c = fen[++pos]; if (!isdigit(c)) { if (!Strict) goto update; my_fatal("board_from_fen(): bad FEN (pos=%d)\n",pos); } board->ply_nb = atoi(&fen[pos]); // board update update: board_init_list(board); } // board_to_fen() bool board_to_fen(const board_t * board, char fen[], int size) { int pos; int file, rank; int sq, piece; int c; int len; ASSERT(board!=NULL); ASSERT(fen!=NULL); ASSERT(size>=92); // init if (size < 92) return false; pos = 0; // piece placement for (rank = Rank8; rank >= Rank1; rank--) { for (file = FileA; file <= FileH;) { sq = SQUARE_MAKE(file,rank); piece = board->square[sq]; ASSERT(piece==Empty||piece_is_ok(piece)); if (piece == Empty) { len = 0; for (; file <= FileH && board->square[SQUARE_MAKE(file,rank)] == Empty; file++) { len++; } ASSERT(len>=1&&len<=8); c = '0' + len; } else { c = piece_to_char(piece); file++; } fen[pos++] = c; } fen[pos++] = '/'; } fen[pos-1] = ' '; // HACK: remove the last '/' // active colour fen[pos++] = (COLOUR_IS_WHITE(board->turn)) ? 'w' : 'b'; fen[pos++] = ' '; // castling if (board->flags == FlagsNone) { fen[pos++] = '-'; } else { if ((board->flags & FlagsWhiteKingCastle) != 0) fen[pos++] = 'K'; if ((board->flags & FlagsWhiteQueenCastle) != 0) fen[pos++] = 'Q'; if ((board->flags & FlagsBlackKingCastle) != 0) fen[pos++] = 'k'; if ((board->flags & FlagsBlackQueenCastle) != 0) fen[pos++] = 'q'; } fen[pos++] = ' '; // en-passant if (board->ep_square == SquareNone) { fen[pos++] = '-'; } else { square_to_string(board->ep_square,&fen[pos],3); pos += 2; } fen[pos++] = ' '; // halfmove clock sprintf(&fen[pos],"%d 1",board->ply_nb); return true; } } // namespace engine // end of fen.cpp gnuchess-6.2.2/src/engine/fen.h000644 000766 000024 00000002140 11517375750 017140 0ustar00antoniostaff000000 000000 /* fen.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // fen.h #ifndef FEN_H #define FEN_H // includes #include "board.h" #include "util.h" namespace engine { // "constants" extern const char * const StartFen; // functions extern void board_from_fen (board_t * board, const char fen[]); extern bool board_to_fen (const board_t * board, char fen[], int size); } // namespace engine #endif // !defined FEN_H // end of fen.h gnuchess-6.2.2/src/engine/hash.cpp000644 000766 000024 00000007475 11517375750 017666 0ustar00antoniostaff000000 000000 /* hash.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // hash.cpp // includes #include "board.h" #include "hash.h" #include "piece.h" #include "random.h" #include "square.h" #include "util.h" namespace engine { // variables uint64 Castle64[16]; // prototypes static uint64 hash_counter_key (int piece_12, int count); // functions // hash_init() void hash_init() { int i; for (i = 0; i < 16; i++) Castle64[i] = hash_castle_key(i); } // hash_key() uint64 hash_key(const board_t * board) { uint64 key; int colour; const sq_t * ptr; int sq, piece; ASSERT(board!=NULL); // init key = 0; // pieces for (colour = 0; colour < ColourNb; colour++) { for (ptr = &board->piece[colour][0]; (sq=*ptr) != SquareNone; ptr++) { piece = board->square[sq]; key ^= hash_piece_key(piece,sq); } for (ptr = &board->pawn[colour][0]; (sq=*ptr) != SquareNone; ptr++) { piece = board->square[sq]; key ^= hash_piece_key(piece,sq); } } // castle flags key ^= hash_castle_key(board->flags); // en-passant square sq = board->ep_square; if (sq != SquareNone) key ^= hash_ep_key(sq); // turn key ^= hash_turn_key(board->turn); return key; } // hash_pawn_key() uint64 hash_pawn_key(const board_t * board) { uint64 key; int colour; const sq_t * ptr; int sq, piece; ASSERT(board!=NULL); // init key = 0; // pawns for (colour = 0; colour < ColourNb; colour++) { for (ptr = &board->pawn[colour][0]; (sq=*ptr) != SquareNone; ptr++) { piece = board->square[sq]; key ^= hash_piece_key(piece,sq); } } return key; } // hash_material_key() uint64 hash_material_key(const board_t * board) { uint64 key; int piece_12, count; ASSERT(board!=NULL); // init key = 0; // counters for (piece_12 = 0; piece_12 < 12; piece_12++) { count = board->number[piece_12]; key ^= hash_counter_key(piece_12,count); } return key; } // hash_piece_key() uint64 hash_piece_key(int piece, int square) { ASSERT(piece_is_ok(piece)); ASSERT(SQUARE_IS_OK(square)); return RANDOM_64(RandomPiece+(PIECE_TO_12(piece)^1)*64+SQUARE_TO_64(square)); // HACK: ^1 for PolyGlot book } // hash_castle_key() uint64 hash_castle_key(int flags) { uint64 key; int i; ASSERT((flags&~0xF)==0); key = 0; for (i = 0; i < 4; i++) { if ((flags & (1<=0&&piece_12<12); ASSERT(count>=0&&count<=10); // init key = 0; // counter index = piece_12 * 16; for (i = 0; i < count; i++) key ^= RANDOM_64(index+i); return key; } } // namespace engine // end of hash.cpp gnuchess-6.2.2/src/engine/hash.h000644 000766 000024 00000003156 11517375750 017323 0ustar00antoniostaff000000 000000 /* hash.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // hash.h #ifndef HASH_H #define HASH_H // includes #include "board.h" #include "util.h" // macros #define KEY_INDEX(key) (uint32(key)) #define KEY_LOCK(key) (uint32((key)>>32)) namespace engine { // constants const int RandomPiece = 0; // 12 * 64 const int RandomCastle = 768; // 4 const int RandomEnPassant = 772; // 8 const int RandomTurn = 780; // 1 // variables extern uint64 Castle64[16]; // functions extern void hash_init (); extern uint64 hash_key (const board_t * board); extern uint64 hash_pawn_key (const board_t * board); extern uint64 hash_material_key (const board_t * board); extern uint64 hash_piece_key (int piece, int square); extern uint64 hash_castle_key (int flags); extern uint64 hash_ep_key (int square); extern uint64 hash_turn_key (int colour); } // namespace engine #endif // !defined HASH_H // end of hash.h gnuchess-6.2.2/src/engine/list.cpp000644 000766 000024 00000006752 11517375750 017713 0ustar00antoniostaff000000 000000 /* list.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // list.cpp // includes #include "board.h" #include "list.h" #include "move.h" #include "util.h" #include "value.h" namespace engine { // constants static const bool UseStrict = true; // functions // list_is_ok() bool list_is_ok(const list_t * list) { if (list == NULL) return false; if (list->size < 0 || list->size >= ListSize) return false; return true; } // list_remove() void list_remove(list_t * list, int pos) { int i; ASSERT(list_is_ok(list)); ASSERT(pos>=0&&possize); for (i = pos; i < list->size-1; i++) { list->move[i] = list->move[i+1]; list->value[i] = list->value[i+1]; } list->size--; } // list_copy() void list_copy(list_t * dst, const list_t * src) { int i; ASSERT(dst!=NULL); ASSERT(list_is_ok(src)); dst->size = src->size; for (i = 0; i < src->size; i++) { dst->move[i] = src->move[i]; dst->value[i] = src->value[i]; } } // list_sort() void list_sort(list_t * list) { int size; int i, j; int move, value; ASSERT(list_is_ok(list)); // init size = list->size; list->value[size] = -32768; // HACK: sentinel // insert sort (stable) for (i = size-2; i >= 0; i--) { move = list->move[i]; value = list->value[i]; for (j = i; value < list->value[j+1]; j++) { list->move[j] = list->move[j+1]; list->value[j] = list->value[j+1]; } ASSERT(jmove[j] = move; list->value[j] = value; } // debug if (DEBUG) { for (i = 0; i < size-1; i++) { ASSERT(list->value[i]>=list->value[i+1]); } } } // list_contain() bool list_contain(const list_t * list, int move) { int i; ASSERT(list_is_ok(list)); ASSERT(move_is_ok(move)); for (i = 0; i < list->size; i++) { if (list->move[i] == move) return true; } return false; } // list_note() void list_note(list_t * list) { int i, move; ASSERT(list_is_ok(list)); for (i = 0; i < list->size; i++) { move = list->move[i]; ASSERT(move_is_ok(move)); list->value[i] = -move_order(move); } } // list_filter() void list_filter(list_t * list, board_t * board, move_test_t test, bool keep) { int pos; int i, move, value; ASSERT(list!=NULL); ASSERT(board!=NULL); ASSERT(test!=NULL); ASSERT(keep==true||keep==false); pos = 0; for (i = 0; i < LIST_SIZE(list); i++) { ASSERT(pos>=0&&pos<=i); move = LIST_MOVE(list,i); value = LIST_VALUE(list,i); if ((*test)(move,board) == keep) { list->move[pos] = move; list->value[pos] = value; pos++; } } ASSERT(pos>=0&&pos<=LIST_SIZE(list)); list->size = pos; // debug ASSERT(list_is_ok(list)); } } // namespace engine // end of list.cpp gnuchess-6.2.2/src/engine/list.h000644 000766 000024 00000003467 11517375750 017360 0ustar00antoniostaff000000 000000 /* list.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // list.h #ifndef LIST_H #define LIST_H // includes #include "board.h" #include "util.h" // constants const int ListSize = 256; // macros #define LIST_CLEAR(list) ((list)->size=0) #define LIST_ADD(list,mv) ((list)->move[(list)->size++]=(mv)) #define LIST_IS_EMPTY(list) ((list)->size==0) #define LIST_SIZE(list) ((list)->size) #define LIST_MOVE(list,pos) ((list)->move[pos]) #define LIST_VALUE(list,pos) ((list)->value[pos]) namespace engine { // types struct list_t { int size; uint16 move[ListSize]; sint16 value[ListSize]; }; typedef bool (*move_test_t) (int move, board_t * board); // functions extern bool list_is_ok (const list_t * list); extern void list_remove (list_t * list, int pos); extern void list_copy (list_t * dst, const list_t * src); extern void list_sort (list_t * list); extern bool list_contain (const list_t * list, int move); extern void list_note (list_t * list); extern void list_filter (list_t * list, board_t * board, move_test_t test, bool keep); } // namespace engine #endif // !defined LIST_H // end of list.h gnuchess-6.2.2/src/engine/main.cpp000644 000766 000024 00000004013 11517375750 017650 0ustar00antoniostaff000000 000000 /* main.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // main.cpp // includes #include #include #include "attack.h" #include "book.h" #include "hash.h" #include "move_do.h" #include "option.h" #include "pawn.h" #include "piece.h" #include "protocol.h" #include "random.h" #include "square.h" #include "trans.h" #include "util.h" #include "value.h" #include "vector.h" #include "components.h" namespace engine { // Streams used to communicate with the adapter FILE *pipefd_a2e_0_stream; FILE *pipefd_e2a_1_stream; // functions // main() int main_engine(int argc, char * argv[]) { // Get reference stream of pipes to communicate with the adapter pipefd_a2e_0_stream = fdopen( pipefd_a2e[0], "r" ); pipefd_e2a_1_stream = fdopen( pipefd_e2a[1], "w" ); setvbuf(pipefd_a2e_0_stream,NULL,_IONBF,0); setvbuf(pipefd_e2a_1_stream,NULL,_IONBF,0); // _IOLBF breaks on Windows! // init my_random_init(); // for opening book // early initialisation (the rest is done after UCI options are parsed in protocol.cpp) option_init(); square_init(); piece_init(); pawn_init_bit(); value_init(); vector_init(); attack_init(); move_do_init(); random_init(); hash_init(); trans_init(Trans); book_init(); // loop loop(); return EXIT_SUCCESS; } } // namespace engine // end of main.cpp gnuchess-6.2.2/src/engine/Makefile.am000644 000766 000024 00000003526 12434150466 020256 0ustar00antoniostaff000000 000000 # Process this file with automake to produce Makefile.in # Makefile for gnuchess/src/engine. # # Copyright (C) 2001-2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . noinst_LIBRARIES = libengine.a libengine_a_SOURCES = attack.cpp board.cpp book.cpp eval.cpp fen.cpp hash.cpp list.cpp main.cpp material.cpp \ move.cpp move_check.cpp move_do.cpp move_evasion.cpp move_gen.cpp move_legal.cpp \ option.cpp pawn.cpp piece.cpp posix.cpp protocol.cpp pst.cpp pv.cpp random.cpp recog.cpp \ search.cpp search_full.cpp see.cpp sort.cpp square.cpp trans.cpp util.cpp value.cpp \ vector.cpp \ attack.h board.h book.h colour.h eval.h fen.h hash.h list.h material.h \ move.h move_check.h move_do.h move_evasion.h move_gen.h move_legal.h \ option.h pawn.h piece.h posix.h protocol.h pst.h pv.h random.h recog.h \ search.h search_full.h see.h sort.h square.h trans.h util.h value.h \ vector.h AM_CPPFLAGS = -I$(top_srcdir)/src AM_CXXFLAGS = $(PTHREAD_CXXFLAGS) # Flags used to compile Fruit 2.1 - not used by default # AM_CXXFLAGS += -fno-exceptions -fno-rtti -O3 -fstrict-aliasing -fomit-frame-pointer AM_LDFLAGS = $(PTHREAD_LDFLAGS) $(PTHREAD_LIBS) DISTCLEANFILES = *~ gnuchess-6.2.2/src/engine/Makefile.in000644 000766 000024 00000052577 12606706417 020305 0ustar00antoniostaff000000 000000 # Makefile.in generated by automake 1.14 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Process this file with automake to produce Makefile.in # Makefile for gnuchess/src/engine. # # Copyright (C) 2001-2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/engine DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libengine_a_AR = $(AR) $(ARFLAGS) libengine_a_LIBADD = am_libengine_a_OBJECTS = attack.$(OBJEXT) board.$(OBJEXT) \ book.$(OBJEXT) eval.$(OBJEXT) fen.$(OBJEXT) hash.$(OBJEXT) \ list.$(OBJEXT) main.$(OBJEXT) material.$(OBJEXT) \ move.$(OBJEXT) move_check.$(OBJEXT) move_do.$(OBJEXT) \ move_evasion.$(OBJEXT) move_gen.$(OBJEXT) move_legal.$(OBJEXT) \ option.$(OBJEXT) pawn.$(OBJEXT) piece.$(OBJEXT) \ posix.$(OBJEXT) protocol.$(OBJEXT) pst.$(OBJEXT) pv.$(OBJEXT) \ random.$(OBJEXT) recog.$(OBJEXT) search.$(OBJEXT) \ search_full.$(OBJEXT) see.$(OBJEXT) sort.$(OBJEXT) \ square.$(OBJEXT) trans.$(OBJEXT) util.$(OBJEXT) \ value.$(OBJEXT) vector.$(OBJEXT) libengine_a_OBJECTS = $(am_libengine_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libengine_a_SOURCES) DIST_SOURCES = $(libengine_a_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HELP2MAN = @HELP2MAN@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGINSDIR = @PLUGINSDIR@ POSUB = @POSUB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXXFLAGS = @PTHREAD_CXXFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libengine.a libengine_a_SOURCES = attack.cpp board.cpp book.cpp eval.cpp fen.cpp hash.cpp list.cpp main.cpp material.cpp \ move.cpp move_check.cpp move_do.cpp move_evasion.cpp move_gen.cpp move_legal.cpp \ option.cpp pawn.cpp piece.cpp posix.cpp protocol.cpp pst.cpp pv.cpp random.cpp recog.cpp \ search.cpp search_full.cpp see.cpp sort.cpp square.cpp trans.cpp util.cpp value.cpp \ vector.cpp \ attack.h board.h book.h colour.h eval.h fen.h hash.h list.h material.h \ move.h move_check.h move_do.h move_evasion.h move_gen.h move_legal.h \ option.h pawn.h piece.h posix.h protocol.h pst.h pv.h random.h recog.h \ search.h search_full.h see.h sort.h square.h trans.h util.h value.h \ vector.h AM_CPPFLAGS = -I$(top_srcdir)/src AM_CXXFLAGS = $(PTHREAD_CXXFLAGS) # Flags used to compile Fruit 2.1 - not used by default # AM_CXXFLAGS += -fno-exceptions -fno-rtti -O3 -fstrict-aliasing -fomit-frame-pointer AM_LDFLAGS = $(PTHREAD_LDFLAGS) $(PTHREAD_LIBS) DISTCLEANFILES = *~ all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/engine/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/engine/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libengine.a: $(libengine_a_OBJECTS) $(libengine_a_DEPENDENCIES) $(EXTRA_libengine_a_DEPENDENCIES) $(AM_V_at)-rm -f libengine.a $(AM_V_AR)$(libengine_a_AR) libengine.a $(libengine_a_OBJECTS) $(libengine_a_LIBADD) $(AM_V_at)$(RANLIB) libengine.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/board.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/book.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eval.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/material.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_check.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_do.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_evasion.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_gen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_legal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/option.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pawn.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/piece.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pst.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/random.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/search.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/search_full.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/see.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sort.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/square.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trans.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/value.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: gnuchess-6.2.2/src/engine/material.cpp000644 000766 000024 00000036234 11713433041 020516 0ustar00antoniostaff000000 000000 /* material.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // material.cpp // includes #include #include "board.h" #include "colour.h" #include "hash.h" #include "material.h" #include "option.h" #include "piece.h" #include "protocol.h" #include "square.h" #include "util.h" namespace engine { // constants static const bool UseTable = true; static const uint32 TableSize = 256; // 4kB static const int PawnPhase = 0; static const int KnightPhase = 1; static const int BishopPhase = 1; static const int RookPhase = 2; static const int QueenPhase = 4; static const int TotalPhase = PawnPhase * 16 + KnightPhase * 4 + BishopPhase * 4 + RookPhase * 4 + QueenPhase * 2; // constants and variables static /* const */ int MaterialWeight = 256; // 100% static const int PawnOpening = 80; // was 100 static const int PawnEndgame = 90; // was 100 static const int KnightOpening = 325; static const int KnightEndgame = 325; static const int BishopOpening = 325; static const int BishopEndgame = 325; static const int RookOpening = 500; static const int RookEndgame = 500; static const int QueenOpening = 1000; static const int QueenEndgame = 1000; static const int BishopPairOpening = 50; static const int BishopPairEndgame = 50; // types typedef material_info_t entry_t; struct material_t { entry_t * table; uint32 size; uint32 mask; uint32 used; sint64 read_nb; sint64 read_hit; sint64 write_nb; sint64 write_collision; }; // variables static material_t Material[1]; // prototypes static void material_comp_info (material_info_t * info, const board_t * board); // functions // material_init() void material_init() { // UCI options MaterialWeight = (option_get_int("Material") * 256 + 50) / 100; // material table Material->size = 0; Material->mask = 0; Material->table = NULL; } // material_alloc() void material_alloc() { ASSERT(sizeof(entry_t)==16); if (UseTable) { Material->size = TableSize; Material->mask = TableSize - 1; Material->table = (entry_t *) my_malloc(Material->size*sizeof(entry_t)); material_clear(); } } // material_clear() void material_clear() { if (Material->table != NULL) { memset(Material->table,0,Material->size*sizeof(entry_t)); } Material->used = 0; Material->read_nb = 0; Material->read_hit = 0; Material->write_nb = 0; Material->write_collision = 0; } // material_get_info() void material_get_info(material_info_t * info, const board_t * board) { uint64 key; entry_t * entry; ASSERT(info!=NULL); ASSERT(board!=NULL); // probe if (UseTable) { Material->read_nb++; key = board->material_key; entry = &Material->table[KEY_INDEX(key)&Material->mask]; if (entry->lock == KEY_LOCK(key)) { // found Material->read_hit++; *info = *entry; return; } } // calculation material_comp_info(info,board); // store if (UseTable) { Material->write_nb++; if (entry->lock == 0) { // HACK: assume free entry Material->used++; } else { Material->write_collision++; } *entry = *info; entry->lock = KEY_LOCK(key); } } // material_comp_info() static void material_comp_info(material_info_t * info, const board_t * board) { int wp, wn, wb, wr, wq; int bp, bn, bb, br, bq; int wt, bt; int wm, bm; int colour; int recog; int flags; int cflags[ColourNb]; int mul[ColourNb]; int phase; int opening, endgame; ASSERT(info!=NULL); ASSERT(board!=NULL); // init wp = board->number[WhitePawn12]; wn = board->number[WhiteKnight12]; wb = board->number[WhiteBishop12]; wr = board->number[WhiteRook12]; wq = board->number[WhiteQueen12]; bp = board->number[BlackPawn12]; bn = board->number[BlackKnight12]; bb = board->number[BlackBishop12]; br = board->number[BlackRook12]; bq = board->number[BlackQueen12]; wt = wq + wr + wb + wn + wp; // no king bt = bq + br + bb + bn + bp; // no king wm = wb + wn; bm = bb + bn; // recogniser recog = MAT_NONE; if (false) { } else if (wt == 0 && bt == 0) { recog = MAT_KK; } else if (wt == 1 && bt == 0) { if (wb == 1) recog = MAT_KBK; if (wn == 1) recog = MAT_KNK; if (wp == 1) recog = MAT_KPK; } else if (wt == 0 && bt == 1) { if (bb == 1) recog = MAT_KKB; if (bn == 1) recog = MAT_KKN; if (bp == 1) recog = MAT_KKP; } else if (wt == 1 && bt == 1) { if (wq == 1 && bq == 1) recog = MAT_KQKQ; if (wq == 1 && bp == 1) recog = MAT_KQKP; if (wp == 1 && bq == 1) recog = MAT_KPKQ; if (wr == 1 && br == 1) recog = MAT_KRKR; if (wr == 1 && bp == 1) recog = MAT_KRKP; if (wp == 1 && br == 1) recog = MAT_KPKR; if (wb == 1 && bb == 1) recog = MAT_KBKB; if (wb == 1 && bp == 1) recog = MAT_KBKP; if (wp == 1 && bb == 1) recog = MAT_KPKB; if (wn == 1 && bn == 1) recog = MAT_KNKN; if (wn == 1 && bp == 1) recog = MAT_KNKP; if (wp == 1 && bn == 1) recog = MAT_KPKN; } else if (wt == 2 && bt == 0) { if (wb == 1 && wp == 1) recog = MAT_KBPK; if (wn == 1 && wp == 1) recog = MAT_KNPK; } else if (wt == 0 && bt == 2) { if (bb == 1 && bp == 1) recog = MAT_KKBP; if (bn == 1 && bp == 1) recog = MAT_KKNP; } else if (wt == 2 && bt == 1) { if (wr == 1 && wp == 1 && br == 1) recog = MAT_KRPKR; if (wb == 1 && wp == 1 && bb == 1) recog = MAT_KBPKB; } else if (wt == 1 && bt == 2) { if (wr == 1 && br == 1 && bp == 1) recog = MAT_KRKRP; if (wb == 1 && bb == 1 && bp == 1) recog = MAT_KBKBP; } // draw node (exact-draw recogniser) flags = 0; // TODO: MOVE ME for (colour = 0; colour < ColourNb; colour++) cflags[colour] = 0; if (wq+wr+wp == 0 && bq+br+bp == 0) { // no major piece or pawn if (wm + bm <= 1 // at most one minor => KK, KBK or KNK || recog == MAT_KBKB) { flags |= DrawNodeFlag; } } else if (recog == MAT_KPK || recog == MAT_KKP || recog == MAT_KBPK || recog == MAT_KKBP) { flags |= DrawNodeFlag; } // bishop endgame if (wq+wr+wn == 0 && bq+br+bn == 0) { // only bishops if (wb == 1 && bb == 1) { if (wp-bp >= -2 && wp-bp <= +2) { // pawn diff <= 2 flags |= DrawBishopFlag; } } } // multipliers for (colour = 0; colour < ColourNb; colour++) mul[colour] = 16; // 1 // white multiplier if (wp == 0) { // white has no pawns int w_maj = wq * 2 + wr; int w_min = wb + wn; int w_tot = w_maj * 2 + w_min; int b_maj = bq * 2 + br; int b_min = bb + bn; int b_tot = b_maj * 2 + b_min; if (false) { } else if (w_tot == 1) { ASSERT(w_maj==0); ASSERT(w_min==1); // KBK* or KNK*, always insufficient mul[White] = 0; } else if (w_tot == 2 && wn == 2) { ASSERT(w_maj==0); ASSERT(w_min==2); // KNNK*, usually insufficient if (b_tot != 0 || bp == 0) { mul[White] = 0; } else { // KNNKP+, might not be draw mul[White] = 1; // 1/16 } } else if (w_tot == 2 && wb == 2 && b_tot == 1 && bn == 1) { ASSERT(w_maj==0); ASSERT(w_min==2); ASSERT(b_maj==0); ASSERT(b_min==1); // KBBKN*, barely drawish (not at all?) mul[White] = 8; // 1/2 } else if (w_tot-b_tot <= 1 && w_maj <= 2) { // no more than 1 minor up, drawish mul[White] = 2; // 1/8 } } else if (wp == 1) { // white has one pawn int w_maj = wq * 2 + wr; int w_min = wb + wn; int w_tot = w_maj * 2 + w_min; int b_maj = bq * 2 + br; int b_min = bb + bn; int b_tot = b_maj * 2 + b_min; if (false) { } else if (b_min != 0) { // assume black sacrifices a minor against the lone pawn b_min--; b_tot--; if (false) { } else if (w_tot == 1) { ASSERT(w_maj==0); ASSERT(w_min==1); // KBK* or KNK*, always insufficient mul[White] = 4; // 1/4 } else if (w_tot == 2 && wn == 2) { ASSERT(w_maj==0); ASSERT(w_min==2); // KNNK*, usually insufficient mul[White] = 4; // 1/4 } else if (w_tot-b_tot <= 1 && w_maj <= 2) { // no more than 1 minor up, drawish mul[White] = 8; // 1/2 } } else if (br != 0) { // assume black sacrifices a rook against the lone pawn b_maj--; b_tot -= 2; if (false) { } else if (w_tot == 1) { ASSERT(w_maj==0); ASSERT(w_min==1); // KBK* or KNK*, always insufficient mul[White] = 4; // 1/4 } else if (w_tot == 2 && wn == 2) { ASSERT(w_maj==0); ASSERT(w_min==2); // KNNK*, usually insufficient mul[White] = 4; // 1/4 } else if (w_tot-b_tot <= 1 && w_maj <= 2) { // no more than 1 minor up, drawish mul[White] = 8; // 1/2 } } } // black multiplier if (bp == 0) { // black has no pawns int w_maj = wq * 2 + wr; int w_min = wb + wn; int w_tot = w_maj * 2 + w_min; int b_maj = bq * 2 + br; int b_min = bb + bn; int b_tot = b_maj * 2 + b_min; if (false) { } else if (b_tot == 1) { ASSERT(b_maj==0); ASSERT(b_min==1); // KBK* or KNK*, always insufficient mul[Black] = 0; } else if (b_tot == 2 && bn == 2) { ASSERT(b_maj==0); ASSERT(b_min==2); // KNNK*, usually insufficient if (w_tot != 0 || wp == 0) { mul[Black] = 0; } else { // KNNKP+, might not be draw mul[Black] = 1; // 1/16 } } else if (b_tot == 2 && bb == 2 && w_tot == 1 && wn == 1) { ASSERT(b_maj==0); ASSERT(b_min==2); ASSERT(w_maj==0); ASSERT(w_min==1); // KBBKN*, barely drawish (not at all?) mul[Black] = 8; // 1/2 } else if (b_tot-w_tot <= 1 && b_maj <= 2) { // no more than 1 minor up, drawish mul[Black] = 2; // 1/8 } } else if (bp == 1) { // black has one pawn int w_maj = wq * 2 + wr; int w_min = wb + wn; int w_tot = w_maj * 2 + w_min; int b_maj = bq * 2 + br; int b_min = bb + bn; int b_tot = b_maj * 2 + b_min; if (false) { } else if (w_min != 0) { // assume white sacrifices a minor against the lone pawn w_min--; w_tot--; if (false) { } else if (b_tot == 1) { ASSERT(b_maj==0); ASSERT(b_min==1); // KBK* or KNK*, always insufficient mul[Black] = 4; // 1/4 } else if (b_tot == 2 && bn == 2) { ASSERT(b_maj==0); ASSERT(b_min==2); // KNNK*, usually insufficient mul[Black] = 4; // 1/4 } else if (b_tot-w_tot <= 1 && b_maj <= 2) { // no more than 1 minor up, drawish mul[Black] = 8; // 1/2 } } else if (wr != 0) { // assume white sacrifices a rook against the lone pawn w_maj--; w_tot -= 2; if (false) { } else if (b_tot == 1) { ASSERT(b_maj==0); ASSERT(b_min==1); // KBK* or KNK*, always insufficient mul[Black] = 4; // 1/4 } else if (b_tot == 2 && bn == 2) { ASSERT(b_maj==0); ASSERT(b_min==2); // KNNK*, usually insufficient mul[Black] = 4; // 1/4 } else if (b_tot-w_tot <= 1 && b_maj <= 2) { // no more than 1 minor up, drawish mul[Black] = 8; // 1/2 } } } // potential draw for white if (wt == wb+wp && wp >= 1) cflags[White] |= MatRookPawnFlag; if (wt == wb+wp && wb <= 1 && wp >= 1 && bt > bp) cflags[White] |= MatBishopFlag; if (wt == 2 && wn == 1 && wp == 1 && bt > bp) cflags[White] |= MatKnightFlag; // potential draw for black if (bt == bb+bp && bp >= 1) cflags[Black] |= MatRookPawnFlag; if (bt == bb+bp && bb <= 1 && bp >= 1 && wt > wp) cflags[Black] |= MatBishopFlag; if (bt == 2 && bn == 1 && bp == 1 && wt > wp) cflags[Black] |= MatKnightFlag; // draw leaf (likely draw) if (recog == MAT_KQKQ || recog == MAT_KRKR) { mul[White] = 0; mul[Black] = 0; } // king safety if (bq >= 1 && bq+br+bb+bn >= 2) cflags[White] |= MatKingFlag; if (wq >= 1 && wq+wr+wb+wn >= 2) cflags[Black] |= MatKingFlag; // phase (0: opening -> 256: endgame) phase = TotalPhase; phase -= wp * PawnPhase; phase -= wn * KnightPhase; phase -= wb * BishopPhase; phase -= wr * RookPhase; phase -= wq * QueenPhase; phase -= bp * PawnPhase; phase -= bn * KnightPhase; phase -= bb * BishopPhase; phase -= br * RookPhase; phase -= bq * QueenPhase; if (phase < 0) phase = 0; ASSERT(phase>=0&&phase<=TotalPhase); phase = (phase * 256 + (TotalPhase / 2)) / TotalPhase; ASSERT(phase>=0&&phase<=256); // material opening = 0; endgame = 0; opening += wp * PawnOpening; opening += wn * KnightOpening; opening += wb * BishopOpening; opening += wr * RookOpening; opening += wq * QueenOpening; opening -= bp * PawnOpening; opening -= bn * KnightOpening; opening -= bb * BishopOpening; opening -= br * RookOpening; opening -= bq * QueenOpening; endgame += wp * PawnEndgame; endgame += wn * KnightEndgame; endgame += wb * BishopEndgame; endgame += wr * RookEndgame; endgame += wq * QueenEndgame; endgame -= bp * PawnEndgame; endgame -= bn * KnightEndgame; endgame -= bb * BishopEndgame; endgame -= br * RookEndgame; endgame -= bq * QueenEndgame; // bishop pair if (wb >= 2) { // HACK: assumes different colours opening += BishopPairOpening; endgame += BishopPairEndgame; } if (bb >= 2) { // HACK: assumes different colours opening -= BishopPairOpening; endgame -= BishopPairEndgame; } // store info info->recog = recog; info->flags = flags; for (colour = 0; colour < ColourNb; colour++) info->cflags[colour] = cflags[colour]; for (colour = 0; colour < ColourNb; colour++) info->mul[colour] = mul[colour]; info->phase = phase; info->opening = (opening * MaterialWeight) / 256; info->endgame = (endgame * MaterialWeight) / 256; } } // namespace engine // end of material.cpp gnuchess-6.2.2/src/engine/material.h000644 000766 000024 00000003611 11517375750 020172 0ustar00antoniostaff000000 000000 /* material.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // material.h #ifndef MATERIAL_H #define MATERIAL_H // includes #include "board.h" #include "colour.h" #include "util.h" namespace engine { // constants enum mat_dummy_t { MAT_NONE, MAT_KK, MAT_KBK, MAT_KKB, MAT_KNK, MAT_KKN, MAT_KPK, MAT_KKP, MAT_KQKQ, MAT_KQKP, MAT_KPKQ, MAT_KRKR, MAT_KRKP, MAT_KPKR, MAT_KBKB, MAT_KBKP, MAT_KPKB, MAT_KBPK, MAT_KKBP, MAT_KNKN, MAT_KNKP, MAT_KPKN, MAT_KNPK, MAT_KKNP, MAT_KRPKR, MAT_KRKRP, MAT_KBPKB, MAT_KBKBP, MAT_NB }; const int DrawNodeFlag = 1 << 0; const int DrawBishopFlag = 1 << 1; const int MatRookPawnFlag = 1 << 0; const int MatBishopFlag = 1 << 1; const int MatKnightFlag = 1 << 2; const int MatKingFlag = 1 << 3; // types struct material_info_t { uint32 lock; uint8 recog; uint8 flags; uint8 cflags[ColourNb]; uint8 mul[ColourNb]; sint16 phase; sint16 opening; sint16 endgame; }; // functions extern void material_init (); extern void material_alloc (); extern void material_clear (); extern void material_get_info (material_info_t * info, const board_t * board); } // namespace engine #endif // !defined MATERIAL_H // end of material.h gnuchess-6.2.2/src/engine/move.cpp000644 000766 000024 00000011032 12360471573 017666 0ustar00antoniostaff000000 000000 /* move.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // move.cpp // includes #include #include #include "attack.h" #include "colour.h" #include "list.h" #include "move.h" #include "move_do.h" #include "move_gen.h" #include "piece.h" #include "square.h" #include "util.h" namespace engine { // constants static const int PromotePiece[4] = { Knight64, Bishop64, Rook64, Queen64 }; // functions // move_is_ok() bool move_is_ok(int move) { if (move < 0 || move >= 65536) return false; if (move == MoveNone) return false; if (move == MoveNull) return false; return true; } // move_promote() int move_promote(int move) { int code, piece; ASSERT(move_is_ok(move)); ASSERT(MOVE_IS_PROMOTE(move)); code = (move >> 12) & 3; piece = PromotePiece[code]; if (SQUARE_RANK(MOVE_TO(move)) == Rank8) { piece |= WhiteFlag; } else { ASSERT(SQUARE_RANK(MOVE_TO(move))==Rank1); piece |= BlackFlag; } ASSERT(piece_is_ok(piece)); return piece; } // move_order() int move_order(int move) { ASSERT(move_is_ok(move)); return ((move & 07777) << 2) | ((move >> 12) & 3); } // move_is_capture() bool move_is_capture(int move, const board_t * board) { ASSERT(move_is_ok(move)); ASSERT(board!=NULL); return MOVE_IS_EN_PASSANT(move) || board->square[MOVE_TO(move)] != Empty; } // move_is_under_promote() bool move_is_under_promote(int move) { ASSERT(move_is_ok(move)); return MOVE_IS_PROMOTE(move) && (move & MoveAllFlags) != MovePromoteQueen; } // move_is_tactical() bool move_is_tactical(int move, const board_t * board) { ASSERT(move_is_ok(move)); ASSERT(board!=NULL); return (move & (1 << 15)) != 0 || board->square[MOVE_TO(move)] != Empty; // HACK } // move_capture() int move_capture(int move, const board_t * board) { ASSERT(move_is_ok(move)); ASSERT(board!=NULL); if (MOVE_IS_EN_PASSANT(move)) { return PAWN_OPP(board->square[MOVE_FROM(move)]); } return board->square[MOVE_TO(move)]; } // move_to_string() bool move_to_string(int move, char string[], int size) { ASSERT(move==MoveNull||move_is_ok(move)); ASSERT(string!=NULL); ASSERT(size>=6); if (size < 6) return false; // null move if (move == MoveNull) { strcpy(string,NullMoveString); return true; } // normal moves square_to_string(MOVE_FROM(move),&string[0],3); square_to_string(MOVE_TO(move),&string[2],3); ASSERT(strlen(string)==4); // promotes if (MOVE_IS_PROMOTE(move)) { string[4] = tolower(piece_to_char(move_promote(move))); string[5] = '\0'; } return true; } // move_from_string() int move_from_string(const char string[], const board_t * board) { char tmp_string[3]; int from, to; int move; int piece, delta; ASSERT(string!=NULL); ASSERT(board!=NULL); // from tmp_string[0] = string[0]; tmp_string[1] = string[1]; tmp_string[2] = '\0'; from = square_from_string(tmp_string); if (from == SquareNone) return MoveNone; // to tmp_string[0] = string[2]; tmp_string[1] = string[3]; tmp_string[2] = '\0'; to = square_from_string(tmp_string); if (to == SquareNone) return MoveNone; move = MOVE_MAKE(from,to); // promote switch (string[4]) { case '\0': // not a promotion break; case 'n': move |= MovePromoteKnight; break; case 'b': move |= MovePromoteBishop; break; case 'r': move |= MovePromoteRook; break; case 'q': move |= MovePromoteQueen; break; default: return MoveNone; } // flags piece = board->square[from]; if (PIECE_IS_PAWN(piece)) { if (to == board->ep_square) move |= MoveEnPassant; } else if (PIECE_IS_KING(piece)) { delta = to - from; if (delta == +2 || delta == -2) move |= MoveCastle; } return move; } } // namespace engine // end of move.cpp gnuchess-6.2.2/src/engine/move.h000644 000766 000024 00000005425 11517375750 017347 0ustar00antoniostaff000000 000000 /* move.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // move.h #ifndef MOVE_H #define MOVE_H // includes #include "board.h" #include "util.h" namespace engine { // constants const int MoveNone = 0; // HACK: a1a1 cannot be a legal move const int MoveNull = 11; // HACK: a1d2 cannot be a legal move const int MoveNormal = 0 << 14; const int MoveCastle = 1 << 14; const int MovePromote = 2 << 14; const int MoveEnPassant = 3 << 14; const int MoveFlags = 3 << 14; const int MovePromoteKnight = MovePromote | (0 << 12); const int MovePromoteBishop = MovePromote | (1 << 12); const int MovePromoteRook = MovePromote | (2 << 12); const int MovePromoteQueen = MovePromote | (3 << 12); const int MoveAllFlags = 0xF << 12; const char NullMoveString[] = "null"; // "0000" in UCI // macros #define MOVE_MAKE(from,to) ((SQUARE_TO_64(from)<<6)|SQUARE_TO_64(to)) #define MOVE_MAKE_FLAGS(from,to,flags) ((SQUARE_TO_64(from)<<6)|SQUARE_TO_64(to)|(flags)) #define MOVE_FROM(move) (SQUARE_FROM_64(((move)>>6)&077)) #define MOVE_TO(move) (SQUARE_FROM_64((move)&077)) #define MOVE_IS_SPECIAL(move) (((move)&MoveFlags)!=MoveNormal) #define MOVE_IS_PROMOTE(move) (((move)&MoveFlags)==MovePromote) #define MOVE_IS_EN_PASSANT(move) (((move)&MoveFlags)==MoveEnPassant) #define MOVE_IS_CASTLE(move) (((move)&MoveFlags)==MoveCastle) #define MOVE_PIECE(move,board) ((board)->square[MOVE_FROM(move)]) // types typedef uint16 mv_t; // functions extern bool move_is_ok (int move); extern int move_promote (int move); extern int move_order (int move); extern bool move_is_capture (int move, const board_t * board); extern bool move_is_under_promote (int move); extern bool move_is_tactical (int move, const board_t * board); extern int move_capture (int move, const board_t * board); extern bool move_to_string (int move, char string[], int size); extern int move_from_string (const char string[], const board_t * board); } // namespace engine #endif // !defined MOVE_H // end of move.h gnuchess-6.2.2/src/engine/move_check.cpp000644 000766 000024 00000022573 11517375750 021042 0ustar00antoniostaff000000 000000 /* move_check.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // move_check.cpp // includes #include "attack.h" #include "colour.h" #include "fen.h" #include "list.h" #include "move.h" #include "move_check.h" #include "move_do.h" #include "move_gen.h" #include "piece.h" #include "square.h" #include "util.h" namespace engine { // prototypes static void add_quiet_checks (list_t * list, const board_t * board); static void add_castle_checks (list_t * list, board_t * board); static void add_check (list_t * list, int move, board_t * board); static void find_pins (int list[], const board_t * board); // functions // gen_quiet_checks() void gen_quiet_checks(list_t * list, board_t * board) { ASSERT(list!=NULL); ASSERT(board!=NULL); ASSERT(!board_is_check(board)); LIST_CLEAR(list); add_quiet_checks(list,board); add_castle_checks(list,board); // debug ASSERT(list_is_ok(list)); } // add_quiet_checks() static void add_quiet_checks(list_t * list, const board_t * board) { int me, opp; int king; const sq_t * ptr, * ptr_2; int from, to, sq; int piece; const inc_t * inc_ptr; int inc; int pawn; int rank; int pin[8+1]; ASSERT(list!=NULL); ASSERT(board!=NULL); // init me = board->turn; opp = COLOUR_OPP(me); king = KING_POS(board,opp); find_pins(pin,board); // indirect checks for (ptr = pin; (from=*ptr) != SquareNone; ptr++) { piece = board->square[from]; ASSERT(is_pinned(board,from,opp)); if (PIECE_IS_PAWN(piece)) { inc = PAWN_MOVE_INC(me); rank = PAWN_RANK(from,me); if (rank != Rank7) { // promotes are generated with captures to = from + inc; if (board->square[to] == Empty) { if (DELTA_INC_LINE(to-king) != DELTA_INC_LINE(from-king)) { ASSERT(!SQUARE_IS_PROMOTE(to)); LIST_ADD(list,MOVE_MAKE(from,to)); if (rank == Rank2) { to = from + (2*inc); if (board->square[to] == Empty) { ASSERT(DELTA_INC_LINE(to-king)!=DELTA_INC_LINE(from-king)); ASSERT(!SQUARE_IS_PROMOTE(to)); LIST_ADD(list,MOVE_MAKE(from,to)); } } } } } } else if (PIECE_IS_SLIDER(piece)) { for (inc_ptr = PIECE_INC(piece); (inc=*inc_ptr) != IncNone; inc_ptr++) { for (to = from+inc; board->square[to] == Empty; to += inc) { ASSERT(DELTA_INC_LINE(to-king)!=DELTA_INC_LINE(from-king)); LIST_ADD(list,MOVE_MAKE(from,to)); } } } else { for (inc_ptr = PIECE_INC(piece); (inc=*inc_ptr) != IncNone; inc_ptr++) { to = from + inc; if (board->square[to] == Empty) { if (DELTA_INC_LINE(to-king) != DELTA_INC_LINE(from-king)) { LIST_ADD(list,MOVE_MAKE(from,to)); } } } } } // piece direct checks for (ptr = &board->piece[me][1]; (from=*ptr) != SquareNone; ptr++) { // HACK: no king for (ptr_2 = pin; (sq=*ptr_2) != SquareNone; ptr_2++) { if (sq == from) goto next_piece; } ASSERT(!is_pinned(board,from,opp)); piece = board->square[from]; inc_ptr = PIECE_INC(piece); if (PIECE_IS_SLIDER(piece)) { for (; (inc=*inc_ptr) != IncNone; inc_ptr++) { for (to = from+inc; board->square[to] == Empty; to += inc) { if (PIECE_ATTACK(board,piece,to,king)) { LIST_ADD(list,MOVE_MAKE(from,to)); } } } } else { for (; (inc=*inc_ptr) != IncNone; inc_ptr++) { to = from + inc; if (board->square[to] == Empty) { if (PSEUDO_ATTACK(piece,king-to)) { LIST_ADD(list,MOVE_MAKE(from,to)); } } } } next_piece: ; } // pawn direct checks inc = PAWN_MOVE_INC(me); pawn = PAWN_MAKE(me); to = king - (inc-1); ASSERT(PSEUDO_ATTACK(pawn,king-to)); from = to - inc; if (board->square[from] == pawn) { if (board->square[to] == Empty) { ASSERT(!SQUARE_IS_PROMOTE(to)); LIST_ADD(list,MOVE_MAKE(from,to)); } } else { from = to - (2*inc); if (board->square[from] == pawn) { if (PAWN_RANK(from,me) == Rank2 && board->square[to] == Empty && board->square[from+inc] == Empty) { ASSERT(!SQUARE_IS_PROMOTE(to)); LIST_ADD(list,MOVE_MAKE(from,to)); } } } to = king - (inc+1); ASSERT(PSEUDO_ATTACK(pawn,king-to)); from = to - inc; if (board->square[from] == pawn) { if (board->square[to] == Empty) { ASSERT(!SQUARE_IS_PROMOTE(to)); LIST_ADD(list,MOVE_MAKE(from,to)); } } else { from = to - (2*inc); if (board->square[from] == pawn) { if (PAWN_RANK(from,me) == Rank2 && board->square[to] == Empty && board->square[from+inc] == Empty) { ASSERT(!SQUARE_IS_PROMOTE(to)); LIST_ADD(list,MOVE_MAKE(from,to)); } } } } // add_castle_checks() static void add_castle_checks(list_t * list, board_t * board) { ASSERT(list!=NULL); ASSERT(board!=NULL); ASSERT(!board_is_check(board)); if (COLOUR_IS_WHITE(board->turn)) { if ((board->flags & FlagsWhiteKingCastle) != 0 && board->square[F1] == Empty && board->square[G1] == Empty && !is_attacked(board,F1,Black)) { add_check(list,MOVE_MAKE_FLAGS(E1,G1,MoveCastle),board); } if ((board->flags & FlagsWhiteQueenCastle) != 0 && board->square[D1] == Empty && board->square[C1] == Empty && board->square[B1] == Empty && !is_attacked(board,D1,Black)) { add_check(list,MOVE_MAKE_FLAGS(E1,C1,MoveCastle),board); } } else { // black if ((board->flags & FlagsBlackKingCastle) != 0 && board->square[F8] == Empty && board->square[G8] == Empty && !is_attacked(board,F8,White)) { add_check(list,MOVE_MAKE_FLAGS(E8,G8,MoveCastle),board); } if ((board->flags & FlagsBlackQueenCastle) != 0 && board->square[D8] == Empty && board->square[C8] == Empty && board->square[B8] == Empty && !is_attacked(board,D8,White)) { add_check(list,MOVE_MAKE_FLAGS(E8,C8,MoveCastle),board); } } } // add_check() static void add_check(list_t * list, int move, board_t * board) { undo_t undo[1]; ASSERT(list!=NULL); ASSERT(move_is_ok(move)); ASSERT(board!=NULL); move_do(board,move,undo); if (IS_IN_CHECK(board,board->turn)) LIST_ADD(list,move); move_undo(board,move,undo); } // move_is_check() bool move_is_check(int move, board_t * board) { undo_t undo[1]; bool check; int me, opp, king; int from, to, piece; ASSERT(move_is_ok(move)); ASSERT(board!=NULL); // slow test for complex moves if (MOVE_IS_SPECIAL(move)) { move_do(board,move,undo); check = IS_IN_CHECK(board,board->turn); move_undo(board,move,undo); return check; } // init me = board->turn; opp = COLOUR_OPP(me); king = KING_POS(board,opp); from = MOVE_FROM(move); to = MOVE_TO(move); piece = board->square[from]; ASSERT(COLOUR_IS(piece,me)); // direct check if (PIECE_ATTACK(board,piece,to,king)) return true; // indirect check if (is_pinned(board,from,opp) && DELTA_INC_LINE(king-to) != DELTA_INC_LINE(king-from)) { return true; } return false; } // find_pins() static void find_pins(int list[], const board_t * board) { int me, opp; int king; const sq_t * ptr; int from; int piece; int delta; int inc; int sq; int capture; int pin; ASSERT(list!=NULL); ASSERT(board!=NULL); // init me = board->turn; opp = COLOUR_OPP(me); king = KING_POS(board,opp); for (ptr = &board->piece[me][1]; (from=*ptr) != SquareNone; ptr++) { // HACK: no king piece = board->square[from]; delta = king - from; ASSERT(delta_is_ok(delta)); if (PSEUDO_ATTACK(piece,delta)) { ASSERT(PIECE_IS_SLIDER(piece)); inc = DELTA_INC_LINE(delta); ASSERT(inc!=IncNone); ASSERT(SLIDER_ATTACK(piece,inc)); sq = from; do sq += inc; while ((capture=board->square[sq]) == Empty); ASSERT(sq!=king); if (COLOUR_IS(capture,me)) { pin = sq; do sq += inc; while (board->square[sq] == Empty); if (sq == king) *list++ = pin; } } } *list = SquareNone; } } // namespace engine // end of move_check.cpp gnuchess-6.2.2/src/engine/move_check.h000644 000766 000024 00000002127 11517375750 020500 0ustar00antoniostaff000000 000000 /* move_check.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // move_check.h #ifndef MOVE_CHECK_H #define MOVE_CHECK_H // includes #include "board.h" #include "list.h" #include "util.h" namespace engine { // functions extern void gen_quiet_checks (list_t * list, board_t * board); extern bool move_is_check (int move, board_t * board); } // namespace engine #endif // !defined MOVE_CHECK_H // end of move_check.h gnuchess-6.2.2/src/engine/move_do.cpp000644 000766 000024 00000036143 11517375750 020365 0ustar00antoniostaff000000 000000 /* move_do.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // move_do.cpp // includes #include "attack.h" #include "board.h" #include "colour.h" #include "hash.h" #include "move.h" #include "move_do.h" #include "pawn.h" // TODO: bit.h #include "piece.h" #include "pst.h" #include "random.h" #include "util.h" #include "value.h" namespace engine { // variables static int CastleMask[SquareNb]; // prototypes static void square_clear (board_t * board, int square, int piece, bool update); static void square_set (board_t * board, int square, int piece, int pos, bool update); static void square_move (board_t * board, int from, int to, int piece, bool update); // functions // move_do_init() void move_do_init() { int sq; for (sq = 0; sq < SquareNb; sq++) CastleMask[sq] = 0xF; CastleMask[E1] &= ~FlagsWhiteKingCastle; CastleMask[H1] &= ~FlagsWhiteKingCastle; CastleMask[E1] &= ~FlagsWhiteQueenCastle; CastleMask[A1] &= ~FlagsWhiteQueenCastle; CastleMask[E8] &= ~FlagsBlackKingCastle; CastleMask[H8] &= ~FlagsBlackKingCastle; CastleMask[E8] &= ~FlagsBlackQueenCastle; CastleMask[A8] &= ~FlagsBlackQueenCastle; } // move_do() void move_do(board_t * board, int move, undo_t * undo) { int me, opp; int from, to; int piece, pos, capture; int old_flags, new_flags; int delta; int sq; int pawn, rook; ASSERT(board!=NULL); ASSERT(move_is_ok(move)); ASSERT(undo!=NULL); ASSERT(board_is_legal(board)); // initialise undo undo->capture = false; undo->turn = board->turn; undo->flags = board->flags; undo->ep_square = board->ep_square; undo->ply_nb = board->ply_nb; undo->cap_sq = board->cap_sq; undo->opening = board->opening; undo->endgame = board->endgame; undo->key = board->key; undo->pawn_key = board->pawn_key; undo->material_key = board->material_key; // init me = board->turn; opp = COLOUR_OPP(me); from = MOVE_FROM(move); to = MOVE_TO(move); piece = board->square[from]; ASSERT(COLOUR_IS(piece,me)); // update key stack ASSERT(board->spstack[board->sp++] = board->key; // update turn board->turn = opp; board->key ^= RANDOM_64(RandomTurn); // update castling rights old_flags = board->flags; new_flags = old_flags & CastleMask[from] & CastleMask[to]; board->flags = new_flags; board->key ^= Castle64[new_flags^old_flags]; // HACK // update en-passant square if ((sq=board->ep_square) != SquareNone) { board->key ^= RANDOM_64(RandomEnPassant+SQUARE_FILE(sq)-FileA); board->ep_square = SquareNone; } if (PIECE_IS_PAWN(piece)) { delta = to - from; if (delta == +32 || delta == -32) { pawn = PAWN_MAKE(opp); if (board->square[to-1] == pawn || board->square[to+1] == pawn) { board->ep_square = (from + to) / 2; board->key ^= RANDOM_64(RandomEnPassant+SQUARE_FILE(to)-FileA); } } } // update move number (captures are handled later) board->ply_nb++; if (PIECE_IS_PAWN(piece)) board->ply_nb = 0; // conversion // update last square board->cap_sq = SquareNone; // remove the captured piece sq = to; if (MOVE_IS_EN_PASSANT(move)) sq = SQUARE_EP_DUAL(sq); if ((capture=board->square[sq]) != Empty) { ASSERT(COLOUR_IS(capture,opp)); ASSERT(!PIECE_IS_KING(capture)); undo->capture = true; undo->capture_square = sq; undo->capture_piece = capture; undo->capture_pos = board->pos[sq]; square_clear(board,sq,capture,true); board->ply_nb = 0; // conversion board->cap_sq = to; } // move the piece if (MOVE_IS_PROMOTE(move)) { // promote undo->pawn_pos = board->pos[from]; square_clear(board,from,piece,true); piece = move_promote(move); // insert the promote piece in MV order for (pos = board->piece_size[me]; pos > 0 && piece > board->square[board->piece[me][pos-1]]; pos--) // HACK ; square_set(board,to,piece,pos,true); board->cap_sq = to; } else { // normal move square_move(board,from,to,piece,true); } // move the rook in case of castling if (MOVE_IS_CASTLE(move)) { rook = Rook64 | COLOUR_FLAG(me); // HACK if (to == G1) { square_move(board,H1,F1,rook,true); } else if (to == C1) { square_move(board,A1,D1,rook,true); } else if (to == G8) { square_move(board,H8,F8,rook,true); } else if (to == C8) { square_move(board,A8,D8,rook,true); } else { ASSERT(false); } } // debug ASSERT(board_is_ok(board)); } // move_undo() void move_undo(board_t * board, int move, const undo_t * undo) { int me; int from, to; int piece, pos; int rook; ASSERT(board!=NULL); ASSERT(move_is_ok(move)); ASSERT(undo!=NULL); // init me = undo->turn; from = MOVE_FROM(move); to = MOVE_TO(move); piece = board->square[to]; ASSERT(COLOUR_IS(piece,me)); // castle if (MOVE_IS_CASTLE(move)) { rook = Rook64 | COLOUR_FLAG(me); // HACK if (to == G1) { square_move(board,F1,H1,rook,false); } else if (to == C1) { square_move(board,D1,A1,rook,false); } else if (to == G8) { square_move(board,F8,H8,rook,false); } else if (to == C8) { square_move(board,D8,A8,rook,false); } else { ASSERT(false); } } // move the piece backward if (MOVE_IS_PROMOTE(move)) { // promote ASSERT(piece==move_promote(move)); square_clear(board,to,piece,false); piece = PAWN_MAKE(me); pos = undo->pawn_pos; square_set(board,from,piece,pos,false); } else { // normal move square_move(board,to,from,piece,false); } // put the captured piece back if (undo->capture) { square_set(board,undo->capture_square,undo->capture_piece,undo->capture_pos,false); } // update board info board->turn = undo->turn; board->flags = undo->flags; board->ep_square = undo->ep_square; board->ply_nb = undo->ply_nb; board->cap_sq = undo->cap_sq; board->opening = undo->opening; board->endgame = undo->endgame; board->key = undo->key; board->pawn_key = undo->pawn_key; board->material_key = undo->material_key; // update key stack ASSERT(board->sp>0); board->sp--; // debug ASSERT(board_is_ok(board)); ASSERT(board_is_legal(board)); } // move_do_null() void move_do_null(board_t * board, undo_t * undo) { int sq; ASSERT(board!=NULL); ASSERT(undo!=NULL); ASSERT(board_is_legal(board)); ASSERT(!board_is_check(board)); // initialise undo undo->turn = board->turn; undo->ep_square = board->ep_square; undo->ply_nb = board->ply_nb; undo->cap_sq = board->cap_sq; undo->key = board->key; // update key stack ASSERT(board->spstack[board->sp++] = board->key; // update turn board->turn = COLOUR_OPP(board->turn); board->key ^= RANDOM_64(RandomTurn); // update en-passant square sq = board->ep_square; if (sq != SquareNone) { board->key ^= RANDOM_64(RandomEnPassant+SQUARE_FILE(sq)-FileA); board->ep_square = SquareNone; } // update move number board->ply_nb = 0; // HACK: null move is considered as a conversion // update last square board->cap_sq = SquareNone; // debug ASSERT(board_is_ok(board)); } // move_undo_null() void move_undo_null(board_t * board, const undo_t * undo) { ASSERT(board!=NULL); ASSERT(undo!=NULL); ASSERT(board_is_legal(board)); ASSERT(!board_is_check(board)); // update board info board->turn = undo->turn; board->ep_square = undo->ep_square; board->ply_nb = undo->ply_nb; board->cap_sq = undo->cap_sq; board->key = undo->key; // update key stack ASSERT(board->sp>0); board->sp--; // debug ASSERT(board_is_ok(board)); } // square_clear() static void square_clear(board_t * board, int square, int piece, bool update) { int pos, piece_12, colour; int sq; int i, size; int sq_64; uint64 hash_xor; ASSERT(board!=NULL); ASSERT(SQUARE_IS_OK(square)); ASSERT(piece_is_ok(piece)); ASSERT(update==true||update==false); // init pos = board->pos[square]; ASSERT(pos>=0); piece_12 = PIECE_TO_12(piece); colour = PIECE_COLOUR(piece); // square ASSERT(board->square[square]==piece); board->square[square] = Empty; // piece list if (!PIECE_IS_PAWN(piece)) { // init size = board->piece_size[colour]; ASSERT(size>=1); // stable swap ASSERT(pos>=0&&pospos[square]==pos); board->pos[square] = -1; for (i = pos; i < size-1; i++) { sq = board->piece[colour][i+1]; board->piece[colour][i] = sq; ASSERT(board->pos[sq]==i+1); board->pos[sq] = i; } // size size--; board->piece[colour][size] = SquareNone; board->piece_size[colour] = size; } else { // init size = board->pawn_size[colour]; ASSERT(size>=1); // stable swap ASSERT(pos>=0&&pospos[square]==pos); board->pos[square] = -1; for (i = pos; i < size-1; i++) { sq = board->pawn[colour][i+1]; board->pawn[colour][i] = sq; ASSERT(board->pos[sq]==i+1); board->pos[sq] = i; } // size size--; board->pawn[colour][size] = SquareNone; board->pawn_size[colour] = size; // pawn "bitboard" board->pawn_file[colour][SQUARE_FILE(square)] ^= BIT(PAWN_RANK(square,colour)); } // material ASSERT(board->piece_nb>0); board->piece_nb--; ASSERT(board->number[piece_12]>0); board->number[piece_12]--; // update if (update) { // init sq_64 = SQUARE_TO_64(square); // PST board->opening -= PST(piece_12,sq_64,Opening); board->endgame -= PST(piece_12,sq_64,Endgame); // hash key hash_xor = RANDOM_64(RandomPiece+(piece_12^1)*64+sq_64); // HACK: ^1 for PolyGlot book board->key ^= hash_xor; if (PIECE_IS_PAWN(piece)) board->pawn_key ^= hash_xor; // material key board->material_key ^= RANDOM_64(piece_12*16+board->number[piece_12]); } } // square_set() static void square_set(board_t * board, int square, int piece, int pos, bool update) { int piece_12, colour; int sq; int i, size; int sq_64; uint64 hash_xor; ASSERT(board!=NULL); ASSERT(SQUARE_IS_OK(square)); ASSERT(piece_is_ok(piece)); ASSERT(pos>=0); ASSERT(update==true||update==false); // init piece_12 = PIECE_TO_12(piece); colour = PIECE_COLOUR(piece); // square ASSERT(board->square[square]==Empty); board->square[square] = piece; // piece list if (!PIECE_IS_PAWN(piece)) { // init size = board->piece_size[colour]; ASSERT(size>=0); // size size++; board->piece[colour][size] = SquareNone; board->piece_size[colour] = size; // stable swap ASSERT(pos>=0&&pos pos; i--) { sq = board->piece[colour][i-1]; board->piece[colour][i] = sq; ASSERT(board->pos[sq]==i-1); board->pos[sq] = i; } board->piece[colour][pos] = square; ASSERT(board->pos[square]==-1); board->pos[square] = pos; } else { // init size = board->pawn_size[colour]; ASSERT(size>=0); // size size++; board->pawn[colour][size] = SquareNone; board->pawn_size[colour] = size; // stable swap ASSERT(pos>=0&&pos pos; i--) { sq = board->pawn[colour][i-1]; board->pawn[colour][i] = sq; ASSERT(board->pos[sq]==i-1); board->pos[sq] = i; } board->pawn[colour][pos] = square; ASSERT(board->pos[square]==-1); board->pos[square] = pos; // pawn "bitboard" board->pawn_file[colour][SQUARE_FILE(square)] ^= BIT(PAWN_RANK(square,colour)); } // material ASSERT(board->piece_nb<32); board->piece_nb++;; ASSERT(board->number[piece_12]<9); board->number[piece_12]++; // update if (update) { // init sq_64 = SQUARE_TO_64(square); // PST board->opening += PST(piece_12,sq_64,Opening); board->endgame += PST(piece_12,sq_64,Endgame); // hash key hash_xor = RANDOM_64(RandomPiece+(piece_12^1)*64+sq_64); // HACK: ^1 for PolyGlot book board->key ^= hash_xor; if (PIECE_IS_PAWN(piece)) board->pawn_key ^= hash_xor; // material key board->material_key ^= RANDOM_64(piece_12*16+(board->number[piece_12]-1)); } } // square_move() static void square_move(board_t * board, int from, int to, int piece, bool update) { int colour; int pos; int from_64, to_64; int piece_12; int piece_index; uint64 hash_xor; ASSERT(board!=NULL); ASSERT(SQUARE_IS_OK(from)); ASSERT(SQUARE_IS_OK(to)); ASSERT(piece_is_ok(piece)); ASSERT(update==true||update==false); // init colour = PIECE_COLOUR(piece); pos = board->pos[from]; ASSERT(pos>=0); // from ASSERT(board->square[from]==piece); board->square[from] = Empty; ASSERT(board->pos[from]==pos); board->pos[from] = -1; // not needed // to ASSERT(board->square[to]==Empty); board->square[to] = piece; ASSERT(board->pos[to]==-1); board->pos[to] = pos; // piece list if (!PIECE_IS_PAWN(piece)) { ASSERT(board->piece[colour][pos]==from); board->piece[colour][pos] = to; } else { ASSERT(board->pawn[colour][pos]==from); board->pawn[colour][pos] = to; // pawn "bitboard" board->pawn_file[colour][SQUARE_FILE(from)] ^= BIT(PAWN_RANK(from,colour)); board->pawn_file[colour][SQUARE_FILE(to)] ^= BIT(PAWN_RANK(to,colour)); } // update if (update) { // init from_64 = SQUARE_TO_64(from); to_64 = SQUARE_TO_64(to); piece_12 = PIECE_TO_12(piece); // PST board->opening += PST(piece_12,to_64,Opening) - PST(piece_12,from_64,Opening); board->endgame += PST(piece_12,to_64,Endgame) - PST(piece_12,from_64,Endgame); // hash key piece_index = RandomPiece + (piece_12^1) * 64; // HACK: ^1 for PolyGlot book hash_xor = RANDOM_64(piece_index+to_64) ^ RANDOM_64(piece_index+from_64); board->key ^= hash_xor; if (PIECE_IS_PAWN(piece)) board->pawn_key ^= hash_xor; } } } // namespace engine // end of move_do.cpp gnuchess-6.2.2/src/engine/move_do.h000644 000766 000024 00000003034 11517375750 020023 0ustar00antoniostaff000000 000000 /* move_do.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // move_do.h #ifndef MOVE_DO_H #define MOVE_DO_H // includes #include "board.h" #include "util.h" namespace engine { // types struct undo_t { bool capture; int capture_square; int capture_piece; int capture_pos; int pawn_pos; int turn; int flags; int ep_square; int ply_nb; int cap_sq; int opening; int endgame; uint64 key; uint64 pawn_key; uint64 material_key; }; // functions extern void move_do_init (); extern void move_do (board_t * board, int move, undo_t * undo); extern void move_undo (board_t * board, int move, const undo_t * undo); extern void move_do_null (board_t * board, undo_t * undo); extern void move_undo_null (board_t * board, const undo_t * undo); } // namespace engine #endif // !defined MOVE_DO_H // end of move_do.h gnuchess-6.2.2/src/engine/move_evasion.cpp000644 000766 000024 00000016615 11517375750 021431 0ustar00antoniostaff000000 000000 /* move_evasion.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // move_evasion.cpp // includes #include "attack.h" #include "board.h" #include "colour.h" #include "list.h" #include "move.h" #include "move_evasion.h" #include "move_gen.h" #include "piece.h" #include "util.h" namespace engine { // prototypes static bool gen_evasions (list_t * list, const board_t * board, const attack_t * attack, bool legal, bool stop); static bool add_pawn_moves (list_t * list, const board_t * board, int to, bool legal, bool stop); static bool add_pawn_captures (list_t * list, const board_t * board, int to, bool legal, bool stop); static bool add_piece_moves (list_t * list, const board_t * board, int to, bool legal, bool stop); // functions // gen_legal_evasions() void gen_legal_evasions(list_t * list, const board_t * board, const attack_t * attack) { ASSERT(list!=NULL); ASSERT(board!=NULL); ASSERT(attack!=NULL); gen_evasions(list,board,attack,true,false); // debug ASSERT(list_is_ok(list)); } // gen_pseudo_evasions() void gen_pseudo_evasions(list_t * list, const board_t * board, const attack_t * attack) { ASSERT(list!=NULL); ASSERT(board!=NULL); ASSERT(attack!=NULL); gen_evasions(list,board,attack,false,false); // debug ASSERT(list_is_ok(list)); } // legal_evasion_exist() bool legal_evasion_exist(const board_t * board, const attack_t * attack) { list_t list[1]; // dummy ASSERT(board!=NULL); ASSERT(attack!=NULL); return gen_evasions(list,board,attack,true,true); } // gen_evasions() static bool gen_evasions(list_t * list, const board_t * board, const attack_t * attack, bool legal, bool stop) { int me, opp; int opp_flag; int king; const inc_t * inc_ptr; int inc; int to; int piece; ASSERT(list!=NULL); ASSERT(board!=NULL); ASSERT(attack!=NULL); ASSERT(legal==true||legal==false); ASSERT(stop==true||stop==false); ASSERT(board_is_check(board)); ASSERT(ATTACK_IN_CHECK(attack)); // init LIST_CLEAR(list); me = board->turn; opp = COLOUR_OPP(me); opp_flag = COLOUR_FLAG(opp); king = KING_POS(board,me); for (inc_ptr = KingInc; (inc=*inc_ptr) != IncNone; inc_ptr++) { if (inc != -attack->di[0] && inc != -attack->di[1]) { // avoid escaping along a check line to = king + inc; piece = board->square[to]; if (piece == Empty || FLAG_IS(piece,opp_flag)) { if (!legal || !is_attacked(board,to,opp)) { if (stop) return true; LIST_ADD(list,MOVE_MAKE(king,to)); } } } } if (attack->dn >= 2) return false; // double check, we are done // single check ASSERT(attack->dn==1); // capture the checking piece if (add_pawn_captures(list,board,attack->ds[0],legal,stop) && stop) return true; if (add_piece_moves(list,board,attack->ds[0],legal,stop) && stop) return true; // interpose a piece inc = attack->di[0]; if (inc != IncNone) { // line for (to = king+inc; to != attack->ds[0]; to += inc) { ASSERT(SQUARE_IS_OK(to)); ASSERT(board->square[to]==Empty); if (add_pawn_moves(list,board,to,legal,stop) && stop) return true; if (add_piece_moves(list,board,to,legal,stop) && stop) return true; } } return false; } // add_pawn_moves() static bool add_pawn_moves(list_t * list, const board_t * board, int to, bool legal, bool stop) { int me; int inc; int pawn; int from; int piece; ASSERT(list!=NULL); ASSERT(board!=NULL); ASSERT(SQUARE_IS_OK(to)); ASSERT(legal==true||legal==false); ASSERT(stop==true||stop==false); ASSERT(board->square[to]==Empty); me = board->turn; inc = PAWN_MOVE_INC(me); pawn = PAWN_MAKE(me); from = to - inc; piece = board->square[from]; if (piece == pawn) { // single push if (!legal || !is_pinned(board,from,me)) { if (stop) return true; add_pawn_move(list,from,to); } } else if (piece == Empty && PAWN_RANK(to,me) == Rank4) { // double push from = to - (2*inc); if (board->square[from] == pawn) { if (!legal || !is_pinned(board,from,me)) { if (stop) return true; ASSERT(!SQUARE_IS_PROMOTE(to)); LIST_ADD(list,MOVE_MAKE(from,to)); } } } return false; } // add_pawn_captures() static bool add_pawn_captures(list_t * list, const board_t * board, int to, bool legal, bool stop) { int me; int inc; int pawn; int from; ASSERT(list!=NULL); ASSERT(board!=NULL); ASSERT(SQUARE_IS_OK(to)); ASSERT(legal==true||legal==false); ASSERT(stop==true||stop==false); ASSERT(COLOUR_IS(board->square[to],COLOUR_OPP(board->turn))); me = board->turn; inc = PAWN_MOVE_INC(me); pawn = PAWN_MAKE(me); from = to - (inc-1); if (board->square[from] == pawn) { if (!legal || !is_pinned(board,from,me)) { if (stop) return true; add_pawn_move(list,from,to); } } from = to - (inc+1); if (board->square[from] == pawn) { if (!legal || !is_pinned(board,from,me)) { if (stop) return true; add_pawn_move(list,from,to); } } if (board->ep_square != SquareNone && to == SQUARE_EP_DUAL(board->ep_square)) { ASSERT(PAWN_RANK(to,me)==Rank5); ASSERT(PIECE_IS_PAWN(board->square[to])); to = board->ep_square; ASSERT(PAWN_RANK(to,me)==Rank6); ASSERT(board->square[to]==Empty); from = to - (inc-1); if (board->square[from] == pawn) { if (!legal || !is_pinned(board,from,me)) { if (stop) return true; ASSERT(!SQUARE_IS_PROMOTE(to)); LIST_ADD(list,MOVE_MAKE_FLAGS(from,to,MoveEnPassant)); } } from = to - (inc+1); if (board->square[from] == pawn) { if (!legal || !is_pinned(board,from,me)) { if (stop) return true; ASSERT(!SQUARE_IS_PROMOTE(to)); LIST_ADD(list,MOVE_MAKE_FLAGS(from,to,MoveEnPassant)); } } } return false; } // add_piece_moves() static bool add_piece_moves(list_t * list, const board_t * board, int to, bool legal, bool stop) { int me; const sq_t * ptr; int from, piece; ASSERT(list!=NULL); ASSERT(board!=NULL); ASSERT(SQUARE_IS_OK(to)); ASSERT(legal==true||legal==false); ASSERT(stop==true||stop==false); me = board->turn; for (ptr = &board->piece[me][1]; (from=*ptr) != SquareNone; ptr++) { // HACK: no king piece = board->square[from]; if (PIECE_ATTACK(board,piece,from,to)) { if (!legal || !is_pinned(board,from,me)) { if (stop) return true; LIST_ADD(list,MOVE_MAKE(from,to)); } } } return false; } } // namespace engine // end of move_evasion.cpp gnuchess-6.2.2/src/engine/move_evasion.h000644 000766 000024 00000002422 11517375750 021065 0ustar00antoniostaff000000 000000 /* move_evasion.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // move_evasion.h #ifndef MOVE_EVASION_H #define MOVE_EVASION_H // includes #include "attack.h" #include "board.h" #include "list.h" #include "util.h" namespace engine { // functions extern void gen_legal_evasions (list_t * list, const board_t * board, const attack_t * attack); extern void gen_pseudo_evasions (list_t * list, const board_t * board, const attack_t * attack); extern bool legal_evasion_exist (const board_t * board, const attack_t * attack); } // namespace engine #endif // !defined MOVE_EVASION_H // end of move_evasion.h gnuchess-6.2.2/src/engine/move_gen.cpp000644 000766 000024 00000045630 11517375750 020535 0ustar00antoniostaff000000 000000 /* move_gen.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // move_gen.cpp // includes #include "attack.h" #include "board.h" #include "colour.h" #include "list.h" #include "move.h" #include "move_evasion.h" #include "move_gen.h" #include "move_legal.h" #include "piece.h" #include "util.h" namespace engine { // prototypes static void add_moves (list_t * list, const board_t * board); static void add_captures (list_t * list, const board_t * board); static void add_quiet_moves (list_t * list, const board_t * board); static void add_en_passant_captures (list_t * list, const board_t * board); static void add_castle_moves (list_t * list, const board_t * board); // functions // gen_legal_moves() void gen_legal_moves(list_t * list, board_t * board) { attack_t attack[1]; ASSERT(list!=NULL); ASSERT(board!=NULL); attack_set(attack,board); if (ATTACK_IN_CHECK(attack)) { gen_legal_evasions(list,board,attack); } else { gen_moves(list,board); list_filter(list,board,&pseudo_is_legal,true); } // debug ASSERT(list_is_ok(list)); } // gen_moves() void gen_moves(list_t * list, const board_t * board) { ASSERT(list!=NULL); ASSERT(board!=NULL); ASSERT(!board_is_check(board)); LIST_CLEAR(list); add_moves(list,board); add_en_passant_captures(list,board); add_castle_moves(list,board); // debug ASSERT(list_is_ok(list)); } // gen_captures() void gen_captures(list_t * list, const board_t * board) { ASSERT(list!=NULL); ASSERT(board!=NULL); LIST_CLEAR(list); add_captures(list,board); add_en_passant_captures(list,board); // debug ASSERT(list_is_ok(list)); } // gen_quiet_moves() void gen_quiet_moves(list_t * list, const board_t * board) { ASSERT(list!=NULL); ASSERT(board!=NULL); ASSERT(!board_is_check(board)); LIST_CLEAR(list); add_quiet_moves(list,board); add_castle_moves(list,board); // debug ASSERT(list_is_ok(list)); } // add_moves() static void add_moves(list_t * list, const board_t * board) { int me, opp; int opp_flag; const sq_t * ptr; int from, to; int piece, capture; const inc_t * inc_ptr; int inc; ASSERT(list!=NULL); ASSERT(board!=NULL); me = board->turn; opp = COLOUR_OPP(me); opp_flag = COLOUR_FLAG(opp); // piece moves for (ptr = &board->piece[me][0]; (from=*ptr) != SquareNone; ptr++) { piece = board->square[from]; inc_ptr = PIECE_INC(piece); if (PIECE_IS_SLIDER(piece)) { for (; (inc=*inc_ptr) != IncNone; inc_ptr++) { for (to = from+inc; (capture=board->square[to]) == Empty; to += inc) { LIST_ADD(list,MOVE_MAKE(from,to)); } if (FLAG_IS(capture,opp_flag)) { LIST_ADD(list,MOVE_MAKE(from,to)); } } } else { for (; (inc=*inc_ptr) != IncNone; inc_ptr++) { to = from + inc; capture = board->square[to]; if (capture == Empty || FLAG_IS(capture,opp_flag)) { LIST_ADD(list,MOVE_MAKE(from,to)); } } } } // pawn moves inc = PAWN_MOVE_INC(me); for (ptr = &board->pawn[me][0]; (from=*ptr) != SquareNone; ptr++) { to = from + (inc-1); if (FLAG_IS(board->square[to],opp_flag)) { add_pawn_move(list,from,to); } to = from + (inc+1); if (FLAG_IS(board->square[to],opp_flag)) { add_pawn_move(list,from,to); } to = from + inc; if (board->square[to] == Empty) { add_pawn_move(list,from,to); if (PAWN_RANK(from,me) == Rank2) { to = from + (2*inc); if (board->square[to] == Empty) { ASSERT(!SQUARE_IS_PROMOTE(to)); LIST_ADD(list,MOVE_MAKE(from,to)); } } } } } // add_captures() static void add_captures(list_t * list, const board_t * board) { int me, opp; int opp_flag; const sq_t * ptr; int from, to; int piece, capture; ASSERT(list!=NULL); ASSERT(board!=NULL); me = board->turn; opp = COLOUR_OPP(me); opp_flag = COLOUR_FLAG(opp); // piece captures for (ptr = &board->piece[me][0]; (from=*ptr) != SquareNone; ptr++) { piece = board->square[from]; switch (PIECE_TYPE(piece)) { case Knight64: to = from - 33; if (FLAG_IS(board->square[to],opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); to = from - 31; if (FLAG_IS(board->square[to],opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); to = from - 18; if (FLAG_IS(board->square[to],opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); to = from - 14; if (FLAG_IS(board->square[to],opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); to = from + 14; if (FLAG_IS(board->square[to],opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); to = from + 18; if (FLAG_IS(board->square[to],opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); to = from + 31; if (FLAG_IS(board->square[to],opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); to = from + 33; if (FLAG_IS(board->square[to],opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); break; case Bishop64: for (to = from-17; (capture=board->square[to]) == Empty; to -= 17) ; if (FLAG_IS(capture,opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); for (to = from-15; (capture=board->square[to]) == Empty; to -= 15) ; if (FLAG_IS(capture,opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); for (to = from+15; (capture=board->square[to]) == Empty; to += 15) ; if (FLAG_IS(capture,opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); for (to = from+17; (capture=board->square[to]) == Empty; to += 17) ; if (FLAG_IS(capture,opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); break; case Rook64: for (to = from-16; (capture=board->square[to]) == Empty; to -= 16) ; if (FLAG_IS(capture,opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); for (to = from-1; (capture=board->square[to]) == Empty; to -= 1) ; if (FLAG_IS(capture,opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); for (to = from+1; (capture=board->square[to]) == Empty; to += 1) ; if (FLAG_IS(capture,opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); for (to = from+16; (capture=board->square[to]) == Empty; to += 16) ; if (FLAG_IS(capture,opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); break; case Queen64: for (to = from-17; (capture=board->square[to]) == Empty; to -= 17) ; if (FLAG_IS(capture,opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); for (to = from-16; (capture=board->square[to]) == Empty; to -= 16) ; if (FLAG_IS(capture,opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); for (to = from-15; (capture=board->square[to]) == Empty; to -= 15) ; if (FLAG_IS(capture,opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); for (to = from-1; (capture=board->square[to]) == Empty; to -= 1) ; if (FLAG_IS(capture,opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); for (to = from+1; (capture=board->square[to]) == Empty; to += 1) ; if (FLAG_IS(capture,opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); for (to = from+15; (capture=board->square[to]) == Empty; to += 15) ; if (FLAG_IS(capture,opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); for (to = from+16; (capture=board->square[to]) == Empty; to += 16) ; if (FLAG_IS(capture,opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); for (to = from+17; (capture=board->square[to]) == Empty; to += 17) ; if (FLAG_IS(capture,opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); break; case King64: to = from - 17; if (FLAG_IS(board->square[to],opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); to = from - 16; if (FLAG_IS(board->square[to],opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); to = from - 15; if (FLAG_IS(board->square[to],opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); to = from - 1; if (FLAG_IS(board->square[to],opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); to = from + 1; if (FLAG_IS(board->square[to],opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); to = from + 15; if (FLAG_IS(board->square[to],opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); to = from + 16; if (FLAG_IS(board->square[to],opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); to = from + 17; if (FLAG_IS(board->square[to],opp_flag)) LIST_ADD(list,MOVE_MAKE(from,to)); break; default: ASSERT(false); break; } } // pawn captures if (COLOUR_IS_WHITE(me)) { for (ptr = &board->pawn[me][0]; (from=*ptr) != SquareNone; ptr++) { to = from + 15; if (FLAG_IS(board->square[to],opp_flag)) add_pawn_move(list,from,to); to = from + 17; if (FLAG_IS(board->square[to],opp_flag)) add_pawn_move(list,from,to); // promote if (SQUARE_RANK(from) == Rank7) { to = from + 16; if (board->square[to] == Empty) { add_promote(list,MOVE_MAKE(from,to)); } } } } else { // black for (ptr = &board->pawn[me][0]; (from=*ptr) != SquareNone; ptr++) { to = from - 17; if (FLAG_IS(board->square[to],opp_flag)) add_pawn_move(list,from,to); to = from - 15; if (FLAG_IS(board->square[to],opp_flag)) add_pawn_move(list,from,to); // promote if (SQUARE_RANK(from) == Rank2) { to = from - 16; if (board->square[to] == Empty) { add_promote(list,MOVE_MAKE(from,to)); } } } } } // add_quiet_moves() static void add_quiet_moves(list_t * list, const board_t * board) { int me; const sq_t * ptr; int from, to; int piece; ASSERT(list!=NULL); ASSERT(board!=NULL); me = board->turn; // piece moves for (ptr = &board->piece[me][0]; (from=*ptr) != SquareNone; ptr++) { piece = board->square[from]; switch (PIECE_TYPE(piece)) { case Knight64: to = from - 33; if (board->square[to] == Empty) LIST_ADD(list,MOVE_MAKE(from,to)); to = from - 31; if (board->square[to] == Empty) LIST_ADD(list,MOVE_MAKE(from,to)); to = from - 18; if (board->square[to] == Empty) LIST_ADD(list,MOVE_MAKE(from,to)); to = from - 14; if (board->square[to] == Empty) LIST_ADD(list,MOVE_MAKE(from,to)); to = from + 14; if (board->square[to] == Empty) LIST_ADD(list,MOVE_MAKE(from,to)); to = from + 18; if (board->square[to] == Empty) LIST_ADD(list,MOVE_MAKE(from,to)); to = from + 31; if (board->square[to] == Empty) LIST_ADD(list,MOVE_MAKE(from,to)); to = from + 33; if (board->square[to] == Empty) LIST_ADD(list,MOVE_MAKE(from,to)); break; case Bishop64: for (to = from-17; board->square[to] == Empty; to -= 17) { LIST_ADD(list,MOVE_MAKE(from,to)); } for (to = from-15; board->square[to] == Empty; to -= 15) { LIST_ADD(list,MOVE_MAKE(from,to)); } for (to = from+15; board->square[to] == Empty; to += 15) { LIST_ADD(list,MOVE_MAKE(from,to)); } for (to = from+17; board->square[to] == Empty; to += 17) { LIST_ADD(list,MOVE_MAKE(from,to)); } break; case Rook64: for (to = from-16; board->square[to] == Empty; to -= 16) { LIST_ADD(list,MOVE_MAKE(from,to)); } for (to = from-1; board->square[to] == Empty; to -= 1) { LIST_ADD(list,MOVE_MAKE(from,to)); } for (to = from+1; board->square[to] == Empty; to += 1) { LIST_ADD(list,MOVE_MAKE(from,to)); } for (to = from+16; board->square[to] == Empty; to += 16) { LIST_ADD(list,MOVE_MAKE(from,to)); } break; case Queen64: for (to = from-17; board->square[to] == Empty; to -= 17) { LIST_ADD(list,MOVE_MAKE(from,to)); } for (to = from-16; board->square[to] == Empty; to -= 16) { LIST_ADD(list,MOVE_MAKE(from,to)); } for (to = from-15; board->square[to] == Empty; to -= 15) { LIST_ADD(list,MOVE_MAKE(from,to)); } for (to = from-1; board->square[to] == Empty; to -= 1) { LIST_ADD(list,MOVE_MAKE(from,to)); } for (to = from+1; board->square[to] == Empty; to += 1) { LIST_ADD(list,MOVE_MAKE(from,to)); } for (to = from+15; board->square[to] == Empty; to += 15) { LIST_ADD(list,MOVE_MAKE(from,to)); } for (to = from+16; board->square[to] == Empty; to += 16) { LIST_ADD(list,MOVE_MAKE(from,to)); } for (to = from+17; board->square[to] == Empty; to += 17) { LIST_ADD(list,MOVE_MAKE(from,to)); } break; case King64: to = from - 17; if (board->square[to] == Empty) LIST_ADD(list,MOVE_MAKE(from,to)); to = from - 16; if (board->square[to] == Empty) LIST_ADD(list,MOVE_MAKE(from,to)); to = from - 15; if (board->square[to] == Empty) LIST_ADD(list,MOVE_MAKE(from,to)); to = from - 1; if (board->square[to] == Empty) LIST_ADD(list,MOVE_MAKE(from,to)); to = from + 1; if (board->square[to] == Empty) LIST_ADD(list,MOVE_MAKE(from,to)); to = from + 15; if (board->square[to] == Empty) LIST_ADD(list,MOVE_MAKE(from,to)); to = from + 16; if (board->square[to] == Empty) LIST_ADD(list,MOVE_MAKE(from,to)); to = from + 17; if (board->square[to] == Empty) LIST_ADD(list,MOVE_MAKE(from,to)); break; default: ASSERT(false); break; } } // pawn moves if (COLOUR_IS_WHITE(me)) { for (ptr = &board->pawn[me][0]; (from=*ptr) != SquareNone; ptr++) { // non promotes if (SQUARE_RANK(from) != Rank7) { to = from + 16; if (board->square[to] == Empty) { ASSERT(!SQUARE_IS_PROMOTE(to)); LIST_ADD(list,MOVE_MAKE(from,to)); if (SQUARE_RANK(from) == Rank2) { to = from + 32; if (board->square[to] == Empty) { ASSERT(!SQUARE_IS_PROMOTE(to)); LIST_ADD(list,MOVE_MAKE(from,to)); } } } } } } else { // black for (ptr = &board->pawn[me][0]; (from=*ptr) != SquareNone; ptr++) { // non promotes if (SQUARE_RANK(from) != Rank2) { to = from - 16; if (board->square[to] == Empty) { ASSERT(!SQUARE_IS_PROMOTE(to)); LIST_ADD(list,MOVE_MAKE(from,to)); if (SQUARE_RANK(from) == Rank7) { to = from - 32; if (board->square[to] == Empty) { ASSERT(!SQUARE_IS_PROMOTE(to)); LIST_ADD(list,MOVE_MAKE(from,to)); } } } } } } } // add_en_passant_captures() static void add_en_passant_captures(list_t * list, const board_t * board) { int from, to; int me; int inc; int pawn; ASSERT(list!=NULL); ASSERT(board!=NULL); to = board->ep_square; if (to != SquareNone) { me = board->turn; inc = PAWN_MOVE_INC(me); pawn = PAWN_MAKE(me); from = to - (inc-1); if (board->square[from] == pawn) { ASSERT(!SQUARE_IS_PROMOTE(to)); LIST_ADD(list,MOVE_MAKE_FLAGS(from,to,MoveEnPassant)); } from = to - (inc+1); if (board->square[from] == pawn) { ASSERT(!SQUARE_IS_PROMOTE(to)); LIST_ADD(list,MOVE_MAKE_FLAGS(from,to,MoveEnPassant)); } } } // add_castle_moves() static void add_castle_moves(list_t * list, const board_t * board) { ASSERT(list!=NULL); ASSERT(board!=NULL); ASSERT(!board_is_check(board)); if (COLOUR_IS_WHITE(board->turn)) { if ((board->flags & FlagsWhiteKingCastle) != 0 && board->square[F1] == Empty && board->square[G1] == Empty && !is_attacked(board,F1,Black)) { LIST_ADD(list,MOVE_MAKE_FLAGS(E1,G1,MoveCastle)); } if ((board->flags & FlagsWhiteQueenCastle) != 0 && board->square[D1] == Empty && board->square[C1] == Empty && board->square[B1] == Empty && !is_attacked(board,D1,Black)) { LIST_ADD(list,MOVE_MAKE_FLAGS(E1,C1,MoveCastle)); } } else { // black if ((board->flags & FlagsBlackKingCastle) != 0 && board->square[F8] == Empty && board->square[G8] == Empty && !is_attacked(board,F8,White)) { LIST_ADD(list,MOVE_MAKE_FLAGS(E8,G8,MoveCastle)); } if ((board->flags & FlagsBlackQueenCastle) != 0 && board->square[D8] == Empty && board->square[C8] == Empty && board->square[B8] == Empty && !is_attacked(board,D8,White)) { LIST_ADD(list,MOVE_MAKE_FLAGS(E8,C8,MoveCastle)); } } } // add_pawn_move() void add_pawn_move(list_t * list, int from, int to) { int move; ASSERT(list!=NULL); ASSERT(SQUARE_IS_OK(from)); ASSERT(SQUARE_IS_OK(to)); move = MOVE_MAKE(from,to); if (SQUARE_IS_PROMOTE(to)) { LIST_ADD(list,move|MovePromoteQueen); LIST_ADD(list,move|MovePromoteKnight); LIST_ADD(list,move|MovePromoteRook); LIST_ADD(list,move|MovePromoteBishop); } else { LIST_ADD(list,move); } } // add_promote() void add_promote(list_t * list, int move) { ASSERT(list!=NULL); ASSERT(move_is_ok(move)); ASSERT((move&~07777)==0); // HACK ASSERT(SQUARE_IS_PROMOTE(MOVE_TO(move))); LIST_ADD(list,move|MovePromoteQueen); LIST_ADD(list,move|MovePromoteKnight); LIST_ADD(list,move|MovePromoteRook); LIST_ADD(list,move|MovePromoteBishop); } } // namespace engine // end of move_gen.cpp gnuchess-6.2.2/src/engine/move_gen.h000644 000766 000024 00000002547 11517375750 020202 0ustar00antoniostaff000000 000000 /* move_gen.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // move_gen.h #ifndef MOVE_GEN_H #define MOVE_GEN_H // includes #include "attack.h" #include "board.h" #include "list.h" #include "util.h" namespace engine { // functions extern void gen_legal_moves (list_t * list, board_t * board); extern void gen_moves (list_t * list, const board_t * board); extern void gen_captures (list_t * list, const board_t * board); extern void gen_quiet_moves (list_t * list, const board_t * board); extern void add_pawn_move (list_t * list, int from, int to); extern void add_promote (list_t * list, int move); } // namespace engine #endif // !defined MOVE_GEN_H // end of move_gen.h gnuchess-6.2.2/src/engine/move_legal.cpp000644 000766 000024 00000012203 11517375750 021036 0ustar00antoniostaff000000 000000 /* move_legal.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // move_legal.cpp // includes #include "attack.h" #include "colour.h" #include "fen.h" #include "list.h" #include "move.h" #include "move_do.h" #include "move_gen.h" #include "move_legal.h" #include "piece.h" #include "square.h" #include "util.h" namespace engine { // prototypes static bool move_is_pseudo_debug (int move, board_t * board); // functions // move_is_pseudo() bool move_is_pseudo(int move, board_t * board) { int me, opp; int from, to; int piece, capture; int inc, delta; ASSERT(move_is_ok(move)); ASSERT(board!=NULL); ASSERT(!board_is_check(board)); // special cases if (MOVE_IS_SPECIAL(move)) { return move_is_pseudo_debug(move,board); } ASSERT((move&~07777)==0); // init me = board->turn; opp = COLOUR_OPP(board->turn); // from from = MOVE_FROM(move); ASSERT(SQUARE_IS_OK(from)); piece = board->square[from]; if (!COLOUR_IS(piece,me)) return false; ASSERT(piece_is_ok(piece)); // to to = MOVE_TO(move); ASSERT(SQUARE_IS_OK(to)); capture = board->square[to]; if (COLOUR_IS(capture,me)) return false; // move if (PIECE_IS_PAWN(piece)) { if (SQUARE_IS_PROMOTE(to)) return false; inc = PAWN_MOVE_INC(me); delta = to - from; ASSERT(delta_is_ok(delta)); if (capture == Empty) { // pawn push if (delta == inc) return true; if (delta == (2*inc) && PAWN_RANK(from,me) == Rank2 && board->square[from+inc] == Empty) { return true; } } else { // pawn capture if (delta == (inc-1) || delta == (inc+1)) return true; } } else { if (PIECE_ATTACK(board,piece,from,to)) return true; } return false; } // quiet_is_pseudo() bool quiet_is_pseudo(int move, board_t * board) { int me, opp; int from, to; int piece; int inc, delta; ASSERT(move_is_ok(move)); ASSERT(board!=NULL); ASSERT(!board_is_check(board)); // special cases if (MOVE_IS_CASTLE(move)) { return move_is_pseudo_debug(move,board); } else if (MOVE_IS_SPECIAL(move)) { return false; } ASSERT((move&~07777)==0); // init me = board->turn; opp = COLOUR_OPP(board->turn); // from from = MOVE_FROM(move); ASSERT(SQUARE_IS_OK(from)); piece = board->square[from]; if (!COLOUR_IS(piece,me)) return false; ASSERT(piece_is_ok(piece)); // to to = MOVE_TO(move); ASSERT(SQUARE_IS_OK(to)); if (board->square[to] != Empty) return false; // capture // move if (PIECE_IS_PAWN(piece)) { if (SQUARE_IS_PROMOTE(to)) return false; inc = PAWN_MOVE_INC(me); delta = to - from; ASSERT(delta_is_ok(delta)); // pawn push if (delta == inc) return true; if (delta == (2*inc) && PAWN_RANK(from,me) == Rank2 && board->square[from+inc] == Empty) { return true; } } else { if (PIECE_ATTACK(board,piece,from,to)) return true; } return false; } // pseudo_is_legal() bool pseudo_is_legal(int move, board_t * board) { int me, opp; int from, to; int piece; bool legal; int king; undo_t undo[1]; ASSERT(move_is_ok(move)); ASSERT(board!=NULL); // init me = board->turn; opp = COLOUR_OPP(me); from = MOVE_FROM(move); to = MOVE_TO(move); piece = board->square[from]; ASSERT(COLOUR_IS(piece,me)); // slow test for en-passant captures if (MOVE_IS_EN_PASSANT(move)) { move_do(board,move,undo); legal = !IS_IN_CHECK(board,me); move_undo(board,move,undo); return legal; } // king moves (including castle) if (PIECE_IS_KING(piece)) { legal = !is_attacked(board,to,opp); if (DEBUG) { ASSERT(board->square[from]==piece); board->square[from] = Empty; ASSERT(legal==!is_attacked(board,to,opp)); board->square[from] = piece; } return legal; } // pins if (is_pinned(board,from,me)) { king = KING_POS(board,me); return DELTA_INC_LINE(king-to) == DELTA_INC_LINE(king-from); // does not discover the line } return true; } // move_is_pseudo_debug() static bool move_is_pseudo_debug(int move, board_t * board) { list_t list[1]; ASSERT(move_is_ok(move)); ASSERT(board!=NULL); ASSERT(!board_is_check(board)); gen_moves(list,board); return list_contain(list,move); } } // namespace engine // end of move_legal.cpp gnuchess-6.2.2/src/engine/move_legal.h000644 000766 000024 00000002211 11517375750 020501 0ustar00antoniostaff000000 000000 /* move_legal.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // move_legal.h #ifndef MOVE_LEGAL_H #define MOVE_LEGAL_H // includes #include "board.h" #include "list.h" #include "util.h" namespace engine { // functions extern bool move_is_pseudo (int move, board_t * board); extern bool quiet_is_pseudo (int move, board_t * board); extern bool pseudo_is_legal (int move, board_t * board); } // namespace engine #endif // !defined MOVE_LEGAL_H // end of move_legal.h gnuchess-6.2.2/src/engine/option.cpp000644 000766 000024 00000011126 11517375750 020237 0ustar00antoniostaff000000 000000 /* option.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // option.cpp // includes #include #include "option.h" #include "protocol.h" #include "util.h" namespace engine { // types struct option_t { const char * var; bool declare; const char * init; const char * type; const char * extra; const char * val; }; // variables static option_t Option[] = { { "Hash", true, "16", "spin", "min 4 max 1024", NULL }, { "Ponder", true, "false", "check", "", NULL }, { "OwnBook", true, "true", "check", "", NULL }, { "BookFile", true, "book_small.bin", "string", "", NULL }, { "NullMove Pruning", true, "Fail High", "combo", "var Always var Fail High var Never", NULL }, { "NullMove Reduction", true, "3", "spin", "min 1 max 3", NULL }, { "Verification Search", true, "Endgame", "combo", "var Always var Endgame var Never", NULL }, { "Verification Reduction", true, "5", "spin", "min 1 max 6", NULL }, { "History Pruning", true, "true", "check", "", NULL }, { "History Threshold", true, "60", "spin", "min 0 max 100", NULL }, { "Futility Pruning", true, "false", "check", "", NULL }, { "Futility Margin", true, "100", "spin", "min 0 max 500", NULL }, { "Delta Pruning", true, "false", "check", "", NULL }, { "Delta Margin", true, "50", "spin", "min 0 max 500", NULL }, { "Quiescence Check Plies", true, "1", "spin", "min 0 max 2", NULL }, { "Material", true, "100", "spin", "min 0 max 400", NULL }, { "Piece Activity", true, "100", "spin", "min 0 max 400", NULL }, { "King Safety", true, "100", "spin", "min 0 max 400", NULL }, { "Pawn Structure", true, "100", "spin", "min 0 max 400", NULL }, { "Passed Pawns", true, "100", "spin", "min 0 max 400", NULL }, { NULL, false, NULL, NULL, NULL, NULL, }, }; // prototypes static option_t * option_find (const char var[]); // functions // option_init() void option_init() { option_t * opt; for (opt = &Option[0]; opt->var != NULL; opt++) { option_set(opt->var,opt->init); } } // option_list() void option_list() { option_t * opt; for (opt = &Option[0]; opt->var != NULL; opt++) { if (opt->declare) { if (opt->extra != NULL && *opt->extra != '\0') { send("option name %s type %s default %s %s",opt->var,opt->type,opt->val,opt->extra); } else { send("option name %s type %s default %s",opt->var,opt->type,opt->val); } } } } // option_set() bool option_set(const char var[], const char val[]) { option_t * opt; ASSERT(var!=NULL); ASSERT(val!=NULL); opt = option_find(var); if (opt == NULL) return false; my_string_set(&opt->val,val); return true; } // option_get() const char * option_get(const char var[]) { option_t * opt; ASSERT(var!=NULL); opt = option_find(var); if (opt == NULL) my_fatal("option_get(): unknown option \"%s\"\n",var); return opt->val; } // option_get_bool() bool option_get_bool(const char var[]) { const char * val; val = option_get(var); if (false) { } else if (my_string_equal(val,"true") || my_string_equal(val,"yes") || my_string_equal(val,"1")) { return true; } else if (my_string_equal(val,"false") || my_string_equal(val,"no") || my_string_equal(val,"0")) { return false; } ASSERT(false); return false; } // option_get_int() int option_get_int(const char var[]) { const char * val; val = option_get(var); return atoi(val); } // option_get_string() const char * option_get_string(const char var[]) { const char * val; val = option_get(var); return val; } // option_find() static option_t * option_find(const char var[]) { option_t * opt; ASSERT(var!=NULL); for (opt = &Option[0]; opt->var != NULL; opt++) { if (my_string_equal(opt->var,var)) return opt; } return NULL; } } // namespace engine // end of option.cpp gnuchess-6.2.2/src/engine/option.h000644 000766 000024 00000002452 11517375750 017706 0ustar00antoniostaff000000 000000 /* option.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // option.h #ifndef OPTION_H #define OPTION_H // includes #include "util.h" namespace engine { // functions extern void option_init (); extern void option_list (); extern bool option_set (const char var[], const char val[]); extern const char * option_get (const char var[]); extern bool option_get_bool (const char var[]); extern int option_get_int (const char var[]); extern const char * option_get_string (const char var[]); } // namespace engine #endif // !defined OPTION_H // end of option.h gnuchess-6.2.2/src/engine/pawn.cpp000644 000766 000024 00000030103 12365651527 017671 0ustar00antoniostaff000000 000000 /* pawn.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // pawn.cpp // includes #include #include "board.h" #include "colour.h" #include "hash.h" #include "option.h" #include "pawn.h" #include "piece.h" #include "protocol.h" #include "square.h" #include "util.h" namespace engine { // constants static const bool UseTable = true; static const uint32 TableSize = 16384; // 256kB // types typedef pawn_info_t entry_t; struct pawn_t { entry_t * table; uint32 size; uint32 mask; uint32 used; sint64 read_nb; sint64 read_hit; sint64 write_nb; sint64 write_collision; }; // constants and variables static /* const */ int PawnStructureWeight = 256; // 100% static const int DoubledOpening = 10; static const int DoubledEndgame = 20; static const int IsolatedOpening = 10; static const int IsolatedOpeningOpen = 20; static const int IsolatedEndgame = 20; static const int BackwardOpening = 8; static const int BackwardOpeningOpen = 16; static const int BackwardEndgame = 10; static const int CandidateOpeningMin = 5; static const int CandidateOpeningMax = 55; static const int CandidateEndgameMin = 10; static const int CandidateEndgameMax = 110; // this was moved to eval.cpp /* static const int PassedOpeningMin = 10; static const int PassedOpeningMax = 70; static const int PassedEndgameMin = 20; static const int PassedEndgameMax = 140; */ static /* const */ int Bonus[RankNb]; // variables int BitEQ[16]; int BitLT[16]; int BitLE[16]; int BitGT[16]; int BitGE[16]; int BitFirst[0x100]; int BitLast[0x100]; int BitCount[0x100]; int BitRev[0x100]; static pawn_t Pawn[1]; static int BitRank1[RankNb]; static int BitRank2[RankNb]; static int BitRank3[RankNb]; // prototypes static void pawn_comp_info (pawn_info_t * info, const board_t * board); // functions // pawn_init_bit() void pawn_init_bit() { int rank; int first, last, count; int b, rev; // rank-indexed Bit*[] for (rank = 0; rank < RankNb; rank++) { BitEQ[rank] = 0; BitLT[rank] = 0; BitLE[rank] = 0; BitGT[rank] = 0; BitGE[rank] = 0; BitRank1[rank] = 0; BitRank2[rank] = 0; BitRank3[rank] = 0; } for (rank = Rank1; rank <= Rank8; rank++) { BitEQ[rank] = 1 << (rank - Rank1); BitLT[rank] = BitEQ[rank] - 1; BitLE[rank] = BitLT[rank] | BitEQ[rank]; BitGT[rank] = BitLE[rank] ^ 0xFF; BitGE[rank] = BitGT[rank] | BitEQ[rank]; } for (rank = Rank1; rank <= Rank8; rank++) { BitRank1[rank] = BitEQ[rank+1]; BitRank2[rank] = BitEQ[rank+1] | BitEQ[rank+2]; BitRank3[rank] = BitEQ[rank+1] | BitEQ[rank+2] | BitEQ[rank+3]; } // bit-indexed Bit*[] for (b = 0; b < 0x100; b++) { first = Rank8; // HACK for pawn shelter last = Rank1; // HACK count = 0; rev = 0; for (rank = Rank1; rank <= Rank8; rank++) { if ((b & BitEQ[rank]) != 0) { if (rank < first) first = rank; if (rank > last) last = rank; count++; rev |= BitEQ[RANK_OPP(rank)]; } } BitFirst[b] = first; BitLast[b] = last; BitCount[b] = count; BitRev[b] = rev; } } // pawn_init() void pawn_init() { int rank; // UCI options PawnStructureWeight = (option_get_int("Pawn Structure") * 256 + 50) / 100; // bonus for (rank = 0; rank < RankNb; rank++) Bonus[rank] = 0; Bonus[Rank4] = 26; Bonus[Rank5] = 77; Bonus[Rank6] = 154; Bonus[Rank7] = 256; // pawn hash-table Pawn->size = 0; Pawn->mask = 0; Pawn->table = NULL; } // pawn_alloc() void pawn_alloc() { ASSERT(sizeof(entry_t)==16); if (UseTable) { Pawn->size = TableSize; Pawn->mask = TableSize - 1; Pawn->table = (entry_t *) my_malloc(Pawn->size*sizeof(entry_t)); pawn_clear(); } } // pawn_clear() void pawn_clear() { if (Pawn->table != NULL) { memset(Pawn->table,0,Pawn->size*sizeof(entry_t)); } Pawn->used = 0; Pawn->read_nb = 0; Pawn->read_hit = 0; Pawn->write_nb = 0; Pawn->write_collision = 0; } // pawn_get_info() void pawn_get_info(pawn_info_t * info, const board_t * board) { uint64 key; entry_t * entry; ASSERT(info!=NULL); ASSERT(board!=NULL); // probe if (UseTable) { Pawn->read_nb++; key = board->pawn_key; entry = &Pawn->table[KEY_INDEX(key)&Pawn->mask]; if (entry->lock == KEY_LOCK(key)) { // found Pawn->read_hit++; *info = *entry; return; } } // calculation pawn_comp_info(info,board); // store if (UseTable) { Pawn->write_nb++; if (entry->lock == 0) { // HACK: assume free entry Pawn->used++; } else { Pawn->write_collision++; } *entry = *info; entry->lock = KEY_LOCK(key); } } // pawn_comp_info() static void pawn_comp_info(pawn_info_t * info, const board_t * board) { int colour; int file, rank; int me, opp; const sq_t * ptr; int sq; bool backward, candidate, doubled, isolated, open, passed; int t1, t2; int n; int bits; int opening[ColourNb], endgame[ColourNb]; int flags[ColourNb]; int file_bits[ColourNb]; int passed_bits[ColourNb]; int single_file[ColourNb]; ASSERT(info!=NULL); ASSERT(board!=NULL); // pawn_file[] #if DEBUG for (colour = 0; colour < ColourNb; colour++) { int pawn_file[FileNb]; me = colour; for (file = 0; file < FileNb; file++) { pawn_file[file] = 0; } for (ptr = &board->pawn[me][0]; (sq=*ptr) != SquareNone; ptr++) { file = SQUARE_FILE(sq); rank = PAWN_RANK(sq,me); ASSERT(file>=FileA&&file<=FileH); ASSERT(rank>=Rank2&&rank<=Rank7); pawn_file[file] |= BIT(rank); } for (file = 0; file < FileNb; file++) { if (board->pawn_file[colour][file] != pawn_file[file]) my_fatal("board->pawn_file[][]\n"); } } #endif // init for (colour = 0; colour < ColourNb; colour++) { opening[colour] = 0; endgame[colour] = 0; flags[colour] = 0; file_bits[colour] = 0; passed_bits[colour] = 0; single_file[colour] = SquareNone; } // features and scoring for (colour = 0; colour < ColourNb; colour++) { me = colour; opp = COLOUR_OPP(me); for (ptr = &board->pawn[me][0]; (sq=*ptr) != SquareNone; ptr++) { // init file = SQUARE_FILE(sq); rank = PAWN_RANK(sq,me); ASSERT(file>=FileA&&file<=FileH); ASSERT(rank>=Rank2&&rank<=Rank7); // flags file_bits[me] |= BIT(file); if (rank == Rank2) flags[me] |= BackRankFlag; // features backward = false; candidate = false; doubled = false; isolated = false; open = false; passed = false; t1 = board->pawn_file[me][file-1] | board->pawn_file[me][file+1]; t2 = board->pawn_file[me][file] | BitRev[board->pawn_file[opp][file]]; // doubled if ((board->pawn_file[me][file] & BitLT[rank]) != 0) { doubled = true; } // isolated and backward if (t1 == 0) { isolated = true; } else if ((t1 & BitLE[rank]) == 0) { backward = true; // really backward? if ((t1 & BitRank1[rank]) != 0) { ASSERT(rank+2<=Rank8); if (((t2 & BitRank1[rank]) | ((BitRev[board->pawn_file[opp][file-1]] | BitRev[board->pawn_file[opp][file+1]]) & BitRank2[rank])) == 0) { backward = false; } } else if (rank == Rank2 && ((t1 & BitEQ[rank+2]) != 0)) { ASSERT(rank+3<=Rank8); if (((t2 & BitRank2[rank]) | ((BitRev[board->pawn_file[opp][file-1]] | BitRev[board->pawn_file[opp][file+1]]) & BitRank3[rank])) == 0) { backward = false; } } } // open, candidate and passed if ((t2 & BitGT[rank]) == 0) { open = true; if (((BitRev[board->pawn_file[opp][file-1]] | BitRev[board->pawn_file[opp][file+1]]) & BitGT[rank]) == 0) { passed = true; passed_bits[me] |= BIT(file); } else { // candidate? n = 0; n += BIT_COUNT(board->pawn_file[me][file-1]&BitLE[rank]); n += BIT_COUNT(board->pawn_file[me][file+1]&BitLE[rank]); n -= BIT_COUNT(BitRev[board->pawn_file[opp][file-1]]&BitGT[rank]); n -= BIT_COUNT(BitRev[board->pawn_file[opp][file+1]]&BitGT[rank]); if (n >= 0) { // safe? n = 0; n += BIT_COUNT(board->pawn_file[me][file-1]&BitEQ[rank-1]); n += BIT_COUNT(board->pawn_file[me][file+1]&BitEQ[rank-1]); n -= BIT_COUNT(BitRev[board->pawn_file[opp][file-1]]&BitEQ[rank+1]); n -= BIT_COUNT(BitRev[board->pawn_file[opp][file+1]]&BitEQ[rank+1]); if (n >= 0) candidate = true; } } } // score if (doubled) { opening[me] -= DoubledOpening; endgame[me] -= DoubledEndgame; } if (isolated) { if (open) { opening[me] -= IsolatedOpeningOpen; endgame[me] -= IsolatedEndgame; } else { opening[me] -= IsolatedOpening; endgame[me] -= IsolatedEndgame; } } if (backward) { if (open) { opening[me] -= BackwardOpeningOpen; endgame[me] -= BackwardEndgame; } else { opening[me] -= BackwardOpening; endgame[me] -= BackwardEndgame; } } if (candidate) { opening[me] += quad(CandidateOpeningMin,CandidateOpeningMax,rank); endgame[me] += quad(CandidateEndgameMin,CandidateEndgameMax,rank); } // this was moved to the dynamic evaluation /* if (passed) { opening[me] += quad(PassedOpeningMin,PassedOpeningMax,rank); endgame[me] += quad(PassedEndgameMin,PassedEndgameMax,rank); } */ } } // store info info->opening = ((opening[White] - opening[Black]) * PawnStructureWeight) / 256; info->endgame = ((endgame[White] - endgame[Black]) * PawnStructureWeight) / 256; for (colour = 0; colour < ColourNb; colour++) { me = colour; opp = COLOUR_OPP(me); // draw flags bits = file_bits[me]; if (bits != 0 && (bits & (bits-1)) == 0) { // one set bit file = BIT_FIRST(bits); rank = BIT_FIRST(board->pawn_file[me][file]); ASSERT(rank>=Rank2); if (((BitRev[board->pawn_file[opp][file-1]] | BitRev[board->pawn_file[opp][file+1]]) & BitGT[rank]) == 0) { rank = BIT_LAST(board->pawn_file[me][file]); single_file[me] = SQUARE_MAKE(file,rank); } } info->flags[colour] = flags[colour]; info->passed_bits[colour] = passed_bits[colour]; info->single_file[colour] = single_file[colour]; } } // quad() int quad(int y_min, int y_max, int x) { int y; ASSERT(y_min>=0&&y_min<=y_max&&y_max<=+32767); ASSERT(x>=Rank2&&x<=Rank7); y = y_min + ((y_max - y_min) * Bonus[x] + 128) / 256; ASSERT(y>=y_min&&y<=y_max); return y; } } // namespace engine // end of pawn.cpp gnuchess-6.2.2/src/engine/pawn.h000644 000766 000024 00000003450 11517375750 017342 0ustar00antoniostaff000000 000000 /* pawn.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // pawn.h #ifndef PAWN_H #define PAWN_H // includes #include "board.h" #include "colour.h" #include "util.h" // macros #define BIT(n) (BitEQ[n]) #define BIT_FIRST(b) (BitFirst[b]) #define BIT_LAST(b) (BitLast[b]) #define BIT_COUNT(b) (BitCount[b]) namespace engine { // constants const int BackRankFlag = 1 << 0; // types struct pawn_info_t { uint32 lock; sint16 opening; sint16 endgame; uint8 flags[ColourNb]; uint8 passed_bits[ColourNb]; uint8 single_file[ColourNb]; uint16 pad; }; // variables extern int BitEQ[16]; extern int BitLT[16]; extern int BitLE[16]; extern int BitGT[16]; extern int BitGE[16]; extern int BitFirst[0x100]; extern int BitLast[0x100]; extern int BitCount[0x100]; extern int BitRev[0x100]; // functions extern void pawn_init_bit (); extern void pawn_init (); extern void pawn_alloc (); extern void pawn_clear (); extern void pawn_get_info (pawn_info_t * info, const board_t * board); extern int quad (int y_min, int y_max, int x); } // namespace engine #endif // !defined PAWN_H // end of pawn.h gnuchess-6.2.2/src/engine/piece.cpp000644 000766 000024 00000006467 11517375750 020030 0ustar00antoniostaff000000 000000 /* piece.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // piece.cpp // includes #include #include "colour.h" #include "piece.h" #include "util.h" namespace engine { // "constants" const int PawnMake[ColourNb] = { WhitePawn256, BlackPawn256 }; const int PieceFrom12[12] = { WhitePawn256, BlackPawn256, WhiteKnight256, BlackKnight256, WhiteBishop256, BlackBishop256, WhiteRook256, BlackRook256, WhiteQueen256, BlackQueen256, WhiteKing256, BlackKing256, }; static const char PieceString[12+1] = "PpNnBbRrQqKk"; const inc_t PawnMoveInc[ColourNb] = { +16, -16, }; const inc_t KnightInc[8+1] = { -33, -31, -18, -14, +14, +18, +31, +33, 0 }; const inc_t BishopInc[4+1] = { -17, -15, +15, +17, 0 }; const inc_t RookInc[4+1] = { -16, -1, +1, +16, 0 }; const inc_t QueenInc[8+1] = { -17, -16, -15, -1, +1, +15, +16, +17, 0 }; const inc_t KingInc[8+1] = { -17, -16, -15, -1, +1, +15, +16, +17, 0 }; // variables int PieceTo12[PieceNb]; int PieceOrder[PieceNb]; const inc_t * PieceInc[PieceNb]; // functions // piece_init() void piece_init() { int piece, piece_12; // PieceTo12[] for (piece = 0; piece < PieceNb; piece++) PieceTo12[piece] = -1; for (piece_12 = 0; piece_12 < 12; piece_12++) { PieceTo12[PieceFrom12[piece_12]] = piece_12; } // PieceOrder[] for (piece = 0; piece < PieceNb; piece++) PieceOrder[piece] = -1; for (piece_12 = 0; piece_12 < 12; piece_12++) { PieceOrder[PieceFrom12[piece_12]] = piece_12 >> 1; } // PieceInc[] for (piece = 0; piece < PieceNb; piece++) { PieceInc[piece] = NULL; } PieceInc[WhiteKnight256] = KnightInc; PieceInc[WhiteBishop256] = BishopInc; PieceInc[WhiteRook256] = RookInc; PieceInc[WhiteQueen256] = QueenInc; PieceInc[WhiteKing256] = KingInc; PieceInc[BlackKnight256] = KnightInc; PieceInc[BlackBishop256] = BishopInc; PieceInc[BlackRook256] = RookInc; PieceInc[BlackQueen256] = QueenInc; PieceInc[BlackKing256] = KingInc; } // piece_is_ok() bool piece_is_ok(int piece) { if (piece < 0 || piece >= PieceNb) return false; if (PieceTo12[piece] < 0) return false; return true; } // piece_from_12() int piece_from_12(int piece_12) { ASSERT(piece_12>=0&&piece_12<12); return PieceFrom12[piece_12]; } // piece_to_char() int piece_to_char(int piece) { ASSERT(piece_is_ok(piece)); return PieceString[PIECE_TO_12(piece)]; } // piece_from_char() int piece_from_char(int c) { const char *ptr; ptr = strchr(PieceString,c); if (ptr == NULL) return PieceNone256; return piece_from_12(ptr-PieceString); } } // namespace engine // end of piece.cpp gnuchess-6.2.2/src/engine/piece.h000644 000766 000024 00000010031 11517375750 017453 0ustar00antoniostaff000000 000000 /* piece.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // piece.h #ifndef PIECE_H #define PIECE_H // includes #include "colour.h" #include "util.h" namespace engine { // constants const int WhitePawnFlag = 1 << 2; const int BlackPawnFlag = 1 << 3; const int KnightFlag = 1 << 4; const int BishopFlag = 1 << 5; const int RookFlag = 1 << 6; const int KingFlag = 1 << 7; const int PawnFlags = WhitePawnFlag | BlackPawnFlag; const int QueenFlags = BishopFlag | RookFlag; const int PieceNone64 = 0; const int WhitePawn64 = WhitePawnFlag; const int BlackPawn64 = BlackPawnFlag; const int Knight64 = KnightFlag; const int Bishop64 = BishopFlag; const int Rook64 = RookFlag; const int Queen64 = QueenFlags; const int King64 = KingFlag; const int PieceNone256 = 0; const int WhitePawn256 = WhitePawn64 | WhiteFlag; const int BlackPawn256 = BlackPawn64 | BlackFlag; const int WhiteKnight256 = Knight64 | WhiteFlag; const int BlackKnight256 = Knight64 | BlackFlag; const int WhiteBishop256 = Bishop64 | WhiteFlag; const int BlackBishop256 = Bishop64 | BlackFlag; const int WhiteRook256 = Rook64 | WhiteFlag; const int BlackRook256 = Rook64 | BlackFlag; const int WhiteQueen256 = Queen64 | WhiteFlag; const int BlackQueen256 = Queen64 | BlackFlag; const int WhiteKing256 = King64 | WhiteFlag; const int BlackKing256 = King64 | BlackFlag; const int PieceNb = 256; const int WhitePawn12 = 0; const int BlackPawn12 = 1; const int WhiteKnight12 = 2; const int BlackKnight12 = 3; const int WhiteBishop12 = 4; const int BlackBishop12 = 5; const int WhiteRook12 = 6; const int BlackRook12 = 7; const int WhiteQueen12 = 8; const int BlackQueen12 = 9; const int WhiteKing12 = 10; const int BlackKing12 = 11; // macros #define PAWN_MAKE(colour) (PawnMake[colour]) #define PAWN_OPP(pawn) ((pawn)^(WhitePawn256^BlackPawn256)) #define PIECE_COLOUR(piece) (((piece)&3)-1) #define PIECE_TYPE(piece) ((piece)&~3) #define PIECE_IS_PAWN(piece) (((piece)&PawnFlags)!=0) #define PIECE_IS_KNIGHT(piece) (((piece)&KnightFlag)!=0) #define PIECE_IS_BISHOP(piece) (((piece)&QueenFlags)==BishopFlag) #define PIECE_IS_ROOK(piece) (((piece)&QueenFlags)==RookFlag) #define PIECE_IS_QUEEN(piece) (((piece)&QueenFlags)==QueenFlags) #define PIECE_IS_KING(piece) (((piece)&KingFlag)!=0) #define PIECE_IS_SLIDER(piece) (((piece)&QueenFlags)!=0) #define PIECE_TO_12(piece) (PieceTo12[piece]) #define PIECE_ORDER(piece) (PieceOrder[piece]) #define PAWN_MOVE_INC(colour) (PawnMoveInc[colour]) #define PIECE_INC(piece) (PieceInc[piece]) // types typedef int inc_t; // "constants" extern const int PawnMake[ColourNb]; extern const int PieceFrom12[12]; extern const inc_t PawnMoveInc[ColourNb]; extern const inc_t KnightInc[8+1]; extern const inc_t BishopInc[4+1]; extern const inc_t RookInc[4+1]; extern const inc_t QueenInc[8+1]; extern const inc_t KingInc[8+1]; // variables extern int PieceTo12[PieceNb]; extern int PieceOrder[PieceNb]; extern const inc_t * PieceInc[PieceNb]; // functions extern void piece_init (); extern bool piece_is_ok (int piece); extern int piece_from_12 (int piece_12); extern int piece_to_char (int piece); extern int piece_from_char (int c); } // namespace engine #endif // !defined PIECE_H // end of piece.h gnuchess-6.2.2/src/engine/posix.cpp000644 000766 000024 00000011614 11517375750 020073 0ustar00antoniostaff000000 000000 /* posix.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // posix.cpp // includes #include #include // REMOVE ME? #include #include #include #if defined(_WIN32) || defined(_WIN64) # include #else // assume POSIX # include # include # include # include #endif #include "posix.h" #include "util.h" #include "components.h" // Streams used to communicate with the adapter extern FILE *pipefd_a2e_0_stream; extern FILE *pipefd_e2a_1_stream; namespace engine { // constants static const bool UseDebug = false; // prototypes #if !defined(_WIN32) && !defined(_WIN64) static double duration (const struct timeval * tv); #endif // functions // input_available() bool input_available() { #if defined(_WIN32) || defined(_WIN64) static bool init = false, is_pipe; static HANDLE stdin_h; DWORD val, error; // val = 0; // needed to make the compiler happy? // have a look at the "local" buffer first, *this time before init (no idea if it helps)* if (UseDebug && !init) printf("info string init=%d pipefd_a2e_0_stream->_cnt=%d\n",int(init),pipefd_a2e_0_stream->_cnt); if (pipefd_a2e_0_stream->_cnt > 0) return true; // HACK: assumes FILE internals // input init (only done once) if (!init) { init = true; stdin_h = GetStdHandle(STD_INPUT_HANDLE); if (UseDebug && (stdin_h == NULL || stdin_h == INVALID_HANDLE_VALUE)) { error = GetLastError(); printf("info string GetStdHandle() failed, error=%d\n",error); } is_pipe = !GetConsoleMode(stdin_h,&val); // HACK: assumes pipe on failure if (UseDebug) printf("info string init=%d is_pipe=%d\n",int(init),int(is_pipe)); if (UseDebug && is_pipe) { // GetConsoleMode() failed, everybody assumes pipe then error = GetLastError(); printf("info string GetConsoleMode() failed, error=%d\n",error); } if (!is_pipe) { SetConsoleMode(stdin_h,val&~(ENABLE_MOUSE_INPUT|ENABLE_WINDOW_INPUT)); FlushConsoleInputBuffer(stdin_h); // no idea if we can lose data doing this } } // different polling depending on input type // does this code work at all for pipes? if (is_pipe) { if (!PeekNamedPipe(stdin_h,NULL,0,NULL,&val,NULL)) { if (UseDebug) { // PeekNamedPipe() failed, everybody assumes EOF then error = GetLastError(); printf("info string PeekNamedPipe() failed, error=%d\n",error); } return true; // HACK: assumes EOF on failure } if (UseDebug && val < 0) printf("info string PeekNamedPipe(): val=%d\n",val); return val > 0; // != 0??? } else { GetNumberOfConsoleInputEvents(stdin_h,&val); return val > 1; // no idea why 1 } return false; #else // assume POSIX int val; fd_set set[1]; struct timeval time_val[1]; FD_ZERO(set); FD_SET(pipefd_a2e[0],set); time_val->tv_sec = 0; time_val->tv_usec = 0; val = select(pipefd_a2e[0]+1,set,NULL,NULL,time_val); if (val == -1 && errno != EINTR) { my_fatal("input_available(): select(): %s\n",strerror(errno)); } return val > 0; #endif } // now_real() double now_real() { #if defined(_WIN32) || defined(_WIN64) return double(GetTickCount()) / 1000.0; #else // assume POSIX struct timeval tv[1]; struct timezone tz[1]; tz->tz_minuteswest = 0; tz->tz_dsttime = 0; // DST_NONE not declared in GNU/Linux if (gettimeofday(tv,tz) == -1) { // tz needed at all? my_fatal("now_real(): gettimeofday(): %s\n",strerror(errno)); } return duration(tv); #endif } // now_cpu() double now_cpu() { #if defined(_WIN32) || defined(_WIN64) return double(clock()) / double(CLOCKS_PER_SEC); // OK if CLOCKS_PER_SEC is small enough #else // assume POSIX struct rusage ru[1]; if (getrusage(RUSAGE_SELF,ru) == -1) { my_fatal("now_cpu(): getrusage(): %s\n",strerror(errno)); } return duration(&ru->ru_utime); #endif } // duration() #if !defined(_WIN32) && !defined(_WIN64) static double duration(const struct timeval * tv) { ASSERT(tv!=NULL); return double(tv->tv_sec) + double(tv->tv_usec) * 1E-6; } #endif } // namespace engine // end of posix.cpp gnuchess-6.2.2/src/engine/posix.h000644 000766 000024 00000002001 11517375750 017526 0ustar00antoniostaff000000 000000 /* posix.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // posix.h #ifndef POSIX_H #define POSIX_H // includes #include "util.h" namespace engine { // functions extern bool input_available (); extern double now_real (); extern double now_cpu (); } // namespace engine #endif // !defined POSIX_H // end of posix.h gnuchess-6.2.2/src/engine/protocol.cpp000644 000766 000024 00000031405 12606163573 020570 0ustar00antoniostaff000000 000000 /* protocol.cpp GNU Chess engine Copyright (C) 2001-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // protocol.cpp // includes #include #include #include #include #include #include "board.h" #include "book.h" #include "eval.h" #include "fen.h" #include "material.h" #include "move.h" #include "move_do.h" #include "move_legal.h" #include "option.h" #include "pawn.h" #include "posix.h" #include "protocol.h" #include "pst.h" #include "search.h" #include "trans.h" #include "util.h" #include "config.h" // constants namespace engine { static const double NormalRatio = 1.0; static const double PonderRatio = 1.25; // variables static bool Init; static bool Searching; // search in progress? static bool Infinite; // infinite or ponder mode? static bool Delay; // postpone "bestmove" in infinite/ponder mode? extern bool UseTrans; // Streams used for communication with the adapter extern FILE *pipefd_a2e_0_stream; extern FILE *pipefd_e2a_1_stream; // prototypes static void init (); static void loop_step (); static void parse_go (char string[]); static void parse_position (char string[]); static void parse_setoption (char string[]); static void send_best_move (); static bool string_equal (const char s1[], const char s2[]); static bool string_start_with (const char s1[], const char s2[]); // functions // loop() void loop() { // init (to help debugging) Init = false; Searching = false; Infinite = false; Delay = false; search_clear(); board_from_fen(SearchInput->board,StartFen); // loop while (true) loop_step(); } // init() static void init() { if (!Init) { // late initialisation Init = true; if (option_get_bool("OwnBook")) { book_open(option_get_string("BookFile")); } trans_alloc(Trans); pawn_init(); pawn_alloc(); material_init(); material_alloc(); pst_init(); eval_init(); } } // event() void event() { while (!SearchInfo->stop && input_available()) loop_step(); } // loop_step() static void loop_step() { char string[65536]; // read a line get(string,65536); // parse if (false) { } else if (string_start_with(string,"debug ")) { // dummy } else if (string_start_with(string,"go ")) { if (!Searching && !Delay) { init(); parse_go(string); } else { ASSERT(false); } } else if (string_equal(string,"isready")) { if (!Searching && !Delay) { init(); } send("readyok"); // no need to wait when searching (dixit SMK) } else if (string_equal(string,"ponderhit")) { if (Searching) { ASSERT(Infinite); SearchInput->infinite = false; Infinite = false; } else if (Delay) { send_best_move(); Delay = false; } else { ASSERT(false); } } else if (string_start_with(string,"position ")) { if (!Searching && !Delay) { init(); parse_position(string); } else { ASSERT(false); } } else if (string_equal(string,"quit")) { ASSERT(!Searching); ASSERT(!Delay); //exit(EXIT_SUCCESS); pthread_exit(NULL); } else if (string_start_with(string,"setoption ")) { if (!Searching && !Delay) { parse_setoption(string); } else { ASSERT(false); } } else if (string_equal(string,"stop")) { if (Searching) { SearchInfo->stop = true; Infinite = false; } else if (Delay) { send_best_move(); Delay = false; } } else if (string_equal(string,"uci")) { ASSERT(!Searching); ASSERT(!Delay); send("id name GNU Chess " VERSION); send("id author GNU Chess team"); option_list(); send("uciok"); } else if (string_equal(string,"ucinewgame")) { if (!Searching && !Delay && Init) { trans_clear(Trans); } else { ASSERT(false); } } else if (string_equal(string,"hashon")) { UseTrans = true; } else if (string_equal(string,"hashoff")) { UseTrans = false; } } // parse_go() static void parse_go(char string[]) { const char * ptr; bool infinite, ponder; int depth, mate, movestogo; sint64 nodes; double binc, btime, movetime, winc, wtime; double time, inc; double time_max, alloc; // init infinite = false; ponder = false; depth = -1; mate = -1; movestogo = -1; nodes = -1; binc = -1.0; btime = -1.0; movetime = -1.0; winc = -1.0; wtime = -1.0; // parse ptr = strtok(string," "); // skip "go" for (ptr = strtok(NULL," "); ptr != NULL; ptr = strtok(NULL," ")) { if (false) { } else if (string_equal(ptr,"binc")) { ptr = strtok(NULL," "); if (ptr == NULL) my_fatal("parse_go(): missing argument\n"); binc = double(atoi(ptr)) / 1000.0; ASSERT(binc>=0.0); } else if (string_equal(ptr,"btime")) { ptr = strtok(NULL," "); if (ptr == NULL) my_fatal("parse_go(): missing argument\n"); btime = double(atoi(ptr)) / 1000.0; ASSERT(btime>=0.0); } else if (string_equal(ptr,"depth")) { ptr = strtok(NULL," "); if (ptr == NULL) my_fatal("parse_go(): missing argument\n"); depth = atoi(ptr); ASSERT(depth>=0); } else if (string_equal(ptr,"infinite")) { infinite = true; } else if (string_equal(ptr,"mate")) { ptr = strtok(NULL," "); if (ptr == NULL) my_fatal("parse_go(): missing argument\n"); mate = atoi(ptr); ASSERT(mate>=0); } else if (string_equal(ptr,"movestogo")) { ptr = strtok(NULL," "); if (ptr == NULL) my_fatal("parse_go(): missing argument\n"); movestogo = atoi(ptr); ASSERT(movestogo>=0); } else if (string_equal(ptr,"movetime")) { ptr = strtok(NULL," "); if (ptr == NULL) my_fatal("parse_go(): missing argument\n"); movetime = double(atoi(ptr)) / 1000.0; ASSERT(movetime>=0.0); } else if (string_equal(ptr,"nodes")) { ptr = strtok(NULL," "); if (ptr == NULL) my_fatal("parse_go(): missing argument\n"); nodes = my_atoll(ptr); ASSERT(nodes>=0); } else if (string_equal(ptr,"ponder")) { ponder = true; } else if (string_equal(ptr,"searchmoves")) { // dummy } else if (string_equal(ptr,"winc")) { ptr = strtok(NULL," "); if (ptr == NULL) my_fatal("parse_go(): missing argument\n"); winc = double(atoi(ptr)) / 1000.0; ASSERT(winc>=0.0); } else if (string_equal(ptr,"wtime")) { ptr = strtok(NULL," "); if (ptr == NULL) my_fatal("parse_go(): missing argument\n"); wtime = double(atoi(ptr)) / 1000.0; ASSERT(wtime>=0.0); } } // init search_clear(); // depth limit if (depth >= 0) { SearchInput->depth_is_limited = true; SearchInput->depth_limit = depth; } else if (mate >= 0) { SearchInput->depth_is_limited = true; SearchInput->depth_limit = mate * 2 - 1; // HACK: move -> ply } // time limit if (COLOUR_IS_WHITE(SearchInput->board->turn)) { time = wtime; inc = winc; } else { time = btime; inc = binc; } if (movestogo <= 0 || movestogo > 30) movestogo = 30; // HACK if (inc < 0.0) inc = 0.0; if (movetime >= 0.0) { // fixed time SearchInput->time_is_limited = true; SearchInput->time_limit_1 = movetime * 5.0; // HACK to avoid early exit SearchInput->time_limit_2 = movetime; } else if (time >= 0.0) { // dynamic allocation time_max = time * 0.95 - 1.0; if (time_max < 0.0) time_max = 0.0; SearchInput->time_is_limited = true; alloc = (time_max + inc * double(movestogo-1)) / double(movestogo); alloc *= (option_get_bool("Ponder") ? PonderRatio : NormalRatio); if (alloc > time_max) alloc = time_max; SearchInput->time_limit_1 = alloc; alloc = (time_max + inc * double(movestogo-1)) * 0.5; if (alloc < SearchInput->time_limit_1) alloc = SearchInput->time_limit_1; if (alloc > time_max) alloc = time_max; SearchInput->time_limit_2 = alloc; } if (infinite || ponder) SearchInput->infinite = true; // search ASSERT(!Searching); ASSERT(!Delay); Searching = true; Infinite = infinite || ponder; Delay = false; search(); search_update_current(); ASSERT(Searching); ASSERT(!Delay); Searching = false; Delay = Infinite; if (!Delay) send_best_move(); } // parse_position() static void parse_position(char string[]) { const char * fen; char * moves; const char * ptr; char move_string[256]; int move; undo_t undo[1]; // init fen = strstr(string,"fen "); moves = strstr(string,"moves "); // start position if (fen != NULL) { // "fen" present if (moves != NULL) { // "moves" present ASSERT(moves>fen); moves[-1] = '\0'; // dirty, but so is UCI } board_from_fen(SearchInput->board,fen+4); // CHANGE ME } else { // HACK: assumes startpos board_from_fen(SearchInput->board,StartFen); } // moves if (moves != NULL) { // "moves" present ptr = moves + 6; while (*ptr != '\0') { move_string[0] = *ptr++; move_string[1] = *ptr++; move_string[2] = *ptr++; move_string[3] = *ptr++; if (*ptr == '\0' || *ptr == ' ') { move_string[4] = '\0'; } else { // promote move_string[4] = *ptr++; move_string[5] = '\0'; } move = move_from_string(move_string,SearchInput->board); move_do(SearchInput->board,move,undo); while (*ptr == ' ') ptr++; } } } // parse_setoption() static void parse_setoption(char string[]) { const char * name; char * value; // init name = strstr(string,"name "); value = strstr(string,"value "); if (name == NULL || value == NULL || name >= value) return; // ignore buttons value[-1] = '\0'; // HACK name += 5; value += 6; // update option_set(name,value); // update transposition-table size if needed if (Init && my_string_equal(name,"Hash")) { // Init => already allocated ASSERT(!Searching); if (option_get_int("Hash") >= 4) { trans_free(Trans); trans_alloc(Trans); } } } // send_best_move() static void send_best_move() { double time, speed, cpu; sint64 node_nb; char move_string[256]; char ponder_string[256]; int move; mv_t * pv; // info // HACK: should be in search.cpp time = SearchCurrent->time; speed = SearchCurrent->speed; cpu = SearchCurrent->cpu; node_nb = SearchCurrent->node_nb; send("info time %.0f nodes " S64_FORMAT " nps %.0f cpuload %.0f",time*1000.0,node_nb,speed,cpu*1000.0); trans_stats(Trans); // pawn_stats(); // material_stats(); // best move move = SearchBest->move; pv = SearchBest->pv; move_to_string(move,move_string,256); if (pv[0] == move && move_is_ok(pv[1])) { move_to_string(pv[1],ponder_string,256); send("bestmove %s ponder %s",move_string,ponder_string); } else { send("bestmove %s",move_string); } } // get() void get(char string[], int size) { ASSERT(string!=NULL); ASSERT(size>=65536); if (!my_file_read_line(pipefd_a2e_0_stream,string,size)) { // EOF exit(EXIT_SUCCESS); } } // send() void send(const char format[], ...) { va_list arg_list; char string[4096]; ASSERT(format!=NULL); va_start(arg_list,format); vsprintf(string,format,arg_list); va_end(arg_list); fprintf(pipefd_e2a_1_stream,"%s\n",string); } // string_equal() static bool string_equal(const char s1[], const char s2[]) { ASSERT(s1!=NULL); ASSERT(s2!=NULL); return strcmp(s1,s2) == 0; } // string_start_with() static bool string_start_with(const char s1[], const char s2[]) { ASSERT(s1!=NULL); ASSERT(s2!=NULL); return strstr(s1,s2) == s1; } } // namespace engine // end of protocol.cpp gnuchess-6.2.2/src/engine/protocol.h000644 000766 000024 00000002064 11517375750 020236 0ustar00antoniostaff000000 000000 /* protocol.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // protocol.h #ifndef PROTOCOL_H #define PROTOCOL_H // includes #include "util.h" namespace engine { // functions extern void loop (); extern void event (); extern void get (char string[], int size); extern void send (const char format[], ...); } // namespace engine #endif // !defined PROTOCOL_H // end of protocol.h gnuchess-6.2.2/src/engine/pst.cpp000644 000766 000024 00000021634 11517375750 017542 0ustar00antoniostaff000000 000000 /* pst.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // pst.cpp // includes #include "option.h" #include "piece.h" #include "pst.h" #include "util.h" // macros #define P(piece_12,square_64,stage) (Pst[(piece_12)][(square_64)][(stage)]) namespace engine { // constants static const int A1=000, B1=001, C1=002, D1=003, E1=004, F1=005, G1=006, H1=007; static const int A2=010, B2=011, C2=012, D2=013, E2=014, F2=015, G2=016, H2=017; static const int A3=020, B3=021, C3=022, D3=023, E3=024, F3=025, G3=026, H3=027; static const int A4=030, B4=031, C4=032, D4=033, E4=034, F4=035, G4=036, H4=037; static const int A5=040, B5=041, C5=042, D5=043, E5=044, F5=045, G5=046, H5=047; static const int A6=050, B6=051, C6=052, D6=053, E6=054, F6=055, G6=056, H6=057; static const int A7=060, B7=061, C7=062, D7=063, E7=064, F7=065, G7=066, H7=067; static const int A8=070, B8=071, C8=072, D8=073, E8=074, F8=075, G8=076, H8=077; // constants and variables static /* const */ int PieceActivityWeight = 256; // 100% static /* const */ int KingSafetyWeight = 256; // 100% static /* const */ int PawnStructureWeight = 256; // 100% static const int PawnFileOpening = 5; static const int KnightCentreOpening = 5; static const int KnightCentreEndgame = 5; static const int KnightRankOpening = 5; static const int KnightBackRankOpening = 0; static const int KnightTrapped = 100; static const int BishopCentreOpening = 2; static const int BishopCentreEndgame = 3; static const int BishopBackRankOpening = 10; static const int BishopDiagonalOpening = 4; static const int RookFileOpening = 3; static const int QueenCentreOpening = 0; static const int QueenCentreEndgame = 4; static const int QueenBackRankOpening = 5; static const int KingCentreEndgame = 12; static const int KingFileOpening = 10; static const int KingRankOpening = 10; // "constants" static const int PawnFile[8] = { -3, -1, +0, +1, +1, +0, -1, -3, }; static const int KnightLine[8] = { -4, -2, +0, +1, +1, +0, -2, -4, }; static const int KnightRank[8] = { -2, -1, +0, +1, +2, +3, +2, +1, }; static const int BishopLine[8] = { -3, -1, +0, +1, +1, +0, -1, -3, }; static const int RookFile[8] = { -2, -1, +0, +1, +1, +0, -1, -2, }; static const int QueenLine[8] = { -3, -1, +0, +1, +1, +0, -1, -3, }; static const int KingLine[8] = { -3, -1, +0, +1, +1, +0, -1, -3, }; static const int KingFile[8] = { +3, +4, +2, +0, +0, +2, +4, +3, }; static const int KingRank[8] = { +1, +0, -2, -3, -4, -5, -6, -7, }; // variables sint16 Pst[12][64][StageNb]; // prototypes static int square_make (int file, int rank); static int square_file (int square); static int square_rank (int square); static int square_opp (int square); // functions // pst_init() void pst_init() { int i; int piece, sq, stage; // UCI options PieceActivityWeight = (option_get_int("Piece Activity") * 256 + 50) / 100; KingSafetyWeight = (option_get_int("King Safety") * 256 + 50) / 100; PawnStructureWeight = (option_get_int("Pawn Structure") * 256 + 50) / 100; // init for (piece = 0; piece < 12; piece++) { for (sq = 0; sq < 64; sq++) { for (stage = 0; stage < StageNb; stage++) { P(piece,sq,stage) = 0; } } } // pawns piece = WhitePawn12; // file for (sq = 0; sq < 64; sq++) { P(piece,sq,Opening) += PawnFile[square_file(sq)] * PawnFileOpening; } // centre control P(piece,D3,Opening) += 10; P(piece,E3,Opening) += 10; P(piece,D4,Opening) += 20; P(piece,E4,Opening) += 20; P(piece,D5,Opening) += 10; P(piece,E5,Opening) += 10; // weight for (sq = 0; sq < 64; sq++) { P(piece,sq,Opening) = (P(piece,sq,Opening) * PawnStructureWeight) / 256; P(piece,sq,Endgame) = (P(piece,sq,Endgame) * PawnStructureWeight) / 256; } // knights piece = WhiteKnight12; // centre for (sq = 0; sq < 64; sq++) { P(piece,sq,Opening) += KnightLine[square_file(sq)] * KnightCentreOpening; P(piece,sq,Opening) += KnightLine[square_rank(sq)] * KnightCentreOpening; P(piece,sq,Endgame) += KnightLine[square_file(sq)] * KnightCentreEndgame; P(piece,sq,Endgame) += KnightLine[square_rank(sq)] * KnightCentreEndgame; } // rank for (sq = 0; sq < 64; sq++) { P(piece,sq,Opening) += KnightRank[square_rank(sq)] * KnightRankOpening; } // back rank for (sq = A1; sq <= H1; sq++) { // HACK: only first rank P(piece,sq,Opening) -= KnightBackRankOpening; } // "trapped" P(piece,A8,Opening) -= KnightTrapped; P(piece,H8,Opening) -= KnightTrapped; // weight for (sq = 0; sq < 64; sq++) { P(piece,sq,Opening) = (P(piece,sq,Opening) * PieceActivityWeight) / 256; P(piece,sq,Endgame) = (P(piece,sq,Endgame) * PieceActivityWeight) / 256; } // bishops piece = WhiteBishop12; // centre for (sq = 0; sq < 64; sq++) { P(piece,sq,Opening) += BishopLine[square_file(sq)] * BishopCentreOpening; P(piece,sq,Opening) += BishopLine[square_rank(sq)] * BishopCentreOpening; P(piece,sq,Endgame) += BishopLine[square_file(sq)] * BishopCentreEndgame; P(piece,sq,Endgame) += BishopLine[square_rank(sq)] * BishopCentreEndgame; } // back rank for (sq = A1; sq <= H1; sq++) { // HACK: only first rank P(piece,sq,Opening) -= BishopBackRankOpening; } // main diagonals for (i = 0; i < 8; i++) { sq = square_make(i,i); P(piece,sq,Opening) += BishopDiagonalOpening; P(piece,square_opp(sq),Opening) += BishopDiagonalOpening; } // weight for (sq = 0; sq < 64; sq++) { P(piece,sq,Opening) = (P(piece,sq,Opening) * PieceActivityWeight) / 256; P(piece,sq,Endgame) = (P(piece,sq,Endgame) * PieceActivityWeight) / 256; } // rooks piece = WhiteRook12; // file for (sq = 0; sq < 64; sq++) { P(piece,sq,Opening) += RookFile[square_file(sq)] * RookFileOpening; } // weight for (sq = 0; sq < 64; sq++) { P(piece,sq,Opening) = (P(piece,sq,Opening) * PieceActivityWeight) / 256; P(piece,sq,Endgame) = (P(piece,sq,Endgame) * PieceActivityWeight) / 256; } // queens piece = WhiteQueen12; // centre for (sq = 0; sq < 64; sq++) { P(piece,sq,Opening) += QueenLine[square_file(sq)] * QueenCentreOpening; P(piece,sq,Opening) += QueenLine[square_rank(sq)] * QueenCentreOpening; P(piece,sq,Endgame) += QueenLine[square_file(sq)] * QueenCentreEndgame; P(piece,sq,Endgame) += QueenLine[square_rank(sq)] * QueenCentreEndgame; } // back rank for (sq = A1; sq <= H1; sq++) { // HACK: only first rank P(piece,sq,Opening) -= QueenBackRankOpening; } // weight for (sq = 0; sq < 64; sq++) { P(piece,sq,Opening) = (P(piece,sq,Opening) * PieceActivityWeight) / 256; P(piece,sq,Endgame) = (P(piece,sq,Endgame) * PieceActivityWeight) / 256; } // kings piece = WhiteKing12; // centre for (sq = 0; sq < 64; sq++) { P(piece,sq,Endgame) += KingLine[square_file(sq)] * KingCentreEndgame; P(piece,sq,Endgame) += KingLine[square_rank(sq)] * KingCentreEndgame; } // file for (sq = 0; sq < 64; sq++) { P(piece,sq,Opening) += KingFile[square_file(sq)] * KingFileOpening; } // rank for (sq = 0; sq < 64; sq++) { P(piece,sq,Opening) += KingRank[square_rank(sq)] * KingRankOpening; } // weight for (sq = 0; sq < 64; sq++) { P(piece,sq,Opening) = (P(piece,sq,Opening) * KingSafetyWeight) / 256; P(piece,sq,Endgame) = (P(piece,sq,Endgame) * PieceActivityWeight) / 256; } // symmetry copy for black for (piece = 0; piece < 12; piece += 2) { // HACK for (sq = 0; sq < 64; sq++) { for (stage = 0; stage < StageNb; stage++) { P(piece+1,sq,stage) = -P(piece,square_opp(sq),stage); // HACK } } } } // square_make() static int square_make(int file, int rank) { ASSERT(file>=0&&file<8); ASSERT(rank>=0&&rank<8); return (rank << 3) | file; } // square_file() static int square_file(int square) { ASSERT(square>=0&&square<64); return square & 7; } // square_rank() static int square_rank(int square) { ASSERT(square>=0&&square<64); return square >> 3; } // square_opp() static int square_opp(int square) { ASSERT(square>=0&&square<64); return square ^ 070; } } // namespace engine // end of pst.cpp gnuchess-6.2.2/src/engine/pst.h000644 000766 000024 00000002202 11517375750 017175 0ustar00antoniostaff000000 000000 /* pst.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // pst.h #ifndef PST_H #define PST_H // includes #include "util.h" namespace engine { // constants const int Opening = 0; const int Endgame = 1; const int StageNb = 2; // macros #define PST(piece_12,square_64,stage) (Pst[piece_12][square_64][stage]) // variables extern sint16 Pst[12][64][StageNb]; // functions extern void pst_init (); } // namespace engine #endif // !defined PST_H // end of pst.h gnuchess-6.2.2/src/engine/pv.cpp000644 000766 000024 00000004037 11517375750 017357 0ustar00antoniostaff000000 000000 /* pv.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // pv.cpp // includes #include #include "board.h" #include "move.h" #include "move_do.h" #include "pv.h" #include "util.h" namespace engine { // functions // pv_is_ok() bool pv_is_ok(const mv_t pv[]) { int pos; int move; if (pv == NULL) return false; for (pos = 0; true; pos++) { if (pos >= 256) return false; move = pv[pos]; if (move == MoveNone) return true; if (!move_is_ok(move)) return false; } return true; } // pv_copy() void pv_copy(mv_t dst[], const mv_t src[]) { ASSERT(pv_is_ok(src)); ASSERT(dst!=NULL); while ((*dst++ = *src++) != MoveNone) ; } // pv_cat() void pv_cat(mv_t dst[], const mv_t src[], int move) { ASSERT(pv_is_ok(src)); ASSERT(dst!=NULL); *dst++ = move; while ((*dst++ = *src++) != MoveNone) ; } // pv_to_string() bool pv_to_string(const mv_t pv[], char string[], int size) { int pos; int move; ASSERT(pv_is_ok(pv)); ASSERT(string!=NULL); ASSERT(size>=512); // init if (size < 512) return false; pos = 0; // loop while ((move = *pv++) != MoveNone) { if (pos != 0) string[pos++] = ' '; move_to_string(move,&string[pos],size-pos); pos += strlen(&string[pos]); } string[pos] = '\0'; return true; } } // namespace engine // end of pv.cpp gnuchess-6.2.2/src/engine/pv.h000644 000766 000024 00000002316 11517375750 017022 0ustar00antoniostaff000000 000000 /* pv.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // pv.h #ifndef PV_H #define PV_H // includes #include "board.h" #include "move.h" #include "util.h" // macros #define PV_CLEAR(pv) (*(pv)=MoveNone) namespace engine { // functions extern bool pv_is_ok (const mv_t pv[]); extern void pv_copy (mv_t dst[], const mv_t src[]); extern void pv_cat (mv_t dst[], const mv_t src[], int move); extern bool pv_to_string (const mv_t pv[], char string[], int size); } // namespace engine #endif // !defined PV_H // end of pv.h gnuchess-6.2.2/src/engine/random.cpp000644 000766 000024 00000051377 11517375750 020223 0ustar00antoniostaff000000 000000 /* random.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // random.cpp // includes #include "random.h" #include "util.h" namespace engine { // "constants" const uint64 Random64[RandomNb] = { U64(0x9D39247E33776D41), U64(0x2AF7398005AAA5C7), U64(0x44DB015024623547), U64(0x9C15F73E62A76AE2), U64(0x75834465489C0C89), U64(0x3290AC3A203001BF), U64(0x0FBBAD1F61042279), U64(0xE83A908FF2FB60CA), U64(0x0D7E765D58755C10), U64(0x1A083822CEAFE02D), U64(0x9605D5F0E25EC3B0), U64(0xD021FF5CD13A2ED5), U64(0x40BDF15D4A672E32), U64(0x011355146FD56395), U64(0x5DB4832046F3D9E5), U64(0x239F8B2D7FF719CC), U64(0x05D1A1AE85B49AA1), U64(0x679F848F6E8FC971), U64(0x7449BBFF801FED0B), U64(0x7D11CDB1C3B7ADF0), U64(0x82C7709E781EB7CC), U64(0xF3218F1C9510786C), U64(0x331478F3AF51BBE6), U64(0x4BB38DE5E7219443), U64(0xAA649C6EBCFD50FC), U64(0x8DBD98A352AFD40B), U64(0x87D2074B81D79217), U64(0x19F3C751D3E92AE1), U64(0xB4AB30F062B19ABF), U64(0x7B0500AC42047AC4), U64(0xC9452CA81A09D85D), U64(0x24AA6C514DA27500), U64(0x4C9F34427501B447), U64(0x14A68FD73C910841), U64(0xA71B9B83461CBD93), U64(0x03488B95B0F1850F), U64(0x637B2B34FF93C040), U64(0x09D1BC9A3DD90A94), U64(0x3575668334A1DD3B), U64(0x735E2B97A4C45A23), U64(0x18727070F1BD400B), U64(0x1FCBACD259BF02E7), U64(0xD310A7C2CE9B6555), U64(0xBF983FE0FE5D8244), U64(0x9F74D14F7454A824), U64(0x51EBDC4AB9BA3035), U64(0x5C82C505DB9AB0FA), U64(0xFCF7FE8A3430B241), U64(0x3253A729B9BA3DDE), U64(0x8C74C368081B3075), U64(0xB9BC6C87167C33E7), U64(0x7EF48F2B83024E20), U64(0x11D505D4C351BD7F), U64(0x6568FCA92C76A243), U64(0x4DE0B0F40F32A7B8), U64(0x96D693460CC37E5D), U64(0x42E240CB63689F2F), U64(0x6D2BDCDAE2919661), U64(0x42880B0236E4D951), U64(0x5F0F4A5898171BB6), U64(0x39F890F579F92F88), U64(0x93C5B5F47356388B), U64(0x63DC359D8D231B78), U64(0xEC16CA8AEA98AD76), U64(0x5355F900C2A82DC7), U64(0x07FB9F855A997142), U64(0x5093417AA8A7ED5E), U64(0x7BCBC38DA25A7F3C), U64(0x19FC8A768CF4B6D4), U64(0x637A7780DECFC0D9), U64(0x8249A47AEE0E41F7), U64(0x79AD695501E7D1E8), U64(0x14ACBAF4777D5776), U64(0xF145B6BECCDEA195), U64(0xDABF2AC8201752FC), U64(0x24C3C94DF9C8D3F6), U64(0xBB6E2924F03912EA), U64(0x0CE26C0B95C980D9), U64(0xA49CD132BFBF7CC4), U64(0xE99D662AF4243939), U64(0x27E6AD7891165C3F), U64(0x8535F040B9744FF1), U64(0x54B3F4FA5F40D873), U64(0x72B12C32127FED2B), U64(0xEE954D3C7B411F47), U64(0x9A85AC909A24EAA1), U64(0x70AC4CD9F04F21F5), U64(0xF9B89D3E99A075C2), U64(0x87B3E2B2B5C907B1), U64(0xA366E5B8C54F48B8), U64(0xAE4A9346CC3F7CF2), U64(0x1920C04D47267BBD), U64(0x87BF02C6B49E2AE9), U64(0x092237AC237F3859), U64(0xFF07F64EF8ED14D0), U64(0x8DE8DCA9F03CC54E), U64(0x9C1633264DB49C89), U64(0xB3F22C3D0B0B38ED), U64(0x390E5FB44D01144B), U64(0x5BFEA5B4712768E9), U64(0x1E1032911FA78984), U64(0x9A74ACB964E78CB3), U64(0x4F80F7A035DAFB04), U64(0x6304D09A0B3738C4), U64(0x2171E64683023A08), U64(0x5B9B63EB9CEFF80C), U64(0x506AACF489889342), U64(0x1881AFC9A3A701D6), U64(0x6503080440750644), U64(0xDFD395339CDBF4A7), U64(0xEF927DBCF00C20F2), U64(0x7B32F7D1E03680EC), U64(0xB9FD7620E7316243), U64(0x05A7E8A57DB91B77), U64(0xB5889C6E15630A75), U64(0x4A750A09CE9573F7), U64(0xCF464CEC899A2F8A), U64(0xF538639CE705B824), U64(0x3C79A0FF5580EF7F), U64(0xEDE6C87F8477609D), U64(0x799E81F05BC93F31), U64(0x86536B8CF3428A8C), U64(0x97D7374C60087B73), U64(0xA246637CFF328532), U64(0x043FCAE60CC0EBA0), U64(0x920E449535DD359E), U64(0x70EB093B15B290CC), U64(0x73A1921916591CBD), U64(0x56436C9FE1A1AA8D), U64(0xEFAC4B70633B8F81), U64(0xBB215798D45DF7AF), U64(0x45F20042F24F1768), U64(0x930F80F4E8EB7462), U64(0xFF6712FFCFD75EA1), U64(0xAE623FD67468AA70), U64(0xDD2C5BC84BC8D8FC), U64(0x7EED120D54CF2DD9), U64(0x22FE545401165F1C), U64(0xC91800E98FB99929), U64(0x808BD68E6AC10365), U64(0xDEC468145B7605F6), U64(0x1BEDE3A3AEF53302), U64(0x43539603D6C55602), U64(0xAA969B5C691CCB7A), U64(0xA87832D392EFEE56), U64(0x65942C7B3C7E11AE), U64(0xDED2D633CAD004F6), U64(0x21F08570F420E565), U64(0xB415938D7DA94E3C), U64(0x91B859E59ECB6350), U64(0x10CFF333E0ED804A), U64(0x28AED140BE0BB7DD), U64(0xC5CC1D89724FA456), U64(0x5648F680F11A2741), U64(0x2D255069F0B7DAB3), U64(0x9BC5A38EF729ABD4), U64(0xEF2F054308F6A2BC), U64(0xAF2042F5CC5C2858), U64(0x480412BAB7F5BE2A), U64(0xAEF3AF4A563DFE43), U64(0x19AFE59AE451497F), U64(0x52593803DFF1E840), U64(0xF4F076E65F2CE6F0), U64(0x11379625747D5AF3), U64(0xBCE5D2248682C115), U64(0x9DA4243DE836994F), U64(0x066F70B33FE09017), U64(0x4DC4DE189B671A1C), U64(0x51039AB7712457C3), U64(0xC07A3F80C31FB4B4), U64(0xB46EE9C5E64A6E7C), U64(0xB3819A42ABE61C87), U64(0x21A007933A522A20), U64(0x2DF16F761598AA4F), U64(0x763C4A1371B368FD), U64(0xF793C46702E086A0), U64(0xD7288E012AEB8D31), U64(0xDE336A2A4BC1C44B), U64(0x0BF692B38D079F23), U64(0x2C604A7A177326B3), U64(0x4850E73E03EB6064), U64(0xCFC447F1E53C8E1B), U64(0xB05CA3F564268D99), U64(0x9AE182C8BC9474E8), U64(0xA4FC4BD4FC5558CA), U64(0xE755178D58FC4E76), U64(0x69B97DB1A4C03DFE), U64(0xF9B5B7C4ACC67C96), U64(0xFC6A82D64B8655FB), U64(0x9C684CB6C4D24417), U64(0x8EC97D2917456ED0), U64(0x6703DF9D2924E97E), U64(0xC547F57E42A7444E), U64(0x78E37644E7CAD29E), U64(0xFE9A44E9362F05FA), U64(0x08BD35CC38336615), U64(0x9315E5EB3A129ACE), U64(0x94061B871E04DF75), U64(0xDF1D9F9D784BA010), U64(0x3BBA57B68871B59D), U64(0xD2B7ADEEDED1F73F), U64(0xF7A255D83BC373F8), U64(0xD7F4F2448C0CEB81), U64(0xD95BE88CD210FFA7), U64(0x336F52F8FF4728E7), U64(0xA74049DAC312AC71), U64(0xA2F61BB6E437FDB5), U64(0x4F2A5CB07F6A35B3), U64(0x87D380BDA5BF7859), U64(0x16B9F7E06C453A21), U64(0x7BA2484C8A0FD54E), U64(0xF3A678CAD9A2E38C), U64(0x39B0BF7DDE437BA2), U64(0xFCAF55C1BF8A4424), U64(0x18FCF680573FA594), U64(0x4C0563B89F495AC3), U64(0x40E087931A00930D), U64(0x8CFFA9412EB642C1), U64(0x68CA39053261169F), U64(0x7A1EE967D27579E2), U64(0x9D1D60E5076F5B6F), U64(0x3810E399B6F65BA2), U64(0x32095B6D4AB5F9B1), U64(0x35CAB62109DD038A), U64(0xA90B24499FCFAFB1), U64(0x77A225A07CC2C6BD), U64(0x513E5E634C70E331), U64(0x4361C0CA3F692F12), U64(0xD941ACA44B20A45B), U64(0x528F7C8602C5807B), U64(0x52AB92BEB9613989), U64(0x9D1DFA2EFC557F73), U64(0x722FF175F572C348), U64(0x1D1260A51107FE97), U64(0x7A249A57EC0C9BA2), U64(0x04208FE9E8F7F2D6), U64(0x5A110C6058B920A0), U64(0x0CD9A497658A5698), U64(0x56FD23C8F9715A4C), U64(0x284C847B9D887AAE), U64(0x04FEABFBBDB619CB), U64(0x742E1E651C60BA83), U64(0x9A9632E65904AD3C), U64(0x881B82A13B51B9E2), U64(0x506E6744CD974924), U64(0xB0183DB56FFC6A79), U64(0x0ED9B915C66ED37E), U64(0x5E11E86D5873D484), U64(0xF678647E3519AC6E), U64(0x1B85D488D0F20CC5), U64(0xDAB9FE6525D89021), U64(0x0D151D86ADB73615), U64(0xA865A54EDCC0F019), U64(0x93C42566AEF98FFB), U64(0x99E7AFEABE000731), U64(0x48CBFF086DDF285A), U64(0x7F9B6AF1EBF78BAF), U64(0x58627E1A149BBA21), U64(0x2CD16E2ABD791E33), U64(0xD363EFF5F0977996), U64(0x0CE2A38C344A6EED), U64(0x1A804AADB9CFA741), U64(0x907F30421D78C5DE), U64(0x501F65EDB3034D07), U64(0x37624AE5A48FA6E9), U64(0x957BAF61700CFF4E), U64(0x3A6C27934E31188A), U64(0xD49503536ABCA345), U64(0x088E049589C432E0), U64(0xF943AEE7FEBF21B8), U64(0x6C3B8E3E336139D3), U64(0x364F6FFA464EE52E), U64(0xD60F6DCEDC314222), U64(0x56963B0DCA418FC0), U64(0x16F50EDF91E513AF), U64(0xEF1955914B609F93), U64(0x565601C0364E3228), U64(0xECB53939887E8175), U64(0xBAC7A9A18531294B), U64(0xB344C470397BBA52), U64(0x65D34954DAF3CEBD), U64(0xB4B81B3FA97511E2), U64(0xB422061193D6F6A7), U64(0x071582401C38434D), U64(0x7A13F18BBEDC4FF5), U64(0xBC4097B116C524D2), U64(0x59B97885E2F2EA28), U64(0x99170A5DC3115544), U64(0x6F423357E7C6A9F9), U64(0x325928EE6E6F8794), U64(0xD0E4366228B03343), U64(0x565C31F7DE89EA27), U64(0x30F5611484119414), U64(0xD873DB391292ED4F), U64(0x7BD94E1D8E17DEBC), U64(0xC7D9F16864A76E94), U64(0x947AE053EE56E63C), U64(0xC8C93882F9475F5F), U64(0x3A9BF55BA91F81CA), U64(0xD9A11FBB3D9808E4), U64(0x0FD22063EDC29FCA), U64(0xB3F256D8ACA0B0B9), U64(0xB03031A8B4516E84), U64(0x35DD37D5871448AF), U64(0xE9F6082B05542E4E), U64(0xEBFAFA33D7254B59), U64(0x9255ABB50D532280), U64(0xB9AB4CE57F2D34F3), U64(0x693501D628297551), U64(0xC62C58F97DD949BF), U64(0xCD454F8F19C5126A), U64(0xBBE83F4ECC2BDECB), U64(0xDC842B7E2819E230), U64(0xBA89142E007503B8), U64(0xA3BC941D0A5061CB), U64(0xE9F6760E32CD8021), U64(0x09C7E552BC76492F), U64(0x852F54934DA55CC9), U64(0x8107FCCF064FCF56), U64(0x098954D51FFF6580), U64(0x23B70EDB1955C4BF), U64(0xC330DE426430F69D), U64(0x4715ED43E8A45C0A), U64(0xA8D7E4DAB780A08D), U64(0x0572B974F03CE0BB), U64(0xB57D2E985E1419C7), U64(0xE8D9ECBE2CF3D73F), U64(0x2FE4B17170E59750), U64(0x11317BA87905E790), U64(0x7FBF21EC8A1F45EC), U64(0x1725CABFCB045B00), U64(0x964E915CD5E2B207), U64(0x3E2B8BCBF016D66D), U64(0xBE7444E39328A0AC), U64(0xF85B2B4FBCDE44B7), U64(0x49353FEA39BA63B1), U64(0x1DD01AAFCD53486A), U64(0x1FCA8A92FD719F85), U64(0xFC7C95D827357AFA), U64(0x18A6A990C8B35EBD), U64(0xCCCB7005C6B9C28D), U64(0x3BDBB92C43B17F26), U64(0xAA70B5B4F89695A2), U64(0xE94C39A54A98307F), U64(0xB7A0B174CFF6F36E), U64(0xD4DBA84729AF48AD), U64(0x2E18BC1AD9704A68), U64(0x2DE0966DAF2F8B1C), U64(0xB9C11D5B1E43A07E), U64(0x64972D68DEE33360), U64(0x94628D38D0C20584), U64(0xDBC0D2B6AB90A559), U64(0xD2733C4335C6A72F), U64(0x7E75D99D94A70F4D), U64(0x6CED1983376FA72B), U64(0x97FCAACBF030BC24), U64(0x7B77497B32503B12), U64(0x8547EDDFB81CCB94), U64(0x79999CDFF70902CB), U64(0xCFFE1939438E9B24), U64(0x829626E3892D95D7), U64(0x92FAE24291F2B3F1), U64(0x63E22C147B9C3403), U64(0xC678B6D860284A1C), U64(0x5873888850659AE7), U64(0x0981DCD296A8736D), U64(0x9F65789A6509A440), U64(0x9FF38FED72E9052F), U64(0xE479EE5B9930578C), U64(0xE7F28ECD2D49EECD), U64(0x56C074A581EA17FE), U64(0x5544F7D774B14AEF), U64(0x7B3F0195FC6F290F), U64(0x12153635B2C0CF57), U64(0x7F5126DBBA5E0CA7), U64(0x7A76956C3EAFB413), U64(0x3D5774A11D31AB39), U64(0x8A1B083821F40CB4), U64(0x7B4A38E32537DF62), U64(0x950113646D1D6E03), U64(0x4DA8979A0041E8A9), U64(0x3BC36E078F7515D7), U64(0x5D0A12F27AD310D1), U64(0x7F9D1A2E1EBE1327), U64(0xDA3A361B1C5157B1), U64(0xDCDD7D20903D0C25), U64(0x36833336D068F707), U64(0xCE68341F79893389), U64(0xAB9090168DD05F34), U64(0x43954B3252DC25E5), U64(0xB438C2B67F98E5E9), U64(0x10DCD78E3851A492), U64(0xDBC27AB5447822BF), U64(0x9B3CDB65F82CA382), U64(0xB67B7896167B4C84), U64(0xBFCED1B0048EAC50), U64(0xA9119B60369FFEBD), U64(0x1FFF7AC80904BF45), U64(0xAC12FB171817EEE7), U64(0xAF08DA9177DDA93D), U64(0x1B0CAB936E65C744), U64(0xB559EB1D04E5E932), U64(0xC37B45B3F8D6F2BA), U64(0xC3A9DC228CAAC9E9), U64(0xF3B8B6675A6507FF), U64(0x9FC477DE4ED681DA), U64(0x67378D8ECCEF96CB), U64(0x6DD856D94D259236), U64(0xA319CE15B0B4DB31), U64(0x073973751F12DD5E), U64(0x8A8E849EB32781A5), U64(0xE1925C71285279F5), U64(0x74C04BF1790C0EFE), U64(0x4DDA48153C94938A), U64(0x9D266D6A1CC0542C), U64(0x7440FB816508C4FE), U64(0x13328503DF48229F), U64(0xD6BF7BAEE43CAC40), U64(0x4838D65F6EF6748F), U64(0x1E152328F3318DEA), U64(0x8F8419A348F296BF), U64(0x72C8834A5957B511), U64(0xD7A023A73260B45C), U64(0x94EBC8ABCFB56DAE), U64(0x9FC10D0F989993E0), U64(0xDE68A2355B93CAE6), U64(0xA44CFE79AE538BBE), U64(0x9D1D84FCCE371425), U64(0x51D2B1AB2DDFB636), U64(0x2FD7E4B9E72CD38C), U64(0x65CA5B96B7552210), U64(0xDD69A0D8AB3B546D), U64(0x604D51B25FBF70E2), U64(0x73AA8A564FB7AC9E), U64(0x1A8C1E992B941148), U64(0xAAC40A2703D9BEA0), U64(0x764DBEAE7FA4F3A6), U64(0x1E99B96E70A9BE8B), U64(0x2C5E9DEB57EF4743), U64(0x3A938FEE32D29981), U64(0x26E6DB8FFDF5ADFE), U64(0x469356C504EC9F9D), U64(0xC8763C5B08D1908C), U64(0x3F6C6AF859D80055), U64(0x7F7CC39420A3A545), U64(0x9BFB227EBDF4C5CE), U64(0x89039D79D6FC5C5C), U64(0x8FE88B57305E2AB6), U64(0xA09E8C8C35AB96DE), U64(0xFA7E393983325753), U64(0xD6B6D0ECC617C699), U64(0xDFEA21EA9E7557E3), U64(0xB67C1FA481680AF8), U64(0xCA1E3785A9E724E5), U64(0x1CFC8BED0D681639), U64(0xD18D8549D140CAEA), U64(0x4ED0FE7E9DC91335), U64(0xE4DBF0634473F5D2), U64(0x1761F93A44D5AEFE), U64(0x53898E4C3910DA55), U64(0x734DE8181F6EC39A), U64(0x2680B122BAA28D97), U64(0x298AF231C85BAFAB), U64(0x7983EED3740847D5), U64(0x66C1A2A1A60CD889), U64(0x9E17E49642A3E4C1), U64(0xEDB454E7BADC0805), U64(0x50B704CAB602C329), U64(0x4CC317FB9CDDD023), U64(0x66B4835D9EAFEA22), U64(0x219B97E26FFC81BD), U64(0x261E4E4C0A333A9D), U64(0x1FE2CCA76517DB90), U64(0xD7504DFA8816EDBB), U64(0xB9571FA04DC089C8), U64(0x1DDC0325259B27DE), U64(0xCF3F4688801EB9AA), U64(0xF4F5D05C10CAB243), U64(0x38B6525C21A42B0E), U64(0x36F60E2BA4FA6800), U64(0xEB3593803173E0CE), U64(0x9C4CD6257C5A3603), U64(0xAF0C317D32ADAA8A), U64(0x258E5A80C7204C4B), U64(0x8B889D624D44885D), U64(0xF4D14597E660F855), U64(0xD4347F66EC8941C3), U64(0xE699ED85B0DFB40D), U64(0x2472F6207C2D0484), U64(0xC2A1E7B5B459AEB5), U64(0xAB4F6451CC1D45EC), U64(0x63767572AE3D6174), U64(0xA59E0BD101731A28), U64(0x116D0016CB948F09), U64(0x2CF9C8CA052F6E9F), U64(0x0B090A7560A968E3), U64(0xABEEDDB2DDE06FF1), U64(0x58EFC10B06A2068D), U64(0xC6E57A78FBD986E0), U64(0x2EAB8CA63CE802D7), U64(0x14A195640116F336), U64(0x7C0828DD624EC390), U64(0xD74BBE77E6116AC7), U64(0x804456AF10F5FB53), U64(0xEBE9EA2ADF4321C7), U64(0x03219A39EE587A30), U64(0x49787FEF17AF9924), U64(0xA1E9300CD8520548), U64(0x5B45E522E4B1B4EF), U64(0xB49C3B3995091A36), U64(0xD4490AD526F14431), U64(0x12A8F216AF9418C2), U64(0x001F837CC7350524), U64(0x1877B51E57A764D5), U64(0xA2853B80F17F58EE), U64(0x993E1DE72D36D310), U64(0xB3598080CE64A656), U64(0x252F59CF0D9F04BB), U64(0xD23C8E176D113600), U64(0x1BDA0492E7E4586E), U64(0x21E0BD5026C619BF), U64(0x3B097ADAF088F94E), U64(0x8D14DEDB30BE846E), U64(0xF95CFFA23AF5F6F4), U64(0x3871700761B3F743), U64(0xCA672B91E9E4FA16), U64(0x64C8E531BFF53B55), U64(0x241260ED4AD1E87D), U64(0x106C09B972D2E822), U64(0x7FBA195410E5CA30), U64(0x7884D9BC6CB569D8), U64(0x0647DFEDCD894A29), U64(0x63573FF03E224774), U64(0x4FC8E9560F91B123), U64(0x1DB956E450275779), U64(0xB8D91274B9E9D4FB), U64(0xA2EBEE47E2FBFCE1), U64(0xD9F1F30CCD97FB09), U64(0xEFED53D75FD64E6B), U64(0x2E6D02C36017F67F), U64(0xA9AA4D20DB084E9B), U64(0xB64BE8D8B25396C1), U64(0x70CB6AF7C2D5BCF0), U64(0x98F076A4F7A2322E), U64(0xBF84470805E69B5F), U64(0x94C3251F06F90CF3), U64(0x3E003E616A6591E9), U64(0xB925A6CD0421AFF3), U64(0x61BDD1307C66E300), U64(0xBF8D5108E27E0D48), U64(0x240AB57A8B888B20), U64(0xFC87614BAF287E07), U64(0xEF02CDD06FFDB432), U64(0xA1082C0466DF6C0A), U64(0x8215E577001332C8), U64(0xD39BB9C3A48DB6CF), U64(0x2738259634305C14), U64(0x61CF4F94C97DF93D), U64(0x1B6BACA2AE4E125B), U64(0x758F450C88572E0B), U64(0x959F587D507A8359), U64(0xB063E962E045F54D), U64(0x60E8ED72C0DFF5D1), U64(0x7B64978555326F9F), U64(0xFD080D236DA814BA), U64(0x8C90FD9B083F4558), U64(0x106F72FE81E2C590), U64(0x7976033A39F7D952), U64(0xA4EC0132764CA04B), U64(0x733EA705FAE4FA77), U64(0xB4D8F77BC3E56167), U64(0x9E21F4F903B33FD9), U64(0x9D765E419FB69F6D), U64(0xD30C088BA61EA5EF), U64(0x5D94337FBFAF7F5B), U64(0x1A4E4822EB4D7A59), U64(0x6FFE73E81B637FB3), U64(0xDDF957BC36D8B9CA), U64(0x64D0E29EEA8838B3), U64(0x08DD9BDFD96B9F63), U64(0x087E79E5A57D1D13), U64(0xE328E230E3E2B3FB), U64(0x1C2559E30F0946BE), U64(0x720BF5F26F4D2EAA), U64(0xB0774D261CC609DB), U64(0x443F64EC5A371195), U64(0x4112CF68649A260E), U64(0xD813F2FAB7F5C5CA), U64(0x660D3257380841EE), U64(0x59AC2C7873F910A3), U64(0xE846963877671A17), U64(0x93B633ABFA3469F8), U64(0xC0C0F5A60EF4CDCF), U64(0xCAF21ECD4377B28C), U64(0x57277707199B8175), U64(0x506C11B9D90E8B1D), U64(0xD83CC2687A19255F), U64(0x4A29C6465A314CD1), U64(0xED2DF21216235097), U64(0xB5635C95FF7296E2), U64(0x22AF003AB672E811), U64(0x52E762596BF68235), U64(0x9AEBA33AC6ECC6B0), U64(0x944F6DE09134DFB6), U64(0x6C47BEC883A7DE39), U64(0x6AD047C430A12104), U64(0xA5B1CFDBA0AB4067), U64(0x7C45D833AFF07862), U64(0x5092EF950A16DA0B), U64(0x9338E69C052B8E7B), U64(0x455A4B4CFE30E3F5), U64(0x6B02E63195AD0CF8), U64(0x6B17B224BAD6BF27), U64(0xD1E0CCD25BB9C169), U64(0xDE0C89A556B9AE70), U64(0x50065E535A213CF6), U64(0x9C1169FA2777B874), U64(0x78EDEFD694AF1EED), U64(0x6DC93D9526A50E68), U64(0xEE97F453F06791ED), U64(0x32AB0EDB696703D3), U64(0x3A6853C7E70757A7), U64(0x31865CED6120F37D), U64(0x67FEF95D92607890), U64(0x1F2B1D1F15F6DC9C), U64(0xB69E38A8965C6B65), U64(0xAA9119FF184CCCF4), U64(0xF43C732873F24C13), U64(0xFB4A3D794A9A80D2), U64(0x3550C2321FD6109C), U64(0x371F77E76BB8417E), U64(0x6BFA9AAE5EC05779), U64(0xCD04F3FF001A4778), U64(0xE3273522064480CA), U64(0x9F91508BFFCFC14A), U64(0x049A7F41061A9E60), U64(0xFCB6BE43A9F2FE9B), U64(0x08DE8A1C7797DA9B), U64(0x8F9887E6078735A1), U64(0xB5B4071DBFC73A66), U64(0x230E343DFBA08D33), U64(0x43ED7F5A0FAE657D), U64(0x3A88A0FBBCB05C63), U64(0x21874B8B4D2DBC4F), U64(0x1BDEA12E35F6A8C9), U64(0x53C065C6C8E63528), U64(0xE34A1D250E7A8D6B), U64(0xD6B04D3B7651DD7E), U64(0x5E90277E7CB39E2D), U64(0x2C046F22062DC67D), U64(0xB10BB459132D0A26), U64(0x3FA9DDFB67E2F199), U64(0x0E09B88E1914F7AF), U64(0x10E8B35AF3EEAB37), U64(0x9EEDECA8E272B933), U64(0xD4C718BC4AE8AE5F), U64(0x81536D601170FC20), U64(0x91B534F885818A06), U64(0xEC8177F83F900978), U64(0x190E714FADA5156E), U64(0xB592BF39B0364963), U64(0x89C350C893AE7DC1), U64(0xAC042E70F8B383F2), U64(0xB49B52E587A1EE60), U64(0xFB152FE3FF26DA89), U64(0x3E666E6F69AE2C15), U64(0x3B544EBE544C19F9), U64(0xE805A1E290CF2456), U64(0x24B33C9D7ED25117), U64(0xE74733427B72F0C1), U64(0x0A804D18B7097475), U64(0x57E3306D881EDB4F), U64(0x4AE7D6A36EB5DBCB), U64(0x2D8D5432157064C8), U64(0xD1E649DE1E7F268B), U64(0x8A328A1CEDFE552C), U64(0x07A3AEC79624C7DA), U64(0x84547DDC3E203C94), U64(0x990A98FD5071D263), U64(0x1A4FF12616EEFC89), U64(0xF6F7FD1431714200), U64(0x30C05B1BA332F41C), U64(0x8D2636B81555A786), U64(0x46C9FEB55D120902), U64(0xCCEC0A73B49C9921), U64(0x4E9D2827355FC492), U64(0x19EBB029435DCB0F), U64(0x4659D2B743848A2C), U64(0x963EF2C96B33BE31), U64(0x74F85198B05A2E7D), U64(0x5A0F544DD2B1FB18), U64(0x03727073C2E134B1), U64(0xC7F6AA2DE59AEA61), U64(0x352787BAA0D7C22F), U64(0x9853EAB63B5E0B35), U64(0xABBDCDD7ED5C0860), U64(0xCF05DAF5AC8D77B0), U64(0x49CAD48CEBF4A71E), U64(0x7A4C10EC2158C4A6), U64(0xD9E92AA246BF719E), U64(0x13AE978D09FE5557), U64(0x730499AF921549FF), U64(0x4E4B705B92903BA4), U64(0xFF577222C14F0A3A), U64(0x55B6344CF97AAFAE), U64(0xB862225B055B6960), U64(0xCAC09AFBDDD2CDB4), U64(0xDAF8E9829FE96B5F), U64(0xB5FDFC5D3132C498), U64(0x310CB380DB6F7503), U64(0xE87FBB46217A360E), U64(0x2102AE466EBB1148), U64(0xF8549E1A3AA5E00D), U64(0x07A69AFDCC42261A), U64(0xC4C118BFE78FEAAE), U64(0xF9F4892ED96BD438), U64(0x1AF3DBE25D8F45DA), U64(0xF5B4B0B0D2DEEEB4), U64(0x962ACEEFA82E1C84), U64(0x046E3ECAAF453CE9), U64(0xF05D129681949A4C), U64(0x964781CE734B3C84), U64(0x9C2ED44081CE5FBD), U64(0x522E23F3925E319E), U64(0x177E00F9FC32F791), U64(0x2BC60A63A6F3B3F2), U64(0x222BBFAE61725606), U64(0x486289DDCC3D6780), U64(0x7DC7785B8EFDFC80), U64(0x8AF38731C02BA980), U64(0x1FAB64EA29A2DDF7), U64(0xE4D9429322CD065A), U64(0x9DA058C67844F20C), U64(0x24C0E332B70019B0), U64(0x233003B5A6CFE6AD), U64(0xD586BD01C5C217F6), U64(0x5E5637885F29BC2B), U64(0x7EBA726D8C94094B), U64(0x0A56A5F0BFE39272), U64(0xD79476A84EE20D06), U64(0x9E4C1269BAA4BF37), U64(0x17EFEE45B0DEE640), U64(0x1D95B0A5FCF90BC6), U64(0x93CBE0B699C2585D), U64(0x65FA4F227A2B6D79), U64(0xD5F9E858292504D5), U64(0xC2B5A03F71471A6F), U64(0x59300222B4561E00), U64(0xCE2F8642CA0712DC), U64(0x7CA9723FBB2E8988), U64(0x2785338347F2BA08), U64(0xC61BB3A141E50E8C), U64(0x150F361DAB9DEC26), U64(0x9F6A419D382595F4), U64(0x64A53DC924FE7AC9), U64(0x142DE49FFF7A7C3D), U64(0x0C335248857FA9E7), U64(0x0A9C32D5EAE45305), U64(0xE6C42178C4BBB92E), U64(0x71F1CE2490D20B07), U64(0xF1BCC3D275AFE51A), U64(0xE728E8C83C334074), U64(0x96FBF83A12884624), U64(0x81A1549FD6573DA5), U64(0x5FA7867CAF35E149), U64(0x56986E2EF3ED091B), U64(0x917F1DD5F8886C61), U64(0xD20D8C88C8FFE65F), U64(0x31D71DCE64B2C310), U64(0xF165B587DF898190), U64(0xA57E6339DD2CF3A0), U64(0x1EF6E6DBB1961EC9), U64(0x70CC73D90BC26E24), U64(0xE21A6B35DF0C3AD7), U64(0x003A93D8B2806962), U64(0x1C99DED33CB890A1), U64(0xCF3145DE0ADD4289), U64(0xD0E4427A5514FB72), U64(0x77C621CC9FB3A483), U64(0x67A34DAC4356550B), U64(0xF8D626AAAF278509), }; // functions // random_init() void random_init() { if ((Random64[RandomNb-1] >> 32) != 0xF8D626AA) { // upper half of the last element of the array my_fatal("broken 64-bit types\n"); } } } // namespace engine // end of random.cpp gnuchess-6.2.2/src/engine/random.h000644 000766 000024 00000002115 11517375750 017652 0ustar00antoniostaff000000 000000 /* random.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // random.h #ifndef RANDOM_H #define RANDOM_H // includes #include "util.h" namespace engine { // constants const int RandomNb = 781; // macros #define RANDOM_64(n) (Random64[n]) // "constants" extern const uint64 Random64[RandomNb]; // functions extern void random_init (); } // namespace engine #endif // !defined RANDOM_H // end of random.h gnuchess-6.2.2/src/engine/recog.cpp000644 000766 000024 00000014060 11517375750 020026 0ustar00antoniostaff000000 000000 /* recog.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // recog.cpp // includes #include "board.h" #include "colour.h" #include "material.h" #include "piece.h" #include "recog.h" #include "util.h" #include "vector.h" namespace engine { // prototypes static bool kpk_draw (int wp, int wk, int bk, int turn); static bool kbpk_draw (int wp, int wb, int bk); // functions // recog_draw() bool recog_draw(const board_t * board) { material_info_t mat_info[1]; ASSERT(board!=NULL); // material if (board->piece_nb > 4) return false; material_get_info(mat_info,board); if ((mat_info->flags & DrawNodeFlag) == 0) return false; // recognisers if (false) { } else if (mat_info->recog == MAT_KK) { // KK return true; } else if (mat_info->recog == MAT_KBK) { // KBK (white) return true; } else if (mat_info->recog == MAT_KKB) { // KBK (black) return true; } else if (mat_info->recog == MAT_KNK) { // KNK (white) return true; } else if (mat_info->recog == MAT_KKN) { // KNK (black) return true; } else if (mat_info->recog == MAT_KPK) { // KPK (white) int me, opp; int wp, wk, bk; me = White; opp = COLOUR_OPP(me); wp = board->pawn[me][0]; wk = KING_POS(board,me); bk = KING_POS(board,opp); if (SQUARE_FILE(wp) >= FileE) { wp = SQUARE_FILE_MIRROR(wp); wk = SQUARE_FILE_MIRROR(wk); bk = SQUARE_FILE_MIRROR(bk); } if (kpk_draw(wp,wk,bk,board->turn)) { return true; } } else if (mat_info->recog == MAT_KKP) { // KPK (black) int me, opp; int wp, wk, bk; me = Black; opp = COLOUR_OPP(me); wp = SQUARE_RANK_MIRROR(board->pawn[me][0]); wk = SQUARE_RANK_MIRROR(KING_POS(board,me)); bk = SQUARE_RANK_MIRROR(KING_POS(board,opp)); if (SQUARE_FILE(wp) >= FileE) { wp = SQUARE_FILE_MIRROR(wp); wk = SQUARE_FILE_MIRROR(wk); bk = SQUARE_FILE_MIRROR(bk); } if (kpk_draw(wp,wk,bk,COLOUR_OPP(board->turn))) { return true; } } else if (mat_info->recog == MAT_KBKB) { // KBKB int wb, bb; wb = board->piece[White][1]; bb = board->piece[Black][1]; if (SQUARE_COLOUR(wb) == SQUARE_COLOUR(bb)) { // bishops on same colour return true; } } else if (mat_info->recog == MAT_KBPK) { // KBPK (white) int me, opp; int wp, wb, bk; me = White; opp = COLOUR_OPP(me); wp = board->pawn[me][0]; wb = board->piece[me][1]; bk = KING_POS(board,opp); if (SQUARE_FILE(wp) >= FileE) { wp = SQUARE_FILE_MIRROR(wp); wb = SQUARE_FILE_MIRROR(wb); bk = SQUARE_FILE_MIRROR(bk); } if (kbpk_draw(wp,wb,bk)) return true; } else if (mat_info->recog == MAT_KKBP) { // KBPK (black) int me, opp; int wp, wb, bk; me = Black; opp = COLOUR_OPP(me); wp = SQUARE_RANK_MIRROR(board->pawn[me][0]); wb = SQUARE_RANK_MIRROR(board->piece[me][1]); bk = SQUARE_RANK_MIRROR(KING_POS(board,opp)); if (SQUARE_FILE(wp) >= FileE) { wp = SQUARE_FILE_MIRROR(wp); wb = SQUARE_FILE_MIRROR(wb); bk = SQUARE_FILE_MIRROR(bk); } if (kbpk_draw(wp,wb,bk)) return true; } else { ASSERT(false); } return false; } // kpk_draw() static bool kpk_draw(int wp, int wk, int bk, int turn) { int wp_file, wp_rank; int wk_file; int bk_file, bk_rank; ASSERT(SQUARE_IS_OK(wp)); ASSERT(SQUARE_IS_OK(wk)); ASSERT(SQUARE_IS_OK(bk)); ASSERT(COLOUR_IS_OK(turn)); ASSERT(SQUARE_FILE(wp)<=FileD); wp_file = SQUARE_FILE(wp); wp_rank = SQUARE_RANK(wp); wk_file = SQUARE_FILE(wk); bk_file = SQUARE_FILE(bk); bk_rank = SQUARE_RANK(bk); if (false) { } else if (bk == wp+16) { if (wp_rank <= Rank6) { return true; } else { ASSERT(wp_rank==Rank7); if (COLOUR_IS_WHITE(turn)) { if (wk == wp-15 || wk == wp-17) return true; } else { if (wk != wp-15 && wk != wp-17) return true; } } } else if (bk == wp+32) { if (wp_rank <= Rank5) { return true; } else { ASSERT(wp_rank==Rank6); if (COLOUR_IS_WHITE(turn)) { if (wk != wp-1 && wk != wp+1) return true; } else { return true; } } } else if (wk == wp-1 || wk == wp+1) { if (bk == wk+32 && COLOUR_IS_WHITE(turn)) { // opposition return true; } } else if (wk == wp+15 || wk == wp+16 || wk == wp+17) { if (wp_rank <= Rank4) { if (bk == wk+32 && COLOUR_IS_WHITE(turn)) { // opposition return true; } } } // rook pawn if (wp_file == FileA) { if (DISTANCE(bk,A8) <= 1) return true; if (wk_file == FileA) { if (wp_rank == Rank2) wp_rank++; // HACK if (bk_file == FileC && bk_rank > wp_rank) return true; } } return false; } // kbpk_draw() static bool kbpk_draw (int wp, int wb, int bk) { ASSERT(SQUARE_IS_OK(wp)); ASSERT(SQUARE_IS_OK(wb)); ASSERT(SQUARE_IS_OK(bk)); if (SQUARE_FILE(wp) == FileA && DISTANCE(bk,A8) <= 1 && SQUARE_COLOUR(wb) != SQUARE_COLOUR(A8)) { return true; } return false; } } // namespace engine // end of recog.cpp gnuchess-6.2.2/src/engine/recog.h000644 000766 000024 00000001735 11517375750 017500 0ustar00antoniostaff000000 000000 /* recog.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // recog.h #ifndef RECOG_H #define RECOG_H // includes #include "board.h" #include "util.h" namespace engine { // functions extern bool recog_draw (const board_t * board); } // namespace engine #endif // !defined RECOG_H // end of recog.h gnuchess-6.2.2/src/engine/search.cpp000644 000766 000024 00000027144 12365664655 020212 0ustar00antoniostaff000000 000000 /* search.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // search.cpp // includes #include #include "attack.h" #include "board.h" #include "book.h" #include "colour.h" #include "list.h" #include "material.h" #include "move.h" #include "move_do.h" #include "move_gen.h" #include "option.h" #include "pawn.h" #include "protocol.h" #include "pv.h" #include "search.h" #include "search_full.h" #include "sort.h" #include "trans.h" #include "util.h" #include "value.h" namespace engine { // constants static const bool UseCpuTime = false; // false static const bool UseEvent = true; // true static const bool UseShortSearch = true; static const int ShortSearchDepth = 1; static const bool DispBest = true; // true static const bool DispDepthStart = true; // true static const bool DispDepthEnd = true; // true static const bool DispRoot = true; // true static const bool DispStat = true; // true static const bool UseEasy = true; // singular move static const int EasyThreshold = 150; static const double EasyRatio = 0.20; static const bool UseEarly = true; // early iteration end static const double EarlyRatio = 0.60; static const bool UseBad = true; static const int BadThreshold = 50; // 50 static const bool UseExtension = true; // variables search_input_t SearchInput[1]; search_info_t SearchInfo[1]; search_root_t SearchRoot[1]; search_current_t SearchCurrent[1]; search_best_t SearchBest[1]; // prototypes static void search_send_stat (); // functions // depth_is_ok() bool depth_is_ok(int depth) { return depth > -128 && depth < DepthMax; } // height_is_ok() bool height_is_ok(int height) { return height >= 0 && height < HeightMax; } // search_clear() void search_clear() { // SearchInput SearchInput->infinite = false; SearchInput->depth_is_limited = false; SearchInput->depth_limit = 0; SearchInput->time_is_limited = false; SearchInput->time_limit_1 = 0.0; SearchInput->time_limit_2 = 0.0; // SearchInfo SearchInfo->can_stop = false; SearchInfo->stop = false; SearchInfo->check_nb = 10000; // was 100000 SearchInfo->check_inc = 10000; // was 100000 SearchInfo->last_time = 0.0; // SearchBest SearchBest->move = MoveNone; SearchBest->value = 0; SearchBest->flags = SearchUnknown; PV_CLEAR(SearchBest->pv); // SearchRoot SearchRoot->depth = 0; SearchRoot->move = MoveNone; SearchRoot->move_pos = 0; SearchRoot->move_nb = 0; SearchRoot->last_value = 0; SearchRoot->bad_1 = false; SearchRoot->bad_2 = false; SearchRoot->change = false; SearchRoot->easy = false; SearchRoot->flag = false; // SearchCurrent SearchCurrent->max_depth = 0; SearchCurrent->node_nb = 0; SearchCurrent->time = 0.0; SearchCurrent->speed = 0.0; SearchCurrent->cpu = 0.0; } // search() void search() { int move; int depth; ASSERT(board_is_ok(SearchInput->board)); // opening book if (option_get_bool("OwnBook") && !SearchInput->infinite) { move = book_move(SearchInput->board); if (move != MoveNone) { // play book move SearchBest->move = move; SearchBest->value = 1; SearchBest->flags = SearchExact; SearchBest->depth = 1; SearchBest->pv[0] = move; SearchBest->pv[1] = MoveNone; search_update_best(); return; } } // SearchInput gen_legal_moves(SearchInput->list,SearchInput->board); if (LIST_SIZE(SearchInput->list) <= 1) { SearchInput->depth_is_limited = true; SearchInput->depth_limit = 4; // was 1 } // SearchInfo if (setjmp(SearchInfo->buf) != 0) { ASSERT(SearchInfo->can_stop); ASSERT(SearchBest->move!=MoveNone); search_update_current(); return; } // SearchRoot list_copy(SearchRoot->list,SearchInput->list); // SearchCurrent board_copy(SearchCurrent->board,SearchInput->board); my_timer_reset(SearchCurrent->timer); my_timer_start(SearchCurrent->timer); // init trans_inc_date(Trans); sort_init(); search_full_init(SearchRoot->list,SearchCurrent->board); // iterative deepening for (depth = 1; depth < DepthMax; depth++) { if (DispDepthStart) send("info depth %d",depth); SearchRoot->bad_1 = false; SearchRoot->change = false; board_copy(SearchCurrent->board,SearchInput->board); if (UseShortSearch && depth <= ShortSearchDepth) { search_full_root(SearchRoot->list,SearchCurrent->board,depth,SearchShort); } else { search_full_root(SearchRoot->list,SearchCurrent->board,depth,SearchNormal); } search_update_current(); if (DispDepthEnd) { send("info depth %d seldepth %d time %.0f nodes " S64_FORMAT " nps %.0f",depth,SearchCurrent->max_depth,SearchCurrent->time*1000.0,SearchCurrent->node_nb,SearchCurrent->speed); } // update search info if (depth >= 1) SearchInfo->can_stop = true; if (depth == 1 && LIST_SIZE(SearchRoot->list) >= 2 && LIST_VALUE(SearchRoot->list,0) >= LIST_VALUE(SearchRoot->list,1) + EasyThreshold) { SearchRoot->easy = true; } if (UseBad && depth > 1) { SearchRoot->bad_2 = SearchRoot->bad_1; SearchRoot->bad_1 = false; ASSERT(SearchRoot->bad_2==(SearchBest->value<=SearchRoot->last_value-BadThreshold)); } SearchRoot->last_value = SearchBest->value; // stop search? if (SearchInput->depth_is_limited && depth >= SearchInput->depth_limit) { SearchRoot->flag = true; } if (SearchInput->time_is_limited && SearchCurrent->time >= SearchInput->time_limit_1 && !SearchRoot->bad_2) { SearchRoot->flag = true; } if (UseEasy && SearchInput->time_is_limited && SearchCurrent->time >= SearchInput->time_limit_1 * EasyRatio && SearchRoot->easy) { ASSERT(!SearchRoot->bad_2); ASSERT(!SearchRoot->change); SearchRoot->flag = true; } if (UseEarly && SearchInput->time_is_limited && SearchCurrent->time >= SearchInput->time_limit_1 * EarlyRatio && !SearchRoot->bad_2 && !SearchRoot->change) { SearchRoot->flag = true; } if (SearchInfo->can_stop && (SearchInfo->stop || (SearchRoot->flag && !SearchInput->infinite))) { break; } } } // search_update_best() void search_update_best() { int move, value, flags, depth, max_depth; const mv_t * pv; double time; sint64 node_nb; int mate; char move_string[256], pv_string[512]; search_update_current(); if (DispBest) { move = SearchBest->move; value = SearchBest->value; flags = SearchBest->flags; depth = SearchBest->depth; pv = SearchBest->pv; max_depth = SearchCurrent->max_depth; time = SearchCurrent->time; node_nb = SearchCurrent->node_nb; move_to_string(move,move_string,256); pv_to_string(pv,pv_string,512); mate = value_to_mate(value); if (mate == 0) { // normal evaluation if (false) { } else if (flags == SearchExact) { send("info depth %d seldepth %d score cp %d time %.0f nodes " S64_FORMAT " pv %s",depth,max_depth,value,time*1000.0,node_nb,pv_string); } else if (flags == SearchLower) { send("info depth %d seldepth %d score cp %d lowerbound time %.0f nodes " S64_FORMAT " pv %s",depth,max_depth,value,time*1000.0,node_nb,pv_string); } else if (flags == SearchUpper) { send("info depth %d seldepth %d score cp %d upperbound time %.0f nodes " S64_FORMAT " pv %s",depth,max_depth,value,time*1000.0,node_nb,pv_string); } } else { // mate announcement if (false) { } else if (flags == SearchExact) { send("info depth %d seldepth %d score mate %d time %.0f nodes " S64_FORMAT " pv %s",depth,max_depth,mate,time*1000.0,node_nb,pv_string); } else if (flags == SearchLower) { send("info depth %d seldepth %d score mate %d lowerbound time %.0f nodes " S64_FORMAT " pv %s",depth,max_depth,mate,time*1000.0,node_nb,pv_string); } else if (flags == SearchUpper) { send("info depth %d seldepth %d score mate %d upperbound time %.0f nodes " S64_FORMAT " pv %s",depth,max_depth,mate,time*1000.0,node_nb,pv_string); } } } // update time-management info if (UseBad && SearchBest->depth > 1) { if (SearchBest->value <= SearchRoot->last_value - BadThreshold) { SearchRoot->bad_1 = true; SearchRoot->easy = false; SearchRoot->flag = false; } else { SearchRoot->bad_1 = false; } } } // search_update_root() void search_update_root() { int move, move_pos, move_nb; double time; sint64 node_nb; char move_string[256]; if (DispRoot) { search_update_current(); if (SearchCurrent->time >= 1.0) { move = SearchRoot->move; move_pos = SearchRoot->move_pos; move_nb = SearchRoot->move_nb; time = SearchCurrent->time; node_nb = SearchCurrent->node_nb; move_to_string(move,move_string,256); send("info currmove %s currmovenumber %d",move_string,move_pos+1); } } } // search_update_current() void search_update_current() { my_timer_t *timer; sint64 node_nb; double time, speed, cpu; timer = SearchCurrent->timer; node_nb = SearchCurrent->node_nb; time = (UseCpuTime) ? my_timer_elapsed_cpu(timer) : my_timer_elapsed_real(timer); speed = (time >= 1.0) ? double(node_nb) / time : 0.0; cpu = my_timer_cpu_usage(timer); SearchCurrent->time = time; SearchCurrent->speed = speed; SearchCurrent->cpu = cpu; } // search_check() void search_check() { search_send_stat(); if (UseEvent) event(); if (SearchInput->depth_is_limited && SearchRoot->depth > SearchInput->depth_limit) { SearchRoot->flag = true; } if (SearchInput->time_is_limited && SearchCurrent->time >= SearchInput->time_limit_2) { SearchRoot->flag = true; } if (SearchInput->time_is_limited && SearchCurrent->time >= SearchInput->time_limit_1 && !SearchRoot->bad_1 && !SearchRoot->bad_2 && (!UseExtension || SearchRoot->move_pos == 0)) { SearchRoot->flag = true; } if (SearchInfo->can_stop && (SearchInfo->stop || (SearchRoot->flag && !SearchInput->infinite))) { longjmp(SearchInfo->buf,1); } } // search_send_stat() static void search_send_stat() { double time, speed, cpu; sint64 node_nb; search_update_current(); if (DispStat && SearchCurrent->time >= SearchInfo->last_time + 1.0) { // at least one-second gap SearchInfo->last_time = SearchCurrent->time; time = SearchCurrent->time; speed = SearchCurrent->speed; cpu = SearchCurrent->cpu; node_nb = SearchCurrent->node_nb; send("info time %.0f nodes " S64_FORMAT " nps %.0f cpuload %.0f",time*1000.0,node_nb,speed,cpu*1000.0); trans_stats(Trans); } } } // namespace engine // end of search.cpp gnuchess-6.2.2/src/engine/search.h000644 000766 000024 00000005027 11517375750 017644 0ustar00antoniostaff000000 000000 /* search.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // search.h #ifndef SEARCH_H #define SEARCH_H // includes #include #include "board.h" #include "list.h" #include "move.h" #include "util.h" namespace engine { // constants const int DepthMax = 64; const int HeightMax = 256; const int SearchNormal = 0; const int SearchShort = 1; const int SearchUnknown = 0; const int SearchUpper = 1; const int SearchLower = 2; const int SearchExact = 3; // types struct search_input_t { board_t board[1]; list_t list[1]; bool infinite; bool depth_is_limited; int depth_limit; bool time_is_limited; double time_limit_1; double time_limit_2; }; struct search_info_t { jmp_buf buf; bool can_stop; bool stop; int check_nb; int check_inc; double last_time; }; struct search_root_t { list_t list[1]; int depth; int move; int move_pos; int move_nb; int last_value; bool bad_1; bool bad_2; bool change; bool easy; bool flag; }; struct search_best_t { int move; int value; int flags; int depth; mv_t pv[HeightMax]; }; struct search_current_t { board_t board[1]; my_timer_t timer[1]; int max_depth; sint64 node_nb; double time; double speed; double cpu; }; // variables extern search_input_t SearchInput[1]; extern search_info_t SearchInfo[1]; extern search_best_t SearchBest[1]; extern search_root_t SearchRoot[1]; extern search_current_t SearchCurrent[1]; // functions extern bool depth_is_ok (int depth); extern bool height_is_ok (int height); extern void search_clear (); extern void search (); extern void search_update_best (); extern void search_update_root (); extern void search_update_current (); extern void search_check (); } // namespace engine #endif // !defined SEARCH_H // end of search.h gnuchess-6.2.2/src/engine/search_full.cpp000644 000766 000024 00000067730 12365664655 021241 0ustar00antoniostaff000000 000000 /* search_full.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // search_full.cpp // includes #include "attack.h" #include "board.h" #include "colour.h" #include "eval.h" #include "list.h" #include "move.h" #include "move_check.h" #include "move_do.h" #include "option.h" #include "piece.h" #include "pst.h" #include "pv.h" #include "recog.h" #include "search.h" #include "search_full.h" #include "see.h" #include "sort.h" #include "trans.h" #include "util.h" #include "value.h" namespace engine { // constants and variables // main search static const bool UseDistancePruning = true; // transposition table bool UseTrans = true; static const int TransDepth = 1; static const bool UseMateValues = true; // use mate values from shallower searches? // null move static /* const */ bool UseNull = true; static /* const */ bool UseNullEval = true; // true static const int NullDepth = 2; static /* const */ int NullReduction = 3; static /* const */ bool UseVer = true; static /* const */ bool UseVerEndgame = true; // true static /* const */ int VerReduction = 5; // was 3 // move ordering static const bool UseIID = true; static const int IIDDepth = 3; static const int IIDReduction = 2; // extensions static const bool ExtendSingleReply = true; // true // history pruning static /* const */ bool UseHistory = true; static const int HistoryDepth = 3; static const int HistoryMoveNb = 3; static /* const */ int HistoryValue = 9830; // 60% static const bool HistoryReSearch = true; // futility pruning static /* const */ bool UseFutility = false; // false static /* const */ int FutilityMargin = 100; // quiescence search static /* const */ bool UseDelta = false; // false static /* const */ int DeltaMargin = 50; static /* const */ int CheckNb = 1; static /* const */ int CheckDepth = 0; // 1 - CheckNb // misc static const int NodeAll = -1; static const int NodePV = 0; static const int NodeCut = +1; // macros #define NODE_OPP(type) (-(type)) #define DEPTH_MATCH(d1,d2) ((d1)>=(d2)) // prototypes static int full_root (list_t * list, board_t * board, int alpha, int beta, int depth, int height, int search_type); static int full_search (board_t * board, int alpha, int beta, int depth, int height, mv_t pv[], int node_type); static int full_no_null (board_t * board, int alpha, int beta, int depth, int height, mv_t pv[], int node_type, int trans_move, int * best_move); static int full_quiescence (board_t * board, int alpha, int beta, int depth, int height, mv_t pv[]); static int full_new_depth (int depth, int move, board_t * board, bool single_reply, bool in_pv); static bool do_null (const board_t * board); static bool do_ver (const board_t * board); static void pv_fill (const mv_t pv[], board_t * board); static bool move_is_dangerous (int move, const board_t * board); static bool capture_is_dangerous (int move, const board_t * board); static bool simple_stalemate (const board_t * board); // functions // search_full_init() void search_full_init(list_t * list, board_t * board) { const char * string; int trans_move, trans_min_depth, trans_max_depth, trans_min_value, trans_max_value; ASSERT(list_is_ok(list)); ASSERT(board_is_ok(board)); // null-move options string = option_get_string("NullMove Pruning"); if (false) { } else if (my_string_equal(string,"Always")) { UseNull = true; UseNullEval = false; } else if (my_string_equal(string,"Fail High")) { UseNull = true; UseNullEval = true; } else if (my_string_equal(string,"Never")) { UseNull = false; UseNullEval = false; } else { ASSERT(false); UseNull = true; UseNullEval = true; } NullReduction = option_get_int("NullMove Reduction"); string = option_get_string("Verification Search"); if (false) { } else if (my_string_equal(string,"Always")) { UseVer = true; UseVerEndgame = false; } else if (my_string_equal(string,"Endgame")) { UseVer = true; UseVerEndgame = true; } else if (my_string_equal(string,"Never")) { UseVer = false; UseVerEndgame = false; } else { ASSERT(false); UseVer = true; UseVerEndgame = true; } VerReduction = option_get_int("Verification Reduction"); // history-pruning options UseHistory = option_get_bool("History Pruning"); HistoryValue = (option_get_int("History Threshold") * 16384 + 50) / 100; // futility-pruning options UseFutility = option_get_bool("Futility Pruning"); FutilityMargin = option_get_int("Futility Margin"); // delta-pruning options UseDelta = option_get_bool("Delta Pruning"); DeltaMargin = option_get_int("Delta Margin"); // quiescence-search options CheckNb = option_get_int("Quiescence Check Plies"); CheckDepth = 1 - CheckNb; // standard sort list_note(list); list_sort(list); // basic sort trans_move = MoveNone; if (UseTrans) trans_retrieve(Trans,board->key,&trans_move,&trans_min_depth,&trans_max_depth,&trans_min_value,&trans_max_value); note_moves(list,board,0,trans_move); list_sort(list); } // search_full_root() int search_full_root(list_t * list, board_t * board, int depth, int search_type) { int value; ASSERT(list_is_ok(list)); ASSERT(board_is_ok(board)); ASSERT(depth_is_ok(depth)); ASSERT(search_type==SearchNormal||search_type==SearchShort); ASSERT(list==SearchRoot->list); ASSERT(!LIST_IS_EMPTY(list)); ASSERT(board==SearchCurrent->board); ASSERT(board_is_legal(board)); ASSERT(depth>=1); value = full_root(list,board,-ValueInf,+ValueInf,depth,0,search_type); ASSERT(value_is_ok(value)); ASSERT(LIST_VALUE(list,0)==value); return value; } // full_root() static int full_root(list_t * list, board_t * board, int alpha, int beta, int depth, int height, int search_type) { int old_alpha; int value, best_value; int i, move; int new_depth; undo_t undo[1]; mv_t new_pv[HeightMax]; ASSERT(list_is_ok(list)); ASSERT(board_is_ok(board)); ASSERT(range_is_ok(alpha,beta)); ASSERT(depth_is_ok(depth)); ASSERT(height_is_ok(height)); ASSERT(search_type==SearchNormal||search_type==SearchShort); ASSERT(list==SearchRoot->list); ASSERT(!LIST_IS_EMPTY(list)); ASSERT(board==SearchCurrent->board); ASSERT(board_is_legal(board)); ASSERT(depth>=1); // init SearchCurrent->node_nb++; SearchInfo->check_nb--; for (i = 0; i < LIST_SIZE(list); i++) list->value[i] = ValueNone; old_alpha = alpha; best_value = ValueNone; // move loop for (i = 0; i < LIST_SIZE(list); i++) { move = LIST_MOVE(list,i); SearchRoot->depth = depth; SearchRoot->move = move; SearchRoot->move_pos = i; SearchRoot->move_nb = LIST_SIZE(list); search_update_root(); new_depth = full_new_depth(depth,move,board,board_is_check(board)&&LIST_SIZE(list)==1,true); move_do(board,move,undo); if (search_type == SearchShort || best_value == ValueNone) { // first move value = -full_search(board,-beta,-alpha,new_depth,height+1,new_pv,NodePV); } else { // other moves value = -full_search(board,-alpha-1,-alpha,new_depth,height+1,new_pv,NodeCut); if (value > alpha) { // && value < beta SearchRoot->change = true; SearchRoot->easy = false; SearchRoot->flag = false; search_update_root(); value = -full_search(board,-beta,-alpha,new_depth,height+1,new_pv,NodePV); } } move_undo(board,move,undo); if (value <= alpha) { // upper bound list->value[i] = old_alpha; } else if (value >= beta) { // lower bound list->value[i] = beta; } else { // alpha < value < beta => exact value list->value[i] = value; } if (value > best_value && (best_value == ValueNone || value > alpha)) { SearchBest->move = move; SearchBest->value = value; if (value <= alpha) { // upper bound SearchBest->flags = SearchUpper; } else if (value >= beta) { // lower bound SearchBest->flags = SearchLower; } else { // alpha < value < beta => exact value SearchBest->flags = SearchExact; } SearchBest->depth = depth; pv_cat(SearchBest->pv,new_pv,move); search_update_best(); } if (value > best_value) { best_value = value; if (value > alpha) { if (search_type == SearchNormal) alpha = value; if (value >= beta) break; } } } ASSERT(value_is_ok(best_value)); list_sort(list); ASSERT(SearchBest->move==LIST_MOVE(list,0)); ASSERT(SearchBest->value==best_value); if (UseTrans && best_value > old_alpha && best_value < beta) { pv_fill(SearchBest->pv,board); } return best_value; } // full_search() static int full_search(board_t * board, int alpha, int beta, int depth, int height, mv_t pv[], int node_type) { bool in_check; bool single_reply; int trans_move, trans_depth, trans_min_depth, trans_max_depth, trans_min_value, trans_max_value; int min_value, max_value; int old_alpha; int value, best_value; int move, best_move; int new_depth; int played_nb; int i; int opt_value; bool reduced; attack_t attack[1]; sort_t sort[1]; undo_t undo[1]; mv_t new_pv[HeightMax]; mv_t played[256]; ASSERT(board!=NULL); ASSERT(range_is_ok(alpha,beta)); ASSERT(depth_is_ok(depth)); ASSERT(height_is_ok(height)); ASSERT(pv!=NULL); ASSERT(node_type==NodePV||node_type==NodeCut||node_type==NodeAll); ASSERT(board_is_legal(board)); // horizon? if (depth <= 0) return full_quiescence(board,alpha,beta,0,height,pv); // init SearchCurrent->node_nb++; SearchInfo->check_nb--; PV_CLEAR(pv); if (height > SearchCurrent->max_depth) SearchCurrent->max_depth = height; if (SearchInfo->check_nb <= 0) { SearchInfo->check_nb += SearchInfo->check_inc; search_check(); } // draw? if (board_is_repetition(board) || recog_draw(board)) return ValueDraw; // mate-distance pruning if (UseDistancePruning) { // lower bound value = VALUE_MATE(height+2); // does not work if the current position is mate if (value > alpha && board_is_mate(board)) value = VALUE_MATE(height); if (value > alpha) { alpha = value; if (value >= beta) return value; } // upper bound value = -VALUE_MATE(height+1); if (value < beta) { beta = value; if (value <= alpha) return value; } } // transposition table trans_move = MoveNone; if (UseTrans && depth >= TransDepth) { if (trans_retrieve(Trans,board->key,&trans_move,&trans_min_depth,&trans_max_depth,&trans_min_value,&trans_max_value)) { // trans_move is now updated if (node_type != NodePV) { if (UseMateValues) { if (trans_min_value > +ValueEvalInf && trans_min_depth < depth) { trans_min_depth = depth; } if (trans_max_value < -ValueEvalInf && trans_max_depth < depth) { trans_max_depth = depth; } } min_value = -ValueInf; if (DEPTH_MATCH(trans_min_depth,depth)) { min_value = value_from_trans(trans_min_value,height); if (min_value >= beta) return min_value; } max_value = +ValueInf; if (DEPTH_MATCH(trans_max_depth,depth)) { max_value = value_from_trans(trans_max_value,height); if (max_value <= alpha) return max_value; } if (min_value == max_value) return min_value; // exact match } } } // height limit if (height >= HeightMax-1) return eval(board); // more init old_alpha = alpha; best_value = ValueNone; best_move = MoveNone; played_nb = 0; attack_set(attack,board); in_check = ATTACK_IN_CHECK(attack); // null-move pruning if (UseNull && depth >= NullDepth && node_type != NodePV) { if (!in_check && !value_is_mate(beta) && do_null(board) && (!UseNullEval || depth <= NullReduction+1 || eval(board) >= beta)) { // null-move search new_depth = depth - NullReduction - 1; move_do_null(board,undo); value = -full_search(board,-beta,-beta+1,new_depth,height+1,new_pv,NODE_OPP(node_type)); move_undo_null(board,undo); // verification search if (UseVer && depth > VerReduction) { if (value >= beta && (!UseVerEndgame || do_ver(board))) { new_depth = depth - VerReduction; ASSERT(new_depth>0); value = full_no_null(board,alpha,beta,new_depth,height,new_pv,NodeCut,trans_move,&move); if (value >= beta) { ASSERT(move==new_pv[0]); played[played_nb++] = move; best_move = move; best_value = value; pv_copy(pv,new_pv); goto cut; } } } // pruning if (value >= beta) { if (value > +ValueEvalInf) value = +ValueEvalInf; // do not return unproven mates ASSERT(!value_is_mate(value)); // pv_cat(pv,new_pv,MoveNull); best_move = MoveNone; best_value = value; goto cut; } } } // Internal Iterative Deepening if (UseIID && depth >= IIDDepth && node_type == NodePV && trans_move == MoveNone) { new_depth = depth - IIDReduction; ASSERT(new_depth>0); value = full_search(board,alpha,beta,new_depth,height,new_pv,node_type); if (value <= alpha) value = full_search(board,-ValueInf,beta,new_depth,height,new_pv,node_type); trans_move = new_pv[0]; } // move generation sort_init(sort,board,attack,depth,height,trans_move); single_reply = false; if (in_check && LIST_SIZE(sort->list) == 1) single_reply = true; // HACK // move loop opt_value = +ValueInf; while ((move=sort_next(sort)) != MoveNone) { // extensions new_depth = full_new_depth(depth,move,board,single_reply,node_type==NodePV); // history pruning reduced = false; if (UseHistory && depth >= HistoryDepth && node_type != NodePV) { if (!in_check && played_nb >= HistoryMoveNb && new_depth < depth) { ASSERT(best_value!=ValueNone); ASSERT(played_nb>0); ASSERT(sort->pos>0&&move==LIST_MOVE(sort->list,sort->pos-1)); value = sort->value; // history score if (value < HistoryValue) { ASSERT(value>=0&&value<16384); ASSERT(move!=trans_move); ASSERT(!move_is_tactical(move,board)); ASSERT(!move_is_check(move,board)); new_depth--; reduced = true; } } } // futility pruning if (UseFutility && depth == 1 && node_type != NodePV) { if (!in_check && new_depth == 0 && !move_is_tactical(move,board) && !move_is_dangerous(move,board)) { ASSERT(!move_is_check(move,board)); // optimistic evaluation if (opt_value == +ValueInf) { opt_value = eval(board) + FutilityMargin; ASSERT(opt_value<+ValueInf); } value = opt_value; // pruning if (value <= alpha) { if (value > best_value) { best_value = value; PV_CLEAR(pv); } continue; } } } // recursive search move_do(board,move,undo); if (node_type != NodePV || best_value == ValueNone) { // first move value = -full_search(board,-beta,-alpha,new_depth,height+1,new_pv,NODE_OPP(node_type)); } else { // other moves value = -full_search(board,-alpha-1,-alpha,new_depth,height+1,new_pv,NodeCut); if (value > alpha) { // && value < beta value = -full_search(board,-beta,-alpha,new_depth,height+1,new_pv,NodePV); } } // history-pruning re-search if (HistoryReSearch && reduced && value >= beta) { ASSERT(node_type!=NodePV); new_depth++; ASSERT(new_depth==depth-1); value = -full_search(board,-beta,-alpha,new_depth,height+1,new_pv,NODE_OPP(node_type)); } move_undo(board,move,undo); played[played_nb++] = move; if (value > best_value) { best_value = value; pv_cat(pv,new_pv,move); if (value > alpha) { alpha = value; best_move = move; if (value >= beta) goto cut; } } if (node_type == NodeCut) node_type = NodeAll; } // ALL node if (best_value == ValueNone) { // no legal move if (in_check) { ASSERT(board_is_mate(board)); return VALUE_MATE(height); } else { ASSERT(board_is_stalemate(board)); return ValueDraw; } } cut: ASSERT(value_is_ok(best_value)); // move ordering if (best_move != MoveNone) { good_move(best_move,board,depth,height); if (best_value >= beta && !move_is_tactical(best_move,board)) { ASSERT(played_nb>0&&played[played_nb-1]==best_move); for (i = 0; i < played_nb-1; i++) { move = played[i]; ASSERT(move!=best_move); history_bad(move,board); } history_good(best_move,board); } } // transposition table if (UseTrans && depth >= TransDepth) { trans_move = best_move; trans_depth = depth; trans_min_value = (best_value > old_alpha) ? value_to_trans(best_value,height) : -ValueInf; trans_max_value = (best_value < beta) ? value_to_trans(best_value,height) : +ValueInf; trans_store(Trans,board->key,trans_move,trans_depth,trans_min_value,trans_max_value); } return best_value; } // full_no_null() static int full_no_null(board_t * board, int alpha, int beta, int depth, int height, mv_t pv[], int node_type, int trans_move, int * best_move) { int value, best_value; int move; int new_depth; attack_t attack[1]; sort_t sort[1]; undo_t undo[1]; mv_t new_pv[HeightMax]; ASSERT(board!=NULL); ASSERT(range_is_ok(alpha,beta)); ASSERT(depth_is_ok(depth)); ASSERT(height_is_ok(height)); ASSERT(pv!=NULL); ASSERT(node_type==NodePV||node_type==NodeCut||node_type==NodeAll); ASSERT(trans_move==MoveNone||move_is_ok(trans_move)); ASSERT(best_move!=NULL); ASSERT(board_is_legal(board)); ASSERT(!board_is_check(board)); ASSERT(depth>=1); // init SearchCurrent->node_nb++; SearchInfo->check_nb--; PV_CLEAR(pv); if (height > SearchCurrent->max_depth) SearchCurrent->max_depth = height; if (SearchInfo->check_nb <= 0) { SearchInfo->check_nb += SearchInfo->check_inc; search_check(); } attack_set(attack,board); ASSERT(!ATTACK_IN_CHECK(attack)); *best_move = MoveNone; best_value = ValueNone; // move loop sort_init(sort,board,attack,depth,height,trans_move); while ((move=sort_next(sort)) != MoveNone) { new_depth = full_new_depth(depth,move,board,false,false); move_do(board,move,undo); value = -full_search(board,-beta,-alpha,new_depth,height+1,new_pv,NODE_OPP(node_type)); move_undo(board,move,undo); if (value > best_value) { best_value = value; pv_cat(pv,new_pv,move); if (value > alpha) { alpha = value; *best_move = move; if (value >= beta) goto cut; } } } // ALL node if (best_value == ValueNone) { // no legal move => stalemate ASSERT(board_is_stalemate(board)); best_value = ValueDraw; } cut: ASSERT(value_is_ok(best_value)); return best_value; } // full_quiescence() static int full_quiescence(board_t * board, int alpha, int beta, int depth, int height, mv_t pv[]) { bool in_check; int old_alpha; int value, best_value; int best_move; int move; int opt_value; attack_t attack[1]; sort_t sort[1]; undo_t undo[1]; mv_t new_pv[HeightMax]; ASSERT(board!=NULL); ASSERT(range_is_ok(alpha,beta)); ASSERT(depth_is_ok(depth)); ASSERT(height_is_ok(height)); ASSERT(pv!=NULL); ASSERT(board_is_legal(board)); ASSERT(depth<=0); // init SearchCurrent->node_nb++; SearchInfo->check_nb--; PV_CLEAR(pv); if (height > SearchCurrent->max_depth) SearchCurrent->max_depth = height; if (SearchInfo->check_nb <= 0) { SearchInfo->check_nb += SearchInfo->check_inc; search_check(); } // draw? if (board_is_repetition(board) || recog_draw(board)) return ValueDraw; // mate-distance pruning if (UseDistancePruning) { // lower bound value = VALUE_MATE(height+2); // does not work if the current position is mate if (value > alpha && board_is_mate(board)) value = VALUE_MATE(height); if (value > alpha) { alpha = value; if (value >= beta) return value; } // upper bound value = -VALUE_MATE(height+1); if (value < beta) { beta = value; if (value <= alpha) return value; } } // more init attack_set(attack,board); in_check = ATTACK_IN_CHECK(attack); if (in_check) { ASSERT(depth<0); depth++; // in-check extension } // height limit if (height >= HeightMax-1) return eval(board); // more init old_alpha = alpha; best_value = ValueNone; best_move = MoveNone; /* if (UseDelta) */ opt_value = +ValueInf; if (!in_check) { // lone-king stalemate? if (simple_stalemate(board)) return ValueDraw; // stand pat value = eval(board); ASSERT(value>best_value); best_value = value; if (value > alpha) { alpha = value; if (value >= beta) goto cut; } if (UseDelta) { opt_value = value + DeltaMargin; ASSERT(opt_value<+ValueInf); } } // move loop sort_init_qs(sort,board,attack,depth>=CheckDepth); while ((move=sort_next_qs(sort)) != MoveNone) { // delta pruning if (UseDelta && beta == old_alpha+1) { if (!in_check && !move_is_check(move,board) && !capture_is_dangerous(move,board)) { ASSERT(move_is_tactical(move,board)); // optimistic evaluation value = opt_value; int to = MOVE_TO(move); int capture = board->square[to]; if (capture != Empty) { value += VALUE_PIECE(capture); } else if (MOVE_IS_EN_PASSANT(move)) { value += ValuePawn; } if (MOVE_IS_PROMOTE(move)) value += ValueQueen - ValuePawn; // pruning if (value <= alpha) { if (value > best_value) { best_value = value; PV_CLEAR(pv); } continue; } } } move_do(board,move,undo); value = -full_quiescence(board,-beta,-alpha,depth-1,height+1,new_pv); move_undo(board,move,undo); if (value > best_value) { best_value = value; pv_cat(pv,new_pv,move); if (value > alpha) { alpha = value; best_move = move; if (value >= beta) goto cut; } } } // ALL node if (best_value == ValueNone) { // no legal move ASSERT(board_is_mate(board)); return VALUE_MATE(height); } cut: ASSERT(value_is_ok(best_value)); return best_value; } // full_new_depth() static int full_new_depth(int depth, int move, board_t * board, bool single_reply, bool in_pv) { int new_depth; ASSERT(depth_is_ok(depth)); ASSERT(move_is_ok(move)); ASSERT(board!=NULL); ASSERT(single_reply==true||single_reply==false); ASSERT(in_pv==true||in_pv==false); ASSERT(depth>0); new_depth = depth - 1; if ((single_reply && ExtendSingleReply) || (in_pv && MOVE_TO(move) == board->cap_sq // recapture && see_move(move,board) > 0) || (in_pv && PIECE_IS_PAWN(MOVE_PIECE(move,board)) && PAWN_RANK(MOVE_TO(move),board->turn) == Rank7 && see_move(move,board) >= 0) || move_is_check(move,board)) { new_depth++; } ASSERT(new_depth>=0&&new_depth<=depth); return new_depth; } // do_null() static bool do_null(const board_t * board) { ASSERT(board!=NULL); // use null move if the side-to-move has at least one piece return board->piece_size[board->turn] >= 2; // king + one piece } // do_ver() static bool do_ver(const board_t * board) { ASSERT(board!=NULL); // use verification if the side-to-move has at most one piece return board->piece_size[board->turn] <= 2; // king + one piece } // pv_fill() static void pv_fill(const mv_t pv[], board_t * board) { int move; int trans_move, trans_depth, trans_min_value, trans_max_value; undo_t undo[1]; ASSERT(pv!=NULL); ASSERT(board!=NULL); ASSERT(UseTrans); move = *pv; if (move != MoveNone && move != MoveNull) { move_do(board,move,undo); pv_fill(pv+1,board); move_undo(board,move,undo); trans_move = move; trans_depth = -127; // HACK trans_min_value = -ValueInf; trans_max_value = +ValueInf; trans_store(Trans,board->key,trans_move,trans_depth,trans_min_value,trans_max_value); } } // move_is_dangerous() static bool move_is_dangerous(int move, const board_t * board) { int piece; ASSERT(move_is_ok(move)); ASSERT(board!=NULL); ASSERT(!move_is_tactical(move,board)); piece = MOVE_PIECE(move,board); if (PIECE_IS_PAWN(piece) && PAWN_RANK(MOVE_TO(move),board->turn) >= Rank7) { return true; } return false; } // capture_is_dangerous() static bool capture_is_dangerous(int move, const board_t * board) { int piece, capture; ASSERT(move_is_ok(move)); ASSERT(board!=NULL); ASSERT(move_is_tactical(move,board)); piece = MOVE_PIECE(move,board); if (PIECE_IS_PAWN(piece) && PAWN_RANK(MOVE_TO(move),board->turn) >= Rank7) { return true; } capture = move_capture(move,board); if (PIECE_IS_QUEEN(capture)) return true; if (PIECE_IS_PAWN(capture) && PAWN_RANK(MOVE_TO(move),board->turn) <= Rank2) { return true; } return false; } // simple_stalemate() static bool simple_stalemate(const board_t * board) { int me, opp; int king; int opp_flag; int from, to; int capture; const inc_t * inc_ptr; int inc; ASSERT(board!=NULL); ASSERT(board_is_legal(board)); ASSERT(!board_is_check(board)); // lone king? me = board->turn; if (board->piece_size[me] != 1 || board->pawn_size[me] != 0) return false; // no // king in a corner? king = KING_POS(board,me); if (king != A1 && king != H1 && king != A8 && king != H8) return false; // no // init opp = COLOUR_OPP(me); opp_flag = COLOUR_FLAG(opp); // king can move? from = king; for (inc_ptr = KingInc; (inc=*inc_ptr) != IncNone; inc_ptr++) { to = from + inc; capture = board->square[to]; if (capture == Empty || FLAG_IS(capture,opp_flag)) { if (!is_attacked(board,to,opp)) return false; // legal king move } } // no legal move ASSERT(board_is_stalemate((board_t*)board)); return true; } } // namespace engine // end of search_full.cpp gnuchess-6.2.2/src/engine/search_full.h000644 000766 000024 00000002153 11517375750 020663 0ustar00antoniostaff000000 000000 /* search_full.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // search_full.h #ifndef SEARCH_FULL_H #define SEARCH_FULL_H // includes #include "board.h" #include "util.h" namespace engine { // functions extern void search_full_init (list_t * list, board_t * board); extern int search_full_root (list_t * list, board_t * board, int depth, int search_type); } // namespace engine #endif // !defined SEARCH_FULL_H // end of search_full.h gnuchess-6.2.2/src/engine/see.cpp000644 000766 000024 00000020673 11517375750 017512 0ustar00antoniostaff000000 000000 /* see.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // see.cpp // includes #include "attack.h" #include "board.h" #include "colour.h" #include "move.h" #include "piece.h" #include "see.h" #include "util.h" #include "value.h" // macros #define ALIST_CLEAR(alist) ((alist)->size=0) namespace engine { // types struct alist_t { int size; int square[15]; }; struct alists_t { alist_t alist[ColourNb][1]; }; // prototypes static int see_rec (alists_t * alists, const board_t * board, int colour, int to, int piece_value); static void alist_build (alist_t * alist, const board_t * board, int to, int colour); static void alists_hidden (alists_t * alists, const board_t * board, int from, int to); static void alist_add (alist_t * alist, int square, const board_t * board); static void alist_remove (alist_t * alist, int pos); static int alist_pop (alist_t * alist, const board_t * board); // functions // see_move() int see_move(int move, const board_t * board) { int att, def; int from, to; alists_t alists[1]; int value, piece_value; int piece, capture; alist_t * alist; int pos; ASSERT(move_is_ok(move)); ASSERT(board!=NULL); // init from = MOVE_FROM(move); to = MOVE_TO(move); // move the piece piece_value = 0; piece = board->square[from]; ASSERT(piece_is_ok(piece)); att = PIECE_COLOUR(piece); def = COLOUR_OPP(att); // promote if (MOVE_IS_PROMOTE(move)) { ASSERT(PIECE_IS_PAWN(piece)); piece = move_promote(move); ASSERT(piece_is_ok(piece)); ASSERT(COLOUR_IS(piece,att)); } piece_value += VALUE_PIECE(piece); // clear attacker lists ALIST_CLEAR(alists->alist[Black]); ALIST_CLEAR(alists->alist[White]); // find hidden attackers alists_hidden(alists,board,from,to); // capture the piece value = 0; capture = board->square[to]; if (capture != Empty) { ASSERT(piece_is_ok(capture)); ASSERT(COLOUR_IS(capture,def)); value += VALUE_PIECE(capture); } // promote if (MOVE_IS_PROMOTE(move)) { value += VALUE_PIECE(piece) - ValuePawn; } // en-passant if (MOVE_IS_EN_PASSANT(move)) { ASSERT(value==0); ASSERT(PIECE_IS_PAWN(board->square[SQUARE_EP_DUAL(to)])); value += ValuePawn; alists_hidden(alists,board,SQUARE_EP_DUAL(to),to); } // build defender list alist = alists->alist[def]; alist_build(alist,board,to,def); if (alist->size == 0) return value; // no defender => stop SEE // build attacker list alist = alists->alist[att]; alist_build(alist,board,to,att); // remove the moved piece (if it's an attacker) for (pos = 0; pos < alist->size && alist->square[pos] != from; pos++) ; if (pos < alist->size) alist_remove(alist,pos); // SEE search value -= see_rec(alists,board,def,to,piece_value); return value; } // see_square() int see_square(const board_t * board, int to, int colour) { int att, def; alists_t alists[1]; alist_t * alist; int piece_value; int piece; ASSERT(board!=NULL); ASSERT(SQUARE_IS_OK(to)); ASSERT(COLOUR_IS_OK(colour)); ASSERT(COLOUR_IS(board->square[to],COLOUR_OPP(colour))); // build attacker list att = colour; alist = alists->alist[att]; ALIST_CLEAR(alist); alist_build(alist,board,to,att); if (alist->size == 0) return 0; // no attacker => stop SEE // build defender list def = COLOUR_OPP(att); alist = alists->alist[def]; ALIST_CLEAR(alist); alist_build(alist,board,to,def); // captured piece piece = board->square[to]; ASSERT(piece_is_ok(piece)); ASSERT(COLOUR_IS(piece,def)); piece_value = VALUE_PIECE(piece); // SEE search return see_rec(alists,board,att,to,piece_value); } // see_rec() static int see_rec(alists_t * alists, const board_t * board, int colour, int to, int piece_value) { int from, piece; int value; ASSERT(alists!=NULL); ASSERT(board!=NULL); ASSERT(COLOUR_IS_OK(colour)); ASSERT(SQUARE_IS_OK(to)); ASSERT(piece_value>0); // find the least valuable attacker from = alist_pop(alists->alist[colour],board); if (from == SquareNone) return 0; // no more attackers // find hidden attackers alists_hidden(alists,board,from,to); // calculate the capture value value = +piece_value; // captured piece if (value == ValueKing) return value; // do not allow an answer to a king capture piece = board->square[from]; ASSERT(piece_is_ok(piece)); ASSERT(COLOUR_IS(piece,colour)); piece_value = VALUE_PIECE(piece); // promote if (piece_value == ValuePawn && SQUARE_IS_PROMOTE(to)) { // HACK: PIECE_IS_PAWN(piece) ASSERT(PIECE_IS_PAWN(piece)); piece_value = ValueQueen; value += ValueQueen - ValuePawn; } value -= see_rec(alists,board,COLOUR_OPP(colour),to,piece_value); if (value < 0) value = 0; return value; } // alist_build() static void alist_build(alist_t * alist, const board_t * board, int to, int colour) { const sq_t * ptr; int from; int piece; int delta; int inc; int sq; int pawn; ASSERT(alist!=NULL); ASSERT(board!=NULL); ASSERT(SQUARE_IS_OK(to)); ASSERT(COLOUR_IS_OK(colour)); // piece attacks for (ptr = &board->piece[colour][0]; (from=*ptr) != SquareNone; ptr++) { piece = board->square[from]; delta = to - from; if (PSEUDO_ATTACK(piece,delta)) { inc = DELTA_INC_ALL(delta); ASSERT(inc!=IncNone); sq = from; do { sq += inc; if (sq == to) { // attack alist_add(alist,from,board); break; } } while (board->square[sq] == Empty); } } // pawn attacks inc = PAWN_MOVE_INC(colour); pawn = PAWN_MAKE(colour); from = to - (inc-1); if (board->square[from] == pawn) alist_add(alist,from,board); from = to - (inc+1); if (board->square[from] == pawn) alist_add(alist,from,board); } // alists_hidden() static void alists_hidden(alists_t * alists, const board_t * board, int from, int to) { int inc; int sq, piece; ASSERT(alists!=NULL); ASSERT(board!=NULL); ASSERT(SQUARE_IS_OK(from)); ASSERT(SQUARE_IS_OK(to)); inc = DELTA_INC_LINE(to-from); if (inc != IncNone) { // line sq = from; do sq -= inc; while ((piece=board->square[sq]) == Empty); if (SLIDER_ATTACK(piece,inc)) { ASSERT(piece_is_ok(piece)); ASSERT(PIECE_IS_SLIDER(piece)); alist_add(alists->alist[PIECE_COLOUR(piece)],sq,board); } } } // alist_add() static void alist_add(alist_t * alist, int square, const board_t * board) { int piece; int size, pos; ASSERT(alist!=NULL); ASSERT(SQUARE_IS_OK(square)); ASSERT(board!=NULL); // insert in MV order piece = board->square[square]; size = ++alist->size; // HACK ASSERT(size>0&&size<16); for (pos = size-1; pos > 0 && piece > board->square[alist->square[pos-1]]; pos--) { // HACK ASSERT(pos>0&&possquare[pos] = alist->square[pos-1]; } ASSERT(pos>=0&&possquare[pos] = square; } // alist_remove() static void alist_remove(alist_t * alist, int pos) { int size, i; ASSERT(alist!=NULL); ASSERT(pos>=0&&possize); size = alist->size--; // HACK ASSERT(size>=1); ASSERT(pos>=0&&pos=0&&isquare[i] = alist->square[i+1]; } } // alist_pop() static int alist_pop(alist_t * alist, const board_t * board) { int sq; int size; ASSERT(alist!=NULL); ASSERT(board!=NULL); sq = SquareNone; size = alist->size; if (size != 0) { size--; ASSERT(size>=0); sq = alist->square[size]; alist->size = size; } return sq; } } // namespace engine // end of see.cpp gnuchess-6.2.2/src/engine/see.h000644 000766 000024 00000002035 11517375750 017147 0ustar00antoniostaff000000 000000 /* see.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // see.h #ifndef SEE_H #define SEE_H // includes #include "board.h" #include "util.h" namespace engine { // functions extern int see_move (int move, const board_t * board); extern int see_square (const board_t * board, int to, int colour); } // namespace engine #endif // !defined SEE_H // end of see.h gnuchess-6.2.2/src/engine/sort.cpp000644 000766 000024 00000043455 11517375750 017730 0ustar00antoniostaff000000 000000 /* sort.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // sort.cpp // includes #include "attack.h" #include "board.h" #include "colour.h" #include "list.h" #include "move.h" #include "move_check.h" #include "move_evasion.h" #include "move_gen.h" #include "move_legal.h" #include "piece.h" #include "search.h" #include "see.h" #include "sort.h" #include "util.h" #include "value.h" namespace engine { // constants static const int KillerNb = 2; static const int HistorySize = 12 * 64; static const int HistoryMax = 16384; static const int TransScore = +32766; static const int GoodScore = +4000; static const int KillerScore = +4; static const int HistoryScore = -24000; static const int BadScore = -28000; static const int CODE_SIZE = 256; // macros #define HISTORY_INC(depth) ((depth)*(depth)) // types enum gen_t { GEN_ERROR, GEN_LEGAL_EVASION, GEN_TRANS, GEN_GOOD_CAPTURE, GEN_BAD_CAPTURE, GEN_KILLER, GEN_QUIET, GEN_EVASION_QS, GEN_CAPTURE_QS, GEN_CHECK_QS, GEN_END }; enum test_t { TEST_ERROR, TEST_NONE, TEST_LEGAL, TEST_TRANS_KILLER, TEST_GOOD_CAPTURE, TEST_BAD_CAPTURE, TEST_KILLER, TEST_QUIET, TEST_CAPTURE_QS, TEST_CHECK_QS }; // variables static int PosLegalEvasion; static int PosSEE; static int PosEvasionQS; static int PosCheckQS; static int PosCaptureQS; static int Code[CODE_SIZE]; static uint16 Killer[HeightMax][KillerNb]; static uint16 History[HistorySize]; static uint16 HistHit[HistorySize]; static uint16 HistTot[HistorySize]; // prototypes static void note_quiet_moves (list_t * list, const board_t * board); static void note_moves_simple (list_t * list, const board_t * board); static void note_mvv_lva (list_t * list, const board_t * board); static int move_value (int move, const board_t * board, int height, int trans_killer); static int capture_value (int move, const board_t * board); static int quiet_move_value (int move, const board_t * board); static int move_value_simple (int move, const board_t * board); static int history_prob (int move, const board_t * board); static bool capture_is_good (int move, const board_t * board); static int mvv_lva (int move, const board_t * board); static int history_index (int move, const board_t * board); // functions // sort_init() void sort_init() { int i, height; int pos; // killer for (height = 0; height < HeightMax; height++) { for (i = 0; i < KillerNb; i++) Killer[height][i] = MoveNone; } // history for (i = 0; i < HistorySize; i++) History[i] = 0; for (i = 0; i < HistorySize; i++) { HistHit[i] = 1; HistTot[i] = 1; } // Code[] for (pos = 0; pos < CODE_SIZE; pos++) Code[pos] = GEN_ERROR; pos = 0; // main search PosLegalEvasion = pos; Code[pos++] = GEN_LEGAL_EVASION; Code[pos++] = GEN_END; PosSEE = pos; Code[pos++] = GEN_TRANS; Code[pos++] = GEN_GOOD_CAPTURE; Code[pos++] = GEN_KILLER; Code[pos++] = GEN_QUIET; Code[pos++] = GEN_BAD_CAPTURE; Code[pos++] = GEN_END; // quiescence search PosEvasionQS = pos; Code[pos++] = GEN_EVASION_QS; Code[pos++] = GEN_END; PosCheckQS = pos; Code[pos++] = GEN_CAPTURE_QS; Code[pos++] = GEN_CHECK_QS; Code[pos++] = GEN_END; PosCaptureQS = pos; Code[pos++] = GEN_CAPTURE_QS; Code[pos++] = GEN_END; ASSERT(posboard = board; sort->attack = attack; sort->depth = depth; sort->height = height; sort->trans_killer = trans_killer; sort->killer_1 = Killer[sort->height][0]; sort->killer_2 = Killer[sort->height][1]; if (ATTACK_IN_CHECK(sort->attack)) { gen_legal_evasions(sort->list,sort->board,sort->attack); note_moves(sort->list,sort->board,sort->height,sort->trans_killer); list_sort(sort->list); sort->gen = PosLegalEvasion + 1; sort->test = TEST_NONE; } else { // not in check LIST_CLEAR(sort->list); sort->gen = PosSEE; } sort->pos = 0; } // sort_next() int sort_next(sort_t * sort) { int move; int gen; ASSERT(sort!=NULL); while (true) { while (sort->pos < LIST_SIZE(sort->list)) { // next move move = LIST_MOVE(sort->list,sort->pos); sort->value = 16384; // default score sort->pos++; ASSERT(move!=MoveNone); // test if (false) { } else if (sort->test == TEST_NONE) { // no-op } else if (sort->test == TEST_TRANS_KILLER) { if (!move_is_pseudo(move,sort->board)) continue; if (!pseudo_is_legal(move,sort->board)) continue; } else if (sort->test == TEST_GOOD_CAPTURE) { ASSERT(move_is_tactical(move,sort->board)); if (move == sort->trans_killer) continue; if (!capture_is_good(move,sort->board)) { LIST_ADD(sort->bad,move); continue; } if (!pseudo_is_legal(move,sort->board)) continue; } else if (sort->test == TEST_BAD_CAPTURE) { ASSERT(move_is_tactical(move,sort->board)); ASSERT(!capture_is_good(move,sort->board)); ASSERT(move!=sort->trans_killer); if (!pseudo_is_legal(move,sort->board)) continue; } else if (sort->test == TEST_KILLER) { if (move == sort->trans_killer) continue; if (!quiet_is_pseudo(move,sort->board)) continue; if (!pseudo_is_legal(move,sort->board)) continue; ASSERT(!move_is_tactical(move,sort->board)); } else if (sort->test == TEST_QUIET) { ASSERT(!move_is_tactical(move,sort->board)); if (move == sort->trans_killer) continue; if (move == sort->killer_1) continue; if (move == sort->killer_2) continue; if (!pseudo_is_legal(move,sort->board)) continue; sort->value = history_prob(move,sort->board); } else { ASSERT(false); return MoveNone; } ASSERT(pseudo_is_legal(move,sort->board)); return move; } // next stage gen = Code[sort->gen++]; if (false) { } else if (gen == GEN_TRANS) { LIST_CLEAR(sort->list); if (sort->trans_killer != MoveNone) LIST_ADD(sort->list,sort->trans_killer); sort->test = TEST_TRANS_KILLER; } else if (gen == GEN_GOOD_CAPTURE) { gen_captures(sort->list,sort->board); note_mvv_lva(sort->list,sort->board); list_sort(sort->list); LIST_CLEAR(sort->bad); sort->test = TEST_GOOD_CAPTURE; } else if (gen == GEN_BAD_CAPTURE) { list_copy(sort->list,sort->bad); sort->test = TEST_BAD_CAPTURE; } else if (gen == GEN_KILLER) { LIST_CLEAR(sort->list); if (sort->killer_1 != MoveNone) LIST_ADD(sort->list,sort->killer_1); if (sort->killer_2 != MoveNone) LIST_ADD(sort->list,sort->killer_2); sort->test = TEST_KILLER; } else if (gen == GEN_QUIET) { gen_quiet_moves(sort->list,sort->board); note_quiet_moves(sort->list,sort->board); list_sort(sort->list); sort->test = TEST_QUIET; } else { ASSERT(gen==GEN_END); return MoveNone; } sort->pos = 0; } } // sort_init_qs() void sort_init_qs(sort_t * sort, board_t * board, const attack_t * attack, bool check) { ASSERT(sort!=NULL); ASSERT(board!=NULL); ASSERT(attack!=NULL); ASSERT(check==true||check==false); sort->board = board; sort->attack = attack; if (ATTACK_IN_CHECK(sort->attack)) { sort->gen = PosEvasionQS; } else if (check) { sort->gen = PosCheckQS; } else { sort->gen = PosCaptureQS; } LIST_CLEAR(sort->list); sort->pos = 0; } // sort_next_qs() int sort_next_qs(sort_t * sort) { int move; int gen; ASSERT(sort!=NULL); while (true) { while (sort->pos < LIST_SIZE(sort->list)) { // next move move = LIST_MOVE(sort->list,sort->pos); sort->pos++; ASSERT(move!=MoveNone); // test if (false) { } else if (sort->test == TEST_LEGAL) { if (!pseudo_is_legal(move,sort->board)) continue; } else if (sort->test == TEST_CAPTURE_QS) { ASSERT(move_is_tactical(move,sort->board)); if (!capture_is_good(move,sort->board)) continue; if (!pseudo_is_legal(move,sort->board)) continue; } else if (sort->test == TEST_CHECK_QS) { ASSERT(!move_is_tactical(move,sort->board)); ASSERT(move_is_check(move,sort->board)); if (see_move(move,sort->board) < 0) continue; if (!pseudo_is_legal(move,sort->board)) continue; } else { ASSERT(false); return MoveNone; } ASSERT(pseudo_is_legal(move,sort->board)); return move; } // next stage gen = Code[sort->gen++]; if (false) { } else if (gen == GEN_EVASION_QS) { gen_pseudo_evasions(sort->list,sort->board,sort->attack); note_moves_simple(sort->list,sort->board); list_sort(sort->list); sort->test = TEST_LEGAL; } else if (gen == GEN_CAPTURE_QS) { gen_captures(sort->list,sort->board); note_mvv_lva(sort->list,sort->board); list_sort(sort->list); sort->test = TEST_CAPTURE_QS; } else if (gen == GEN_CHECK_QS) { gen_quiet_checks(sort->list,sort->board); sort->test = TEST_CHECK_QS; } else { ASSERT(gen==GEN_END); return MoveNone; } sort->pos = 0; } } // good_move() void good_move(int move, const board_t * board, int depth, int height) { int index; int i; ASSERT(move_is_ok(move)); ASSERT(board!=NULL); ASSERT(depth_is_ok(depth)); ASSERT(height_is_ok(height)); if (move_is_tactical(move,board)) return; // killer if (Killer[height][0] != move) { Killer[height][1] = Killer[height][0]; Killer[height][0] = move; } ASSERT(Killer[height][0]==move); ASSERT(Killer[height][1]!=move); // history index = history_index(move,board); History[index] += HISTORY_INC(depth); if (History[index] >= HistoryMax) { for (i = 0; i < HistorySize; i++) { History[i] = (History[i] + 1) / 2; } } } // history_good() void history_good(int move, const board_t * board) { int index; ASSERT(move_is_ok(move)); ASSERT(board!=NULL); if (move_is_tactical(move,board)) return; // history index = history_index(move,board); HistHit[index]++; HistTot[index]++; if (HistTot[index] >= HistoryMax) { HistHit[index] = (HistHit[index] + 1) / 2; HistTot[index] = (HistTot[index] + 1) / 2; } ASSERT(HistHit[index]<=HistTot[index]); ASSERT(HistTot[index]= HistoryMax) { HistHit[index] = (HistHit[index] + 1) / 2; HistTot[index] = (HistTot[index] + 1) / 2; } ASSERT(HistHit[index]<=HistTot[index]); ASSERT(HistTot[index]= 2) { for (i = 0; i < size; i++) { move = LIST_MOVE(list,i); list->value[i] = move_value(move,board,height,trans_killer); } } } // note_quiet_moves() static void note_quiet_moves(list_t * list, const board_t * board) { int size; int i, move; ASSERT(list_is_ok(list)); ASSERT(board!=NULL); size = LIST_SIZE(list); if (size >= 2) { for (i = 0; i < size; i++) { move = LIST_MOVE(list,i); list->value[i] = quiet_move_value(move,board); } } } // note_moves_simple() static void note_moves_simple(list_t * list, const board_t * board) { int size; int i, move; ASSERT(list_is_ok(list)); ASSERT(board!=NULL); size = LIST_SIZE(list); if (size >= 2) { for (i = 0; i < size; i++) { move = LIST_MOVE(list,i); list->value[i] = move_value_simple(move,board); } } } // note_mvv_lva() static void note_mvv_lva(list_t * list, const board_t * board) { int size; int i, move; ASSERT(list_is_ok(list)); ASSERT(board!=NULL); size = LIST_SIZE(list); if (size >= 2) { for (i = 0; i < size; i++) { move = LIST_MOVE(list,i); list->value[i] = mvv_lva(move,board); } } } // move_value() static int move_value(int move, const board_t * board, int height, int trans_killer) { int value; ASSERT(move_is_ok(move)); ASSERT(board!=NULL); ASSERT(height_is_ok(height)); ASSERT(trans_killer==MoveNone||move_is_ok(trans_killer)); if (false) { } else if (move == trans_killer) { // transposition table killer value = TransScore; } else if (move_is_tactical(move,board)) { // capture or promote value = capture_value(move,board); } else if (move == Killer[height][0]) { // killer 1 value = KillerScore; } else if (move == Killer[height][1]) { // killer 2 value = KillerScore - 1; } else { // quiet move value = quiet_move_value(move,board); } return value; } // capture_value() static int capture_value(int move, const board_t * board) { int value; ASSERT(move_is_ok(move)); ASSERT(board!=NULL); ASSERT(move_is_tactical(move,board)); value = mvv_lva(move,board); if (capture_is_good(move,board)) { value += GoodScore; } else { value += BadScore; } ASSERT(value>=-30000&&value<=+30000); return value; } // quiet_move_value() static int quiet_move_value(int move, const board_t * board) { int value; int index; ASSERT(move_is_ok(move)); ASSERT(board!=NULL); ASSERT(!move_is_tactical(move,board)); index = history_index(move,board); value = HistoryScore + History[index]; ASSERT(value>=HistoryScore&&value<=KillerScore-4); return value; } // move_value_simple() static int move_value_simple(int move, const board_t * board) { int value; ASSERT(move_is_ok(move)); ASSERT(board!=NULL); value = HistoryScore; if (move_is_tactical(move,board)) value = mvv_lva(move,board); return value; } // history_prob() static int history_prob(int move, const board_t * board) { int value; int index; ASSERT(move_is_ok(move)); ASSERT(board!=NULL); ASSERT(!move_is_tactical(move,board)); index = history_index(move,board); ASSERT(HistHit[index]<=HistTot[index]); ASSERT(HistTot[index]=0&&value<=16384); return value; } // capture_is_good() static bool capture_is_good(int move, const board_t * board) { int piece, capture; ASSERT(move_is_ok(move)); ASSERT(board!=NULL); ASSERT(move_is_tactical(move,board)); // special cases if (MOVE_IS_EN_PASSANT(move)) return true; if (move_is_under_promote(move)) return false; // REMOVE ME? // captures and queen promotes capture = board->square[MOVE_TO(move)]; if (capture != Empty) { // capture ASSERT(move_is_capture(move,board)); if (MOVE_IS_PROMOTE(move)) return true; // promote-capture piece = board->square[MOVE_FROM(move)]; if (VALUE_PIECE(capture) >= VALUE_PIECE(piece)) return true; } return see_move(move,board) >= 0; } // mvv_lva() static int mvv_lva(int move, const board_t * board) { int piece, capture, promote; int value; ASSERT(move_is_ok(move)); ASSERT(board!=NULL); ASSERT(move_is_tactical(move,board)); if (MOVE_IS_EN_PASSANT(move)) { // en-passant capture value = 5; // PxP } else if ((capture = board->square[MOVE_TO(move)]) != Empty) { // normal capture piece = board->square[MOVE_FROM(move)]; value = PIECE_ORDER(capture) * 6 - PIECE_ORDER(piece) + 5; ASSERT(value>=0&&value<30); } else { // promote ASSERT(MOVE_IS_PROMOTE(move)); promote = move_promote(move); value = PIECE_ORDER(promote) - 5; ASSERT(value>=-4&&value<0); } ASSERT(value>=-4&&value<+30); return value; } // history_index() static int history_index(int move, const board_t * board) { int index; ASSERT(move_is_ok(move)); ASSERT(board!=NULL); ASSERT(!move_is_tactical(move,board)); index = PIECE_TO_12(board->square[MOVE_FROM(move)]) * 64 + SQUARE_TO_64(MOVE_TO(move)); ASSERT(index>=0&&index. */ // sort.h #ifndef SORT_H #define SORT_H // includes #include "attack.h" #include "board.h" #include "list.h" #include "util.h" namespace engine { // types struct sort_t { int depth; int height; int trans_killer; int killer_1; int killer_2; int gen; int test; int pos; int value; board_t * board; const attack_t * attack; list_t list[1]; list_t bad[1]; }; // functions extern void sort_init (); extern void sort_init (sort_t * sort, board_t * board, const attack_t * attack, int depth, int height, int trans_killer); extern int sort_next (sort_t * sort); extern void sort_init_qs (sort_t * sort, board_t * board, const attack_t * attack, bool check); extern int sort_next_qs (sort_t * sort); extern void good_move (int move, const board_t * board, int depth, int height); extern void history_good (int move, const board_t * board); extern void history_bad (int move, const board_t * board); extern void note_moves (list_t * list, const board_t * board, int height, int trans_killer); } // namespace engine #endif // !defined SORT_H // end of sort.h gnuchess-6.2.2/src/engine/square.cpp000644 000766 000024 00000005663 11517375750 020240 0ustar00antoniostaff000000 000000 /* square.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // square.cpp // includes #include "colour.h" #include "square.h" #include "util.h" namespace engine { // "constants" const int SquareFrom64[64] = { A1, B1, C1, D1, E1, F1, G1, H1, A2, B2, C2, D2, E2, F2, G2, H2, A3, B3, C3, D3, E3, F3, G3, H3, A4, B4, C4, D4, E4, F4, G4, H4, A5, B5, C5, D5, E5, F5, G5, H5, A6, B6, C6, D6, E6, F6, G6, H6, A7, B7, C7, D7, E7, F7, G7, H7, A8, B8, C8, D8, E8, F8, G8, H8, }; const int RankMask[ColourNb] = { 0, 0xF }; const int PromoteRank[ColourNb] = { 0xB0, 0x40 }; // variables int SquareTo64[SquareNb]; bool SquareIsPromote[SquareNb]; // functions // square_init() void square_init() { int sq; // SquareTo64[] for (sq = 0; sq < SquareNb; sq++) SquareTo64[sq] = -1; for (sq = 0; sq < 64; sq++) { SquareTo64[SquareFrom64[sq]] = sq; } // SquareIsPromote[] for (sq = 0; sq < SquareNb; sq++) { SquareIsPromote[sq] = SQUARE_IS_OK(sq) && (SQUARE_RANK(sq) == Rank1 || SQUARE_RANK(sq) == Rank8); } } // file_from_char() int file_from_char(int c) { ASSERT(c>='a'&&c<='h'); return FileA + (c - 'a'); } // rank_from_char() int rank_from_char(int c) { ASSERT(c>='1'&&c<='8'); return Rank1 + (c - '1'); } // file_to_char() int file_to_char(int file) { ASSERT(file>=FileA&&file<=FileH); return 'a' + (file - FileA); } // rank_to_char() int rank_to_char(int rank) { ASSERT(rank>=Rank1&&rank<=Rank8); return '1' + (rank - Rank1); } // square_to_string() bool square_to_string(int square, char string[], int size) { ASSERT(SQUARE_IS_OK(square)); ASSERT(string!=NULL); ASSERT(size>=3); if (size < 3) return false; string[0] = file_to_char(SQUARE_FILE(square)); string[1] = rank_to_char(SQUARE_RANK(square)); string[2] = '\0'; return true; } // square_from_string() int square_from_string(const char string[]) { int file, rank; ASSERT(string!=NULL); if (string[0] < 'a' || string[0] > 'h') return SquareNone; if (string[1] < '1' || string[1] > '8') return SquareNone; if (string[2] != '\0') return SquareNone; file = file_from_char(string[0]); rank = rank_from_char(string[1]); return SQUARE_MAKE(file,rank); } } // namespace engine // end of square.cpp gnuchess-6.2.2/src/engine/square.h000644 000766 000024 00000007170 11517375750 017700 0ustar00antoniostaff000000 000000 /* square.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // square.h #ifndef SQUARE_H #define SQUARE_H // includes #include "colour.h" #include "util.h" namespace engine { // constants const int FileNb = 16; const int RankNb = 16; const int SquareNb = FileNb * RankNb; const int FileInc = +1; const int RankInc = +16; const int FileNone = 0; const int FileA = 0x4; const int FileB = 0x5; const int FileC = 0x6; const int FileD = 0x7; const int FileE = 0x8; const int FileF = 0x9; const int FileG = 0xA; const int FileH = 0xB; const int RankNone = 0; const int Rank1 = 0x4; const int Rank2 = 0x5; const int Rank3 = 0x6; const int Rank4 = 0x7; const int Rank5 = 0x8; const int Rank6 = 0x9; const int Rank7 = 0xA; const int Rank8 = 0xB; const int SquareNone = 0; const int A1=0x44, B1=0x45, C1=0x46, D1=0x47, E1=0x48, F1=0x49, G1=0x4A, H1=0x4B; const int A2=0x54, B2=0x55, C2=0x56, D2=0x57, E2=0x58, F2=0x59, G2=0x5A, H2=0x5B; const int A3=0x64, B3=0x65, C3=0x66, D3=0x67, E3=0x68, F3=0x69, G3=0x6A, H3=0x6B; const int A4=0x74, B4=0x75, C4=0x76, D4=0x77, E4=0x78, F4=0x79, G4=0x7A, H4=0x7B; const int A5=0x84, B5=0x85, C5=0x86, D5=0x87, E5=0x88, F5=0x89, G5=0x8A, H5=0x8B; const int A6=0x94, B6=0x95, C6=0x96, D6=0x97, E6=0x98, F6=0x99, G6=0x9A, H6=0x9B; const int A7=0xA4, B7=0xA5, C7=0xA6, D7=0xA7, E7=0xA8, F7=0xA9, G7=0xAA, H7=0xAB; const int A8=0xB4, B8=0xB5, C8=0xB6, D8=0xB7, E8=0xB8, F8=0xB9, G8=0xBA, H8=0xBB; const int Dark = 0; const int Light = 1; // macros #define SQUARE_IS_OK(square) ((((square)-0x44)&~0x77)==0) #define SQUARE_MAKE(file,rank) (((rank)<<4)|(file)) #define SQUARE_FILE(square) ((square)&0xF) #define SQUARE_RANK(square) ((square)>>4) #define SQUARE_FROM_64(square) (SquareFrom64[square]) #define SQUARE_TO_64(square) (SquareTo64[square]) #define SQUARE_IS_PROMOTE(square) (SquareIsPromote[square]) #define SQUARE_EP_DUAL(square) ((square)^16) #define SQUARE_COLOUR(square) (((square)^((square)>>4))&1) #define SQUARE_FILE_MIRROR(square) ((square)^0x0F) #define SQUARE_RANK_MIRROR(square) ((square)^0xF0) #define FILE_OPP(file) ((file)^0xF) #define RANK_OPP(rank) ((rank)^0xF) #define PAWN_RANK(square,colour) (SQUARE_RANK(square)^RankMask[colour]) #define PAWN_PROMOTE(square,colour) (PromoteRank[colour]|((square)&0xF)) // types typedef int sq_t; // "constants" extern const int SquareFrom64[64]; extern const int RankMask[ColourNb]; extern const int PromoteRank[ColourNb]; // variables extern int SquareTo64[SquareNb]; extern bool SquareIsPromote[SquareNb]; // functions extern void square_init (); extern int file_from_char (int c); extern int rank_from_char (int c); extern int file_to_char (int file); extern int rank_to_char (int rank); extern bool square_to_string (int square, char string[], int size); extern int square_from_string (const char string[]); } // namespace engine #endif // !defined SQUARE_H // end of square.h gnuchess-6.2.2/src/engine/trans.cpp000644 000766 000024 00000022753 11517375750 020066 0ustar00antoniostaff000000 000000 /* trans.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // trans.cpp // includes #include "hash.h" #include "move.h" #include "option.h" #include "protocol.h" #include "trans.h" #include "util.h" #include "value.h" // macros #define MIN(a,b) ((a)<=(b)?(a):(b)) #define MAX(a,b) ((a)>=(b)?(a):(b)) namespace engine { // constants static const bool UseModulo = false; static const int DateSize = 16; static const int ClusterSize = 4; // TODO: unsigned? static const int DepthNone = -128; // types struct entry_t { uint32 lock; uint16 move; sint8 depth; uint8 date; sint8 move_depth; uint8 flags; sint8 min_depth; sint8 max_depth; sint16 min_value; sint16 max_value; }; struct trans { // HACK: typedef'ed in trans.h entry_t * table; uint32 size; uint32 mask; int date; int age[DateSize]; uint32 used; sint64 read_nb; sint64 read_hit; sint64 write_nb; sint64 write_hit; sint64 write_collision; }; // variables trans_t Trans[1]; // prototypes static void trans_set_date (trans_t * trans, int date); static int trans_age (const trans_t * trans, int date); static entry_t * trans_entry (trans_t * trans, uint64 key); static bool entry_is_ok (const entry_t * entry); // functions // trans_is_ok() bool trans_is_ok(const trans_t * trans) { int date; if (trans == NULL) return false; if (trans->table == NULL) return false; if (trans->size == 0) return false; if (trans->mask == 0 || trans->mask >= trans->size) return false; if (trans->date >= DateSize) return false; for (date = 0; date < DateSize; date++) { if (trans->age[date] != trans_age(trans,date)) return false; } return true; } // trans_init() void trans_init(trans_t * trans) { ASSERT(trans!=NULL); ASSERT(sizeof(entry_t)==16); trans->size = 0; trans->mask = 0; trans->table = NULL; trans_set_date(trans,0); trans_clear(trans); // ASSERT(trans_is_ok(trans)); } // trans_alloc() void trans_alloc(trans_t * trans) { uint32 size, target; ASSERT(trans!=NULL); // calculate size target = option_get_int("Hash"); if (target < 4) target = 16; target *= 1024 * 1024; for (size = 1; size != 0 && size <= target; size *= 2) ; size /= 2; ASSERT(size>0&&size<=target); // allocate table size /= sizeof(entry_t); ASSERT(size!=0&&(size&(size-1))==0); // power of 2 trans->size = size + (ClusterSize - 1); // HACK to avoid testing for end of table trans->mask = size - 1; trans->table = (entry_t *) my_malloc(trans->size*sizeof(entry_t)); trans_clear(trans); ASSERT(trans_is_ok(trans)); } // trans_free() void trans_free(trans_t * trans) { ASSERT(trans_is_ok(trans)); my_free(trans->table); trans->table = NULL; trans->size = 0; trans->mask = 0; } // trans_clear() void trans_clear(trans_t * trans) { entry_t clear_entry[1]; entry_t * entry; uint32 index; ASSERT(trans!=NULL); trans_set_date(trans,0); clear_entry->lock = 0; clear_entry->move = MoveNone; clear_entry->depth = DepthNone; clear_entry->date = trans->date; clear_entry->move_depth = DepthNone; clear_entry->flags = 0; clear_entry->min_depth = DepthNone; clear_entry->max_depth = DepthNone; clear_entry->min_value = -ValueInf; clear_entry->max_value = +ValueInf; ASSERT(entry_is_ok(clear_entry)); entry = trans->table; for (index = 0; index < trans->size; index++) { *entry++ = *clear_entry; } } // trans_inc_date() void trans_inc_date(trans_t * trans) { ASSERT(trans!=NULL); trans_set_date(trans,(trans->date+1)%DateSize); } // trans_set_date() static void trans_set_date(trans_t * trans, int date) { ASSERT(trans!=NULL); ASSERT(date>=0&&datedate = date; for (date = 0; date < DateSize; date++) { trans->age[date] = trans_age(trans,date); } trans->used = 0; trans->read_nb = 0; trans->read_hit = 0; trans->write_nb = 0; trans->write_hit = 0; trans->write_collision = 0; } // trans_age() static int trans_age(const trans_t * trans, int date) { int age; ASSERT(trans!=NULL); ASSERT(date>=0&&datedate - date; if (age < 0) age += DateSize; ASSERT(age>=0&&age=0&&move<65536); ASSERT(depth>=-127&&depth<=+127); ASSERT(min_value>=-ValueInf&&min_value<=+ValueInf); ASSERT(max_value>=-ValueInf&&max_value<=+ValueInf); ASSERT(min_value<=max_value); // init trans->write_nb++; // probe best_entry = NULL; best_score = -32767; entry = trans_entry(trans,key); for (i = 0; i < ClusterSize; i++, entry++) { if (entry->lock == KEY_LOCK(key)) { // hash hit => update existing entry trans->write_hit++; if (entry->date != trans->date) trans->used++; entry->date = trans->date; if (depth > entry->depth) entry->depth = depth; // for replacement scheme if (move != MoveNone && depth >= entry->move_depth) { entry->move_depth = depth; entry->move = move; } if (min_value > -ValueInf && depth >= entry->min_depth) { entry->min_depth = depth; entry->min_value = min_value; } if (max_value < +ValueInf && depth >= entry->max_depth) { entry->max_depth = depth; entry->max_value = max_value; } ASSERT(entry_is_ok(entry)); return; } // evaluate replacement score score = trans->age[entry->date] * 256 - entry->depth; ASSERT(score>-32767); if (score > best_score) { best_entry = entry; best_score = score; } } // "best" entry found entry = best_entry; ASSERT(entry!=NULL); ASSERT(entry->lock!=KEY_LOCK(key)); if (entry->date == trans->date) { trans->write_collision++; } else { trans->used++; } // store ASSERT(entry!=NULL); entry->lock = KEY_LOCK(key); entry->date = trans->date; entry->depth = depth; entry->move_depth = (move != MoveNone) ? depth : DepthNone; entry->move = move; entry->min_depth = (min_value > -ValueInf) ? depth : DepthNone; entry->max_depth = (max_value < +ValueInf) ? depth : DepthNone; entry->min_value = min_value; entry->max_value = max_value; ASSERT(entry_is_ok(entry)); } // trans_retrieve() bool trans_retrieve(trans_t * trans, uint64 key, int * move, int * min_depth, int * max_depth, int * min_value, int * max_value) { entry_t * entry; int i; ASSERT(trans_is_ok(trans)); ASSERT(move!=NULL); ASSERT(min_depth!=NULL); ASSERT(max_depth!=NULL); ASSERT(min_value!=NULL); ASSERT(max_value!=NULL); // init trans->read_nb++; // probe entry = trans_entry(trans,key); for (i = 0; i < ClusterSize; i++, entry++) { if (entry->lock == KEY_LOCK(key)) { // found trans->read_hit++; if (entry->date != trans->date) entry->date = trans->date; *move = entry->move; *min_depth = entry->min_depth; *max_depth = entry->max_depth; *min_value = entry->min_value; *max_value = entry->max_value; return true; } } // not found return false; } // trans_stats() void trans_stats(const trans_t * trans) { double full; // double hit, collision; ASSERT(trans_is_ok(trans)); full = double(trans->used) / double(trans->size); // hit = double(trans->read_hit) / double(trans->read_nb); // collision = double(trans->write_collision) / double(trans->write_nb); send("info hashfull %.0f",full*1000.0); } // trans_entry() static entry_t * trans_entry(trans_t * trans, uint64 key) { uint32 index; ASSERT(trans_is_ok(trans)); if (UseModulo) { index = KEY_INDEX(key) % (trans->mask + 1); } else { index = KEY_INDEX(key) & trans->mask; } ASSERT(index<=trans->mask); return &trans->table[index]; } // entry_is_ok() static bool entry_is_ok(const entry_t * entry) { if (entry == NULL) return false; if (entry->date >= DateSize) return false; if (entry->move == MoveNone && entry->move_depth != DepthNone) return false; if (entry->move != MoveNone && entry->move_depth == DepthNone) return false; if (entry->min_value == -ValueInf && entry->min_depth != DepthNone) return false; if (entry->min_value > -ValueInf && entry->min_depth == DepthNone) return false; if (entry->max_value == +ValueInf && entry->max_depth != DepthNone) return false; if (entry->max_value < +ValueInf && entry->max_depth == DepthNone) return false; return true; } } // namespace engine // end of trans.cpp gnuchess-6.2.2/src/engine/trans.h000644 000766 000024 00000003064 11517375750 017525 0ustar00antoniostaff000000 000000 /* trans.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // trans.h #ifndef TRANS_H #define TRANS_H // includes #include "util.h" namespace engine { // types typedef struct trans trans_t; // variables extern trans_t Trans[1]; // functions extern bool trans_is_ok (const trans_t * trans); extern void trans_init (trans_t * trans); extern void trans_alloc (trans_t * trans); extern void trans_free (trans_t * trans); extern void trans_clear (trans_t * trans); extern void trans_inc_date (trans_t * trans); extern void trans_store (trans_t * trans, uint64 key, int move, int depth, int min_value, int max_value); extern bool trans_retrieve (trans_t * trans, uint64 key, int * move, int * min_depth, int * max_depth, int * min_value, int * max_value); extern void trans_stats (const trans_t * trans); } // namespace engine #endif // !defined TRANS_H // end of trans.h gnuchess-6.2.2/src/engine/util.cpp000644 000766 000024 00000012761 12575116712 017706 0ustar00antoniostaff000000 000000 /* util.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // util.cpp // includes #include #include #include #include #include #include #include #include #include "posix.h" #include "util.h" namespace engine { // Streams used for coommunication with the the adapter extern FILE *pipefd_a2e_0_stream; extern FILE *pipefd_e2a_1_stream; // functions // util_init() void util_init() { setvbuf(pipefd_a2e_0_stream,NULL,_IONBF,0); setvbuf(pipefd_e2a_1_stream,NULL,_IONBF,0); // _IOLBF breaks on Windows! } // my_random_init() void my_random_init() { srand(time(NULL)); } // my_random() int my_random(int n) { double r; ASSERT(n>0); r = double(rand()) / (double(RAND_MAX) + 1.0); return int(floor(r*double(n))); } // my_atoll() sint64 my_atoll(const char string[]) { sint64 n; sscanf(string,S64_FORMAT,&n); return n; } // my_round() int my_round(double x) { return int(floor(x+0.5)); } // my_malloc() void * my_malloc(int size) { void * address; ASSERT(size>0); address = malloc(size); if (address == NULL) my_fatal("my_malloc(): malloc(): %s\n",strerror(errno)); return address; } // my_free() void my_free(void * address) { ASSERT(address!=NULL); free(address); } // my_fatal() void my_fatal(const char format[], ...) { va_list ap; ASSERT(format!=NULL); va_start(ap,format); vfprintf(stderr,format,ap); va_end(ap); exit(EXIT_FAILURE); // abort(); } // my_file_read_line() bool my_file_read_line(FILE * file, char string[], int size) { char * ptr; ASSERT(file!=NULL); ASSERT(string!=NULL); ASSERT(size>0); if (fgets(string,size,file) == NULL) { if (feof(file)) { return false; } else { // error my_fatal("my_file_read_line(): fgets(): %s\n",strerror(errno)); } } // suppress '\n' ptr = strchr(string,'\n'); if (ptr != NULL) *ptr = '\0'; return true; } // my_string_empty() bool my_string_empty(const char string[]) { return string == NULL || string[0] == '\0'; } // my_string_equal() bool my_string_equal(const char string_1[], const char string_2[]) { int c1, c2; ASSERT(string_1!=NULL); ASSERT(string_2!=NULL); while (true) { c1 = *string_1++; c2 = *string_2++; if (tolower(c1) != tolower(c2)) return false; if (c1 == '\0') return true; } return false; } // my_strdup() char * my_strdup(const char string[]) { char * address; ASSERT(string!=NULL); // strdup() is not ANSI C address = (char *) my_malloc(strlen(string)+1); strcpy(address,string); return address; } // my_string_clear() void my_string_clear(const char * * variable) { ASSERT(variable!=NULL); if (*variable != NULL) { my_free((void*)(*variable)); *variable = NULL; } } // my_string_set() void my_string_set(const char * * variable, const char string[]) { ASSERT(variable!=NULL); ASSERT(string!=NULL); if (*variable != NULL) my_free((void*)(*variable)); *variable = my_strdup(string); } // my_timer_reset() void my_timer_reset(my_timer_t * timer) { ASSERT(timer!=NULL); timer->start_real = 0.0; timer->start_cpu = 0.0; timer->elapsed_real = 0.0; timer->elapsed_cpu = 0.0; timer->running = false; } // my_timer_start() void my_timer_start(my_timer_t * timer) { ASSERT(timer!=NULL); ASSERT(timer->start_real==0.0); ASSERT(timer->start_cpu==0.0); ASSERT(!timer->running); timer->running = true; timer->start_real = now_real(); timer->start_cpu = now_cpu(); } // my_timer_stop() void my_timer_stop(my_timer_t * timer) { ASSERT(timer!=NULL); ASSERT(timer->running); timer->elapsed_real += now_real() - timer->start_real; timer->elapsed_cpu += now_cpu() - timer->start_cpu; timer->start_real = 0.0; timer->start_cpu = 0.0; timer->running = false; } // my_timer_elapsed_real() double my_timer_elapsed_real(const my_timer_t * timer) { double elapsed; ASSERT(timer!=NULL); elapsed = timer->elapsed_real; if (timer->running) elapsed += now_real() - timer->start_real; if (elapsed < 0.0) elapsed = 0.0; return elapsed; } // my_timer_elapsed_cpu() double my_timer_elapsed_cpu(const my_timer_t * timer) { double elapsed; ASSERT(timer!=NULL); elapsed = timer->elapsed_cpu; if (timer->running) elapsed += now_cpu() - timer->start_cpu; if (elapsed < 0.0) elapsed = 0.0; return elapsed; } // my_timer_cpu_usage() double my_timer_cpu_usage(const my_timer_t * timer) { double real, cpu; double usage; ASSERT(timer!=NULL); real = my_timer_elapsed_real(timer); cpu = my_timer_elapsed_cpu(timer); if (real <= 0.0 || cpu <= 0.0) return 0.0; usage = cpu / real; if (usage >= 1.0) usage = 1.0; return usage; } } // namespace engine // end of util.cpp gnuchess-6.2.2/src/engine/util.h000644 000766 000024 00000006244 12363750602 017347 0ustar00antoniostaff000000 000000 /* util.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // util.h #ifndef UTIL_H #define UTIL_H // includes #include // constants #undef FALSE #define FALSE 0 #undef TRUE #define TRUE 1 #ifdef DEBUG # undef DEBUG # define DEBUG TRUE #else # define DEBUG FALSE #endif #ifdef _MSC_VER # define S64_FORMAT "%I64d" # define U64_FORMAT "%016I64X" #else # define S64_FORMAT "%lld" # define U64_FORMAT "%016llX" #endif // macros #ifdef _MSC_VER # define S64(u) (u##i64) # define U64(u) (u##ui64) #else # define S64(u) (u##LL) # define U64(u) (u##ULL) #endif #undef ASSERT #if DEBUG # define ASSERT(a) { if (!(a)) my_fatal("file \"%s\", line %d, assertion \"" #a "\" failed\n",__FILE__,__LINE__); } #else # define ASSERT(a) #endif namespace engine { // types typedef signed char sint8; typedef unsigned char uint8; typedef signed short sint16; typedef unsigned short uint16; typedef signed int sint32; typedef unsigned int uint32; #ifdef _MSC_VER typedef signed __int64 sint64; typedef unsigned __int64 uint64; #else typedef signed long long int sint64; typedef unsigned long long int uint64; #endif struct my_timer_t { double start_real; double start_cpu; double elapsed_real; double elapsed_cpu; bool running; }; // functions extern void util_init (); extern void my_random_init (); extern int my_random (int n); extern sint64 my_atoll (const char string[]); extern int my_round (double x); extern void * my_malloc (int size); extern void my_free (void * address); extern void my_fatal (const char format[], ...); extern bool my_file_read_line (FILE * file, char string[], int size); extern bool my_string_empty (const char string[]); extern bool my_string_equal (const char string_1[], const char string_2[]); extern char * my_strdup (const char string[]); extern void my_string_clear (const char * * variable); extern void my_string_set (const char * * variable, const char string[]); extern void my_timer_reset (my_timer_t * timer); extern void my_timer_start (my_timer_t * timer); extern void my_timer_stop (my_timer_t * timer); extern double my_timer_elapsed_real (const my_timer_t * timer); extern double my_timer_elapsed_cpu (const my_timer_t * timer); extern double my_timer_cpu_usage (const my_timer_t * timer); } // namespace engine #endif // !defined UTIL_H // end of util.h gnuchess-6.2.2/src/engine/value.cpp000644 000766 000024 00000006007 11517375750 020045 0ustar00antoniostaff000000 000000 /* value.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // value.cpp // includes #include "piece.h" #include "search.h" #include "util.h" #include "value.h" namespace engine { // variables int ValuePiece[PieceNb]; // functions // value_init() void value_init() { int piece; // ValuePiece[] for (piece = 0; piece < PieceNb; piece++) ValuePiece[piece] = -1; ValuePiece[Empty] = 0; // needed? ValuePiece[Edge] = 0; // needed? ValuePiece[WP] = ValuePawn; ValuePiece[WN] = ValueKnight; ValuePiece[WB] = ValueBishop; ValuePiece[WR] = ValueRook; ValuePiece[WQ] = ValueQueen; ValuePiece[WK] = ValueKing; ValuePiece[BP] = ValuePawn; ValuePiece[BN] = ValueKnight; ValuePiece[BB] = ValueBishop; ValuePiece[BR] = ValueRook; ValuePiece[BQ] = ValueQueen; ValuePiece[BK] = ValueKing; } // value_is_ok() bool value_is_ok(int value) { if (value < -ValueInf || value > +ValueInf) return false; return true; } // range_is_ok() bool range_is_ok(int min, int max) { if (!value_is_ok(min)) return false; if (!value_is_ok(max)) return false; if (min >= max) return false; // alpha-beta-like ranges cannot be null return true; } // value_is_mate() bool value_is_mate(int value) { ASSERT(value_is_ok(value)); if (value < -ValueEvalInf || value > +ValueEvalInf) return true; return false; } // value_to_trans() int value_to_trans(int value, int height) { ASSERT(value_is_ok(value)); ASSERT(height_is_ok(height)); if (value < -ValueEvalInf) { value -= height; } else if (value > +ValueEvalInf) { value += height; } ASSERT(value_is_ok(value)); return value; } // value_from_trans() int value_from_trans(int value, int height) { ASSERT(value_is_ok(value)); ASSERT(height_is_ok(height)); if (value < -ValueEvalInf) { value += height; } else if (value > +ValueEvalInf) { value -= height; } ASSERT(value_is_ok(value)); return value; } // value_to_mate() int value_to_mate(int value) { int dist; ASSERT(value_is_ok(value)); if (value < -ValueEvalInf) { dist = (ValueMate + value) / 2; ASSERT(dist>0); return -dist; } else if (value > +ValueEvalInf) { dist = (ValueMate - value + 1) / 2; ASSERT(dist>0); return +dist; } return 0; } } // namespace engine // end of value.cpp gnuchess-6.2.2/src/engine/value.h000644 000766 000024 00000003540 11517375750 017511 0ustar00antoniostaff000000 000000 /* value.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // value.h #ifndef VALUE_H #define VALUE_H // includes #include "piece.h" #include "util.h" namespace engine { // constants const int ValuePawn = 100; // was 100 const int ValueKnight = 325; // was 300 const int ValueBishop = 325; // was 300 const int ValueRook = 500; // was 500 const int ValueQueen = 1000; // was 900 const int ValueKing = 10000; // was 10000 const int ValueNone = -32767; const int ValueDraw = 0; const int ValueMate = 30000; const int ValueInf = ValueMate; const int ValueEvalInf = ValueMate - 256; // handle mates upto 255 plies // macros #define VALUE_MATE(height) (-ValueMate+(height)) #define VALUE_PIECE(piece) (ValuePiece[piece]) // variables extern int ValuePiece[PieceNb]; // functions extern void value_init (); extern bool value_is_ok (int value); extern bool range_is_ok (int min, int max); extern bool value_is_mate (int value); extern int value_to_trans (int value, int height); extern int value_from_trans (int value, int height); extern int value_to_mate (int value); } // namespace engine #endif // !defined VALUE_H // end of value.h gnuchess-6.2.2/src/engine/vector.cpp000644 000766 000024 00000003556 11517375750 020241 0ustar00antoniostaff000000 000000 /* vector.cpp GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // vector.cpp // includes #include "piece.h" #include "square.h" #include "util.h" #include "vector.h" namespace engine { // variables int Distance[DeltaNb]; // functions void vector_init() { int delta; int x, y; int dist, tmp; // Distance[] for (delta = 0; delta < DeltaNb; delta++) Distance[delta] = -1; for (y = -7; y <= +7; y++) { for (x = -7; x <= +7; x++) { delta = y * 16 + x; ASSERT(delta_is_ok(delta)); dist = 0; tmp = x; if (tmp < 0) tmp = -tmp; if (tmp > dist) dist = tmp; tmp = y; if (tmp < 0) tmp = -tmp; if (tmp > dist) dist = tmp; Distance[DeltaOffset+delta] = dist; } } } // delta_is_ok() bool delta_is_ok(int delta) { if (delta < -119 || delta > +119) return false; if ((delta & 0xF) == 8) return false; // HACK: delta % 16 would be ill-defined for negative numbers return true; } // inc_is_ok() bool inc_is_ok(int inc) { int dir; for (dir = 0; dir < 8; dir++) { if (KingInc[dir] == inc) return true; } return false; } } // namespace engine // end of vector.cpp gnuchess-6.2.2/src/engine/vector.h000644 000766 000024 00000002512 11517375750 017675 0ustar00antoniostaff000000 000000 /* vector.h GNU Chess engine Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // vector.h #ifndef VECTOR_H #define VECTOR_H // includes #include "util.h" namespace engine { // "constants" const int IncNone = 0; const int IncNb = 2 * 17 + 1; const int IncOffset = 17; const int DeltaNone = 0; const int DeltaNb = 2 * 119 + 1; const int DeltaOffset = 119; // macros #define DISTANCE(square_1,square_2) (Distance[DeltaOffset+((square_2)-(square_1))]) // variables extern int Distance[DeltaNb]; // functions extern void vector_init (); extern bool delta_is_ok (int delta); extern bool inc_is_ok (int inc); } // namespace engine #endif // !defined VECTOR_H // end of vector.h gnuchess-6.2.2/src/adapter/adapter.cpp000644 000766 000024 00000104502 12575116564 020524 0ustar00antoniostaff000000 000000 /* adapter.cpp GNU Chess protocol adapter Copyright (C) 2001-2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // adapter.cpp // includes #include #include #include #include #include #include #include // Mac OS X needs this one #include #include "adapter.h" #include "board.h" #include "book.h" #include "book_make.h" #include "colour.h" #include "engine.h" #include "fen.h" #include "game.h" #include "io.h" #include "line.h" #include "main.h" #include "move.h" #include "move_do.h" #include "move_legal.h" #include "option.h" #include "parse.h" #include "san.h" #include "uci.h" #include "util.h" #include "components.h" namespace adapter { // constants static const bool UseDebug = false; static const bool DelayPong = false; static const int StringSize = 4096; // types struct xboard_t { io_t io[1]; }; struct state_t { int state; bool computer[ColourNb]; int exp_move; int resign_nb; my_timer_t timer[1]; }; struct xb_t { bool analyse; bool computer; const char * name; bool ics; bool new_hack; // "new" is a C++ keyword bool ponder; int ping; bool post; int proto_ver; bool result; int mps; double base; double inc; bool time_limit; double time_max; bool depth_limit; int depth_max; double my_time; double opp_time; }; enum dummy_state_t { WAIT, THINK, PONDER, ANALYSE }; // variables static xboard_t XBoard[1]; static state_t State[1]; static xb_t XB[1]; extern unsigned int HashSize; // prototypes static void adapter_step (); static void xboard_step (); static void engine_step (); static void comp_move (int move); static void move_step (int move); static void board_update (); static void mess (); static void no_mess (int move); static void search_update (); static void search_clear (); static bool active (); static bool ponder (); static bool ponder_move_is_ok (int ponder_move); static void stop_search (); // static void quit (); static void send_board (int extra_move); static void send_pv (); static void xboard_get (xboard_t * xboard, char string[], int size); static void xboard_send (xboard_t * xboard, const char format[], ...); static void learn (int result); // functions // adapter_loop() void adapter_loop() { // init game_clear(Game); // state State->state = WAIT; State->computer[White] = false; State->computer[Black] = true; State->exp_move = MoveNone; State->resign_nb = 0; my_timer_reset(State->timer); // xboard XBoard->io->in_fd = pipefd_f2a[0]; XBoard->io->out_fd = pipefd_a2f[1]; XBoard->io->name = "XBOARD"; io_init(XBoard->io); XB->analyse = false; XB->computer = false; XB->name = NULL; my_string_set(&XB->name,""); XB->ics = false; XB->new_hack = true; XB->ping = -1; XB->ponder = true; XB->post = false; XB->proto_ver = 1; XB->result = false; XB->mps = 0; XB->base = 300.0; XB->inc = 0.0; XB->time_limit = false; XB->time_max = 5.0; XB->depth_limit = false; XB->depth_max = 127; XB->my_time = 300.0; XB->opp_time = 300.0; // loop while (true) { adapter_step(); sleep( 0 ); // Otherwise, sometimes the program will crash while spending // a long time solving a position } } // adapter_step() static void adapter_step() { fd_set set[1]; int fd_max; int val; // process buffered lines while (io_line_ready(XBoard->io)) xboard_step(); // process available xboard lines while (io_line_ready(Engine->io)) engine_step(); // process available engine lines // init FD_ZERO(set); fd_max = -1; // HACK // add xboard input ASSERT(XBoard->io->in_fd>=0); FD_SET(XBoard->io->in_fd,set); if (XBoard->io->in_fd > fd_max) fd_max = XBoard->io->in_fd; // add engine input ASSERT(Engine->io->in_fd>=0); FD_SET(Engine->io->in_fd,set); if (Engine->io->in_fd > fd_max) fd_max = Engine->io->in_fd; // wait for something to read (no timeout) ASSERT(fd_max>=0); val = select(fd_max+1,set,NULL,NULL,NULL); if (val == -1 && errno != EINTR) my_fatal("adapter_step(): select(): %s\n",strerror(errno)); if (val > 0) { if (FD_ISSET(XBoard->io->in_fd,set)) io_get_update(XBoard->io); // read some xboard input if (FD_ISSET(Engine->io->in_fd,set)) io_get_update(Engine->io); // read some engine input } } // xboard_step() static void xboard_step() { char string[StringSize]; int move; char move_string[256]; board_t board[1]; xboard_get(XBoard,string,StringSize); if (false) { } else if (match(string,"accepted *")) { // ignore } else if (match(string,"analyze")) { State->computer[White] = false; State->computer[Black] = false; XB->analyse = true; XB->new_hack = false; ASSERT(!XB->result); XB->result = false; mess(); } else if (match(string,"bk")) { if (option_get_bool("Book")) { game_get_board(Game,board); book_disp(board); } } else if (match(string,"black")) { if (colour_is_black(game_turn(Game))) { State->computer[White] = true; State->computer[Black] = false; XB->new_hack = true; XB->result = false; mess(); } } else if (match(string,"computer")) { XB->computer = true; } else if (match(string,"draw")) { // ignore } else if (match(string,"easy")) { XB->ponder = false; mess(); } else if (match(string,"edit")) { // refuse xboard_send(XBoard,"Error (unknown command): %s",string); } else if (match(string,"exit")) { State->computer[White] = false; State->computer[Black] = false; XB->analyse = false; mess(); } else if (match(string,"force")) { State->computer[White] = false; State->computer[Black] = false; mess(); } else if (match(string,"go")) { State->computer[game_turn(Game)] = true; State->computer[colour_opp(game_turn(Game))] = false; XB->new_hack = false; ASSERT(!XB->result); XB->result = false; mess(); } else if (match(string,"hard")) { XB->ponder = true; mess(); } else if (match(string,"hint")) { if (option_get_bool("Book")) { game_get_board(Game,board); move = book_move(board,false); if (move != MoveNone && move_is_legal(move,board)) { move_to_san(move,board,move_string,256); xboard_send(XBoard,"Hint: %s",move_string); } } } else if (match(string,"ics *")) { XB->ics = true; } else if (match(string,"level * *:* *")) { XB->mps = atoi(Star[0]); XB->base = double(atoi(Star[1])) * 60.0 + double(atoi(Star[2])); XB->inc = double(atoi(Star[3])); } else if (match(string,"level * * *")) { XB->mps = atoi(Star[0]); XB->base = double(atoi(Star[1])) * 60.0; XB->inc = double(atoi(Star[2])); } else if (match(string,"name *")) { my_string_set(&XB->name,Star[0]); } else if (match(string,"new")) { my_log("POLYGLOT NEW GAME\n"); option_set("Chess960","false"); game_clear(Game); if (XB->analyse) { State->computer[White] = false; State->computer[Black] = false; } else { State->computer[White] = false; State->computer[Black] = true; } XB->new_hack = true; XB->result = false; XB->depth_limit = false; XB->computer = false; my_string_set(&XB->name,""); board_update(); mess(); uci_send_ucinewgame(Uci); } else if (match(string,"nopost")) { XB->post = false; } else if (match(string,"otim *")) { XB->opp_time = double(atoi(Star[0])) / 100.0; if (XB->opp_time < 0.0) XB->opp_time = 0.0; } else if (match(string,"pause")) { // refuse xboard_send(XBoard,"Error (unknown command): %s",string); } else if (match(string,"ping *")) { // HACK; TODO: answer only after an engine move if (DelayPong) { if (XB->ping >= 0) xboard_send(XBoard,"pong %d",XB->ping); // HACK: get rid of old ping XB->ping = atoi(Star[0]); uci_send_isready(Uci); } else { ASSERT(XB->ping==-1); xboard_send(XBoard,"pong %s",Star[0]); } } else if (match(string,"playother")) { State->computer[game_turn(Game)] = false; State->computer[colour_opp(game_turn(Game))] = true; XB->new_hack = false; ASSERT(!XB->result); XB->result = false; mess(); } else if (match(string,"post")) { XB->post = true; } else if (match(string,"protover *")) { XB->proto_ver = atoi(Star[0]); ASSERT(XB->proto_ver>=2); xboard_send(XBoard,"feature done=0"); xboard_send(XBoard,"feature analyze=1"); xboard_send(XBoard,"feature colors=0"); xboard_send(XBoard,"feature draw=1"); xboard_send(XBoard,"feature ics=1"); xboard_send(XBoard,"feature myname=\"%s\"",option_get_string("EngineName")); xboard_send(XBoard,"feature name=1"); xboard_send(XBoard,"feature pause=0"); xboard_send(XBoard,"feature ping=1"); xboard_send(XBoard,"feature playother=1"); xboard_send(XBoard,"feature reuse=1"); xboard_send(XBoard,"feature san=0"); xboard_send(XBoard,"feature setboard=1"); xboard_send(XBoard,"feature sigint=0"); xboard_send(XBoard,"feature sigterm=0"); xboard_send(XBoard,"feature time=1"); xboard_send(XBoard,"feature usermove=1"); if (uci_option_exist(Uci,"UCI_Chess960")) { xboard_send(XBoard,"feature variants=\"normal,fischerandom\""); } else { xboard_send(XBoard,"feature variants=\"normal\""); } if (Uci->ready) xboard_send(XBoard,"feature done=1"); // otherwise "feature done=1" will be sent when the engine is ready } else if (match(string,"quit")) { my_log("POLYGLOT *** \"quit\" from XBoard ***\n"); quit(); } else if (match(string,"random")) { // ignore } else if (match(string,"rating * *")) { // ignore } else if (match(string,"remove")) { if (game_pos(Game) >= 2) { game_goto(Game,game_pos(Game)-2); ASSERT(!XB->new_hack); XB->new_hack = false; // HACK? XB->result = false; board_update(); mess(); } } else if (match(string,"rejected *")) { // ignore } else if (match(string,"reset")) { // protover 3? // refuse xboard_send(XBoard,"Error (unknown command): %s",string); } else if (false || match(string,"result * {*}") || match(string,"result * {* }") || match(string,"result * { *}") || match(string,"result * { * }")) { my_log("POLYGLOT GAME END\n"); XB->result = true; mess(); // book learning if (option_get_bool("Book") && option_get_bool("BookLearn")) { if (false) { } else if (my_string_equal(Star[0],"1-0")) { learn(+1); } else if (my_string_equal(Star[0],"0-1")) { learn(-1); } else if (my_string_equal(Star[0],"1/2-1/2")) { learn(0); } } } else if (match(string,"resume")) { // refuse xboard_send(XBoard,"Error (unknown command): %s",string); } else if (match(string,"sd *")) { XB->depth_limit = true; XB->depth_max = atoi(Star[0]); } else if (match(string,"setboard *")) { my_log("POLYGLOT FEN %s\n",Star[0]); if (!game_init(Game,Star[0])) my_fatal("xboard_step(): bad FEN \"%s\"\n",Star[0]); State->computer[White] = false; State->computer[Black] = false; XB->new_hack = true; // HACK? XB->result = false; board_update(); mess(); } else if (match(string,"st *")) { XB->time_limit = true; XB->time_max = double(atoi(Star[0])); } else if (match(string,"time *")) { XB->my_time = double(atoi(Star[0])) / 100.0; if (XB->my_time < 0.0) XB->my_time = 0.0; } else if (match(string,"undo")) { if (game_pos(Game) >= 1) { game_goto(Game,game_pos(Game)-1); ASSERT(!XB->new_hack); XB->new_hack = false; // HACK? XB->result = false; board_update(); mess(); } } else if (match(string,"usermove *")) { game_get_board(Game,board); move = move_from_san(Star[0],board); if (move != MoveNone && move_is_legal(move,board)) { XB->new_hack = false; ASSERT(!XB->result); XB->result = false; move_step(move); no_mess(move); } else { xboard_send(XBoard,"Illegal move: %s",Star[0]); } } else if (match(string,"variant *")) { if (my_string_equal(Star[0],"fischerandom")) { option_set("Chess960","true"); } else { option_set("Chess960","false"); } } else if (match(string,"white")) { if (colour_is_white(game_turn(Game))) { State->computer[White] = false; State->computer[Black] = true; XB->new_hack = true; XB->result = false; mess(); } } else if (match(string,"xboard")) { // ignore } else if (match(string,".")) { // analyse info if (State->state == ANALYSE) { ASSERT(Uci->searching); ASSERT(Uci->pending_nb>=1); if (Uci->root_move != MoveNone && move_is_legal(Uci->root_move,Uci->board)) { move_to_san(Uci->root_move,Uci->board,move_string,256); xboard_send(XBoard,"stat01: %.0f %lld %d %d %d %s",Uci->time*100.0,Uci->node_nb,Uci->depth,Uci->root_move_nb-(Uci->root_move_pos+1),Uci->root_move_nb,move_string); } else { xboard_send(XBoard,"stat01: %.0f %lld %d %d %d",Uci->time*100.0,Uci->node_nb,Uci->depth,0,0); // HACK } } } else if (match(string,"?")) { // move now if (State->state == THINK) { ASSERT(Uci->searching); ASSERT(Uci->pending_nb>=1); // HACK: just send "stop" to the engine if (Uci->searching) { my_log("POLYGLOT STOP SEARCH\n"); engine_send(Engine,"stop"); } } } else // Extended commands from GNU Chess frontend if (match(string,"book *")) { // book command (from GNU Chess v5) // TODO Invoke Polyglot's book functionality // Subcommands: add, on, off, prefer, random, best, worst char *my_argv[4]; char *token; token = strtok( Star[0], " " ); if ( strcmp( token, "add" ) == 0 ) { token = strtok( NULL, " " ); my_argv[0] = (char *)malloc( 2 ); my_argv[1] = (char *)malloc( 10 ); my_argv[2] = (char *)malloc( 5 ); my_argv[3] = (char *)malloc( strlen(token) + 1 ); strcpy( my_argv[0], "g" ); strcpy( my_argv[1], "make-book" ); strcpy( my_argv[2], "-pgn" ); strcpy( my_argv[3], token ); book_make( 4, my_argv ); } else if ( strcmp( token, "on" ) == 0 ) { option_set("Book","true"); int mode = BookReadOnly; if (option_get_bool("BookLearn")) { mode = BookReadWrite; } book_open(option_get_string("BookFile"),mode); } else if ( strcmp( token, "off" ) == 0 ) { option_set("Book","false"); } else if ( strcmp( token, "best" ) == 0 ) { option_set("BookRandom","false"); option_set("BookWorst","false"); } else if ( strcmp( token, "best" ) == 0 ) { option_set("BookRandom","true"); option_set("BookWorst","false"); } else if ( strcmp( token, "worst" ) == 0 ) { option_set("BookWorst","true"); } } else if (match(string,"hashon")) { // hash on command (from GNU Chess v5) engine_send(Engine,"hashon"); } else if (match(string,"hashoff")) { // hash off command (from GNU Chess v5) engine_send(Engine,"hashoff"); } else if (match(string,"memory")) { // memory command (from GNU Chess v5) xboard_send(XBoard, "Current HashSize is %d MB", HashSize ); } else if (match(string,"memory *")) { // memory N command (from GNU Chess v5) char *token; unsigned int memory; token = strtok( Star[0], " " ); if ( sscanf( token, "%d", &memory ) == 1 ) { HashSize = memory; uci_send_option(Uci,"Hash","%d",HashSize); //xboard_send(XBoard, "Current HashSize is %d MB", HashSize ); } engine_send(Uci->engine,"uci"); } else if (match(string,"nullon")) { // null on command (from GNU Chess v5) uci_send_option(Uci,"NullMove Pruning","%s","Always"); } else if (match(string,"nulloff")) { // null off command (from GNU Chess v5) uci_send_option(Uci,"NullMove Pruning","%s","Never"); } else { // unknown command, maybe a move? game_get_board(Game,board); move = move_from_san(string,board); if (move != MoveNone && move_is_legal(move,board)) { XB->new_hack = false; ASSERT(!XB->result); XB->result = false; move_step(move); no_mess(move); } else if (move != MoveNone) { xboard_send(XBoard,"Illegal move: %s",string); } else { xboard_send(XBoard,"Error (unknown command): %s",string); } } } // engine_step() static void engine_step() { char string[StringSize]; int event; // parse UCI line engine_get(Engine,string,StringSize); event = uci_parse(Uci,string); // react to events if ((event & EVENT_READY) != 0) { // the engine is now ready if (!Uci->ready) { Uci->ready = true; if (XB->proto_ver >= 2) xboard_send(XBoard,"feature done=1"); } if (!DelayPong && XB->ping >= 0) { xboard_send(XBoard,"pong %d",XB->ping); XB->ping = -1; } } if ((event & EVENT_MOVE) != 0 && State->state == THINK) { // the engine is playing a move // MEGA HACK: estimate remaining time because XBoard won't send it! my_timer_stop(State->timer); XB->my_time -= my_timer_elapsed_real(State->timer); XB->my_time += XB->inc; if (XB->mps != 0 && (game_move_nb(Game) + 1) % XB->mps == 0) XB->my_time += XB->base; if (XB->my_time < 0.0) XB->my_time = 0.0; // play the engine move comp_move(Uci->best_move); } if ((event & EVENT_PV) != 0) { // the engine has sent a new PV send_pv(); } } // comp_move() static void comp_move(int move) { board_t board[1]; char string[256]; ASSERT(move_is_ok(move)); ASSERT(State->state==THINK); ASSERT(!XB->analyse); send_pv(); // to update time and nodes // send the move game_get_board(Game,board); if (move_is_castle(move,board) && option_get_bool("Chess960")) { if (!move_to_san(move,board,string,256)) my_fatal("comp_move(): move_to_san() failed\n"); // O-O/O-O-O } else { if (!move_to_can(move,board,string,256)) my_fatal("comp_move(): move_to_can() failed\n"); } xboard_send(XBoard,"move %s",string); // resign? if (option_get_bool("Resign") && Uci->root_move_nb > 1) { if (Uci->best_score <= -abs(option_get_int("ResignScore"))) { State->resign_nb++; my_log("POLYGLOT %d move%s with resign score\n",State->resign_nb,(State->resign_nb>1)?"s":""); if (State->resign_nb >= option_get_int("ResignMoves")) { my_log("POLYGLOT *** RESIGN ***\n"); xboard_send(XBoard,"resign"); } } else { if (State->resign_nb > 0) my_log("POLYGLOT resign reset (State->resign_nb=%d)\n",State->resign_nb); State->resign_nb = 0; } } // play the move move_step(move); no_mess(move); } // move_step() static void move_step(int move) { board_t board[1]; char move_string[256]; ASSERT(move_is_ok(move)); // log game_get_board(Game,board); if (move != MoveNone && move_is_legal(move,board)) { move_to_san(move,board,move_string,256); my_log("POLYGLOT MOVE %s\n",move_string); } else { move_to_can(move,board,move_string,256); my_log("POLYGLOT ILLEGAL MOVE \"%s\"\n",move_string); board_disp(board); my_fatal("move_step(): illegal move \"%s\"\n",move_string); } // play the move game_add_move(Game,move); board_update(); } // board_update() static void board_update() { // handle game end ASSERT(!XB->result); switch (game_status(Game)) { case PLAYING: break; case WHITE_MATES: xboard_send(XBoard,"1-0 {White mates}"); break; case BLACK_MATES: xboard_send(XBoard,"0-1 {Black mates}"); break; case STALEMATE: xboard_send(XBoard,"1/2-1/2 {Stalemate}"); break; case DRAW_MATERIAL: xboard_send(XBoard,"1/2-1/2 {Draw by insufficient material}"); break; case DRAW_FIFTY: xboard_send(XBoard,"1/2-1/2 {Draw by fifty-move rule}"); break; case DRAW_REPETITION: xboard_send(XBoard,"1/2-1/2 {Draw by repetition}"); break; default: ASSERT(false); break; } } // mess() static void mess() { // clear state variables State->resign_nb = 0; State->exp_move = MoveNone; my_timer_reset(State->timer); // abort a possible search stop_search(); // calculate the new state if (false) { } else if (!active()) { State->state = WAIT; my_log("POLYGLOT WAIT\n"); } else if (XB->analyse) { State->state = ANALYSE; my_log("POLYGLOT ANALYSE\n"); } else if (State->computer[game_turn(Game)]) { State->state = THINK; my_log("POLYGLOT THINK\n"); } else { State->state = WAIT; my_log("POLYGLOT WAIT\n"); } search_update(); } // no_mess() static void no_mess(int move) { ASSERT(move_is_ok(move)); // just received a move, calculate the new state if (false) { } else if (!active()) { stop_search(); // abort a possible search State->state = WAIT; State->exp_move = MoveNone; my_log("POLYGLOT WAIT\n"); } else if (State->state == WAIT) { ASSERT(State->computer[game_turn(Game)]); ASSERT(!State->computer[colour_opp(game_turn(Game))]); ASSERT(!XB->analyse); my_log("POLYGLOT WAIT -> THINK\n"); State->state = THINK; State->exp_move = MoveNone; } else if (State->state == THINK) { ASSERT(!State->computer[game_turn(Game)]); ASSERT(State->computer[colour_opp(game_turn(Game))]); ASSERT(!XB->analyse); if (ponder() && ponder_move_is_ok(Uci->ponder_move)) { my_log("POLYGLOT THINK -> PONDER\n"); State->state = PONDER; State->exp_move = Uci->ponder_move; } else { my_log("POLYGLOT THINK -> WAIT\n"); State->state = WAIT; State->exp_move = MoveNone; } } else if (State->state == PONDER) { ASSERT(State->computer[game_turn(Game)]); ASSERT(!State->computer[colour_opp(game_turn(Game))]); ASSERT(!XB->analyse); if (move == State->exp_move && Uci->searching) { ASSERT(Uci->searching); ASSERT(Uci->pending_nb>=1); my_timer_reset(State->timer); my_timer_start(State->timer); my_log("POLYGLOT PONDER -> THINK (*** HIT ***)\n"); engine_send(Engine,"ponderhit"); State->state = THINK; State->exp_move = MoveNone; send_pv(); // update display return; // do not launch a new search } else { my_log("POLYGLOT PONDER -> THINK (miss)\n"); stop_search(); State->state = THINK; State->exp_move = MoveNone; } } else if (State->state == ANALYSE) { ASSERT(XB->analyse); my_log("POLYGLOT ANALYSE -> ANALYSE\n"); stop_search(); } else { ASSERT(false); } search_update(); } // search_update() static void search_update() { int move; int move_nb; board_t board[1]; ASSERT(!Uci->searching); // launch a new search if needed if (State->state == THINK || State->state == PONDER || State->state == ANALYSE) { // opening book if (State->state == THINK && option_get_bool("Book")) { game_get_board(Game,Uci->board); move = book_move(Uci->board,option_get_bool("BookRandom"), option_get_bool("BookWorst")); if (move != MoveNone && move_is_legal(move,Uci->board)) { my_log("POLYGLOT *BOOK MOVE*\n"); search_clear(); // clears Uci->ponder_move Uci->best_move = move; board_copy(board,Uci->board); move_do(board,move); Uci->ponder_move = book_move(board,false); // expected move = best book move Uci->best_pv[0] = Uci->best_move; Uci->best_pv[1] = Uci->ponder_move; // can be MoveNone Uci->best_pv[2] = MoveNone; comp_move(Uci->best_move); return; } } // engine search my_log("POLYGLOT START SEARCH\n"); // options uci_send_option(Uci,"UCI_Chess960","%s",option_get_bool("Chess960")?"true":"false"); if (option_get_int("UCIVersion") >= 2) { uci_send_option(Uci,"UCI_Opponent","none none %s %s",(XB->computer)?"computer":"human",XB->name); uci_send_option(Uci,"UCI_AnalyseMode","%s",(XB->analyse)?"true":"false"); } uci_send_option(Uci,"Ponder","%s",ponder()?"true":"false"); // position move = (State->state == PONDER) ? State->exp_move : MoveNone; send_board(move); // updates Uci->board global variable // search if (State->state == THINK || State->state == PONDER) { engine_send_queue(Engine,"go"); if (XB->time_limit) { // fixed time per move engine_send_queue(Engine," movetime %.0f",XB->time_max*1000.0); } else { // time controls if (colour_is_white(Uci->board->turn)) { engine_send_queue(Engine," wtime %.0f btime %.0f",XB->my_time*1000.0,XB->opp_time*1000.0); } else { engine_send_queue(Engine," wtime %.0f btime %.0f",XB->opp_time*1000.0,XB->my_time*1000.0); } if (XB->inc != 0.0) engine_send_queue(Engine," winc %.0f binc %.0f",XB->inc*1000.0,XB->inc*1000.0); if (XB->mps != 0) { move_nb = XB->mps - (Uci->board->move_nb % XB->mps); ASSERT(move_nb>=1&&move_nb<=XB->mps); engine_send_queue(Engine," movestogo %d",move_nb); } } if (XB->depth_limit) engine_send_queue(Engine," depth %d",XB->depth_max); if (State->state == PONDER) engine_send_queue(Engine," ponder"); engine_send(Engine,""); // newline } else if (State->state == ANALYSE) { engine_send(Engine,"go infinite"); } else { ASSERT(false); } // init search info ASSERT(!Uci->searching); search_clear(); Uci->searching = true; Uci->pending_nb++; } } // search_clear() static void search_clear() { uci_clear(Uci); // TODO: MOVE ME my_timer_reset(State->timer); my_timer_start(State->timer); } // active() static bool active() { // position state if (game_status(Game) != PLAYING) return false; // game ended // xboard state if (XB->analyse) return true; // analysing if (!State->computer[White] && !State->computer[Black]) return false; // force mode if (XB->new_hack || XB->result) return false; // unstarted or ended game return true; // playing } // ponder() static bool ponder() { return XB->ponder && (option_get_bool("CanPonder") || uci_option_exist(Uci,"Ponder")); } // ponder_move_is_ok() static bool ponder_move_is_ok(int move) { int status; board_t board[1]; ASSERT(move==MoveNone||move_is_ok(move)); // legal ponder move? if (move == MoveNone) return false; game_get_board(Game,board); if (!move_is_legal(move,board)) return false; // UCI-legal resulting position? game_add_move(Game,move); game_get_board(Game,board); status = game_status(Game); game_rem_move(Game); if (status != PLAYING) return false; // game ended if (option_get_bool("Book") && is_in_book(board)) { return false; } return true; } // stop_search() static void stop_search() { if (Uci->searching) { ASSERT(Uci->searching); ASSERT(Uci->pending_nb>=1); my_log("POLYGLOT STOP SEARCH\n"); /* engine_send(Engine,"stop"); Uci->searching = false; */ if (option_get_bool("SyncStop")) { uci_send_stop_sync(Uci); } else { uci_send_stop(Uci); } } } // quit() /* static void quit() { char string[StringSize]; my_log("POLYGLOT *** QUIT ***\n"); stop_search(); engine_send(Engine,"quit"); // wait for the engine to quit while (true) { engine_get(Engine,string,StringSize); // HACK: calls exit() on receiving EOF } uci_close(Uci); exit(EXIT_SUCCESS); } */ // send_board() static void send_board(int extra_move) { char fen[256]; int start, end; board_t board[1]; int pos; int move; char string[256]; ASSERT(extra_move==MoveNone||move_is_ok(extra_move)); ASSERT(!Uci->searching); // init game_get_board(Game,Uci->board); if (extra_move != MoveNone) move_do(Uci->board,extra_move); board_to_fen(Uci->board,fen,256); my_log("POLYGLOT FEN %s\n",fen); ASSERT(board_can_play(Uci->board)); // more init start = 0; end = game_pos(Game); ASSERT(end>=start); // position game_get_board(Game,board,start); board_to_fen(board,string,256); engine_send_queue(Engine,"position"); if (my_string_equal(string,StartFen)) { engine_send_queue(Engine," startpos"); } else { engine_send_queue(Engine," fen %s",string); } // move list if (end > start || extra_move != MoveNone) engine_send_queue(Engine," moves"); for (pos = start; pos < end; pos++) { // game moves move = game_move(Game,pos); move_to_can(move,board,string,256); engine_send_queue(Engine," %s",string); move_do(board,move); } if (extra_move != MoveNone) { // move to ponder on move_to_can(extra_move,board,string,256); engine_send_queue(Engine," %s",string); } // end engine_send(Engine,""); // newline } // send_pv() static void send_pv() { char pv_string[StringSize]; board_t board[1]; int move; char move_string[StringSize]; ASSERT(State->state!=WAIT); if (Uci->best_depth == 0) return; // xboard search information if (XB->post) { if (State->state == THINK || State->state == ANALYSE) { line_to_san(Uci->best_pv,Uci->board,pv_string,StringSize); xboard_send(XBoard,"%d %+d %.0f %lld %s",Uci->best_depth,Uci->best_score,Uci->time*100.0,Uci->node_nb,pv_string); } else if (State->state == PONDER && option_get_bool("ShowPonder")) { game_get_board(Game,board); move = State->exp_move; if (move != MoveNone && move_is_legal(move,board)) { move_to_san(move,board,move_string,256); line_to_san(Uci->best_pv,Uci->board,pv_string,StringSize); xboard_send(XBoard,"%d %+d %.0f %lld (%s) %s",Uci->best_depth,Uci->best_score,Uci->time*100.0,Uci->node_nb,move_string,pv_string); } } } // kibitz if ((Uci->searching && option_get_bool("KibitzPV") && Uci->time >= option_get_double("KibitzDelay")) || (!Uci->searching && option_get_bool("KibitzMove"))) { if (State->state == THINK || State->state == ANALYSE) { line_to_san(Uci->best_pv,Uci->board,pv_string,StringSize); xboard_send(XBoard,"%s depth=%d time=%.2f node=%lld speed=%.0f score=%+.2f pv=\"%s\"",option_get_string("KibitzCommand"),Uci->best_depth,Uci->time,Uci->node_nb,Uci->speed,double(Uci->best_score)/100.0,pv_string); } else if (State->state == PONDER) { game_get_board(Game,board); move = State->exp_move; if (move != MoveNone && move_is_legal(move,board)) { move_to_san(move,board,move_string,256); line_to_san(Uci->best_pv,Uci->board,pv_string,StringSize); xboard_send(XBoard,"%s depth=%d time=%.2f node=%lld speed=%.0f score=%+.2f pv=\"(%s) %s\"",option_get_string("KibitzCommand"),Uci->best_depth,Uci->time,Uci->node_nb,Uci->speed,double(Uci->best_score)/100.0,move_string,pv_string); } } } } // xboard_get() static void xboard_get(xboard_t * xboard, char string[], int size) { ASSERT(xboard!=NULL); ASSERT(string!=NULL); ASSERT(size>=256); if (!io_get_line(xboard->io,string,size)) { // EOF my_log("POLYGLOT *** EOF from XBoard ***\n"); quit(); } } // xboard_send() static void xboard_send(xboard_t * xboard, const char format[], ...) { va_list arg_list; char string[StringSize]; ASSERT(xboard!=NULL); ASSERT(format!=NULL); // format va_start(arg_list,format); vsprintf(string,format,arg_list); va_end(arg_list); // send io_send(xboard->io,"%s",string); } // learn() static void learn(int result) { int pos; board_t board[1]; int move; ASSERT(result>=-1&&result<=+1); ASSERT(XB->result); ASSERT(State->computer[White]||State->computer[Black]); // init pos = 0; if (false) { } else if (State->computer[White]) { pos = 0; } else if (State->computer[Black]) { pos = 1; result = -result; } else { my_fatal("learn(): unknown side\n"); } if (false) { } else if (result > 0) { my_log("POLYGLOT *LEARN WIN*\n"); } else if (result < 0) { my_log("POLYGLOT *LEARN LOSS*\n"); } else { my_log("POLYGLOT *LEARN DRAW*\n"); } // loop for (; pos < Game->size; pos += 2) { game_get_board(Game,board,pos); move = game_move(Game,pos); book_learn_move(board,move,result); } book_flush(); } } // namespace adapter // end of adapter.cpp gnuchess-6.2.2/src/adapter/adapter.h000644 000766 000024 00000001717 12575116531 020167 0ustar00antoniostaff000000 000000 /* adapter.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // adapter.h #ifndef ADAPTER_H #define ADAPTER_H // includes #include "util.h" namespace adapter { // functions extern void adapter_loop (); } // namespace adapter #endif // !defined ADAPTER_H // end of adapter.h gnuchess-6.2.2/src/adapter/attack.cpp000644 000766 000024 00000012214 12451347634 020346 0ustar00antoniostaff000000 000000 /* attack.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // attack.cpp // includes #include "board.h" #include "colour.h" #include "move.h" #include "attack.h" #include "piece.h" #include "util.h" // macros #define DELTA_INC(delta) (DeltaInc[128+(delta)]) #define DELTA_MASK(delta) (DeltaMask[128+(delta)]) namespace adapter { // "constants" const sint8 KnightInc[8+1] = { -33, -31, -18, -14, +14, +18, +31, +33, 0 }; const sint8 BishopInc[4+1] = { -17, -15, +15, +17, 0 }; const sint8 RookInc[4+1] = { -16, -1, +1, +16, 0 }; const sint8 QueenInc[8+1] = { -17, -16, -15, -1, +1, +15, +16, +17, 0 }; const sint8 KingInc[8+1] = { -17, -16, -15, -1, +1, +15, +16, +17, 0 }; // variables static sint8 DeltaInc[256]; static uint8 DeltaMask[256]; // prototypes static bool delta_is_ok (int delta); static bool inc_is_ok (int inc); // functions // attack_init() void attack_init() { int delta; int dir, inc, dist; for (delta = -128; delta < +128; delta++) { DeltaInc[128+delta] = IncNone; DeltaMask[128+delta] = 0; } DeltaMask[128-17] |= BlackPawnFlag; DeltaMask[128-15] |= BlackPawnFlag; DeltaMask[128+15] |= WhitePawnFlag; DeltaMask[128+17] |= WhitePawnFlag; for (dir = 0; dir < 8; dir++) { delta = KnightInc[dir]; ASSERT(delta_is_ok(delta)); DeltaMask[128+delta] |= KnightFlag; } for (dir = 0; dir < 4; dir++) { inc = BishopInc[dir]; ASSERT(inc!=IncNone); for (dist = 1; dist < 8; dist++) { delta = inc*dist; ASSERT(delta_is_ok(delta)); ASSERT(DeltaInc[128+delta]==IncNone); DeltaInc[128+delta] = inc; DeltaMask[128+delta] |= BishopFlag; } } for (dir = 0; dir < 4; dir++) { inc = RookInc[dir]; ASSERT(inc!=IncNone); for (dist = 1; dist < 8; dist++) { delta = inc*dist; ASSERT(delta_is_ok(delta)); ASSERT(DeltaInc[128+delta]==IncNone); DeltaInc[128+delta] = inc; DeltaMask[128+delta] |= RookFlag; } } for (dir = 0; dir < 8; dir++) { delta = KingInc[dir]; ASSERT(delta_is_ok(delta)); DeltaMask[128+delta] |= KingFlag; } } // delta_is_ok() static bool delta_is_ok(int delta) { if (delta < -119 || delta > +119) return false; return true; } // inc_is_ok() static bool inc_is_ok(int inc) { int dir; for (dir = 0; dir < 8; dir++) { if (KingInc[dir] == inc) return true; } return false; } // is_in_check() bool is_in_check(const board_t * board, int colour) { ASSERT(board_is_ok(board)); ASSERT(colour_is_ok(colour)); return is_attacked(board,king_pos(board,colour),colour_opp(colour)); } // is_attacked() bool is_attacked(const board_t * board, int to, int colour) { const uint8 * ptr; int from, piece; ASSERT(board_is_ok(board)); ASSERT(square_is_ok(to)); ASSERT(colour_is_ok(colour)); for (ptr = board->list[colour]; (from=*ptr) != SquareNone; ptr++) { piece = board->square[from]; ASSERT(colour_equal(piece,colour)); if (piece_attack(board,piece,from,to)) return true; } return false; } // piece_attack() bool piece_attack(const board_t * board, int piece, int from, int to) { int delta; int inc, sq; ASSERT(board_is_ok(board)); ASSERT(piece_is_ok(piece)); ASSERT(square_is_ok(from)); ASSERT(square_is_ok(to)); delta = to - from; ASSERT(delta_is_ok(delta)); if ((piece & DELTA_MASK(delta)) == 0) return false; // no pseudo-attack if (!piece_is_slider(piece)) return true; inc = DELTA_INC(delta); ASSERT(inc_is_ok(inc)); for (sq = from+inc; sq != to; sq += inc) { ASSERT(square_is_ok(sq)); if (board->square[sq] != Empty) return false; // blocker } return true; } // is_pinned() bool is_pinned(const board_t * board, int from, int to, int colour) { int king; int inc; int sq, piece; ASSERT(board!=NULL); ASSERT(square_is_ok(from)); ASSERT(square_is_ok(to)); ASSERT(colour_is_ok(colour)); king = king_pos(board,colour); inc = DELTA_INC(king-from); if (inc == IncNone) return false; // not a line sq = from; do sq += inc; while (board->square[sq] == Empty); if (sq != king) return false; // blocker sq = from; do sq -= inc; while ((piece=board->square[sq]) == Empty); return square_is_ok(sq) && (piece & DELTA_MASK(king-sq)) != 0 && piece_colour(piece) == colour_opp(colour) && DELTA_INC(king-to) != inc; } } // namespace adapter // end of attack.cpp gnuchess-6.2.2/src/adapter/attack.h000644 000766 000024 00000002742 12451347640 020015 0ustar00antoniostaff000000 000000 /* attack.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // attack.h #ifndef ATTACK_H #define ATTACK_H // includes #include "board.h" #include "util.h" namespace adapter { // constants const int IncNone = 0; // "constants" extern const sint8 KnightInc[8+1]; extern const sint8 BishopInc[4+1]; extern const sint8 RookInc[4+1]; extern const sint8 QueenInc[8+1]; extern const sint8 KingInc[8+1]; // functions extern void attack_init (); extern bool is_in_check (const board_t * board, int colour); extern bool is_attacked (const board_t * board, int to, int colour); extern bool piece_attack (const board_t * board, int piece, int from, int to); extern bool is_pinned (const board_t * board, int from, int to, int colour); } // namespace adapter #endif // !defined ATTACK_H // end of attack.h gnuchess-6.2.2/src/adapter/board.cpp000644 000766 000024 00000026771 12451347645 020205 0ustar00antoniostaff000000 000000 /* board.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // board.cpp // includes #include #include "attack.h" #include "board.h" #include "colour.h" #include "fen.h" #include "hash.h" #include "list.h" #include "move.h" #include "move_do.h" #include "move_gen.h" #include "move_legal.h" #include "piece.h" #include "util.h" namespace adapter { // constants static const bool UseSlowDebug = false; // functions // board_is_ok() bool board_is_ok(const board_t * board) { int sq, piece; int colour, pos; int king, rook; if (board == NULL) return false; // optional heavy DEBUG mode if (!UseSlowDebug) return true; // squares for (sq = 0; sq < SquareNb; sq++) { piece = board->square[sq]; if (square_is_ok(sq)) { pos = board->pos[sq]; if (piece == Empty) { if (pos != -1) return false; } else { if (pos < 0) return false; if (board->list[piece_colour(piece)][pos] != sq) return false; } } else { if (piece != Knight64) return false; } } // white piece list colour = White; pos = 0; if (board->list_size[colour] <= 0 || board->list_size[colour] > 16) return false; sq = board->list[colour][pos]; if (sq == SquareNone) return false; if (board->pos[sq] != pos) return false; piece = board->square[sq]; if (!colour_equal(piece,colour) || !piece_is_king(piece)) return false; for (pos++; pos < board->list_size[colour]; pos++) { sq = board->list[colour][pos]; if (sq == SquareNone) return false; if (board->pos[sq] != pos) return false; if (!colour_equal(board->square[sq],colour)) return false; } sq = board->list[colour][pos]; if (sq != SquareNone) return false; // black piece list colour = Black; pos = 0; if (board->list_size[colour] <= 0 || board->list_size[colour] > 16) return false; sq = board->list[colour][pos]; if (sq == SquareNone) return false; if (board->pos[sq] != pos) return false; piece = board->square[sq]; if (!colour_equal(piece,colour) || !piece_is_king(piece)) return false; for (pos++; pos < board->list_size[colour]; pos++) { sq = board->list[colour][pos]; if (sq == SquareNone) return false; if (board->pos[sq] != pos) return false; if (!colour_equal(board->square[sq],colour)) return false; } sq = board->list[colour][pos]; if (sq != SquareNone) return false; // TODO: material if (board->number[WhiteKing12] != 1) return false; if (board->number[BlackKing12] != 1) return false; if (!colour_is_ok(board->turn)) return false; // castling status if (board->castle[White][SideH] != SquareNone) { king = board->list[White][0]; if (king < A1 || king > H1) return false; if (board->square[king] != WhiteKing256) return false; rook = board->castle[White][SideH]; if (rook < A1 || rook > H1) return false; if (board->square[rook] != WhiteRook256) return false; if (rook <= king) return false; } if (board->castle[White][SideA] != SquareNone) { king = board->list[White][0]; if (king < A1 || king > H1) return false; if (board->square[king] != WhiteKing256) return false; rook = board->castle[White][SideA]; if (rook < A1 || rook > H1) return false; if (board->square[rook] != WhiteRook256) return false; if (rook >= king) return false; } if (board->castle[Black][SideH] != SquareNone) { king = board->list[Black][0]; if (king < A8 || king > H8) return false; if (board->square[king] != BlackKing256) return false; rook = board->castle[Black][SideH]; if (rook < A8 || rook > H8) return false; if (board->square[rook] != BlackRook256) return false; if (rook <= king) return false; } if (board->castle[Black][SideA] != SquareNone) { king = board->list[Black][0]; if (king < A8 || king > H8) return false; if (board->square[king] != BlackKing256) return false; rook = board->castle[Black][SideA]; if (rook < A8 || rook > H8) return false; if (board->square[rook] != BlackRook256) return false; if (rook >= king) return false; } return true; } // board_clear() void board_clear(board_t * board) { int file, rank, sq; int colour, pos; int piece; ASSERT(board!=NULL); // edge squares for (sq = 0; sq < SquareNb; sq++) { board->square[sq] = Knight64; // HACK: uncoloured knight board->pos[sq] = -1; } // empty squares for (rank = 0; rank < 8; rank++) { for (file = 0; file < 8; file++) { sq = square_make(file,rank); board->square[sq] = Empty; } } // piece lists for (colour = 0; colour < 3; colour++) { for (pos = 0; pos < 32; pos++) { // HACK board->list[colour][pos] = SquareNone; } board->list_size[colour] = 0; } // material for (piece = 0; piece < 12; piece++) { board->number[piece] = 0; } // rest board->turn = ColourNone; board->castle[White][SideH] = SquareNone; board->castle[White][SideA] = SquareNone; board->castle[Black][SideH] = SquareNone; board->castle[Black][SideA] = SquareNone; board->ep_square = SquareNone; board->ply_nb = 0; board->move_nb = 0; board->key = 0; } // board_start() void board_start(board_t * board) { ASSERT(board!=NULL); if (!board_from_fen(board,StartFen)) ASSERT(false); } // board_copy() void board_copy(board_t * dst, const board_t * src) { ASSERT(dst!=NULL); ASSERT(board_is_ok(src)); *dst = *src; } // board_equal() bool board_equal(const board_t * board_1, const board_t * board_2) { int sq_64, sq; ASSERT(board_is_ok(board_1)); ASSERT(board_is_ok(board_2)); // fast comparison if (board_1->key != board_2->key) return false; // slow comparison for (sq_64 = 0; sq_64 < 64; sq_64++) { sq = square_from_64(sq_64); if (board_1->square[sq] != board_2->square[sq]) return false; } if (board_1->turn != board_2->turn) return false; if (board_1->castle[White][SideH] != board_2->castle[White][SideH]) return false; if (board_1->castle[White][SideA] != board_2->castle[White][SideA]) return false; if (board_1->castle[Black][SideH] != board_2->castle[Black][SideH]) return false; if (board_1->castle[Black][SideA] != board_2->castle[Black][SideA]) return false; if (board_1->ep_square != board_2->ep_square) return false; return true; } // board_init_list() void board_init_list(board_t * board) { int sq_64, sq, piece; int colour, pos; ASSERT(board!=NULL); // init for (sq_64 = 0; sq_64 < 64; sq_64++) { sq = square_from_64(sq_64); board->pos[sq] = -1; } for (piece = 0; piece < 12; piece++) board->number[piece] = 0; // white piece list colour = White; pos = 0; for (sq_64 = 0; sq_64 < 64; sq_64++) { sq = square_from_64(sq_64); piece = board->square[sq]; ASSERT(pos>=0&&pos<=16); if (colour_equal(piece,colour) && piece_is_king(piece)) { board->pos[sq] = pos; board->list[colour][pos] = sq; pos++; board->number[piece_to_12(piece)]++; } } ASSERT(pos==1); for (sq_64 = 0; sq_64 < 64; sq_64++) { sq = square_from_64(sq_64); piece = board->square[sq]; ASSERT(pos>=0&&pos<=16); if (colour_equal(piece,colour) && !piece_is_king(piece)) { board->pos[sq] = pos; board->list[colour][pos] = sq; pos++; board->number[piece_to_12(piece)]++; } } ASSERT(pos>=1&&pos<=16); board->list[colour][pos] = SquareNone; board->list_size[colour] = pos; // black piece list colour = Black; pos = 0; for (sq_64 = 0; sq_64 < 64; sq_64++) { sq = square_from_64(sq_64); piece = board->square[sq]; ASSERT(pos>=0&&pos<=16); if (colour_equal(piece,colour) && piece_is_king(piece)) { board->pos[sq] = pos; board->list[colour][pos] = sq; pos++; board->number[piece_to_12(piece)]++; } } ASSERT(pos==1); for (sq_64 = 0; sq_64 < 64; sq_64++) { sq = square_from_64(sq_64); piece = board->square[sq]; ASSERT(pos>=1&&pos<=16); if (colour_equal(piece,colour) && !piece_is_king(piece)) { board->pos[sq] = pos; board->list[colour][pos] = sq; pos++; board->number[piece_to_12(piece)]++; } } ASSERT(pos>=1&&pos<=16); board->list[colour][pos] = SquareNone; board->list_size[colour] = pos; // hash key board->key = hash_key(board); } // board_flags() int board_flags(const board_t * board) { int flags; flags = 0; if (board->castle[White][SideH] != SquareNone) flags |= 1 << 0; if (board->castle[White][SideA] != SquareNone) flags |= 1 << 1; if (board->castle[Black][SideH] != SquareNone) flags |= 1 << 2; if (board->castle[Black][SideA] != SquareNone) flags |= 1 << 3; return flags; } // board_can_play() bool board_can_play(const board_t * board) { list_t list[1]; int i, move; ASSERT(board_is_ok(board)); gen_moves(list,board); for (i = 0; i < list_size(list); i++) { move = list_move(list,i); if (pseudo_is_legal(move,board)) return true; } return false; // no legal move } // board_mobility() int board_mobility(const board_t * board) { list_t list[1]; ASSERT(board_is_ok(board)); gen_legal_moves(list,board); return list_size(list); } // board_is_check() bool board_is_check(const board_t * board) { ASSERT(board_is_ok(board)); return is_in_check(board,board->turn); } // board_is_mate() bool board_is_mate(const board_t * board) { ASSERT(board_is_ok(board)); if (!board_is_check(board)) return false; if (board_can_play(board)) return false; return true; } // board_is_stalemate() bool board_is_stalemate(const board_t * board) { ASSERT(board_is_ok(board)); if (board_is_check(board)) return false; if (board_can_play(board)) return false; return true; } // king_pos() int king_pos(const board_t * board, int colour) { ASSERT(board_is_ok(board)); ASSERT(colour_is_ok(colour)); return board->list[colour][0]; } // board_disp() void board_disp(const board_t * board) { int file, rank, sq; int piece, c; char fen[256]; ASSERT(board!=NULL); if (!board_to_fen(board,fen,256)) ASSERT(false); my_log("POLYGLOT %s\n",fen); my_log("POLYGLOT\n"); for (rank = 7; rank >= 0; rank--) { my_log("POLYGLOT "); for (file = 0; file < 8; file++) { sq = square_make(file,rank); piece = board->square[sq]; c = (piece != Empty) ? piece_to_char(piece) : '-'; my_log("%c ",c); } my_log("\n"); } my_log("POLYGLOT\n"); my_log("POLYGLOT %s to play\n",(colour_is_black(board->turn))?"black":"white"); my_log("POLYGLOT\n"); } } // namespace adapter // end of board.cpp gnuchess-6.2.2/src/adapter/board.h000644 000766 000024 00000004217 12451347650 017635 0ustar00antoniostaff000000 000000 /* board.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // board.h #ifndef BOARD_H #define BOARD_H // includes #include "colour.h" #include "square.h" #include "util.h" namespace adapter { // constants const int Empty = 0; const int SideH = 0; const int SideA = 1; const int SideNb = 2; // types struct board_t { uint8 square[SquareNb]; sint8 pos[SquareNb]; uint8 list[ColourNb][32]; sint8 list_size[ColourNb]; sint8 number[12]; sint8 turn; uint8 castle[ColourNb][SideNb]; uint8 ep_square; sint16 ply_nb; sint16 move_nb; uint64 key; }; // functions extern bool board_is_ok (const board_t * board); extern void board_clear (board_t * board); extern void board_start (board_t * board); extern void board_copy (board_t * dst, const board_t * src); extern bool board_equal (const board_t * board_1, const board_t * board_2); extern void board_init_list (board_t * board); extern int board_flags (const board_t * board); extern bool board_can_play (const board_t * board); extern int board_mobility (const board_t * board); extern bool board_is_check (const board_t * board); extern bool board_is_mate (const board_t * board); extern bool board_is_stalemate (const board_t * board); extern int king_pos (const board_t * board, int colour); extern void board_disp (const board_t * board); } // namespace adapter #endif // !defined BOARD_H // end of board.h gnuchess-6.2.2/src/adapter/book.cpp000644 000766 000024 00000022141 12451347654 020033 0ustar00antoniostaff000000 000000 /* book.cpp GNU Chess protocol adapter Copyright (C) 2001-2014 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // book.cpp // includes #include #include #include #include #include "board.h" #include "book.h" #include "move.h" #include "move_legal.h" #include "san.h" #include "util.h" namespace adapter { // types struct entry_t { uint64 key; uint16 move; uint16 count; uint16 n; uint16 sum; }; // variables static FILE * BookFile; static int BookSize; // prototypes static int find_pos (uint64 key); static void read_entry (entry_t * entry, int n); static void write_entry (const entry_t * entry, int n); static uint64 read_integer (FILE * file, int size); static void write_integer (FILE * file, int size, uint64 n); // functions // book_clear() void book_clear() { BookFile = NULL; BookSize = 0; } // book_open() void book_open(const char file_name[], int mode) { ASSERT(file_name!=NULL); ASSERT(mode==BookReadOnly || mode==BookReadWrite); const int MaxModeLength = 4; char full_file_name[MaxFileNameSize+1]; char file_open_mode[MaxModeLength]=""; FILE *bf; if ( ( bf = fopen(file_name, "r") ) != NULL ) { fclose(bf); strcpy(full_file_name,""); } else { strcpy(full_file_name,compute_pkgdatadir()); strcat(full_file_name,"/"); } strcat(full_file_name,file_name); if (mode == BookReadWrite) { strcpy(file_open_mode,"rb+"); } else { strcpy(file_open_mode,"rb"); } BookFile = fopen(full_file_name,file_open_mode); if (BookFile == NULL) { if (fopen(full_file_name,"rb") != NULL) { fclose(bf); my_fatal("book_open(): file \"%s\" is read only\n",full_file_name); } else { my_fatal("book_open(): can't open file \"%s\": %s\n",full_file_name,strerror(errno)); } } if (fseek(BookFile,0,SEEK_END) == -1) { my_fatal("book_open(): fseek(): %s\n",strerror(errno)); } BookSize = ftell(BookFile) / 16; if (BookSize == 0) my_fatal("book_open(): empty file\n"); } // book_close() void book_close() { if (fclose(BookFile) == EOF) { my_fatal("book_close(): fclose(): %s\n",strerror(errno)); } } // is_in_book() bool is_in_book(const board_t * board) { int pos; entry_t entry[1]; ASSERT(board!=NULL); for (pos = find_pos(board->key); pos < BookSize; pos++) { read_entry(entry,pos); if (entry->key == board->key) return true; } return false; } // book_move() int book_move(const board_t * board, bool random) { int best_move; int best_score; int pos; entry_t entry[1]; int move; int score; ASSERT(board!=NULL); ASSERT(random==true||random==false); best_move = MoveNone; best_score = 0; for (pos = find_pos(board->key); pos < BookSize; pos++) { read_entry(entry,pos); if (entry->key != board->key) break; move = entry->move; score = entry->count; if (move != MoveNone && move_is_legal(move,board)) { // pick this move? ASSERT(score>0); if (random) { best_score += score; if (my_random_int(best_score) < score) best_move = move; } else { if (score > best_score) { best_move = move; best_score = score; } } } else { ASSERT(false); } } return best_move; } // book_move() int book_move(const board_t * board, bool random, bool worst) { int worst_move; int worst_score; int best_move; int best_score; int pos; entry_t entry[1]; int move; int score; ASSERT(board!=NULL); ASSERT(random==true||random==false); worst_move = MoveNone; worst_score = 10000; best_move = MoveNone; best_score = 0; for (pos = find_pos(board->key); pos < BookSize; pos++) { read_entry(entry,pos); if (entry->key != board->key) break; move = entry->move; score = entry->count; if (move != MoveNone && move_is_legal(move,board)) { // pick this move? ASSERT(score>0); if (worst) { if (score < worst_score) { worst_move = move; worst_score = score; } } else if (random) { best_score += score; if (my_random_int(best_score) < score) best_move = move; } else { if (score > best_score) { best_move = move; best_score = score; } } } else { ASSERT(false); } } if (worst) { best_move = worst_move; } return best_move; } // book_disp() void book_disp(const board_t * board) { int first_pos; int sum; int pos; entry_t entry[1]; int move; int score; char move_string[256]; ASSERT(board!=NULL); first_pos = find_pos(board->key); // sum sum = 0; for (pos = first_pos; pos < BookSize; pos++) { read_entry(entry,pos); if (entry->key != board->key) break; sum += entry->count; } // disp for (pos = first_pos; pos < BookSize; pos++) { read_entry(entry,pos); if (entry->key != board->key) break; move = entry->move; score = entry->count; if (score > 0 && move != MoveNone && move_is_legal(move,board)) { move_to_san(move,board,move_string,256); printf(" %s (%.0f%%)\n",move_string,(double(score)/double(sum))*100.0); } } printf("\n"); } // book_learn_move() void book_learn_move(const board_t * board, int move, int result) { int pos; entry_t entry[1]; ASSERT(board!=NULL); ASSERT(move_is_ok(move)); ASSERT(result>=-1&&result<=+1); ASSERT(move_is_legal(move,board)); for (pos = find_pos(board->key); pos < BookSize; pos++) { read_entry(entry,pos); if (entry->key != board->key) break; if (entry->move == move) { entry->n++; entry->sum += result+1; write_entry(entry,pos); break; } } } // book_flush() void book_flush() { if (fflush(BookFile) == EOF) { my_fatal("book_flush(): fflush(): %s\n",strerror(errno)); } } // find_pos() static int find_pos(uint64 key) { int left, right, mid; entry_t entry[1]; // binary search (finds the leftmost entry) left = 0; right = BookSize-1; ASSERT(left<=right); while (left < right) { mid = (left + right) / 2; ASSERT(mid>=left&&midkey) { right = mid; } else { left = mid+1; } } ASSERT(left==right); read_entry(entry,left); return (entry->key == key) ? left : BookSize; } // read_entry() static void read_entry(entry_t * entry, int n) { ASSERT(entry!=NULL); ASSERT(n>=0&&nkey = read_integer(BookFile,8); entry->move = read_integer(BookFile,2); entry->count = read_integer(BookFile,2); entry->n = read_integer(BookFile,2); entry->sum = read_integer(BookFile,2); } // write_entry() static void write_entry(const entry_t * entry, int n) { ASSERT(entry!=NULL); ASSERT(n>=0&&nkey); write_integer(BookFile,2,entry->move); write_integer(BookFile,2,entry->count); write_integer(BookFile,2,entry->n); write_integer(BookFile,2,entry->sum); } // read_integer() static uint64 read_integer(FILE * file, int size) { uint64 n; int i; int b; ASSERT(file!=NULL); ASSERT(size>0&&size<=8); n = 0; for (i = 0; i < size; i++) { b = fgetc(file); if (b == EOF) { if (feof(file)) { my_fatal("read_integer(): fgetc(): EOF reached\n"); } else { // error my_fatal("read_integer(): fgetc(): %s\n",strerror(errno)); } } ASSERT(b>=0&&b<256); n = (n << 8) | b; } return n; } // write_integer() static void write_integer(FILE * file, int size, uint64 n) { int i; int b; ASSERT(file!=NULL); ASSERT(size>0&&size<=8); ASSERT(size==8||n>>(size*8)==0); for (i = size-1; i >= 0; i--) { b = (n >> (i*8)) & 0xFF; ASSERT(b>=0&&b<256); if (fputc(b,file) == EOF) { my_fatal("write_integer(): fputc(): %s\n",strerror(errno)); } } } } // namespace adapter // end of book.cpp gnuchess-6.2.2/src/adapter/book.h000644 000766 000024 00000002746 12451347657 017514 0ustar00antoniostaff000000 000000 /* book.h GNU Chess protocol adapter Copyright (C) 2001-2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // book.h #ifndef BOOK_H #define BOOK_H // includes #include "board.h" #include "util.h" namespace adapter { // constants const int BookReadOnly = 1; const int BookReadWrite = 2; // functions extern void book_clear (); extern void book_open (const char file_name[], int mode); extern void book_close (); extern bool is_in_book (const board_t * board); extern int book_move (const board_t * board, bool random); extern int book_move (const board_t * board, bool random, bool worst); extern void book_disp (const board_t * board); extern void book_learn_move (const board_t * board, int move, int result); extern void book_flush (); } // namespace adapter #endif // !defined BOOK_H // end of book.h gnuchess-6.2.2/src/adapter/book_make.cpp000644 000766 000024 00000026407 12451347664 021042 0ustar00antoniostaff000000 000000 /* book_make.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // book_make.cpp // includes #include #include #include #include #include #include "board.h" #include "book_make.h" #include "move.h" #include "move_do.h" #include "move_legal.h" #include "pgn.h" #include "san.h" #include "util.h" #include "book_make.h" namespace adapter { // constants static const int COUNT_MAX = 16384; static const int NIL = -1; // types struct entry_t { uint64 key; uint16 move; uint16 n; uint16 sum; uint16 colour; }; struct book_t { int size; int alloc; uint32 mask; entry_t * entry; sint32 * hash; }; // variables static int MaxPly; static int MinGame; static double MinScore; static bool RemoveWhite, RemoveBlack; static bool Uniform; static book_t Book[1]; // prototypes static void book_clear (); static void book_insert (const char file_name[]); static void book_filter (); static void book_sort (); static void book_save (const char file_name[]); static int find_entry (const board_t * board, int move); static void resize (); static void halve_stats (uint64 key); static bool keep_entry (int pos); static int entry_score (const entry_t * entry); static int key_compare (const void * p1, const void * p2); static void write_integer (FILE * file, int size, uint64 n); // functions // book_make() void book_make(int argc, char * argv[]) { int i; const char * pgn_file; const char * bin_file; pgn_file = NULL; my_string_set(&pgn_file,"book.pgn"); bin_file = NULL; my_string_set(&bin_file,"book.bin"); MaxPly = 1024; MinGame = 3; MinScore = 0.0; RemoveWhite = false; RemoveBlack = false; Uniform = false; for (i = 1; i < argc; i++) { if (false) { } else if (my_string_equal(argv[i],"make-book")) { // skip } else if (my_string_equal(argv[i],"-pgn")) { i++; if (argv[i] == NULL) my_fatal("book_make(): missing argument\n"); my_string_set(&pgn_file,argv[i]); } else if (my_string_equal(argv[i],"-bin")) { i++; if (argv[i] == NULL) my_fatal("book_make(): missing argument\n"); my_string_set(&bin_file,argv[i]); } else if (my_string_equal(argv[i],"-max-ply")) { i++; if (argv[i] == NULL) my_fatal("book_make(): missing argument\n"); MaxPly = atoi(argv[i]); ASSERT(MaxPly>=0); } else if (my_string_equal(argv[i],"-min-game")) { i++; if (argv[i] == NULL) my_fatal("book_make(): missing argument\n"); MinGame = atoi(argv[i]); ASSERT(MinGame>0); } else if (my_string_equal(argv[i],"-min-score")) { i++; if (argv[i] == NULL) my_fatal("book_make(): missing argument\n"); MinScore = atof(argv[i]) / 100.0; ASSERT(MinScore>=0.0&&MinScore<=1.0); } else if (my_string_equal(argv[i],"-only-white")) { RemoveWhite = false; RemoveBlack = true; } else if (my_string_equal(argv[i],"-only-black")) { RemoveWhite = true; RemoveBlack = false; } else if (my_string_equal(argv[i],"-uniform")) { Uniform = true; } else { my_fatal("book_make(): unknown option \"%s\"\n",argv[i]); } } book_clear(); printf("inserting games ...\n"); book_insert(pgn_file); printf("filtering entries ...\n"); book_filter(); printf("sorting entries ...\n"); book_sort(); printf("saving entries ...\n"); book_save(bin_file); printf("all done!\n"); } // book_clear() static void book_clear() { int index; Book->alloc = 1; Book->mask = (Book->alloc * 2) - 1; Book->entry = (entry_t *) my_malloc(Book->alloc*sizeof(entry_t)); Book->size = 0; Book->hash = (sint32 *) my_malloc((Book->alloc*2)*sizeof(sint32)); for (index = 0; index < Book->alloc*2; index++) { Book->hash[index] = NIL; } } // book_insert() static void book_insert(const char file_name[]) { int game_nb; pgn_t pgn[1]; board_t board[1]; int ply; int result; char string[256]; int move; int pos; ASSERT(file_name!=NULL); // init game_nb = 0; // scan loop pgn_open(pgn,file_name); while (pgn_next_game(pgn)) { board_start(board); ply = 0; result = 0; if (false) { } else if (my_string_equal(pgn->result,"1-0")) { result = +1; } else if (my_string_equal(pgn->result,"0-1")) { result = -1; } while (pgn_next_move(pgn,string,256)) { if (ply < MaxPly) { move = move_from_san(string,board); if (move == MoveNone || !move_is_legal(move,board)) { my_fatal("book_insert(): illegal move \"%s\" at line %d, column %d\n",string,pgn->move_line,pgn->move_column); } pos = find_entry(board,move); Book->entry[pos].n++; Book->entry[pos].sum += result+1; if (Book->entry[pos].n >= COUNT_MAX) { halve_stats(board->key); } move_do(board,move); ply++; result = -result; } } game_nb++; if (game_nb % 10000 == 0) printf("%d games ...\n",game_nb); } pgn_close(pgn); printf("%d game%s.\n",game_nb,(game_nb>1)?"s":""); printf("%d entries.\n",Book->size); return; } // book_filter() static void book_filter() { int src, dst; // entry loop dst = 0; for (src = 0; src < Book->size; src++) { if (keep_entry(src)) Book->entry[dst++] = Book->entry[src]; } ASSERT(dst>=0&&dst<=Book->size); Book->size = dst; printf("%d entries.\n",Book->size); } // book_sort() static void book_sort() { // sort keys for binary search qsort(Book->entry,Book->size,sizeof(entry_t),&key_compare); } // book_save() static void book_save(const char file_name[]) { FILE * file; int pos; ASSERT(file_name!=NULL); file = fopen(file_name,"wb"); if (file == NULL) my_fatal("book_save(): can't open file \"%s\" for writing: %s\n",file_name,strerror(errno)); // entry loop for (pos = 0; pos < Book->size; pos++) { ASSERT(keep_entry(pos)); write_integer(file,8,Book->entry[pos].key); write_integer(file,2,Book->entry[pos].move); write_integer(file,2,entry_score(&Book->entry[pos])); write_integer(file,2,0); write_integer(file,2,0); } fclose(file); } // find_entry() static int find_entry(const board_t * board, int move) { uint64 key; int index; int pos; ASSERT(board!=NULL); ASSERT(move_is_ok(move)); ASSERT(move_is_legal(move,board)); // init key = board->key; // search for (index = key & Book->mask; (pos=Book->hash[index]) != NIL; index = (index+1) & Book->mask) { ASSERT(pos>=0&&possize); if (Book->entry[pos].key == key && Book->entry[pos].move == move) { return pos; // found } } // not found ASSERT(Book->size<=Book->alloc); if (Book->size == Book->alloc) { // allocate more memory resize(); for (index = key & Book->mask; Book->hash[index] != NIL; index = (index+1) & Book->mask) ; } // create a new entry ASSERT(Book->sizealloc); pos = Book->size++; Book->entry[pos].key = key; Book->entry[pos].move = move; Book->entry[pos].n = 0; Book->entry[pos].sum = 0; Book->entry[pos].colour = board->turn; // insert into the hash table ASSERT(index>=0&&indexalloc*2); ASSERT(Book->hash[index]==NIL); Book->hash[index] = pos; ASSERT(pos>=0&&possize); return pos; } // resize() static void resize() { int size; int pos; int index; ASSERT(Book->size==Book->alloc); Book->alloc *= 2; Book->mask = (Book->alloc * 2) - 1; size = 0; size += Book->alloc * sizeof(entry_t); size += (Book->alloc*2) * sizeof(sint32); if (size >= 1048576) printf("allocating %gMB ...\n",double(size)/1048576.0); // resize arrays Book->entry = (entry_t *) my_realloc(Book->entry,Book->alloc*sizeof(entry_t)); Book->hash = (sint32 *) my_realloc(Book->hash,(Book->alloc*2)*sizeof(sint32)); // rebuild hash table for (index = 0; index < Book->alloc*2; index++) { Book->hash[index] = NIL; } for (pos = 0; pos < Book->size; pos++) { for (index = Book->entry[pos].key & Book->mask; Book->hash[index] != NIL; index = (index+1) & Book->mask) ; ASSERT(index>=0&&indexalloc*2); Book->hash[index] = pos; } } // halve_stats() static void halve_stats(uint64 key) { int index; int pos; // search for (index = key & Book->mask; (pos=Book->hash[index]) != NIL; index = (index+1) & Book->mask) { ASSERT(pos>=0&&possize); if (Book->entry[pos].key == key) { Book->entry[pos].n = (Book->entry[pos].n + 1) / 2; Book->entry[pos].sum = (Book->entry[pos].sum + 1) / 2; } } } // keep_entry() static bool keep_entry(int pos) { const entry_t * entry; int colour; double score; ASSERT(pos>=0&&possize); entry = &Book->entry[pos]; // if (entry->n == 0) return false; if (entry->n < MinGame) return false; if (entry->sum == 0) return false; score = (double(entry->sum) / double(entry->n)) / 2.0; ASSERT(score>=0.0&&score<=1.0); if (score < MinScore) return false; colour = entry->colour; if ((RemoveWhite && colour_is_white(colour)) || (RemoveBlack && colour_is_black(colour))) { return false; } if (entry_score(entry) == 0) return false; // REMOVE ME? return true; } // entry_score() static int entry_score(const entry_t * entry) { int score; ASSERT(entry!=NULL); // score = entry->n; // popularity score = entry->sum; // "expectancy" if (Uniform) score = 1; ASSERT(score>=0); return score; } // key_compare() static int key_compare(const void * p1, const void * p2) { const entry_t * entry_1, * entry_2; ASSERT(p1!=NULL); ASSERT(p2!=NULL); entry_1 = (const entry_t *) p1; entry_2 = (const entry_t *) p2; if (entry_1->key > entry_2->key) { return +1; } else if (entry_1->key < entry_2->key) { return -1; } else { return entry_score(entry_2) - entry_score(entry_1); // highest score first } } // write_integer() static void write_integer(FILE * file, int size, uint64 n) { int i; int b; ASSERT(file!=NULL); ASSERT(size>0&&size<=8); ASSERT(size==8||n>>(size*8)==0); for (i = size-1; i >= 0; i--) { b = (n >> (i*8)) & 0xFF; ASSERT(b>=0&&b<256); fputc(b,file); } } } // namespace adapter // end of book_make.cpp gnuchess-6.2.2/src/adapter/book_make.h000644 000766 000024 00000001757 12451347671 020506 0ustar00antoniostaff000000 000000 /* book_make.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // book_make.h #ifndef BOOK_MAKE_H #define BOOK_MAKE_H // includes #include "util.h" namespace adapter { // functions extern void book_make (int argc, char * argv[]); } // namespace adapter #endif // !defined BOOK_MAKE_H // end of book_make.h gnuchess-6.2.2/src/adapter/book_merge.cpp000644 000766 000024 00000014673 12451347676 021231 0ustar00antoniostaff000000 000000 /* book_merge.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // book_merge.cpp // includes #include #include #include #include #include "book_merge.h" #include "util.h" namespace adapter { // types struct book_t { FILE * file; int size; }; struct entry_t { uint64 key; uint16 move; uint16 count; uint16 n; uint16 sum; }; // variables static book_t In1[1]; static book_t In2[1]; static book_t Out[1]; // prototypes static void book_clear (book_t * book); static void book_open (book_t * book, const char file_name[], const char mode[]); static void book_close (book_t * book); static bool read_entry (book_t * book, entry_t * entry, int n); static void write_entry (book_t * book, const entry_t * entry); static uint64 read_integer (FILE * file, int size); static void write_integer (FILE * file, int size, uint64 n); // functions // book_merge() void book_merge(int argc, char * argv[]) { int i; const char * in_file_1; const char * in_file_2; const char * out_file; int i1, i2; bool b1, b2; entry_t e1[1], e2[1]; int skip; in_file_1 = NULL; my_string_clear(&in_file_1); in_file_2 = NULL; my_string_clear(&in_file_2); out_file = NULL; my_string_set(&out_file,"out.bin"); for (i = 1; i < argc; i++) { if (false) { } else if (my_string_equal(argv[i],"merge-book")) { // skip } else if (my_string_equal(argv[i],"-in1")) { i++; if (argv[i] == NULL) my_fatal("book_merge(): missing argument\n"); my_string_set(&in_file_1,argv[i]); } else if (my_string_equal(argv[i],"-in2")) { i++; if (argv[i] == NULL) my_fatal("book_merge(): missing argument\n"); my_string_set(&in_file_2,argv[i]); } else if (my_string_equal(argv[i],"-out")) { i++; if (argv[i] == NULL) my_fatal("book_merge(): missing argument\n"); my_string_set(&out_file,argv[i]); } else { my_fatal("book_merge(): unknown option \"%s\"\n",argv[i]); } } book_clear(In1); book_clear(In2); book_clear(Out); book_open(In1,in_file_1,"rb"); book_open(In2,in_file_2,"rb"); book_open(Out,out_file,"wb"); skip = 0; i1 = 0; i2 = 0; while (true) { b1 = read_entry(In1,e1,i1); b2 = read_entry(In2,e2,i2); if (false) { } else if (!b1 && !b2) { break; } else if (b1 && !b2) { write_entry(Out,e1); i1++; } else if (b2 && !b1) { write_entry(Out,e2); i2++; } else { ASSERT(b1); ASSERT(b2); if (false) { } else if (e1->key < e2->key) { write_entry(Out,e1); i1++; } else if (e1->key > e2->key) { write_entry(Out,e2); i2++; } else { ASSERT(e1->key==e2->key); skip++; i2++; } } } book_close(In1); book_close(In2); book_close(Out); if (skip != 0) { printf("skipped %d entr%s.\n",skip,(skip>1)?"ies":"y"); } printf("done!\n"); } // book_clear() static void book_clear(book_t * book) { ASSERT(book!=NULL); book->file = NULL; book->size = 0; } // book_open() static void book_open(book_t * book, const char file_name[], const char mode[]) { ASSERT(book!=NULL); ASSERT(file_name!=NULL); ASSERT(mode!=NULL); book->file = fopen(file_name,mode); if (book->file == NULL) my_fatal("book_open(): can't open file \"%s\": %s\n",file_name,strerror(errno)); if (fseek(book->file,0,SEEK_END) == -1) { my_fatal("book_open(): fseek(): %s\n",strerror(errno)); } book->size = ftell(book->file) / 16; } // book_close() static void book_close(book_t * book) { ASSERT(book!=NULL); if (fclose(book->file) == EOF) { my_fatal("book_close(): fclose(): %s\n",strerror(errno)); } } // read_entry() static bool read_entry(book_t * book, entry_t * entry, int n) { ASSERT(book!=NULL); ASSERT(entry!=NULL); if (n < 0 || n >= book->size) return false; ASSERT(n>=0&&nsize); if (fseek(book->file,n*16,SEEK_SET) == -1) { my_fatal("read_entry(): fseek(): %s\n",strerror(errno)); } entry->key = read_integer(book->file,8); entry->move = read_integer(book->file,2); entry->count = read_integer(book->file,2); entry->n = read_integer(book->file,2); entry->sum = read_integer(book->file,2); return true; } // write_entry() static void write_entry(book_t * book, const entry_t * entry) { ASSERT(book!=NULL); ASSERT(entry!=NULL); write_integer(book->file,8,entry->key); write_integer(book->file,2,entry->move); write_integer(book->file,2,entry->count); write_integer(book->file,2,entry->n); write_integer(book->file,2,entry->sum); } // read_integer() static uint64 read_integer(FILE * file, int size) { uint64 n; int i; int b; ASSERT(file!=NULL); ASSERT(size>0&&size<=8); n = 0; for (i = 0; i < size; i++) { b = fgetc(file); if (b == EOF) { if (feof(file)) { my_fatal("read_integer(): fgetc(): EOF reached\n"); } else { // error my_fatal("read_integer(): fgetc(): %s\n",strerror(errno)); } } ASSERT(b>=0&&b<256); n = (n << 8) | b; } return n; } // write_integer() static void write_integer(FILE * file, int size, uint64 n) { int i; int b; ASSERT(file!=NULL); ASSERT(size>0&&size<=8); ASSERT(size==8||n>>(size*8)==0); for (i = size-1; i >= 0; i--) { b = (n >> (i*8)) & 0xFF; ASSERT(b>=0&&b<256); if (fputc(b,file) == EOF) { my_fatal("write_integer(): fputc(): %s\n",strerror(errno)); } } } } // namespace adapter // end of book_merge.cpp gnuchess-6.2.2/src/adapter/book_merge.h000644 000766 000024 00000001766 12451347704 020665 0ustar00antoniostaff000000 000000 /* book_merge.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // book_merge.h #ifndef BOOK_MERGE_H #define BOOK_MERGE_H // includes #include "util.h" namespace adapter { // functions extern void book_merge (int argc, char * argv[]); } // namespace adapter #endif // !defined BOOK_MERGE_H // end of book_merge.h gnuchess-6.2.2/src/adapter/colour.cpp000644 000766 000024 00000002755 12451347720 020407 0ustar00antoniostaff000000 000000 /* colour.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // colour.cpp // includes #include "colour.h" #include "util.h" namespace adapter { // functions // colour_is_ok() bool colour_is_ok(int colour) { return colour == Black || colour == White; } // colour_is_white() bool colour_is_white(int colour) { ASSERT(colour_is_ok(colour)); return colour == White; } // colour_is_black() bool colour_is_black(int colour) { ASSERT(colour_is_ok(colour)); return colour == Black; } // colour_equal() bool colour_equal(int colour_1, int colour_2) { ASSERT(colour_is_ok(colour_2)); return (colour_1 & colour_2) != 0; } // colour_opp() int colour_opp(int colour) { ASSERT(colour_is_ok(colour)); return colour ^ (BlackFlag^WhiteFlag); } } // namespace adapter // end of colour.cpp gnuchess-6.2.2/src/adapter/colour.h000644 000766 000024 00000002524 12451347724 020052 0ustar00antoniostaff000000 000000 /* colour.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // colour.h #ifndef COLOUR_H #define COLOUR_H // includes #include "util.h" namespace adapter { // constants const int BlackFlag = 1 << 0; const int WhiteFlag = 1 << 1; const int ColourNone = 0; const int Black = BlackFlag; const int White = WhiteFlag; const int ColourNb = 3; // functions extern bool colour_is_ok (int colour); extern bool colour_is_white (int colour); extern bool colour_is_black (int colour); extern bool colour_equal (int colour_1, int colour_2); extern int colour_opp (int colour); } // namespace adapter #endif // !defined COLOUR_H // end of colour.h gnuchess-6.2.2/src/adapter/engine.cpp000644 000766 000024 00000005304 12575116464 020350 0ustar00antoniostaff000000 000000 /* engine.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // engine.cpp // includes #include #include #include #include #include #include #include #include "engine.h" #include "io.h" #include "option.h" #include "util.h" #include "components.h" namespace adapter { // constants static const bool UseNice = false; static const int StringSize = 4096; // variables engine_t Engine[1]; // prototypes // functions // engine_is_ok() bool engine_is_ok(const engine_t * engine) { if (engine == NULL) return false; if (!io_is_ok(engine->io)) return false; return true; } // engine_open() void engine_open(engine_t * engine) { engine->io->in_fd = pipefd_e2a[0]; engine->io->out_fd = pipefd_a2e[1]; engine->io->name = "ENGINE"; io_init(engine->io); } // engine_close() void engine_close(engine_t * engine) { ASSERT(engine_is_ok(engine)); io_close(engine->io); } // engine_get() void engine_get(engine_t * engine, char string[], int size) { ASSERT(engine_is_ok(engine)); ASSERT(string!=NULL); ASSERT(size>=256); while (!io_line_ready(engine->io)) { io_get_update(engine->io); } if (!io_get_line(engine->io,string,size)) { // EOF exit(EXIT_SUCCESS); } } // engine_send() void engine_send(engine_t * engine, const char format[], ...) { va_list arg_list; char string[StringSize]; ASSERT(engine_is_ok(engine)); ASSERT(format!=NULL); // format va_start(arg_list,format); vsprintf(string,format,arg_list); va_end(arg_list); // send io_send(engine->io,"%s",string); } // engine_send_queue() void engine_send_queue(engine_t * engine, const char format[], ...) { va_list arg_list; char string[StringSize]; ASSERT(engine_is_ok(engine)); ASSERT(format!=NULL); // format va_start(arg_list,format); vsprintf(string,format,arg_list); va_end(arg_list); // send io_send_queue(engine->io,"%s",string); } } // namespace adapter // end of engine.cpp gnuchess-6.2.2/src/adapter/engine.h000644 000766 000024 00000002635 12451347735 020021 0ustar00antoniostaff000000 000000 /* engine.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // engine.h #ifndef ENGINE_H #define ENGINE_H // includes #include "io.h" #include "util.h" namespace adapter { // types struct engine_t { io_t io[1]; }; // variables extern engine_t Engine[1]; // functions extern bool engine_is_ok (const engine_t * engine); extern void engine_open (engine_t * engine); extern void engine_close (engine_t * engine); extern void engine_get (engine_t * engine, char string[], int size); extern void engine_send (engine_t * engine, const char format[], ...); extern void engine_send_queue (engine_t * engine, const char format[], ...); } // namespace adapter #endif // !defined ENGINE_H // end of engine.h gnuchess-6.2.2/src/adapter/epd.cpp000644 000766 000024 00000022100 12451347741 017641 0ustar00antoniostaff000000 000000 /* epd.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // epd.cpp // includes #include #include #include #include #include "board.h" #include "engine.h" #include "epd.h" #include "fen.h" #include "line.h" #include "move.h" #include "move_legal.h" #include "option.h" #include "parse.h" #include "san.h" #include "uci.h" #include "util.h" namespace adapter { // constants static const bool UseDebug = false; static const bool UseTrace = false; static const int StringSize = 4096; // variables static int MinDepth; static int MaxDepth; static double MaxTime; static double MinTime; static int DepthDelta; static int FirstMove; static int FirstDepth; static int FirstSelDepth; static int FirstScore; static double FirstTime; static sint64 FirstNodeNb; static move_t FirstPV[LineSize]; static int LastMove; static int LastDepth; static int LastSelDepth; static int LastScore; static double LastTime; static sint64 LastNodeNb; static move_t LastPV[LineSize]; // prototypes static void epd_test_file (const char file_name[]); static bool is_solution (int move, const board_t * board, const char bm[], const char am[]); static bool string_contain (const char string[], const char substring[]); static bool engine_step (); // functions // epd_test() void epd_test(int argc, char * argv[]) { int i; const char * epd_file; epd_file = NULL; my_string_set(&epd_file,"wac.epd"); MinDepth = 8; MaxDepth = 63; MinTime = 1.0; MaxTime = 5.0; DepthDelta = 3; for (i = 1; i < argc; i++) { if (false) { } else if (my_string_equal(argv[i],"epd-test")) { // skip } else if (my_string_equal(argv[i],"-epd")) { i++; if (argv[i] == NULL) my_fatal("epd_test(): missing argument\n"); my_string_set(&epd_file,argv[i]); } else if (my_string_equal(argv[i],"-min-depth")) { i++; if (argv[i] == NULL) my_fatal("epd_test(): missing argument\n"); MinDepth = atoi(argv[i]); } else if (my_string_equal(argv[i],"-max-depth")) { i++; if (argv[i] == NULL) my_fatal("epd_test(): missing argument\n"); MaxDepth = atoi(argv[i]); } else if (my_string_equal(argv[i],"-min-time")) { i++; if (argv[i] == NULL) my_fatal("epd_test(): missing argument\n"); MinTime = atof(argv[i]); } else if (my_string_equal(argv[i],"-max-time")) { i++; if (argv[i] == NULL) my_fatal("epd_test(): missing argument\n"); MaxTime = atof(argv[i]); } else if (my_string_equal(argv[i],"-depth-delta")) { i++; if (argv[i] == NULL) my_fatal("epd_test(): missing argument\n"); DepthDelta = atoi(argv[i]); } else { my_fatal("epd_test(): unknown option \"%s\"\n",argv[i]); } } epd_test_file(epd_file); } // epd_test_file() static void epd_test_file(const char file_name[]) { FILE * file; int hit, tot; char epd[StringSize]; char am[StringSize], bm[StringSize], id[StringSize]; board_t board[1]; char string[StringSize]; int move; char pv_string[StringSize]; bool correct; double depth_tot, time_tot, node_tot; ASSERT(file_name!=NULL); // init file = fopen(file_name,"r"); if (file == NULL) my_fatal("epd_test_file(): can't open file \"%s\": %s\n",file_name,strerror(errno)); hit = 0; tot = 0; depth_tot = 0.0; time_tot = 0.0; node_tot = 0.0; // loop while (my_file_read_line(file,epd,StringSize)) { if (UseTrace) printf("%s\n",epd); if (!epd_get_op(epd,"am",am,StringSize)) strcpy(am,""); if (!epd_get_op(epd,"bm",bm,StringSize)) strcpy(bm,""); if (!epd_get_op(epd,"id",id,StringSize)) strcpy(id,""); if (my_string_empty(am) && my_string_empty(bm)) { my_fatal("epd_test(): no am or bm field in EPD\n"); } // init uci_send_ucinewgame(Uci); uci_send_isready_sync(Uci); ASSERT(!Uci->searching); // position if (!board_from_fen(board,epd)) ASSERT(false); if (!board_to_fen(board,string,StringSize)) ASSERT(false); engine_send(Engine,"position fen %s",string); // search engine_send(Engine,"go movetime %.0f depth %d",MaxTime*1000.0,MaxDepth); // engine_send(Engine,"go infinite"); // engine data board_copy(Uci->board,board); uci_clear(Uci); Uci->searching = true; Uci->pending_nb++; FirstMove = MoveNone; FirstDepth = 0; FirstSelDepth = 0; FirstScore = 0; FirstTime = 0.0; FirstNodeNb = 0; line_clear(FirstPV); LastMove = MoveNone; LastDepth = 0; LastSelDepth = 0; LastScore = 0; LastTime = 0.0; LastNodeNb = 0; line_clear(LastPV); // parse engine output while (engine_step()) { // stop search? if (Uci->depth > MaxDepth || Uci->time >= MaxTime || (Uci->depth - FirstDepth >= DepthDelta && Uci->depth > MinDepth && Uci->time >= MinTime && is_solution(FirstMove,board,bm,am))) { engine_send(Engine,"stop"); } } move = FirstMove; correct = is_solution(move,board,bm,am); if (correct) hit++; tot++; if (correct) { depth_tot += double(FirstDepth); time_tot += FirstTime; node_tot += double(FirstNodeNb); } printf("%s %d %4d %4d",id,correct,hit,tot); if (!line_to_san(LastPV,Uci->board,pv_string,StringSize)) ASSERT(false); printf(" - %2d %6.2f %9lld %+6.2f %s\n",FirstDepth,FirstTime,FirstNodeNb,double(LastScore)/100.0,pv_string); } printf("%d/%d",hit,tot); if (hit != 0) { depth_tot /= double(hit); time_tot /= double(hit); node_tot /= double(hit); printf(" - %.1f %.2f %.0f",depth_tot,time_tot,node_tot); } printf("\n"); fclose(file); } // is_solution() static bool is_solution(int move, const board_t * board, const char bm[], const char am[]) { char move_string[256]; bool correct; ASSERT(move!=MoveNone); ASSERT(bm!=NULL); ASSERT(am!=NULL); if (!move_is_legal(move,board)) { board_disp(board); move_disp(move,board); printf("\n\n"); } ASSERT(move_is_legal(move,board)); if (!move_to_san(move,board,move_string,256)) ASSERT(false); correct = false; if (!my_string_empty(bm)) { correct = string_contain(bm,move_string); } else if (!my_string_empty(am)) { correct = !string_contain(am,move_string); } else { ASSERT(false); } return correct; } // epd_get_op() bool epd_get_op(const char record[], const char opcode[], char string[], int size) { char op[256]; int len; const char *p_start, *p_end; ASSERT(record!=NULL); ASSERT(opcode!=NULL); ASSERT(string!=NULL); ASSERT(size>0); // find the opcode sprintf(op," %s ",opcode); p_start = strstr(record,op); if (p_start == NULL) return false; // skip the opcode p_start += strlen(op); // find the end p_end = strchr(p_start,';'); if (p_end == NULL) return false; // calculate the length len = p_end - p_start; if (size < len+1) my_fatal("epd_get_op(): size < len+1\n"); strncpy(string,p_start,len); string[len] = '\0'; return true; } // string_contain() static bool string_contain(const char string[], const char substring[]) { char new_string[StringSize], *p; strcpy(new_string,string); // HACK for (p = strtok(new_string," "); p != NULL; p = strtok(NULL," ")) { if (my_string_equal(p,substring)) return true; } return false; } // engine_step() static bool engine_step() { char string[StringSize]; int event; engine_get(Engine,string,StringSize); event = uci_parse(Uci,string); if ((event & EVENT_MOVE) != 0) { return false; } if ((event & EVENT_PV) != 0) { LastMove = Uci->best_pv[0]; LastDepth = Uci->best_depth; LastSelDepth = Uci->best_sel_depth; LastScore = Uci->best_score; LastTime = Uci->time; LastNodeNb = Uci->node_nb; line_copy(LastPV,Uci->best_pv); if (LastMove != FirstMove) { FirstMove = LastMove; FirstDepth = LastDepth; FirstSelDepth = LastSelDepth; FirstScore = LastScore; FirstTime = LastTime; FirstNodeNb = LastNodeNb; line_copy(FirstPV,LastPV); } } return true; } } // namespace adapter // end of epd.cpp gnuchess-6.2.2/src/adapter/epd.h000644 000766 000024 00000002051 12451347745 017315 0ustar00antoniostaff000000 000000 /* epd.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // epd.h #ifndef EPD_H #define EPD_H // includes #include "util.h" namespace adapter { // functions extern void epd_test (int argc, char * argv[]); extern bool epd_get_op (const char record[], const char opcode[], char string[], int size); } // namespace adapter #endif // !defined EPD_H // end of epd.h gnuchess-6.2.2/src/adapter/fen.cpp000644 000766 000024 00000024032 12510207056 017635 0ustar00antoniostaff000000 000000 /* fen.cpp GNU Chess protocol adapter Copyright (C) 2001-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // fen.cpp // includes #include #include #include #include #include "board.h" #include "colour.h" #include "fen.h" #include "option.h" #include "piece.h" #include "square.h" #include "util.h" namespace adapter { // "constants" // const char * StartFen = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w HAha - 0 1"; const char * StartFen = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"; static const int StringSize = 4096; // variables static const bool Strict = false; // functions // fen_fatal() void fen_fatal(const char format[], int pos, const char fen[]) { char errorMsg[StringSize]=""; char pointerStr[StringSize]=""; for ( int i=0; i= 0; rank--) { for (file = 0; file < 8;) { sq = square_make(file,rank); if (c >= '1' && c <= '8') { // empty square(s) len = c - '0'; if (file + len > 8) fen_fatal("board_from_fen(): bad FEN (a file was expected at pos=%d)\n",pos,string); for (i = 0; i < len; i++) { board->square[sq++] = Empty; file++; } } else { // piece piece = piece_from_char(c); if (piece == PieceNone256) fen_fatal("board_from_fen(): bad FEN (a piece was expected at pos=%d)\n",pos,string); if (piece_is_king(piece)) king_pos[piece_colour(piece)] = sq; board->square[sq++] = piece; file++; } c = string[++pos]; } if (rank > 0) { if (c != '/') fen_fatal("board_from_fen(): bad FEN ('/' was expected at pos=%d)\n",pos,string); c = string[++pos]; } } // active colour if (c != ' ') fen_fatal("board_from_fen(): bad FEN (a space was expected at pos=%d)\n",pos,string); c = string[++pos]; switch (c) { case 'w': board->turn = White; break; case 'b': board->turn = Black; break; default: fen_fatal("board_from_fen(): bad FEN (the active colour ('w' or 'b') was expected at pos=%d)\n",pos,string); break; } c = string[++pos]; // castling if (c != ' ') fen_fatal("board_from_fen(): bad FEN (a space was expected at pos=%d)\n",pos,string); c = string[++pos]; board->castle[White][SideH] = SquareNone; board->castle[White][SideA] = SquareNone; board->castle[Black][SideH] = SquareNone; board->castle[Black][SideA] = SquareNone; if (c == '-') { // no castling rights c = string[++pos]; } else { // TODO: filter out illegal rights do { if (false) { } else if (c == 'K') { for (sq = H1; sq > king_pos[White]; sq--) { if (board->square[sq] == WhiteRook256) { board->castle[White][SideH] = sq; break; } } } else if (c == 'Q') { for (sq = A1; sq < king_pos[White]; sq++) { if (board->square[sq] == WhiteRook256) { board->castle[White][SideA] = sq; break; } } } else if (c == 'k') { for (sq = H8; sq > king_pos[Black]; sq--) { if (board->square[sq] == BlackRook256) { board->castle[Black][SideH] = sq; break; } } } else if (c == 'q') { for (sq = A8; sq < king_pos[Black]; sq++) { if (board->square[sq] == BlackRook256) { board->castle[Black][SideA] = sq; break; } } } else if (c >= 'A' && c <= 'H') { // white castling right sq = square_make(file_from_char(tolower(c)),Rank1); if (sq > king_pos[White]) { // h side board->castle[White][SideH] = sq; } else { // a side board->castle[White][SideA] = sq; } } else if (c >= 'a' && c <= 'h') { // black castling right sq = square_make(file_from_char(tolower(c)),Rank8); if (sq > king_pos[Black]) { // h side board->castle[Black][SideH] = sq; } else { // a side board->castle[Black][SideA] = sq; } } else { fen_fatal("board_from_fen(): bad FEN (invalid castling availability at pos=%d)\n",pos,string); } c = string[++pos]; } while (c != ' '); } // en-passant if (c != ' ') fen_fatal("board_from_fen(): bad FEN (a space was expected at pos=%d)\n",pos,string); c = string[++pos]; if (c == '-') { // no en-passant sq = SquareNone; c = string[++pos]; } else { if (c < 'a' || c > 'h') fen_fatal("board_from_fen(): bad FEN (invalid en-passant rank at pos=%d)\n",pos,string); file = file_from_char(c); c = string[++pos]; if (c < '1' || c > '8') fen_fatal("board_from_fen(): bad FEN (invalid en-passant file at pos=%d)\n",pos,string); rank = rank_from_char(c); c = string[++pos]; sq = square_make(file,rank); } board->ep_square = sq; // halfmove clock board->ply_nb = 0; board->move_nb = 0; // HACK, in case of broken syntax if (c != ' ') { if (!Strict) goto update; fen_fatal("board_from_fen(): bad FEN (a space was expected at pos=%d)\n",pos,string); } c = string[++pos]; if (!isdigit(c)) { if (!Strict) goto update; fen_fatal("board_from_fen(): bad FEN (a digit for the halfmove clock was expected at pos=%d)\n",pos,string); } board->ply_nb = atoi(&string[pos]); do c = string[++pos]; while (isdigit(c)); // fullmove number board->move_nb = 0; if (c != ' ') { if (!Strict) goto update; fen_fatal("board_from_fen(): bad FEN (a space was expected at pos=%d)\n",pos,string); } c = string[++pos]; if (!isdigit(c)) { if (!Strict) goto update; fen_fatal("board_from_fen(): bad FEN (a digit for the fullmove number was expected at pos=%d)\n",pos,string); } board->move_nb = atoi(&string[pos]) - 1; do c = string[++pos]; while (isdigit(c)); // board update update: board_init_list(board); return true; } // board_to_fen() bool board_to_fen(const board_t * board, char string[], int size) { int pos; int file, rank; int sq, piece; int c; int len; int old_pos; ASSERT(board_is_ok(board)); ASSERT(string!=NULL); ASSERT(size>=92); // init if (size < 92) return false; pos = 0; // piece placement for (rank = 7; rank >= 0; rank--) { for (file = 0; file < 8;) { sq = square_make(file,rank); piece = board->square[sq]; ASSERT(piece==Empty||piece_is_ok(piece)); if (piece == Empty) { len = 0; for (; file < 8 && board->square[square_make(file,rank)] == Empty; file++) { len++; } ASSERT(len>=1&&len<=8); c = '0' + len; } else { c = piece_to_char(piece); file++; } string[pos++] = c; } string[pos++] = '/'; } string[pos-1] = ' '; // HACK: remove the last '/' // active colour string[pos++] = (colour_is_white(board->turn)) ? 'w' : 'b'; string[pos++] = ' '; // castling old_pos = pos; if (option_get_bool("Chess960")) { // FEN-960 if (board->castle[White][SideH] != SquareNone) { string[pos++] = toupper(file_to_char(square_file(board->castle[White][SideH]))); } if (board->castle[White][SideA] != SquareNone) { string[pos++] = toupper(file_to_char(square_file(board->castle[White][SideA]))); } if (board->castle[Black][SideH] != SquareNone) { string[pos++] = tolower(file_to_char(square_file(board->castle[Black][SideH]))); } if (board->castle[Black][SideA] != SquareNone) { string[pos++] = tolower(file_to_char(square_file(board->castle[Black][SideA]))); } } else { // FEN if (board->castle[White][SideH] != SquareNone) string[pos++] = 'K'; if (board->castle[White][SideA] != SquareNone) string[pos++] = 'Q'; if (board->castle[Black][SideH] != SquareNone) string[pos++] = 'k'; if (board->castle[Black][SideA] != SquareNone) string[pos++] = 'q'; } if (pos == old_pos) string[pos++] = '-'; string[pos++] = ' '; // en-passant if (board->ep_square == SquareNone) { string[pos++] = '-'; } else { if (!square_to_string(board->ep_square,&string[pos],3)) return false; pos += 2; } string[pos++] = ' '; // halfmove clock and fullmove number sprintf(&string[pos],"%d %d",board->ply_nb,board->move_nb+1); return true; } } // namespace adapter // end of fen.cpp gnuchess-6.2.2/src/adapter/fen.h000644 000766 000024 00000002154 12451347754 017321 0ustar00antoniostaff000000 000000 /* fen.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // fen.h #ifndef FEN_H #define FEN_H // includes #include "board.h" #include "util.h" namespace adapter { // "constants" extern const char * StartFen; // functions extern bool board_from_fen (board_t * board, const char string[]); extern bool board_to_fen (const board_t * board, char string[], int size); } // namespace adapter #endif // !defined FEN_H // end of fen.h gnuchess-6.2.2/src/adapter/game.cpp000644 000766 000024 00000015752 12451347760 020022 0ustar00antoniostaff000000 000000 /* game.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // game.cpp // includes #include "attack.h" #include "board.h" #include "fen.h" #include "game.h" #include "list.h" #include "move.h" #include "move_do.h" #include "move_legal.h" #include "piece.h" #include "square.h" #include "util.h" namespace adapter { // constants static const bool UseSlowDebug = false; // variables game_t Game[1]; // prototypes static void game_update (game_t * game); static int game_comp_status (const game_t * game); // functions // game_is_ok() bool game_is_ok(const game_t * game) { board_t board[1]; int pos, move; if (game == NULL) return false; if (game->size < 0 || game->size > GameSize) return false; if (game->pos < 0 || game->pos > game->size) return false; // optional heavy DEBUG mode if (!UseSlowDebug) return true; if (!board_is_ok(game->start_board)) return false; board_copy(board,game->start_board); for (pos = 0; pos <= game->size; pos++) { if (pos == game->pos) { if (!board_equal(game->board,board)) return false; } if (pos >= game->size) break; if (game->key[pos] != board->key) return false; move = game->move[pos]; if (!move_is_legal(move,board)); move_do(board,move); } if (game->status != game_comp_status(game)) return false; return true; } // game_clear() void game_clear(game_t * game) { ASSERT(game!=NULL); game_init(game,StartFen); } // game_init() bool game_init(game_t * game, const char fen[]) { ASSERT(game!=NULL); ASSERT(fen!=NULL); if (!board_from_fen(game->start_board,fen)) return false; game->size = 0; board_copy(game->board,game->start_board); game->pos = 0; game_update(game); return true; } // game_status() int game_status(const game_t * game) { ASSERT(game!=NULL); return game->status; } // game_size() int game_size(const game_t * game) { ASSERT(game!=NULL); return game->size; } // game_pos() int game_pos(const game_t * game) { ASSERT(game!=NULL); return game->pos; } // game_move() int game_move(const game_t * game, int pos) { ASSERT(game!=NULL); ASSERT(pos>=0&&pospos); return game->move[pos]; } // game_get_board() void game_get_board(const game_t * game, board_t * board, int pos) { int start; int i; ASSERT(game!=NULL); ASSERT(board!=NULL); ASSERT(pos==-1||(pos>=0&&pos<=game->size)); // HACK if (pos < 0) pos = game->pos; if (pos >= game->pos) { // forward from current position start = game->pos; board_copy(board,game->board); } else { // backward => replay the whole game start = 0; board_copy(board,game->start_board); } for (i = start; i < pos; i++) move_do(board,game->move[i]); } // game_turn() int game_turn(const game_t * game) { ASSERT(game!=NULL); return game->board->turn; } // game_move_nb() int game_move_nb(const game_t * game) { ASSERT(game!=NULL); return game->board->move_nb; } // game_add_move() void game_add_move(game_t * game, int move) { ASSERT(game!=NULL); ASSERT(move_is_ok(move)); ASSERT(move_is_legal(move,game->board)); if (game->pos >= GameSize) my_fatal("game_add_move(): game overflow\n"); game->move[game->pos] = move; game->key[game->pos] = game->board->key; move_do(game->board,move); game->pos++; game->size = game->pos; // truncate game, HACK: before calling game_is_ok() in game_update() game_update(game); } // game_rem_move() void game_rem_move(game_t * game) { ASSERT(game!=NULL); game_goto(game,game->pos-1); game->size = game->pos; // truncate game } // game_goto() void game_goto(game_t * game, int pos) { int i; ASSERT(game!=NULL); ASSERT(pos>=0&&pos<=game->size); if (pos < game->pos) { // going backward => replay the whole game board_copy(game->board,game->start_board); game->pos = 0; } for (i = game->pos; i < pos; i++) move_do(game->board,game->move[i]); ASSERT(i==pos); game->pos = pos; game_update(game); } // game_disp() void game_disp(const game_t * game) { board_t board[1]; int i, move; ASSERT(game_is_ok(game)); board_copy(board,game->start_board); board_disp(board); for (i = 0; i < game->pos; i++) { move = game->move[i]; move_disp(move,board); move_do(board,move); } my_log("POLYGLOT\n"); board_disp(board); } // game_update() static void game_update(game_t * game) { ASSERT(game!=NULL); game->status = game_comp_status(game); ASSERT(game_is_ok(game)); } // game_comp_status() static int game_comp_status(const game_t * game) { int i, n; int wb, bb; const board_t * board; uint64 key; int start; ASSERT(game!=NULL); // init board = game->board; // mate and stalemate if (!board_can_play(board)) { if (false) { } else if (is_in_check(board,Black)) { // HACK return WHITE_MATES; } else if (is_in_check(board,White)) { // HACK return BLACK_MATES; } else { return STALEMATE; } } // insufficient material if (board->number[WhitePawn12] == 0 && board->number[BlackPawn12] == 0 && board->number[WhiteQueen12] == 0 && board->number[BlackQueen12] == 0 && board->number[WhiteRook12] == 0 && board->number[BlackRook12] == 0) { if (board->number[WhiteBishop12] + board->number[BlackBishop12] + board->number[WhiteKnight12] + board->number[BlackKnight12] <= 1) { // KK, KBK and KNK return DRAW_MATERIAL; } else if (board->number[WhiteBishop12] == 1 && board->number[BlackBishop12] == 1 && board->number[WhiteKnight12] == 0 && board->number[BlackKnight12] == 0) { wb = board->list[White][1]; // HACK bb = board->list[Black][1]; // HACK if (square_colour(wb) == square_colour(bb)) { // KBKB return DRAW_MATERIAL; } } } // 50-move rule if (board->ply_nb >= 100) return DRAW_FIFTY; // position repetition key = board->key; n = 0; start = game->pos - board->ply_nb; if (start < 0) start = 0; for (i = game->pos-4; i >= start; i -= 2) { if (game->key[i] == key) { if (++n == 2) return DRAW_REPETITION; } } return PLAYING; } } // namespace adapter // end of game.cpp gnuchess-6.2.2/src/adapter/game.h000644 000766 000024 00000004072 12451347763 017463 0ustar00antoniostaff000000 000000 /* game.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // game.h #ifndef GAME_H #define GAME_H // includes #include "board.h" #include "move.h" #include "util.h" namespace adapter { // constants const int GameSize = 4096; enum status_t { PLAYING, WHITE_MATES, BLACK_MATES, STALEMATE, DRAW_MATERIAL, DRAW_FIFTY, DRAW_REPETITION }; // types struct game_t { board_t start_board[1]; board_t board[1]; sint16 size; sint16 pos; sint8 status; move_t move[GameSize]; uint64 key[GameSize]; }; // variables extern game_t Game[1]; // functions extern bool game_is_ok (const game_t * game); extern void game_clear (game_t * game); extern bool game_init (game_t * game, const char fen[]); extern int game_status (const game_t * game); extern int game_size (const game_t * game); extern int game_pos (const game_t * game); extern int game_move (const game_t * game, int pos); extern void game_get_board (const game_t * game, board_t * board, int pos = -1); extern int game_turn (const game_t * game); extern int game_move_nb (const game_t * game); extern void game_add_move (game_t * game, int move); extern void game_rem_move (game_t * game); extern void game_goto (game_t * game, int pos); extern void game_disp (const game_t * game); } // namespace adapter #endif // !defined GAME_H // end of game.h gnuchess-6.2.2/src/adapter/hash.cpp000644 000766 000024 00000005302 12451347770 020023 0ustar00antoniostaff000000 000000 /* hash.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // hash.cpp // includes #include "board.h" #include "hash.h" #include "piece.h" #include "random.h" #include "square.h" #include "util.h" namespace adapter { // variables static uint64 Castle64[16]; // prototypes static uint64 hash_castle_key_debug (int flags); // functions // hash_init() void hash_init() { int i; for (i = 0; i < 16; i++) Castle64[i] = hash_castle_key_debug(i); } // hash_key() uint64 hash_key(const board_t * board) { uint64 key; int colour; const uint8 * ptr; int sq, piece; ASSERT(board_is_ok(board)); // init key = 0; // pieces for (colour = 1; colour <= 2; colour++) { // HACK for (ptr = board->list[colour]; (sq=*ptr) != SquareNone; ptr++) { piece = board->square[sq]; key ^= hash_piece_key(piece,sq); } } // castle flags key ^= hash_castle_key(board_flags(board)); // en-passant square sq = board->ep_square; if (sq != SquareNone) key ^= hash_ep_key(sq); // turn key ^= hash_turn_key(board->turn); return key; } // hash_piece_key() uint64 hash_piece_key(int piece, int square) { ASSERT(piece_is_ok(piece)); ASSERT(square_is_ok(square)); return random_64(RandomPiece+piece_to_12(piece)*64+square_to_64(square)); } // hash_castle_key() uint64 hash_castle_key(int flags) { ASSERT((flags&~0xF)==0); return Castle64[flags]; } // hash_castle_key_debug() static uint64 hash_castle_key_debug(int flags) { uint64 key; int i; ASSERT((flags&~0xF)==0); key = 0; for (i = 0; i < 4; i++) { if ((flags & (1<. */ // hash.h #ifndef HASH_H #define HASH_H // includes #include "board.h" #include "util.h" namespace adapter { // constants const int RandomPiece = 0; // 12 * 64 const int RandomCastle = 768; // 4 const int RandomEnPassant = 772; // 8 const int RandomTurn = 780; // 1 // functions extern void hash_init (); extern uint64 hash_key (const board_t * board); extern uint64 hash_piece_key (int piece, int square); extern uint64 hash_castle_key (int flags); extern uint64 hash_ep_key (int square); extern uint64 hash_turn_key (int colour); extern uint64 hash_random_64 (int index); } // namespace adapter #endif // !defined HASH_H // end of hash.h gnuchess-6.2.2/src/adapter/io.cpp000644 000766 000024 00000015345 12575111612 017506 0ustar00antoniostaff000000 000000 /* io.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // io.cpp // includes #include #include #include #include #include #include #include #include "io.h" #include "util.h" namespace adapter { // constants static const bool UseDebug = false; static const bool UseCR = false; // true on Windows static const int StringSize = 4096; static const char LF = '\n'; static const char CR = '\r'; // prototypes static int my_read (int fd, char string[], int size); static void my_write (int fd, const char string[], int size); // functions // io_is_ok() bool io_is_ok(const io_t * io) { if (io == NULL) return false; if (io->name == NULL) return false; if (io->in_eof != true && io->in_eof != false) return false; if (io->in_size < 0 || io->in_size > BufferSize) return false; if (io->out_size < 0 || io->out_size > BufferSize) return false; return true; } // io_init() void io_init(io_t * io) { ASSERT(io!=NULL); io->in_eof = false; io->in_size = 0; io->out_size = 0; ASSERT(io_is_ok(io)); } // io_close() void io_close(io_t * io) { ASSERT(io_is_ok(io)); ASSERT(io->out_fd>=0); my_log("> %s EOF\n",io->name); if (close(io->out_fd) == -1) { my_fatal("io_close(): close(): %s\n",strerror(errno)); } io->out_fd = -1; } // io_get_update() void io_get_update(io_t * io) { int pos, size; int n; ASSERT(io_is_ok(io)); ASSERT(io->in_fd>=0); ASSERT(!io->in_eof); // init pos = io->in_size; size = BufferSize - pos; if (size <= 0) my_fatal("io_get_update(): buffer overflow\n"); // read as many data as possible n = my_read(io->in_fd,&io->in_buffer[pos],size); if (UseDebug) my_log("POLYGLOT read %d byte%s from %s\n",n,(n>1)?"s":"",io->name); if (n > 0) { // at least one character was read // update buffer size ASSERT(n>=1&&n<=size); io->in_size += n; ASSERT(io->in_size>=0&&io->in_size<=BufferSize); } else { // EOF ASSERT(n==0); io->in_eof = true; } } // io_line_ready() bool io_line_ready(const io_t * io) { ASSERT(io_is_ok(io)); if (io->in_eof) return true; if (memchr(io->in_buffer,LF,io->in_size) != NULL) return true; // buffer contains LF return false; } // io_get_line() bool io_get_line(io_t * io, char string[], int size) { int src, dst; int c; ASSERT(io_is_ok(io)); ASSERT(string!=NULL); ASSERT(size>=256); src = 0; dst = 0; while (true) { // test for end of buffer if (src >= io->in_size) { if (io->in_eof) { my_log("< %s EOF\n",io->name); return false; } else { my_fatal("io_get_line(): no EOL in buffer\n"); } } // test for end of string if (dst >= size) my_fatal("io_get_line(): buffer overflow\n"); // copy the next character c = io->in_buffer[src++]; if (c == LF) { // LF => line complete string[dst] = '\0'; break; } else if (c != CR) { // skip CRs string[dst++] = c; } } // shift the buffer ASSERT(src>0); io->in_size -= src; ASSERT(io->in_size>=0); if (io->in_size > 0) memmove(&io->in_buffer[0],&io->in_buffer[src],io->in_size); // return my_log("< %s %s\n",io->name,string); return true; } // io_send() void io_send(io_t * io, const char format[], ...) { va_list arg_list; char string[StringSize]; int len; ASSERT(io_is_ok(io)); ASSERT(format!=NULL); ASSERT(io->out_fd>=0); // format va_start(arg_list,format); vsprintf(string,format,arg_list); va_end(arg_list); // append string to buffer len = strlen(string); if (io->out_size + len > BufferSize-2) my_fatal("io_send(): buffer overflow\n"); memcpy(&io->out_buffer[io->out_size],string,len); io->out_size += len; ASSERT(io->out_size>=0&&io->out_size<=BufferSize-2); // log io->out_buffer[io->out_size] = '\0'; my_log("> %s %s\n",io->name,io->out_buffer); // append EOL to buffer if (UseCR) io->out_buffer[io->out_size++] = CR; io->out_buffer[io->out_size++] = LF; ASSERT(io->out_size>=0&&io->out_size<=BufferSize); // flush buffer if (UseDebug) my_log("POLYGLOT writing %d byte%s to %s\n",io->out_size,(io->out_size>1)?"s":"",io->name); my_write(io->out_fd,io->out_buffer,io->out_size); io->out_size = 0; } // io_send_queue() void io_send_queue(io_t * io, const char format[], ...) { va_list arg_list; char string[StringSize]; int len; ASSERT(io_is_ok(io)); ASSERT(format!=NULL); ASSERT(io->out_fd>=0); // format va_start(arg_list,format); vsprintf(string,format,arg_list); va_end(arg_list); // append string to buffer len = strlen(string); if (io->out_size + len > BufferSize-2) my_fatal("io_send_queue(): buffer overflow\n"); memcpy(&io->out_buffer[io->out_size],string,len); io->out_size += len; ASSERT(io->out_size>=0&&io->out_size<=BufferSize-2); } // my_read() static int my_read(int fd, char string[], int size) { int n; ASSERT(fd>=0); ASSERT(string!=NULL); ASSERT(size>0); do { n = read(fd,string,size); } while (n == -1 && errno == EINTR); if (n == -1) my_fatal("my_read(): read(): %s\n",strerror(errno)); ASSERT(n>=0); return n; } // my_write() static void my_write(int fd, const char string[], int size) { int n; ASSERT(fd>=0); ASSERT(string!=NULL); ASSERT(size>0); do { n = write(fd,string,size); // if (n == -1 && errno != EINTR && errno != EPIPE) my_fatal("my_write(): write(): %s\n",strerror(errno)); if (n == -1) { if (false) { } else if (errno == EINTR) { n = 0; // nothing has been written } else if (errno == EPIPE) { n = size; // pretend everything has been written } else { my_fatal("my_write(): write(): %s\n",strerror(errno)); } } ASSERT(n>=0); string += n; size -= n; } while (size > 0); ASSERT(size==0); } } // namespace adapter // end of io.cpp gnuchess-6.2.2/src/adapter/io.h000644 000766 000024 00000003040 12451350000 017125 0ustar00antoniostaff000000 000000 /* io.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // io.h #ifndef IO_H #define IO_H // includes #include "util.h" namespace adapter { // constants const int BufferSize = 16384; // types struct io_t { int in_fd; int out_fd; const char * name; bool in_eof; sint32 in_size; sint32 out_size; char in_buffer[BufferSize]; char out_buffer[BufferSize]; }; // functions extern bool io_is_ok (const io_t * io); extern void io_init (io_t * io); extern void io_close (io_t * io); extern void io_get_update (io_t * io); extern bool io_line_ready (const io_t * io); extern bool io_get_line (io_t * io, char string[], int size); extern void io_send (io_t * io, const char format[], ...); extern void io_send_queue (io_t * io, const char format[], ...); } // namespace adapter #endif // !defined IO_H // end of io.h gnuchess-6.2.2/src/adapter/line.cpp000644 000766 000024 00000010462 12451350003 020011 0ustar00antoniostaff000000 000000 /* line.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // line.cpp // includes #include #include "board.h" #include "line.h" #include "move.h" #include "move_do.h" #include "move_legal.h" #include "san.h" #include "util.h" namespace adapter { // constants static const bool Strict = false; // false static const bool UseDebug = false; // false static const int StringSize = 1024; // functions // line_is_ok() bool line_is_ok(const move_t line[]) { int move; if (line == NULL) return false; while ((move = *line++) != MoveNone) { if (!move_is_ok(move)) return false; } return true; } // line_clear() void line_clear(move_t line[]) { ASSERT(line!=NULL); *line = MoveNone; } // line_copy() void line_copy(move_t dst[], const move_t src[]) { ASSERT(dst!=NULL); ASSERT(src!=NULL); ASSERT(dst!=src); while ((*dst++ = *src++) != MoveNone) ; } // line_from_can() bool line_from_can (move_t line[], const board_t * board, const char string[], int size) { int pos; char new_string[StringSize], *p; int move; board_t new_board[1]; ASSERT(line!=NULL); ASSERT(board_is_ok(board)); ASSERT(string!=NULL); ASSERT(size>=LineSize); // init pos = 0; board_copy(new_board,board); // loop strcpy(new_string,string); // HACK for (p = strtok(new_string," "); p != NULL; p = strtok(NULL," ")) { move = move_from_can(p,new_board); ASSERT(move!=MoveNone); ASSERT(move_is_legal(move,new_board)); if (move == MoveNone || !move_is_legal(move,new_board)) break; // HACK: ignore illegal moves if (pos >= size) return false; line[pos++] = move; move_do(new_board,move); } if (pos >= size) return false; line[pos] = MoveNone; return true; } // line_to_can() bool line_to_can(const move_t line[], const board_t * board, char string[], int size) { board_t new_board[1]; int pos; int move; ASSERT(line_is_ok(line)); ASSERT(board_is_ok(board)); ASSERT(string!=NULL); ASSERT(size>=StringSize); // init if (size < StringSize) return false; board_copy(new_board,board); pos = 0; // loop while ((move = *line++) != MoveNone) { if (pos != 0) { if (pos >= size) return false; string[pos++] = ' '; } if (!move_to_can(move,new_board,&string[pos],size-pos)) return false; pos += strlen(&string[pos]); move_do(new_board,move); } if (pos >= size) return false; string[pos] = '\0'; return true; } // line_to_san() bool line_to_san(const move_t line[], const board_t * board, char string[], int size) { board_t new_board[1]; int pos; int move; char move_string[256]; ASSERT(line_is_ok(line)); ASSERT(board_is_ok(board)); ASSERT(string!=NULL); ASSERT(size>=StringSize); // init if (size < StringSize) return false; board_copy(new_board,board); pos = 0; // loop while ((move = *line++) != MoveNone) { if (pos != 0) { if (pos >= size) return false; string[pos++] = ' '; } if (!move_is_legal(move,new_board) || !move_to_san(move,new_board,&string[pos],size-pos)) { if (Strict || UseDebug) { move_to_can(move,new_board,move_string,256); my_log("POLYGLOT ILLEGAL MOVE IN LINE %s\n",move_string); board_disp(new_board); } if (Strict) my_fatal("line_to_san(): illegal move\n"); break; } pos += strlen(&string[pos]); move_do(new_board,move); } if (pos >= size) return false; string[pos] = '\0'; return true; } } // namespace adapter // end of line.cpp gnuchess-6.2.2/src/adapter/line.h000644 000766 000024 00000002656 12451350007 017470 0ustar00antoniostaff000000 000000 /* line.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // line.h #ifndef LINE_H #define LINE_H // includes #include "board.h" #include "move.h" #include "util.h" namespace adapter { // constants const int LineSize = 256; // functions extern bool line_is_ok (const move_t line[]); extern void line_clear (move_t line[]); extern void line_copy (move_t dst[], const move_t src[]); extern bool line_from_can (move_t line[], const board_t * board, const char string[], int size); extern bool line_to_can (const move_t line[], const board_t * board, char string[], int size); extern bool line_to_san (const move_t line[], const board_t * board, char string[], int size); } // namespace adapter #endif // !defined LINE_H // end of line.h gnuchess-6.2.2/src/adapter/list.cpp000644 000766 000024 00000012446 12451350012 020041 0ustar00antoniostaff000000 000000 /* list.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // list.cpp // includes #include "board.h" #include "list.h" #include "move.h" #include "util.h" namespace adapter { // functions // list_is_ok() bool list_is_ok(const list_t * list) { if (list == NULL) return false; if (list->size >= ListSize) return false; return true; } // list_clear() void list_clear(list_t * list) { ASSERT(list!=NULL); list->size = 0; } // list_add() void list_add(list_t * list, int move, int value) { ASSERT(list_is_ok(list)); ASSERT(move_is_ok(move)); ASSERT(value>=-32767&&value<=+32767); ASSERT(list->sizemove[list->size] = move; list->value[list->size] = value; list->size++; } // list_remove() void list_remove(list_t * list, int index) { int i; ASSERT(list_is_ok(list)); ASSERT(index>=0&&indexsize); for (i = index; i < list->size-1; i++) { list->move[i] = list->move[i+1]; list->value[i] = list->value[i+1]; } list->size--; } // list_is_empty() bool list_is_empty(const list_t * list) { ASSERT(list_is_ok(list)); return list->size == 0; } // list_size() int list_size(const list_t * list) { ASSERT(list_is_ok(list)); return list->size; } // list_move() int list_move(const list_t * list, int index) { ASSERT(list_is_ok(list)); ASSERT(index>=0&&indexsize); return list->move[index]; } // list_value() int list_value(const list_t * list, int index) { ASSERT(list_is_ok(list)); ASSERT(index>=0&&indexsize); return list->value[index]; } // list_copy() void list_copy(list_t * dst, const list_t * src) { int i; ASSERT(dst!=NULL); ASSERT(list_is_ok(src)); dst->size = src->size; for (i = 0; i < src->size; i++) { dst->move[i] = src->move[i]; dst->value[i] = src->value[i]; } } // list_move_to_front() void list_move_to_front(list_t * list, int index) { int i; int move, value; ASSERT(list_is_ok(list)); ASSERT(index>=0&&indexsize); if (index != 0) { move = list->move[index]; value = list->value[index]; for (i = index; i > 0; i--) { list->move[i] = list->move[i-1]; list->value[i] = list->value[i-1]; } list->move[0] = move; list->value[0] = value; } } // list_note() void list_note(list_t * list) { int i, move; ASSERT(list_is_ok(list)); for (i = 0; i < list->size; i++) { move = list->move[i]; ASSERT(move_is_ok(move)); list->value[i] = -move_order(move); } } // list_sort() void list_sort(list_t * list) { int i, j; int best_index, best_move, best_value; ASSERT(list_is_ok(list)); for (i = 0; i < list->size-1; i++) { best_index = i; best_value = list->value[i]; for (j = i+1; j < list->size; j++) { if (list->value[j] > best_value) { best_index = j; best_value = list->value[j]; } } if (best_index != i) { best_move = list->move[best_index]; ASSERT(best_value==list->value[best_index]); for (j = best_index; j > i; j--) { list->move[j] = list->move[j-1]; list->value[j] = list->value[j-1]; } list->move[i] = best_move; list->value[i] = best_value; } } if (DEBUG) { for (i = 0; i < list->size-1; i++) { ASSERT(list->value[i]>=list->value[i+1]); } } } // list_contain() bool list_contain(const list_t * list, int move) { int i; ASSERT(list_is_ok(list)); ASSERT(move_is_ok(move)); for (i = 0; i < list->size; i++) { if (list->move[i] == move) return true; } return false; } // list_equal() bool list_equal(list_t * list_1, list_t * list_2) { list_t copy_1[1], copy_2[1]; int i; ASSERT(list_is_ok(list_1)); ASSERT(list_is_ok(list_2)); if (list_1->size != list_2->size) return false; list_copy(copy_1,list_1); list_note(copy_1); list_sort(copy_1); list_copy(copy_2,list_2); list_note(copy_2); list_sort(copy_2); for (i = 0; i < copy_1->size; i++) { if (copy_1->move[i] != copy_2->move[i]) return false; } return true; } // list_disp() void list_disp(const list_t * list, const board_t * board) { int i, move, value; char string[256]; ASSERT(list_is_ok(list)); ASSERT(board_is_ok(board)); for (i = 0; i < list->size; i++) { move = list->move[i]; value = list->value[i]; if (!move_to_can(move,board,string,256)) ASSERT(false); my_log("POLYGLOT %-5s %04X %+4d\n",string,move,value); } my_log("POLYGLOT\n"); } } // namespace adapter // end of list.cpp gnuchess-6.2.2/src/adapter/list.h000644 000766 000024 00000003535 12451350014 017507 0ustar00antoniostaff000000 000000 /* list.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // list.h #ifndef LIST_H #define LIST_H // includes #include "board.h" #include "move.h" #include "util.h" namespace adapter { // constants const int ListSize = 256; // types struct list_t { sint16 size; move_t move[ListSize]; sint16 value[ListSize]; }; // functions extern bool list_is_ok (const list_t * list); extern void list_clear (list_t * list); extern void list_add (list_t * list, int move, int value = 0); extern void list_remove (list_t * list, int index); extern bool list_is_empty (const list_t * list); extern int list_size (const list_t * list); extern int list_move (const list_t * list, int index); extern int list_value (const list_t * list, int index); extern void list_copy (list_t * dst, const list_t * src); extern void list_note (list_t * list); extern void list_sort (list_t * list); extern bool list_contain (const list_t * list, int move); extern bool list_equal (list_t * list_1, list_t * list_2); extern void list_disp (const list_t * list, const board_t * board); } // namespace adapter #endif // !defined LIST_H // end of list.h gnuchess-6.2.2/src/adapter/main.cpp000644 000766 000024 00000015100 12606163554 020017 0ustar00antoniostaff000000 000000 /* main.cpp GNU Chess protocol adapter Copyright (C) 2001-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // main.cpp // includes #include #include #include #include #include #include #include "adapter.h" #include "attack.h" #include "board.h" #include "book.h" #include "book_make.h" #include "book_merge.h" #include "engine.h" #include "epd.h" #include "fen.h" #include "hash.h" #include "list.h" #include "main.h" #include "move.h" #include "move_gen.h" #include "option.h" #include "piece.h" #include "search.h" #include "square.h" #include "uci.h" #include "util.h" namespace adapter { // constants static const char * const Version = "1.4"; static const bool BlockSignal = false; // true on Windows static const int SearchDepth = 63; static const double SearchTime = 3600.0; static const int StringSize = 4096; // variables static bool Init; extern unsigned int HashSize; pthread_mutex_t adapter_init_mutex; pthread_cond_t adapter_init_cond; // prototypes static void parse_option (); static bool parse_line (char line[], char * * name_ptr, char * * value_ptr); static void stop_search (); // functions // main() int main_adapter(int argc, char * argv[]) { // init Init = false; if (BlockSignal) { signal(SIGINT,SIG_IGN); signal(SIGTERM,SIG_IGN); signal(SIGPIPE,SIG_IGN); } util_init(); option_init(); square_init(); piece_init(); attack_init(); hash_init(); my_random_init(); // build book if (argc >= 2 && my_string_equal(argv[1],"make-book")) { book_make(argc,argv); return EXIT_SUCCESS; } if (argc >= 2 && my_string_equal(argv[1],"merge-book")) { book_merge(argc,argv); return EXIT_SUCCESS; } // read options if (argc == 2) option_set("OptionFile",argv[1]); // HACK for compatibility parse_option(); // HACK: also launches the engine // EPD test if (argc >= 2 && my_string_equal(argv[1],"epd-test")) { epd_test(argc,argv); return EXIT_SUCCESS; } // opening book book_clear(); if (option_get_bool("Book")) { int mode = BookReadOnly; if (option_get_bool("BookLearn")) { mode = BookReadWrite; } book_open(option_get_string("BookFile"),mode); } // flag adapter initialized pthread_mutex_lock( &adapter_init_mutex ); pthread_cond_signal( &adapter_init_cond ); pthread_mutex_unlock( &adapter_init_mutex ); // adapter adapter_loop(); engine_send(Engine,"quit"); engine_close(Engine); return EXIT_SUCCESS; } // parse_option() static void parse_option() { const char * file_name; FILE * file; char line[256]; char * name, * value; file_name = option_get_string("OptionFile"); file = fopen(file_name,"r"); if (file == NULL) fprintf( stderr,"Can't open file \"%s\": %s - using defaults\n",file_name,strerror(errno)); // PolyGlot options (assumed first) if ( file != NULL ) { while (true) { if (!my_file_read_line(file,line,256)) { my_fatal("parse_option(): missing [Engine] section\n"); } if (my_string_case_equal(line,"[engine]")) break; if (parse_line(line,&name,&value)) option_set(name,value); } } if (option_get_bool("Log")) { my_log_open(option_get_string("LogFile")); } my_log("POLYGLOT *** START ***\n"); my_log("POLYGLOT INI file \"%s\"\n",file_name); // engine options (assumed second and last) engine_open(Engine); Init = true; // engine has been launched uci_open(Uci,Engine); if ( file != NULL ) { while (my_file_read_line(file,line,256)) { if (line[0] == '[') my_fatal("parse_option(): unknown section %s\n",line); if (parse_line(line,&name,&value)) { if ( strcmp(name,"Hash") == 0 ) { sscanf( value, "%d", &HashSize ); } uci_send_option(Uci,name,"%s",value); } } } uci_send_isready(Uci); if ( file != NULL ) { fclose(file); } if (my_string_equal(option_get_string("EngineName"),"")) { option_set("EngineName",Uci->name); } } // parse_line() static bool parse_line(char line[], char * * name_ptr, char * * value_ptr) { char * ptr; char * name, * value; ASSERT(line!=NULL); ASSERT(name_ptr!=NULL); ASSERT(value_ptr!=NULL); // remove comments ptr = strchr(line,';'); if (ptr != NULL) *ptr = '\0'; ptr = strchr(line,'#'); if (ptr != NULL) *ptr = '\0'; // split at '=' ptr = strchr(line,'='); if (ptr == NULL) return false; name = line; value = ptr+1; // cleanup name while (*name == ' ') name++; // remove leading spaces while (ptr > name && ptr[-1] == ' ') ptr--; // remove trailing spaces *ptr = '\0'; if (*name == '\0') return false; // cleanup value ptr = &value[strlen(value)]; // pointer to string terminator while (*value == ' ') value++; // remove leading spaces while (ptr > value && ptr[-1] == ' ') ptr--; // remove trailing spaces *ptr = '\0'; if (*value == '\0') return false; // end *name_ptr = name; *value_ptr = value; return true; } // quit() void quit() { char string[StringSize]; my_log("POLYGLOT *** QUIT ***\n"); if (Init) { stop_search(); engine_send(Engine,"quit"); pthread_exit(NULL); // wait for the engine to quit while (true) { engine_get(Engine,string,StringSize); // HACK: calls exit() on receiving EOF } uci_close(Uci); } //exit(EXIT_SUCCESS); } // stop_search() static void stop_search() { if (Init && Uci->searching) { ASSERT(Uci->searching); ASSERT(Uci->pending_nb>=1); my_log("POLYGLOT STOP SEARCH\n"); /* engine_send(Engine,"stop"); Uci->searching = false; */ if (option_get_bool("SyncStop")) { uci_send_stop_sync(Uci); } else { uci_send_stop(Uci); } } } } // namespace adapter // end of main.cpp gnuchess-6.2.2/src/adapter/main.h000644 000766 000024 00000001665 12451350021 017460 0ustar00antoniostaff000000 000000 /* main.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // main.h #ifndef MAIN_H #define MAIN_H // includes #include "util.h" namespace adapter { // functions extern void quit (); } // namespace adapter #endif // !defined MAIN_H // end of main.h gnuchess-6.2.2/src/adapter/Makefile.am000644 000766 000024 00000003110 11517375750 020424 0ustar00antoniostaff000000 000000 # Process this file with automake to produce Makefile.in # Makefile for gnuchess/src/adapter. # # Copyright (C) 2001-2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . noinst_LIBRARIES = libadapter.a libadapter_a_SOURCES = adapter.cpp attack.cpp board.cpp book.cpp book_make.cpp book_merge.cpp colour.cpp \ engine.cpp epd.cpp fen.cpp game.cpp hash.cpp io.cpp line.cpp list.cpp main.cpp move.cpp \ move_do.cpp move_gen.cpp move_legal.cpp option.cpp parse.cpp pgn.cpp piece.cpp \ posix.cpp random.cpp san.cpp search.cpp square.cpp uci.cpp util.cpp \ adapter.h attack.h board.h book.h book_make.h book_merge.h colour.h \ engine.h epd.h fen.h game.h hash.h io.h line.h list.h main.h move.h \ move_do.h move_gen.h move_legal.h option.h parse.h pgn.h piece.h \ posix.h random.h san.h search.h square.h uci.h util.h AM_CPPFLAGS = -I$(top_srcdir)/src AM_CXXFLAGS = $(PTHREAD_CXXFLAGS) AM_LDFLAGS = $(PTHREAD_LDFLAGS) $(PTHREAD_LIBS) DISTCLEANFILES = *~ gnuchess-6.2.2/src/adapter/Makefile.in000644 000766 000024 00000051746 12606706417 020455 0ustar00antoniostaff000000 000000 # Makefile.in generated by automake 1.14 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Process this file with automake to produce Makefile.in # Makefile for gnuchess/src/adapter. # # Copyright (C) 2001-2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/adapter DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libadapter_a_AR = $(AR) $(ARFLAGS) libadapter_a_LIBADD = am_libadapter_a_OBJECTS = adapter.$(OBJEXT) attack.$(OBJEXT) \ board.$(OBJEXT) book.$(OBJEXT) book_make.$(OBJEXT) \ book_merge.$(OBJEXT) colour.$(OBJEXT) engine.$(OBJEXT) \ epd.$(OBJEXT) fen.$(OBJEXT) game.$(OBJEXT) hash.$(OBJEXT) \ io.$(OBJEXT) line.$(OBJEXT) list.$(OBJEXT) main.$(OBJEXT) \ move.$(OBJEXT) move_do.$(OBJEXT) move_gen.$(OBJEXT) \ move_legal.$(OBJEXT) option.$(OBJEXT) parse.$(OBJEXT) \ pgn.$(OBJEXT) piece.$(OBJEXT) posix.$(OBJEXT) random.$(OBJEXT) \ san.$(OBJEXT) search.$(OBJEXT) square.$(OBJEXT) uci.$(OBJEXT) \ util.$(OBJEXT) libadapter_a_OBJECTS = $(am_libadapter_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libadapter_a_SOURCES) DIST_SOURCES = $(libadapter_a_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HELP2MAN = @HELP2MAN@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGINSDIR = @PLUGINSDIR@ POSUB = @POSUB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXXFLAGS = @PTHREAD_CXXFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libadapter.a libadapter_a_SOURCES = adapter.cpp attack.cpp board.cpp book.cpp book_make.cpp book_merge.cpp colour.cpp \ engine.cpp epd.cpp fen.cpp game.cpp hash.cpp io.cpp line.cpp list.cpp main.cpp move.cpp \ move_do.cpp move_gen.cpp move_legal.cpp option.cpp parse.cpp pgn.cpp piece.cpp \ posix.cpp random.cpp san.cpp search.cpp square.cpp uci.cpp util.cpp \ adapter.h attack.h board.h book.h book_make.h book_merge.h colour.h \ engine.h epd.h fen.h game.h hash.h io.h line.h list.h main.h move.h \ move_do.h move_gen.h move_legal.h option.h parse.h pgn.h piece.h \ posix.h random.h san.h search.h square.h uci.h util.h AM_CPPFLAGS = -I$(top_srcdir)/src AM_CXXFLAGS = $(PTHREAD_CXXFLAGS) AM_LDFLAGS = $(PTHREAD_LDFLAGS) $(PTHREAD_LIBS) DISTCLEANFILES = *~ all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/adapter/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/adapter/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libadapter.a: $(libadapter_a_OBJECTS) $(libadapter_a_DEPENDENCIES) $(EXTRA_libadapter_a_DEPENDENCIES) $(AM_V_at)-rm -f libadapter.a $(AM_V_AR)$(libadapter_a_AR) libadapter.a $(libadapter_a_OBJECTS) $(libadapter_a_LIBADD) $(AM_V_at)$(RANLIB) libadapter.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adapter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/board.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/book.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/book_make.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/book_merge.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colour.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/engine.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/game.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/line.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_do.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_gen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_legal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/option.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pgn.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/piece.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/random.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/san.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/search.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/square.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uci.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: gnuchess-6.2.2/src/adapter/move.cpp000644 000766 000024 00000017055 12451350025 020041 0ustar00antoniostaff000000 000000 /* move.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // move.cpp // includes #include #include #include "attack.h" #include "colour.h" #include "list.h" #include "move.h" #include "move_do.h" #include "move_gen.h" #include "move_legal.h" #include "option.h" #include "piece.h" #include "square.h" #include "util.h" namespace adapter { // "constants" static const uint8 PromotePiece[5] = { PieceNone64, Knight64, Bishop64, Rook64, Queen64 }; // functions // move_is_ok() bool move_is_ok(int move) { if (move < 0 || move >= 65536) return false; if (move == MoveNone) return false; return true; } // move_make() int move_make(int from, int to) { ASSERT(square_is_ok(from)); ASSERT(square_is_ok(to)); return (square_to_64(from) << 6) | square_to_64(to); } // move_make_flags() int move_make_flags(int from, int to, int flags) { ASSERT(square_is_ok(from)); ASSERT(square_is_ok(to)); ASSERT((flags&~0xF000)==0); ASSERT(to!=from); return (square_to_64(from) << 6) | square_to_64(to) | flags; } // move_from() int move_from(int move) { int from_64; ASSERT(move_is_ok(move)); from_64 = (move >> 6) & 077; return square_from_64(from_64); } // move_to() int move_to(int move) { int to_64; ASSERT(move_is_ok(move)); to_64 = move & 077; return square_from_64(to_64); } // move_promote_hack() int move_promote_hack(int move) { int code; ASSERT(move_is_ok(move)); ASSERT(move_is_promote(move)); code = move >> 12; ASSERT(code>=1&&code<=4); return PromotePiece[code]; } // move_is_capture() bool move_is_capture(int move, const board_t * board) { ASSERT(move_is_ok(move)); ASSERT(board_is_ok(board)); if (move_is_en_passant(move,board)) return true; if (board->square[move_to(move)] != Empty) return true; return false; } // move_is_promote() bool move_is_promote(int move) { ASSERT(move_is_ok(move)); return (move & MoveFlags) != 0; } // move_is_en_passant() bool move_is_en_passant(int move, const board_t * board) { ASSERT(move_is_ok(move)); ASSERT(board_is_ok(board)); return piece_is_pawn(move_piece(move,board)) && move_to(move) == board->ep_square; } // move_is_castle() bool move_is_castle(int move, const board_t * board) { ASSERT(move_is_ok(move)); ASSERT(board_is_ok(board)); return colour_equal(board->square[move_to(move)],board->turn); } // move_piece() int move_piece(int move, const board_t * board) { ASSERT(move_is_ok(move)); ASSERT(board_is_ok(board)); return board->square[move_from(move)]; } // move_capture() int move_capture(int move, const board_t * board) { ASSERT(move_is_ok(move)); ASSERT(board_is_ok(board)); if (move_is_en_passant(move,board)) { return piece_pawn_opp(move_piece(move,board)); } return board->square[move_to(move)]; } // move_promote() int move_promote(int move, const board_t * board) { int code; ASSERT(move_is_ok(move)); ASSERT(board_is_ok(board)); if (move_is_promote(move)) { code = move >> 12; ASSERT(code>=1&&code<=4); return PromotePiece[code] | board->turn; } return Empty; } // move_is_check() bool move_is_check(int move, const board_t * board) { board_t new_board[1]; ASSERT(move_is_ok(move)); ASSERT(board_is_ok(board)); board_copy(new_board,board); move_do(new_board,move); ASSERT(!is_in_check(new_board,colour_opp(new_board->turn))); return board_is_check(new_board); } // move_is_mate() bool move_is_mate(int move, const board_t * board) { board_t new_board[1]; ASSERT(move_is_ok(move)); ASSERT(board_is_ok(board)); board_copy(new_board,board); move_do(new_board,move); ASSERT(!is_in_check(new_board,colour_opp(new_board->turn))); return board_is_mate(new_board); } // move_to_can() bool move_to_can(int move, const board_t * board, char string[], int size) { int from, to; ASSERT(move_is_ok(move)); ASSERT(board_is_ok(board)); ASSERT(string!=NULL); ASSERT(size>=6); ASSERT(move_is_legal(move,board)); if (size < 6) return false; // init from = move_from(move); to = move_to(move); // king-slide castling if (move_is_castle(move,board) && !option_get_bool("Chess960")) { if (false) { } else if (from == E1 && to == H1) { to = G1; } else if (from == E1 && to == A1) { to = C1; } else if (from == E8 && to == H8) { to = G8; } else if (from == E8 && to == A8) { to = C8; } } // normal moves if (!square_to_string(from,&string[0],3)) ASSERT(false); if (!square_to_string(to,&string[2],3)) ASSERT(false); ASSERT(strlen(string)==4); // promotes if (move_is_promote(move)) { string[4] = piece_to_char(move_promote_hack(move)|Black); // HACK: black => lower-case string[5] = '\0'; } // debug ASSERT(move_from_can(string,board)==move); return true; } // move_from_can() int move_from_can(const char string[], const board_t * board) { char tmp_string[256]; int from, to; int side; int move; ASSERT(string!=NULL); ASSERT(board_is_ok(board)); // from tmp_string[0] = string[0]; tmp_string[1] = string[1]; tmp_string[2] = '\0'; from = square_from_string(tmp_string); if (from == SquareNone) return MoveNone; // to tmp_string[0] = string[2]; tmp_string[1] = string[3]; tmp_string[2] = '\0'; to = square_from_string(tmp_string); if (to == SquareNone) return MoveNone; // convert "king slide" castling to KxR if (piece_is_king(board->square[from]) && square_rank(to) == square_rank(from) && abs(to-from) > 1) { side = (to > from) ? SideH : SideA; to = board->castle[board->turn][side]; if (to == SquareNone) return MoveNone; } // move move = move_make(from,to); // promote switch (string[4]) { case '\0': // not a promotion if (piece_is_pawn(board->square[from]) && square_side_rank(to,board->turn) == Rank8 && option_get_bool("PromoteWorkAround")) { move |= MovePromoteQueen; } break; case 'N': case 'n': move |= MovePromoteKnight; break; case 'B': case 'b': move |= MovePromoteBishop; break; case 'R': case 'r': move |= MovePromoteRook; break; case 'Q': case 'q': move |= MovePromoteQueen; break; default: return MoveNone; break; } // debug ASSERT(move_is_legal(move,board)); return move; } // move_order() int move_order(int move) { ASSERT(move_is_ok(move)); return ((move & 07777) << 3) | (move >> 12); // from, to, promote } // move_disp() void move_disp(int move, const board_t * board) { char string[256]; ASSERT(move_is_ok(move)); ASSERT(board_is_ok(board)); if (!move_to_can(move,board,string,256)) ASSERT(false); my_log("POLYGLOT %s\n",string); } } // namespace adapter // end of move.cpp gnuchess-6.2.2/src/adapter/move.h000644 000766 000024 00000004555 12451350027 017511 0ustar00antoniostaff000000 000000 /* move.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // move.h #ifndef MOVE_H #define MOVE_H // includes #include "board.h" #include "util.h" namespace adapter { // constants const int MoveNone = 0; // HACK: a1a1 cannot be a legal move const int MovePromoteKnight = 1 << 12; const int MovePromoteBishop = 2 << 12; const int MovePromoteRook = 3 << 12; const int MovePromoteQueen = 4 << 12; const int MoveFlags = 7 << 12; // types typedef uint16 move_t; // functions extern bool move_is_ok (int move); extern int move_make (int from, int to); extern int move_make_flags (int from, int to, int flags); extern int move_from (int move); extern int move_to (int move); extern int move_promote_hack (int move); extern bool move_is_capture (int move, const board_t * board); extern bool move_is_promote (int move); extern bool move_is_en_passant (int move, const board_t * board); extern bool move_is_castle (int move, const board_t * board); extern int move_piece (int move, const board_t * board); extern int move_capture (int move, const board_t * board); extern int move_promote (int move, const board_t * board); extern bool move_is_check (int move, const board_t * board); extern bool move_is_mate (int move, const board_t * board); extern int move_order (int move); extern bool move_to_can (int move, const board_t * board, char string[], int size); extern int move_from_can (const char string[], const board_t * board); extern void move_disp (int move, const board_t * board); } // namespace adapter #endif // !defined MOVE_H // end of move.h gnuchess-6.2.2/src/adapter/move_do.cpp000644 000766 000024 00000017735 12451350042 020527 0ustar00antoniostaff000000 000000 /* move_do.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // move_do.cpp // includes #include #include "board.h" #include "colour.h" #include "hash.h" #include "move.h" #include "move_do.h" #include "move_legal.h" #include "piece.h" #include "random.h" #include "util.h" namespace adapter { // prototypes static void square_clear (board_t * board, int square, int piece); static void square_set (board_t * board, int square, int piece, int pos); static void square_move (board_t * board, int from, int to, int piece); // functions // move_do() void move_do(board_t * board, int move) { int me, opp; int from, to; int piece, pos, capture; int old_flags, new_flags; int sq, ep_square; int pawn; ASSERT(board_is_ok(board)); ASSERT(move_is_ok(move)); ASSERT(move_is_pseudo(move,board)); // init me = board->turn; opp = colour_opp(me); from = move_from(move); to = move_to(move); piece = board->square[from]; ASSERT(colour_equal(piece,me)); pos = board->pos[from]; ASSERT(pos>=0); // update turn board->turn = opp; board->key ^= random_64(RandomTurn); // update castling rights old_flags = board_flags(board); if (piece_is_king(piece)) { board->castle[me][SideH] = SquareNone; board->castle[me][SideA] = SquareNone; } if (board->castle[me][SideH] == from) board->castle[me][SideH] = SquareNone; if (board->castle[me][SideA] == from) board->castle[me][SideA] = SquareNone; if (board->castle[opp][SideH] == to) board->castle[opp][SideH] = SquareNone; if (board->castle[opp][SideA] == to) board->castle[opp][SideA] = SquareNone; new_flags = board_flags(board); board->key ^= hash_castle_key(new_flags^old_flags); // HACK // update en-passant square ep_square = sq = board->ep_square; if (sq != SquareNone) { board->key ^= random_64(RandomEnPassant+square_file(sq)); board->ep_square = SquareNone; } if (piece_is_pawn(piece) && abs(to-from) == 32) { pawn = piece_make_pawn(opp); if (board->square[to-1] == pawn || board->square[to+1] == pawn) { board->ep_square = sq = (from + to) / 2; board->key ^= random_64(RandomEnPassant+square_file(sq)); } } // update ply number (captures are handled later) board->ply_nb++; if (piece_is_pawn(piece)) board->ply_nb = 0; // conversion // update move number if (me == Black) board->move_nb++; // castle if (colour_equal(board->square[to],me)) { int rank; int king_from, king_to; int rook_from, rook_to; int rook; rank = colour_is_white(me) ? Rank1 : Rank8; king_from = from; rook_from = to; if (to > from) { // h side king_to = square_make(FileG,rank); rook_to = square_make(FileF,rank); } else { // a side king_to = square_make(FileC,rank); rook_to = square_make(FileD,rank); } // remove the rook pos = board->pos[rook_from]; ASSERT(pos>=0); rook = Rook64 | me; // HACK square_clear(board,rook_from,rook); // move the king square_move(board,king_from,king_to,piece); // put the rook back square_set(board,rook_to,rook,pos); ASSERT(board->key==hash_key(board)); return; } // remove the captured piece if (piece_is_pawn(piece) && to == ep_square) { // en-passant capture sq = square_ep_dual(to); capture = board->square[sq]; ASSERT(capture==piece_make_pawn(opp)); square_clear(board,sq,capture); board->ply_nb = 0; // conversion } else { capture = board->square[to]; if (capture != Empty) { // normal capture ASSERT(colour_equal(capture,opp)); ASSERT(!piece_is_king(capture)); square_clear(board,to,capture); board->ply_nb = 0; // conversion } } // move the piece if (move_is_promote(move)) { // promote square_clear(board,from,piece); piece = move_promote_hack(move) | me; // HACK square_set(board,to,piece,pos); } else { // normal move square_move(board,from,to,piece); } ASSERT(board->key==hash_key(board)); } // square_clear() static void square_clear(board_t * board, int square, int piece) { int pos, piece_12, colour; int sq, size; ASSERT(board!=NULL); ASSERT(square_is_ok(square)); ASSERT(piece_is_ok(piece)); // init pos = board->pos[square]; ASSERT(pos>=0); colour = piece_colour(piece); piece_12 = piece_to_12(piece); // square ASSERT(board->square[square]==piece); board->square[square] = Empty; ASSERT(board->pos[square]==pos); board->pos[square] = -1; // not needed // piece list ASSERT(board->list_size[colour]>=2); size = --board->list_size[colour]; ASSERT(pos<=size); if (pos != size) { sq = board->list[colour][size]; ASSERT(square_is_ok(sq)); ASSERT(sq!=square); ASSERT(board->pos[sq]==size); board->pos[sq] = pos; ASSERT(board->list[colour][pos]==square); board->list[colour][pos] = sq; } board->list[colour][size] = SquareNone; // material ASSERT(board->number[piece_12]>=1); board->number[piece_12]--; // hash key board->key ^= random_64(RandomPiece+piece_12*64+square_to_64(square)); } // square_set() static void square_set(board_t * board, int square, int piece, int pos) { int piece_12, colour; int sq, size; ASSERT(board!=NULL); ASSERT(square_is_ok(square)); ASSERT(piece_is_ok(piece)); ASSERT(pos>=0); // init colour = piece_colour(piece); piece_12 = piece_to_12(piece); // square ASSERT(board->square[square]==Empty); board->square[square] = piece; ASSERT(board->pos[square]==-1); board->pos[square] = pos; // piece list size = board->list_size[colour]++; ASSERT(board->list[colour][size]==SquareNone); ASSERT(pos<=size); if (pos != size) { sq = board->list[colour][pos]; ASSERT(square_is_ok(sq)); ASSERT(sq!=square); ASSERT(board->pos[sq]==pos); board->pos[sq] = size; ASSERT(board->list[colour][size]==SquareNone); board->list[colour][size] = sq; } board->list[colour][pos] = square; // material ASSERT(board->number[piece_12]<=8); board->number[piece_12]++; // hash key board->key ^= random_64(RandomPiece+piece_12*64+square_to_64(square)); } // square_move() static void square_move(board_t * board, int from, int to, int piece) { int colour, pos; int piece_index; ASSERT(board!=NULL); ASSERT(square_is_ok(from)); ASSERT(square_is_ok(to)); ASSERT(piece_is_ok(piece)); // init colour = piece_colour(piece); pos = board->pos[from]; ASSERT(pos>=0); // from ASSERT(board->square[from]==piece); board->square[from] = Empty; ASSERT(board->pos[from]==pos); board->pos[from] = -1; // not needed // to ASSERT(board->square[to]==Empty); board->square[to] = piece; ASSERT(board->pos[to]==-1); board->pos[to] = pos; // piece list ASSERT(board->list[colour][pos]==from); board->list[colour][pos] = to; // hash key piece_index = RandomPiece + piece_to_12(piece) * 64; board->key ^= random_64(piece_index+square_to_64(from)) ^ random_64(piece_index+square_to_64(to)); } } // namespace adapter // end of move_do.cpp gnuchess-6.2.2/src/adapter/move_do.h000644 000766 000024 00000001766 12451350050 020170 0ustar00antoniostaff000000 000000 /* move_do.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // move_do.h #ifndef MOVE_DO_H #define MOVE_DO_H // includes #include "board.h" #include "util.h" namespace adapter { // functions extern void move_do (board_t * board, int move); } // namespace adapter #endif // !defined MOVE_DO_H // end of move_do.h gnuchess-6.2.2/src/adapter/move_gen.cpp000644 000766 000024 00000021122 12451350054 020662 0ustar00antoniostaff000000 000000 /* move_gen.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // move_gen.cpp // includes #include "attack.h" #include "board.h" #include "colour.h" #include "list.h" #include "move.h" #include "move_gen.h" #include "move_legal.h" #include "piece.h" #include "util.h" namespace adapter { // prototypes static void add_all_moves (list_t * list, const board_t * board); static void add_castle_moves (list_t * list, const board_t * board); static void add_pawn_move (list_t * list, int from, int to); // functions // gen_legal_moves() void gen_legal_moves(list_t * list, const board_t * board) { ASSERT(list!=NULL); ASSERT(board_is_ok(board)); gen_moves(list,board); filter_legal(list,board); } // gen_moves() void gen_moves(list_t * list, const board_t * board) { ASSERT(list!=NULL); ASSERT(board_is_ok(board)); list_clear(list); add_all_moves(list,board); if (!is_in_check(board,board->turn)) add_castle_moves(list,board); } // add_all_moves() static void add_all_moves(list_t * list, const board_t * board) { int me, opp; const uint8 * ptr; const sint8 * ptr_inc; int from, to; int inc; int piece, capture; ASSERT(list_is_ok(list)); ASSERT(board_is_ok(board)); me = board->turn; opp = colour_opp(me); for (ptr = board->list[me]; (from=*ptr) != SquareNone; ptr++) { piece = board->square[from]; ASSERT(colour_equal(piece,me)); switch (piece_type(piece)) { case WhitePawn64: to = from + 15; if (to == board->ep_square || colour_equal(board->square[to],opp)) { add_pawn_move(list,from,to); } to = from + 17; if (to == board->ep_square || colour_equal(board->square[to],opp)) { add_pawn_move(list,from,to); } to = from + 16; if (board->square[to] == Empty) { add_pawn_move(list,from,to); if (square_rank(from) == Rank2) { to = from + 32; if (board->square[to] == Empty) { ASSERT(!square_is_promote(to)); list_add(list,move_make(from,to)); } } } break; case BlackPawn64: to = from - 17; if (to == board->ep_square || colour_equal(board->square[to],opp)) { add_pawn_move(list,from,to); } to = from - 15; if (to == board->ep_square || colour_equal(board->square[to],opp)) { add_pawn_move(list,from,to); } to = from - 16; if (board->square[to] == Empty) { add_pawn_move(list,from,to); if (square_rank(from) == Rank7) { to = from - 32; if (board->square[to] == Empty) { ASSERT(!square_is_promote(to)); list_add(list,move_make(from,to)); } } } break; case Knight64: for (ptr_inc = KnightInc; (inc=*ptr_inc) != IncNone; ptr_inc++) { to = from + inc; capture = board->square[to]; if (capture == Empty || colour_equal(capture,opp)) { list_add(list,move_make(from,to)); } } break; case Bishop64: for (ptr_inc = BishopInc; (inc=*ptr_inc) != IncNone; ptr_inc++) { for (to = from+inc; (capture=board->square[to]) == Empty; to += inc) { list_add(list,move_make(from,to)); } if (colour_equal(capture,opp)) { list_add(list,move_make(from,to)); } } break; case Rook64: for (ptr_inc = RookInc; (inc=*ptr_inc) != IncNone; ptr_inc++) { for (to = from+inc; (capture=board->square[to]) == Empty; to += inc) { list_add(list,move_make(from,to)); } if (colour_equal(capture,opp)) { list_add(list,move_make(from,to)); } } break; case Queen64: for (ptr_inc = QueenInc; (inc=*ptr_inc) != IncNone; ptr_inc++) { for (to = from+inc; (capture=board->square[to]) == Empty; to += inc) { list_add(list,move_make(from,to)); } if (colour_equal(capture,opp)) { list_add(list,move_make(from,to)); } } break; case King64: for (ptr_inc = KingInc; (inc=*ptr_inc) != IncNone; ptr_inc++) { to = from + inc; capture = board->square[to]; if (capture == Empty || colour_equal(capture,opp)) { list_add(list,move_make(from,to)); } } break; default: ASSERT(false); break; } } } // add_castle_moves() static void add_castle_moves(list_t * list, const board_t * board) { int me, opp; int rank; int king_from, king_to; int rook_from, rook_to; bool legal; int inc; int sq; ASSERT(list_is_ok(list)); ASSERT(board_is_ok(board)); ASSERT(!is_in_check(board,board->turn)); me = board->turn; opp = colour_opp(me); rank = colour_is_white(me) ? Rank1 : Rank8; // h-side castling if (board->castle[me][SideH] != SquareNone) { king_from = king_pos(board,me); king_to = square_make(FileG,rank); rook_from = board->castle[me][SideH]; rook_to = square_make(FileF,rank); ASSERT(square_rank(king_from)==rank); ASSERT(square_rank(rook_from)==rank); ASSERT(board->square[king_from]==(King64|me)); // HACK ASSERT(board->square[rook_from]==(Rook64|me)); // HACK ASSERT(rook_from>king_from); legal = true; if (king_to != king_from) { inc = (king_to > king_from) ? +1 : -1; for (sq = king_from+inc; true; sq += inc) { if (sq != rook_from && board->square[sq] != Empty) legal = false; if (is_attacked(board,sq,opp)) legal = false; if (sq == king_to) break; } } if (rook_to != rook_from) { inc = (rook_to > rook_from) ? +1 : -1; for (sq = rook_from+inc; true; sq += inc) { if (sq != king_from && board->square[sq] != Empty) legal = false; if (sq == rook_to) break; } } if (legal) list_add(list,move_make(king_from,rook_from)); } // a-side castling if (board->castle[me][SideA] != SquareNone) { king_from = king_pos(board,me); king_to = square_make(FileC,rank); rook_from = board->castle[me][SideA]; rook_to = square_make(FileD,rank); ASSERT(square_rank(king_from)==rank); ASSERT(square_rank(rook_from)==rank); ASSERT(board->square[king_from]==(King64|me)); // HACK ASSERT(board->square[rook_from]==(Rook64|me)); // HACK ASSERT(rook_from king_from) ? +1 : -1; for (sq = king_from+inc; true; sq += inc) { if (sq != rook_from && board->square[sq] != Empty) legal = false; if (is_attacked(board,sq,opp)) legal = false; if (sq == king_to) break; } } if (rook_to != rook_from) { inc = (rook_to > rook_from) ? +1 : -1; for (sq = rook_from+inc; true; sq += inc) { if (sq != king_from && board->square[sq] != Empty) legal = false; if (sq == rook_to) break; } } if (legal) list_add(list,move_make(king_from,rook_from)); } } // add_pawn_move() static void add_pawn_move(list_t * list, int from, int to) { int move; ASSERT(list_is_ok(list)); ASSERT(square_is_ok(from)); ASSERT(square_is_ok(to)); move = move_make(from,to); if (square_is_promote(to)) { list_add(list,move|MovePromoteKnight); list_add(list,move|MovePromoteBishop); list_add(list,move|MovePromoteRook); list_add(list,move|MovePromoteQueen); } else { list_add(list,move); } } } // namespace adapter // end of move_gen.cpp gnuchess-6.2.2/src/adapter/move_gen.h000644 000766 000024 00000002145 12451350060 020330 0ustar00antoniostaff000000 000000 /* move_gen.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // move_gen.h #ifndef MOVE_GEN_H #define MOVE_GEN_H // includes #include "board.h" #include "list.h" #include "util.h" namespace adapter { // functions extern void gen_legal_moves (list_t * list, const board_t * board); extern void gen_moves (list_t * list, const board_t * board); } // namespace adapter #endif // !defined MOVE_GEN_H // end of move_gen.h gnuchess-6.2.2/src/adapter/move_legal.cpp000644 000766 000024 00000005365 12451350064 021211 0ustar00antoniostaff000000 000000 /* move_legal.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // move_legal.cpp // includes #include "attack.h" #include "colour.h" #include "fen.h" #include "list.h" #include "move.h" #include "move_do.h" #include "move_gen.h" #include "move_legal.h" #include "piece.h" #include "square.h" #include "util.h" namespace adapter { // prototypes static bool move_is_legal_debug (int move, const board_t * board); // functions // move_is_pseudo() bool move_is_pseudo(int move, const board_t * board) { list_t list[1]; ASSERT(move_is_ok(move)); ASSERT(board_is_ok(board)); gen_moves(list,board); return list_contain(list,move); } // pseudo_is_legal() bool pseudo_is_legal(int move, const board_t * board) { board_t new_board[1]; ASSERT(move_is_ok(move)); ASSERT(board_is_ok(board)); ASSERT(move_is_pseudo(move,board)); board_copy(new_board,board); move_do(new_board,move); return !is_in_check(new_board,colour_opp(new_board->turn)); } // move_is_legal() bool move_is_legal(int move, const board_t * board) { bool legal; ASSERT(move_is_ok(move)); ASSERT(board_is_ok(board)); legal = move_is_pseudo(move,board) && pseudo_is_legal(move,board); ASSERT(legal==move_is_legal_debug(move,board)); return legal; } // filter_legal() void filter_legal(list_t * list, const board_t * board) { int pos; int i, move, value; ASSERT(list_is_ok(list)); ASSERT(board_is_ok(board)); pos = 0; for (i = 0; i < list_size(list); i++) { ASSERT(pos>=0&&pos<=i); move = list_move(list,i); value = list_value(list,i); if (pseudo_is_legal(move,board)) { list->move[pos] = move; list->value[pos] = value; pos++; } } ASSERT(pos>=0&&pos<=list_size(list)); list->size = pos; } // move_is_legal_debug() static bool move_is_legal_debug(int move, const board_t * board) { list_t list[1]; ASSERT(move_is_ok(move)); ASSERT(board_is_ok(board)); gen_legal_moves(list,board); return list_contain(list,move); } } // namespace adapter // end of move_legal.cpp gnuchess-6.2.2/src/adapter/move_legal.h000644 000766 000024 00000002353 12451350072 020647 0ustar00antoniostaff000000 000000 /* move_legal.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // move_legal.h #ifndef MOVE_LEGAL_H #define MOVE_LEGAL_H // includes #include "board.h" #include "list.h" #include "util.h" namespace adapter { // functions extern bool move_is_pseudo (int move, const board_t * board); extern bool pseudo_is_legal (int move, const board_t * board); extern bool move_is_legal (int move, const board_t * board); extern void filter_legal (list_t * list, const board_t * board); } // namespace adapter #endif // !defined MOVE_LEGAL_H // end of move_legal.h gnuchess-6.2.2/src/adapter/option.cpp000644 000766 000024 00000012606 12451350075 020405 0ustar00antoniostaff000000 000000 /* option.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // option.cpp // includes #include #include #include "option.h" #include "util.h" namespace adapter { // constants static const bool UseDebug = false; // types struct option_t { const char * var; const char * val; }; // variables static option_t Option[] = { { "OptionFile", NULL, }, // string // options { "EngineName", NULL, }, // string { "EngineDir", NULL, }, // string { "EngineCommand", NULL, }, // string { "Log", NULL, }, // true/false { "LogFile", NULL, }, // string { "Chess960", NULL, }, // true/false { "Resign", NULL, }, // true/false { "ResignMoves", NULL, }, // move number { "ResignScore", NULL, }, // centipawns { "MateScore", NULL, }, // centipawns { "Book", NULL, }, // true/false { "BookFile", NULL, }, // string { "BookRandom", NULL, }, // true/false { "BookWorst", NULL, }, // true/false { "BookLearn", NULL, }, // true/false { "KibitzMove", NULL, }, // true/false { "KibitzPV", NULL, }, // true/false { "KibitzCommand", NULL, }, // string { "KibitzDelay", NULL, }, // seconds { "ShowPonder", NULL, }, // true/false // work-arounds { "UCIVersion", NULL, }, // 1- { "CanPonder", NULL, }, // true/false { "SyncStop", NULL, }, // true/false { "PromoteWorkAround", NULL, }, // true/false // { "", NULL, }, { NULL, NULL, }, }; // prototypes static option_t * option_find (const char var[]); // functions // option_init() void option_init() { // option file const char optionName[]="gnuchess.ini"; char optionFile[MaxFileNameSize+1]; FILE *of; if ( ( of = fopen(optionName, "r") ) != NULL ) { fclose(of); strcpy(optionFile,""); } else { strcpy(optionFile,compute_pkgdatadir()); strcat(optionFile,"/"); } strcat(optionFile,optionName); // options option_set("OptionFile",optionFile); option_set("EngineName","GNU Chess"); option_set("EngineDir","."); option_set("EngineCommand",""); option_set("Log","false"); option_set("LogFile","adapter.log"); option_set("Chess960","false"); option_set("Resign","false"); option_set("ResignMoves","3"); option_set("ResignScore","600"); option_set("MateScore","10000"); option_set("Book","false"); option_set("BookFile","book.bin"); option_set("BookRandom","true"); option_set("BookWorst","false"); option_set("BookLearn","false"); option_set("KibitzMove","false"); option_set("KibitzPV","false"); option_set("KibitzCommand","tellall"); option_set("KibitzDelay","5"); option_set("ShowPonder","true"); // work-arounds option_set("UCIVersion","2"); option_set("CanPonder","false"); option_set("SyncStop","false"); option_set("PromoteWorkAround","false"); // option_set("",""); } // option_set() bool option_set(const char var[], const char val[]) { option_t * opt; ASSERT(var!=NULL); ASSERT(val!=NULL); opt = option_find(var); if (opt == NULL) return false; my_string_set(&opt->val,val); if (UseDebug) my_log("POLYGLOT OPTION SET \"%s\" -> \"%s\"\n",opt->var,opt->val); return true; } // option_get() const char * option_get(const char var[]) { option_t * opt; ASSERT(var!=NULL); opt = option_find(var); if (opt == NULL) my_fatal("option_get(): unknown option \"%s\"\n",var); if (UseDebug) my_log("POLYGLOT OPTION GET \"%s\" -> \"%s\"\n",opt->var,opt->val); return opt->val; } // option_get_bool() bool option_get_bool(const char var[]) { const char * val; val = option_get(var); if (false) { } else if (my_string_case_equal(val,"true") || my_string_case_equal(val,"yes") || my_string_equal(val,"1")) { return true; } else if (my_string_case_equal(val,"false") || my_string_case_equal(val,"no") || my_string_equal(val,"0")) { return false; } ASSERT(false); return false; } // option_get_double() double option_get_double(const char var[]) { const char * val; val = option_get(var); return atof(val); } // option_get_int() int option_get_int(const char var[]) { const char * val; val = option_get(var); return atoi(val); } // option_get_string() const char * option_get_string(const char var[]) { const char * val; val = option_get(var); return val; } // option_find() static option_t * option_find(const char var[]) { option_t * opt; ASSERT(var!=NULL); for (opt = &Option[0]; opt->var != NULL; opt++) { if (my_string_case_equal(opt->var,var)) return opt; } return NULL; } } // namespace adapter // end of option.cpp gnuchess-6.2.2/src/adapter/option.h000644 000766 000024 00000002506 12451350100 020035 0ustar00antoniostaff000000 000000 /* option.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // option.h #ifndef OPTION_H #define OPTION_H // includes #include "util.h" namespace adapter { // functions extern void option_init (); extern bool option_set (const char var[], const char val[]); extern const char * option_get (const char var[]); extern bool option_get_bool (const char var[]); extern double option_get_double (const char var[]); extern int option_get_int (const char var[]); extern const char * option_get_string (const char var[]); } // namespace adapter #endif // !defined OPTION_H // end of option.h gnuchess-6.2.2/src/adapter/parse.cpp000644 000766 000024 00000013003 12451350103 020167 0ustar00antoniostaff000000 000000 /* parse.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // parse.cpp // includes #include #include "parse.h" #include "util.h" namespace adapter { // constants static const int StringSize = 256; // variables char * Star[STAR_NUMBER]; // prototypes static bool match_rec (char string[], const char pattern[], char * star[]); // functions // match() bool match(char string[], const char pattern[]) { ASSERT(string!=NULL); ASSERT(pattern!=NULL); ASSERT(strstr(pattern,"**")==NULL); return match_rec(string,pattern,Star); } // match_rec() static bool match_rec(char string[], const char pattern[], char * star[]) { int c; ASSERT(string!=NULL); ASSERT(pattern!=NULL); ASSERT(star!=NULL); // iterative matches while ((c=*pattern++) != '*') { if (false) { } else if (c == '\0') { // end of pattern while (*string == ' ') string++; // skip trailing spaces return *string == '\0'; } else if (c == ' ') { // spaces if (*string++ != ' ') return false; // mismatch while (*string == ' ') string++; // skip trailing spaces } else { // normal character if (*string++ != c) return false; // mismatch } } // recursive wildcard match ASSERT(c=='*'); while (*string == ' ') string++; // skip leading spaces *star++ = string; // remember beginning of star while ((c=*string++) != '\0') { // reject empty-string match if (c != ' ' && match_rec(string,pattern,star)) { // shortest match ASSERT(string>star[-1]); *string = '\0'; // truncate star return true; } } return false; } // parse_is_ok() bool parse_is_ok(const parse_t * parse) { if (parse == NULL) return false; if (parse->string == NULL) return false; if (parse->pos < 0 || parse->pos > strlen(parse->string)) return false; if (parse->keyword_nb < 0 || parse->keyword_nb >= KEYWORD_NUMBER) return false; return true; } // parse_open() void parse_open(parse_t * parse, const char string[]) { ASSERT(parse!=NULL); ASSERT(string!=NULL); parse->string = string; parse->pos = 0; parse->keyword_nb = 0; } // parse_close() void parse_close(parse_t * parse) { int i; ASSERT(parse_is_ok(parse)); parse->string = NULL; parse->pos = 0; for (i = 0; i < parse->keyword_nb; i++) { my_string_clear(&parse->keyword[i]); } parse->keyword_nb = 0; } // parse_add_keyword() void parse_add_keyword(parse_t * parse, const char keyword[]) { const char * * string; ASSERT(parse_is_ok(parse)); ASSERT(keyword!=NULL); if (parse->keyword_nb < KEYWORD_NUMBER) { string = &parse->keyword[parse->keyword_nb]; parse->keyword_nb++; *string = NULL; my_string_set(string,keyword); } } // parse_get_word() bool parse_get_word(parse_t * parse, char string[], int size) { int pos; int c; ASSERT(parse!=NULL); ASSERT(string!=NULL); ASSERT(size>=256); // skip blanks for (; parse->string[parse->pos] == ' '; parse->pos++) ; ASSERT(parse->string[parse->pos]!=' '); // copy word pos = 0; while (true) { c = parse->string[parse->pos]; if (c == ' ' || pos >= size-1) c = '\0'; string[pos] = c; if (c == '\0') break; parse->pos++; pos++; } ASSERT(strchr(string,' ')==NULL); return pos > 0; // non-empty word? } // parse_get_string() bool parse_get_string(parse_t * parse, char string[], int size) { int pos; parse_t parse_2[1]; char word[StringSize]; int i; int c; ASSERT(parse!=NULL); ASSERT(string!=NULL); ASSERT(size>=256); // skip blanks for (; parse->string[parse->pos] == ' '; parse->pos++) ; ASSERT(parse->string[parse->pos]!=' '); // copy string pos = 0; while (true) { parse_open(parse_2,&parse->string[parse->pos]); if (!parse_get_word(parse_2,word,StringSize)) { string[pos] = '\0'; parse_close(parse_2); goto finished; } for (i = 0; i < parse->keyword_nb; i++) { if (my_string_equal(parse->keyword[i],word)) { string[pos] = '\0'; parse_close(parse_2); goto finished; } } parse_close(parse_2); // copy spaces while (true) { c = parse->string[parse->pos]; if (c != ' ') break; if (pos >= size-1) c = '\0'; string[pos] = c; if (c == '\0') break; parse->pos++; pos++; } // copy non spaces while (true) { c = parse->string[parse->pos]; if (c == ' ' || pos >= size-1) c = '\0'; string[pos] = c; if (c == '\0') break; parse->pos++; pos++; } string[pos] = '\0'; } finished: ; return pos > 0; // non-empty string? } } // namespace adapter // end of parse.cpp gnuchess-6.2.2/src/adapter/parse.h000644 000766 000024 00000003072 12451350107 017645 0ustar00antoniostaff000000 000000 /* parse.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // parse.h #ifndef PARSE_H #define PARSE_H // includes #include "util.h" namespace adapter { // constants const int STAR_NUMBER = 16; const int KEYWORD_NUMBER = 256; // types struct parse_t { const char * string; int pos; int keyword_nb; const char * keyword[KEYWORD_NUMBER]; }; // variables extern char * Star[STAR_NUMBER]; // functions extern bool match (char string[], const char pattern[]); extern void parse_open (parse_t * parse, const char string[]); extern void parse_close (parse_t * parse); extern void parse_add_keyword (parse_t * parse, const char keyword[]); extern bool parse_get_word (parse_t * parse, char string[], int size); extern bool parse_get_string (parse_t * parse, char string[], int size); } // namespace adapter #endif // !defined PARSE_H // end of parse.h gnuchess-6.2.2/src/adapter/pgn.cpp000644 000766 000024 00000036333 12451350113 017655 0ustar00antoniostaff000000 000000 /* pgn.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // pgn.cpp // includes #include #include #include #include #include "pgn.h" #include "util.h" namespace adapter { // constants static const bool DispMove = false; static const bool DispToken = false; static const bool DispChar = false; static const int TAB_SIZE = 8; static const int CHAR_EOF = 256; // types enum token_t { TOKEN_ERROR = -1, TOKEN_EOF = 256, TOKEN_SYMBOL = 257, TOKEN_STRING = 258, TOKEN_INTEGER = 259, TOKEN_NAG = 260, TOKEN_RESULT = 261 }; // prototypes static void pgn_token_read (pgn_t * pgn); static void pgn_token_unread (pgn_t * pgn); static void pgn_read_token (pgn_t * pgn); static bool is_symbol_start (int c); static bool is_symbol_next (int c); static void pgn_skip_blanks (pgn_t * pgn); static void pgn_char_read (pgn_t * pgn); static void pgn_char_unread (pgn_t * pgn); // functions // pgn_open() void pgn_open(pgn_t * pgn, const char file_name[]) { ASSERT(pgn!=NULL); ASSERT(file_name!=NULL); pgn->file = fopen(file_name,"r"); if (pgn->file == NULL) my_fatal("pgn_open(): can't open file \"%s\": %s\n",file_name,strerror(errno)); pgn->char_hack = CHAR_EOF; // DEBUG pgn->char_line = 1; pgn->char_column = 0; pgn->char_unread = false; pgn->char_first = true; pgn->token_type = TOKEN_ERROR; // DEBUG strcpy(pgn->token_string,"?"); // DEBUG pgn->token_length = -1; // DEBUG pgn->token_line = -1; // DEBUG pgn->token_column = -1; // DEBUG pgn->token_unread = false; pgn->token_first = true; strcpy(pgn->result,"?"); // DEBUG strcpy(pgn->fen,"?"); // DEBUG pgn->move_line = -1; // DEBUG pgn->move_column = -1; // DEBUG } // pgn_close() void pgn_close(pgn_t * pgn) { ASSERT(pgn!=NULL); fclose(pgn->file); } // pgn_next_game() bool pgn_next_game(pgn_t * pgn) { char name[PGN_STRING_SIZE]; char value[PGN_STRING_SIZE]; ASSERT(pgn!=NULL); // init strcpy(pgn->result,"*"); strcpy(pgn->fen,""); // loop while (true) { pgn_token_read(pgn); if (pgn->token_type != '[') break; // tag pgn_token_read(pgn); if (pgn->token_type != TOKEN_SYMBOL) { my_fatal("pgn_next_game(): malformed tag at line %d, column %d\n",pgn->token_line,pgn->token_column); } strcpy(name,pgn->token_string); pgn_token_read(pgn); if (pgn->token_type != TOKEN_STRING) { my_fatal("pgn_next_game(): malformed tag at line %d, column %d\n",pgn->token_line,pgn->token_column); } strcpy(value,pgn->token_string); pgn_token_read(pgn); if (pgn->token_type != ']') { if ( (my_string_equal(name,"Result")) || (my_string_equal(name,"FEN")) ) { my_fatal("pgn_next_game(): malformed tag at line %d, column %d\n",pgn->token_line,pgn->token_column); } else { // Ignore rest of line up to ']' my_log("pgn_next_game(): malformed tag at line %d, column %d\n",pgn->token_line,pgn->token_column); while (pgn->char_hack!= ']') { pgn_char_read(pgn); } pgn_char_unread(pgn); pgn_token_read(pgn); if (pgn->token_type != ']') { my_fatal("pgn_next_game(): malformed tag at line %d, column %d\n",pgn->token_line,pgn->token_column); } } } // special tag? if (false) { } else if (my_string_equal(name,"Result")) { strcpy(pgn->result,value); } else if (my_string_equal(name,"FEN")) { strcpy(pgn->fen,value); } } if (pgn->token_type == TOKEN_EOF) return false; pgn_token_unread(pgn); return true; } // pgn_next_move() bool pgn_next_move(pgn_t * pgn, char string[], int size) { int depth; ASSERT(pgn!=NULL); ASSERT(string!=NULL); ASSERT(size>=PGN_STRING_SIZE); // init pgn->move_line = -1; // DEBUG pgn->move_column = -1; // DEBUG // loop depth = 0; while (true) { pgn_token_read(pgn); if (false) { } else if (pgn->token_type == '(') { // open RAV depth++; } else if (pgn->token_type == ')') { // close RAV if (depth == 0) { my_fatal("pgn_next_move(): malformed variation at line %d, column %d\n",pgn->token_line,pgn->token_column); } depth--; ASSERT(depth>=0); } else if (pgn->token_type == TOKEN_RESULT) { // game finished if (depth > 0) { my_fatal("pgn_next_move(): malformed variation at line %d, column %d\n",pgn->token_line,pgn->token_column); } return false; } else { // skip optional move number if (pgn->token_type == TOKEN_INTEGER) { do pgn_token_read(pgn); while (pgn->token_type == '.'); } // move must be a symbol if (pgn->token_type != TOKEN_SYMBOL) { my_fatal("pgn_next_move(): malformed move at line %d, column %d\n",pgn->token_line,pgn->token_column); } // store move for later use if (depth == 0) { if (pgn->token_length >= size) { my_fatal("pgn_next_move(): move too long at line %d, column %d\n",pgn->token_line,pgn->token_column); } strcpy(string,pgn->token_string); pgn->move_line = pgn->token_line; pgn->move_column = pgn->token_column; } // skip optional NAGs do pgn_token_read(pgn); while (pgn->token_type == TOKEN_NAG); pgn_token_unread(pgn); // return move if (depth == 0) { if (DispMove) printf("move=\"%s\"\n",string); return true; } } } ASSERT(false); return false; } // pgn_token_read() static void pgn_token_read(pgn_t * pgn) { ASSERT(pgn!=NULL); // token "stack" if (pgn->token_unread) { pgn->token_unread = false; return; } // consume the current token if (pgn->token_first) { pgn->token_first = false; } else { ASSERT(pgn->token_type!=TOKEN_ERROR); ASSERT(pgn->token_type!=TOKEN_EOF); } // read a new token pgn_read_token(pgn); if (pgn->token_type == TOKEN_ERROR) my_fatal("pgn_token_read(): lexical error at line %d, column %d\n",pgn->char_line,pgn->char_column); if (DispToken) printf("< L%d C%d \"%s\" (%03X)\n",pgn->token_line,pgn->token_column,pgn->token_string,pgn->token_type); } // pgn_token_unread() static void pgn_token_unread(pgn_t * pgn) { ASSERT(pgn!=NULL); ASSERT(!pgn->token_unread); ASSERT(!pgn->token_first); pgn->token_unread = true; } // pgn_read_token() static void pgn_read_token(pgn_t * pgn) { ASSERT(pgn!=NULL); // skip white-space characters pgn_skip_blanks(pgn); // init pgn->token_type = TOKEN_ERROR; strcpy(pgn->token_string,""); pgn->token_length = 0; pgn->token_line = pgn->char_line; pgn->token_column = pgn->char_column; // determine token type if (false) { } else if (pgn->char_hack == CHAR_EOF) { pgn->token_type = TOKEN_EOF; } else if (strchr(".[]()<>",pgn->char_hack) != NULL) { // single-character token pgn->token_type = pgn->char_hack; sprintf(pgn->token_string,"%c",pgn->char_hack); pgn->token_length = 1; } else if (pgn->char_hack == '*') { pgn->token_type = TOKEN_RESULT; sprintf(pgn->token_string,"%c",pgn->char_hack); pgn->token_length = 1; } else if (pgn->char_hack == '!') { pgn_char_read(pgn); if (false) { } else if (pgn->char_hack == '!') { // "!!" pgn->token_type = TOKEN_NAG; strcpy(pgn->token_string,"3"); pgn->token_length = 1; } else if (pgn->char_hack == '?') { // "!?" pgn->token_type = TOKEN_NAG; strcpy(pgn->token_string,"5"); pgn->token_length = 1; } else { // "!" pgn_char_unread(pgn); pgn->token_type = TOKEN_NAG; strcpy(pgn->token_string,"1"); pgn->token_length = 1; } } else if (pgn->char_hack == '?') { pgn_char_read(pgn); if (false) { } else if (pgn->char_hack == '?') { // "??" pgn->token_type = TOKEN_NAG; strcpy(pgn->token_string,"4"); pgn->token_length = 1; } else if (pgn->char_hack == '!') { // "?!" pgn->token_type = TOKEN_NAG; strcpy(pgn->token_string,"6"); pgn->token_length = 1; } else { // "?" pgn_char_unread(pgn); pgn->token_type = TOKEN_NAG; strcpy(pgn->token_string,"2"); pgn->token_length = 1; } } else if (is_symbol_start(pgn->char_hack)) { // symbol, integer, or result pgn->token_type = TOKEN_INTEGER; pgn->token_length = 0; do { if (pgn->token_length >= PGN_STRING_SIZE-1) { my_fatal("pgn_read_token(): symbol too long at line %d, column %d\n",pgn->char_line,pgn->char_column); } if (!isdigit(pgn->char_hack)) pgn->token_type = TOKEN_SYMBOL; pgn->token_string[pgn->token_length++] = pgn->char_hack; pgn_char_read(pgn); } while (is_symbol_next(pgn->char_hack)); pgn_char_unread(pgn); ASSERT(pgn->token_length>0&&pgn->token_lengthtoken_string[pgn->token_length] = '\0'; if (my_string_equal(pgn->token_string,"1-0") || my_string_equal(pgn->token_string,"0-1") || my_string_equal(pgn->token_string,"1/2-1/2")) { pgn->token_type = TOKEN_RESULT; } } else if (pgn->char_hack == '"') { // string pgn->token_type = TOKEN_STRING; pgn->token_length = 0; while (true) { pgn_char_read(pgn); if (pgn->char_hack == CHAR_EOF) { my_fatal("pgn_read_token(): EOF in string at line %d, column %d\n",pgn->char_line,pgn->char_column); } if (pgn->char_hack == '"') break; if (pgn->char_hack == '\\') { pgn_char_read(pgn); if (pgn->char_hack == CHAR_EOF) { my_fatal("pgn_read_token(): EOF in string at line %d, column %d\n",pgn->char_line,pgn->char_column); } if (pgn->char_hack != '"' && pgn->char_hack != '\\') { // bad escape, ignore if (pgn->token_length >= PGN_STRING_SIZE-1) { my_fatal("pgn_read_token(): string too long at line %d, column %d\n",pgn->char_line,pgn->char_column); } pgn->token_string[pgn->token_length++] = '\\'; } } if (pgn->token_length >= PGN_STRING_SIZE-1) { my_fatal("pgn_read_token(): string too long at line %d, column %d\n",pgn->char_line,pgn->char_column); } pgn->token_string[pgn->token_length++] = pgn->char_hack; } ASSERT(pgn->token_length>=0&&pgn->token_lengthtoken_string[pgn->token_length] = '\0'; } else if (pgn->char_hack == '$') { // NAG pgn->token_type = TOKEN_NAG; pgn->token_length = 0; while (true) { pgn_char_read(pgn); if (!isdigit(pgn->char_hack)) break; if (pgn->token_length >= 3) { my_fatal("pgn_read_token(): NAG too long at line %d, column %d\n",pgn->char_line,pgn->char_column); } pgn->token_string[pgn->token_length++] = pgn->char_hack; } pgn_char_unread(pgn); if (pgn->token_length == 0) { my_fatal("pgn_read_token(): malformed NAG at line %d, column %d\n",pgn->char_line,pgn->char_column); } ASSERT(pgn->token_length>0&&pgn->token_length<=3); pgn->token_string[pgn->token_length] = '\0'; } else { // unknown token // my_fatal("lexical error at line %d, column %d\n",pgn->char_line,pgn->char_column); } } // pgn_skip_blanks() static void pgn_skip_blanks(pgn_t * pgn) { ASSERT(pgn!=NULL); while (true) { pgn_char_read(pgn); if (false) { } else if (isspace(pgn->char_hack)) { // skip white space } else if (pgn->char_hack == ';') { // skip comment to EOL do { pgn_char_read(pgn); if (pgn->char_hack == CHAR_EOF) { my_fatal("pgn_skip_blanks(): EOF in comment at line %d, column %d\n",pgn->char_line,pgn->char_column); } } while (pgn->char_hack != '\n'); } else if (pgn->char_hack == '%' && pgn->char_column == 0) { // skip comment to EOL do { pgn_char_read(pgn); if (pgn->char_hack == CHAR_EOF) { my_fatal("pgn_skip_blanks(): EOF in comment at line %d, column %d\n",pgn->char_line,pgn->char_column); } } while (pgn->char_hack != '\n'); } else if (pgn->char_hack == '{') { // skip comment to next '}' do { pgn_char_read(pgn); if (pgn->char_hack == CHAR_EOF) { my_fatal("pgn_skip_blanks(): EOF in comment at line %d, column %d\n",pgn->char_line,pgn->char_column); } } while (pgn->char_hack != '}'); } else { // not a white space break; } } } // is_symbol_start() static bool is_symbol_start(int c) { return strchr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",c) != NULL; } // is_symbol_next() static bool is_symbol_next(int c) { return strchr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_+#=:-/",c) != NULL; } // pgn_char_read() static void pgn_char_read(pgn_t * pgn) { ASSERT(pgn!=NULL); // char "stack" if (pgn->char_unread) { pgn->char_unread = false; return; } // consume the current character if (pgn->char_first) { pgn->char_first = false; } else { // update counters ASSERT(pgn->char_hack!=CHAR_EOF); if (false) { } else if (pgn->char_hack == '\n') { pgn->char_line++; pgn->char_column = 0; } else if (pgn->char_hack == '\t') { pgn->char_column += TAB_SIZE - (pgn->char_column % TAB_SIZE); } else { pgn->char_column++; } } // read a new character pgn->char_hack = fgetc(pgn->file); if (pgn->char_hack == EOF) { if (ferror(pgn->file)) my_fatal("pgn_char_read(): fgetc(): %s\n",strerror(errno)); pgn->char_hack = TOKEN_EOF; } if (DispChar) printf("< L%d C%d '%c' (%02X)\n",pgn->char_line,pgn->char_column,pgn->char_hack,pgn->char_hack); } // pgn_char_unread() static void pgn_char_unread(pgn_t * pgn) { ASSERT(pgn!=NULL); ASSERT(!pgn->char_unread); ASSERT(!pgn->char_first); pgn->char_unread = true; } } // namespace adapter // end of pgn.cpp gnuchess-6.2.2/src/adapter/pgn.h000644 000766 000024 00000003115 12451350116 017315 0ustar00antoniostaff000000 000000 /* pgn.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // pgn.h #ifndef PGN_H #define PGN_H // includes #include #include "util.h" namespace adapter { // constants const int PGN_STRING_SIZE = 256; // types struct pgn_t { FILE * file; int char_hack; int char_line; int char_column; bool char_unread; bool char_first; int token_type; char token_string[PGN_STRING_SIZE]; int token_length; int token_line; int token_column; bool token_unread; bool token_first; char result[PGN_STRING_SIZE]; char fen[PGN_STRING_SIZE]; int move_line; int move_column; }; // functions extern void pgn_open (pgn_t * pgn, const char file_name[]); extern void pgn_close (pgn_t * pgn); extern bool pgn_next_game (pgn_t * pgn); extern bool pgn_next_move (pgn_t * pgn, char string[], int size); } // namespace adapter #endif // !defined PGN_H // end of pgn.h gnuchess-6.2.2/src/adapter/piece.cpp000644 000766 000024 00000007306 12451350125 020157 0ustar00antoniostaff000000 000000 /* piece.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // piece.cpp // includes #include #include "colour.h" #include "piece.h" #include "util.h" namespace adapter { // "constants" static const uint8 MakePawn[ColourNb] = { PieceNone256, BlackPawn256, WhitePawn256 }; // -BW static const uint8 PieceFrom12[12] = { BlackPawn256, WhitePawn256, BlackKnight256, WhiteKnight256, BlackBishop256, WhiteBishop256, BlackRook256, WhiteRook256, BlackQueen256, WhiteQueen256, BlackKing256, WhiteKing256, }; static const char PieceString[12+1] = "pPnNbBrRqQkK"; // variables static sint8 PieceTo12[256]; // functions // piece_init() void piece_init() { int piece; for (piece = 0; piece < 256; piece++) PieceTo12[piece] = -1; for (piece = 0; piece < 12; piece++) { PieceTo12[PieceFrom12[piece]] = piece; } } // piece_is_ok() bool piece_is_ok(int piece) { if (piece < 0 || piece >= 256) return false; if (PieceTo12[piece] < 0) return false; return true; } // piece_make_pawn() int piece_make_pawn(int colour) { ASSERT(colour_is_ok(colour)); return MakePawn[colour]; } // piece_pawn_opp() int piece_pawn_opp(int piece) { ASSERT(piece==BlackPawn256||piece==WhitePawn256); return piece ^ 15; } // piece_colour() int piece_colour(int piece) { ASSERT(piece_is_ok(piece)); return piece & 3; } // piece_type() int piece_type(int piece) { ASSERT(piece_is_ok(piece)); return piece & ~3; } // piece_is_pawn() bool piece_is_pawn(int piece) { ASSERT(piece_is_ok(piece)); return (piece & PawnFlags) != 0; } // piece_is_knight() bool piece_is_knight(int piece) { ASSERT(piece_is_ok(piece)); return (piece & KnightFlag) != 0; } // piece_is_bishop() bool piece_is_bishop(int piece) { ASSERT(piece_is_ok(piece)); return (piece & QueenFlags) == BishopFlag; } // piece_is_rook() bool piece_is_rook(int piece) { ASSERT(piece_is_ok(piece)); return (piece & QueenFlags) == RookFlag; } // piece_is_queen() bool piece_is_queen(int piece) { ASSERT(piece_is_ok(piece)); return (piece & QueenFlags) == QueenFlags; } // piece_is_king() bool piece_is_king(int piece) { ASSERT(piece_is_ok(piece)); return (piece & KingFlag) != 0; } // piece_is_slider() bool piece_is_slider(int piece) { ASSERT(piece_is_ok(piece)); return (piece & QueenFlags) != 0; } // piece_to_12() int piece_to_12(int piece) { ASSERT(piece_is_ok(piece)); return PieceTo12[piece]; } // piece_from_12() int piece_from_12(int piece) { ASSERT(piece>=0&&piece<12); return PieceFrom12[piece]; } // piece_to_char() int piece_to_char(int piece) { ASSERT(piece_is_ok(piece)); return PieceString[piece_to_12(piece)]; } // piece_from_char() int piece_from_char(int c) { const char * ptr; ptr = strchr(PieceString,c); if (ptr == NULL) return PieceNone256; return piece_from_12(ptr-PieceString); } // char_is_piece() bool char_is_piece(int c) { return strchr("PNBRQK",c) != NULL; } } // namespace adapter // end of piece.cpp gnuchess-6.2.2/src/adapter/piece.h000644 000766 000024 00000006266 12451350127 017632 0ustar00antoniostaff000000 000000 /* piece.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // piece.h #ifndef PIECE_H #define PIECE_H // includes #include "colour.h" #include "util.h" namespace adapter { // constants const int BlackPawnFlag = 1 << 2; const int WhitePawnFlag = 1 << 3; const int KnightFlag = 1 << 4; const int BishopFlag = 1 << 5; const int RookFlag = 1 << 6; const int KingFlag = 1 << 7; const int PawnFlags = BlackPawnFlag | WhitePawnFlag; const int QueenFlags = BishopFlag | RookFlag; const int PieceNone64 = 0; const int BlackPawn64 = BlackPawnFlag; const int WhitePawn64 = WhitePawnFlag; const int Knight64 = KnightFlag; const int Bishop64 = BishopFlag; const int Rook64 = RookFlag; const int Queen64 = QueenFlags; const int King64 = KingFlag; const int PieceNone256 = 0; const int BlackPawn256 = BlackPawn64 | Black; const int WhitePawn256 = WhitePawn64 | White; const int BlackKnight256 = Knight64 | Black; const int WhiteKnight256 = Knight64 | White; const int BlackBishop256 = Bishop64 | Black; const int WhiteBishop256 = Bishop64 | White; const int BlackRook256 = Rook64 | Black; const int WhiteRook256 = Rook64 | White; const int BlackQueen256 = Queen64 | Black; const int WhiteQueen256 = Queen64 | White; const int BlackKing256 = King64 | Black; const int WhiteKing256 = King64 | White; const int BlackPawn12 = 0; const int WhitePawn12 = 1; const int BlackKnight12 = 2; const int WhiteKnight12 = 3; const int BlackBishop12 = 4; const int WhiteBishop12 = 5; const int BlackRook12 = 6; const int WhiteRook12 = 7; const int BlackQueen12 = 8; const int WhiteQueen12 = 9; const int BlackKing12 = 10; const int WhiteKing12 = 11; // functions extern void piece_init (); extern bool piece_is_ok (int piece); extern int piece_make_pawn (int colour); extern int piece_pawn_opp (int piece); extern int piece_colour (int piece); extern int piece_type (int piece); extern bool piece_is_pawn (int piece); extern bool piece_is_knight (int piece); extern bool piece_is_bishop (int piece); extern bool piece_is_rook (int piece); extern bool piece_is_queen (int piece); extern bool piece_is_king (int piece); extern bool piece_is_slider (int piece); extern int piece_to_12 (int piece); extern int piece_from_12 (int piece); extern int piece_to_char (int piece); extern int piece_from_char (int c); extern bool char_is_piece (int c); } // namespace adapter #endif // !defined PIECE_H // end of piece.h gnuchess-6.2.2/src/adapter/posix.cpp000644 000766 000024 00000004170 12451350137 020233 0ustar00antoniostaff000000 000000 /* posix.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // posix.cpp // includes #include #include #include #include #include // Mac OS X needs this one first #include #include #include #include "posix.h" #include "util.h" namespace adapter { // prototypes static double duration (const struct timeval *t); // functions // input_available() bool input_available() { int val; fd_set set[1]; struct timeval time_val[1]; FD_ZERO(set); FD_SET(STDIN_FILENO,set); time_val->tv_sec = 0; time_val->tv_usec = 0; val = select(STDIN_FILENO+1,set,NULL,NULL,time_val); if (val == -1) my_fatal("input_available(): select(): %s\n",strerror(errno)); return val != 0; } // now_real() double now_real() { struct timeval tv[1]; struct timezone tz[1]; tz->tz_minuteswest = 0; tz->tz_dsttime = 0; // DST_NONE not declared in GNU/Linux if (gettimeofday(tv,tz) == -1) { my_fatal("now_real(): gettimeofday(): %s\n",strerror(errno)); } return duration(tv); } // now_cpu() double now_cpu() { struct rusage ru[1]; if (getrusage(RUSAGE_SELF,ru) == -1) { my_fatal("now_cpu(): getrusage(): %s\n",strerror(errno)); } return duration(&ru->ru_utime); } // duration() static double duration(const struct timeval *tv) { return tv->tv_sec + tv->tv_usec * 1E-6; } } // namespace adapter // end of posix.cpp gnuchess-6.2.2/src/adapter/posix.h000644 000766 000024 00000002015 12451350142 017670 0ustar00antoniostaff000000 000000 /* posix.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // posix.h #ifndef POSIX_H #define POSIX_H // includes #include "util.h" namespace adapter { // functions extern bool input_available (); extern double now_real (); extern double now_cpu (); } // namespace adapter #endif // !defined POSIX_H // end of posix.h gnuchess-6.2.2/src/adapter/random.cpp000644 000766 000024 00000051575 12451350146 020364 0ustar00antoniostaff000000 000000 /* random.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // random.cpp // includes #include "random.h" #include "util.h" namespace adapter { // "constants" const uint64 Random64[RandomNb] = { U64(0x9D39247E33776D41), U64(0x2AF7398005AAA5C7), U64(0x44DB015024623547), U64(0x9C15F73E62A76AE2), U64(0x75834465489C0C89), U64(0x3290AC3A203001BF), U64(0x0FBBAD1F61042279), U64(0xE83A908FF2FB60CA), U64(0x0D7E765D58755C10), U64(0x1A083822CEAFE02D), U64(0x9605D5F0E25EC3B0), U64(0xD021FF5CD13A2ED5), U64(0x40BDF15D4A672E32), U64(0x011355146FD56395), U64(0x5DB4832046F3D9E5), U64(0x239F8B2D7FF719CC), U64(0x05D1A1AE85B49AA1), U64(0x679F848F6E8FC971), U64(0x7449BBFF801FED0B), U64(0x7D11CDB1C3B7ADF0), U64(0x82C7709E781EB7CC), U64(0xF3218F1C9510786C), U64(0x331478F3AF51BBE6), U64(0x4BB38DE5E7219443), U64(0xAA649C6EBCFD50FC), U64(0x8DBD98A352AFD40B), U64(0x87D2074B81D79217), U64(0x19F3C751D3E92AE1), U64(0xB4AB30F062B19ABF), U64(0x7B0500AC42047AC4), U64(0xC9452CA81A09D85D), U64(0x24AA6C514DA27500), U64(0x4C9F34427501B447), U64(0x14A68FD73C910841), U64(0xA71B9B83461CBD93), U64(0x03488B95B0F1850F), U64(0x637B2B34FF93C040), U64(0x09D1BC9A3DD90A94), U64(0x3575668334A1DD3B), U64(0x735E2B97A4C45A23), U64(0x18727070F1BD400B), U64(0x1FCBACD259BF02E7), U64(0xD310A7C2CE9B6555), U64(0xBF983FE0FE5D8244), U64(0x9F74D14F7454A824), U64(0x51EBDC4AB9BA3035), U64(0x5C82C505DB9AB0FA), U64(0xFCF7FE8A3430B241), U64(0x3253A729B9BA3DDE), U64(0x8C74C368081B3075), U64(0xB9BC6C87167C33E7), U64(0x7EF48F2B83024E20), U64(0x11D505D4C351BD7F), U64(0x6568FCA92C76A243), U64(0x4DE0B0F40F32A7B8), U64(0x96D693460CC37E5D), U64(0x42E240CB63689F2F), U64(0x6D2BDCDAE2919661), U64(0x42880B0236E4D951), U64(0x5F0F4A5898171BB6), U64(0x39F890F579F92F88), U64(0x93C5B5F47356388B), U64(0x63DC359D8D231B78), U64(0xEC16CA8AEA98AD76), U64(0x5355F900C2A82DC7), U64(0x07FB9F855A997142), U64(0x5093417AA8A7ED5E), U64(0x7BCBC38DA25A7F3C), U64(0x19FC8A768CF4B6D4), U64(0x637A7780DECFC0D9), U64(0x8249A47AEE0E41F7), U64(0x79AD695501E7D1E8), U64(0x14ACBAF4777D5776), U64(0xF145B6BECCDEA195), U64(0xDABF2AC8201752FC), U64(0x24C3C94DF9C8D3F6), U64(0xBB6E2924F03912EA), U64(0x0CE26C0B95C980D9), U64(0xA49CD132BFBF7CC4), U64(0xE99D662AF4243939), U64(0x27E6AD7891165C3F), U64(0x8535F040B9744FF1), U64(0x54B3F4FA5F40D873), U64(0x72B12C32127FED2B), U64(0xEE954D3C7B411F47), U64(0x9A85AC909A24EAA1), U64(0x70AC4CD9F04F21F5), U64(0xF9B89D3E99A075C2), U64(0x87B3E2B2B5C907B1), U64(0xA366E5B8C54F48B8), U64(0xAE4A9346CC3F7CF2), U64(0x1920C04D47267BBD), U64(0x87BF02C6B49E2AE9), U64(0x092237AC237F3859), U64(0xFF07F64EF8ED14D0), U64(0x8DE8DCA9F03CC54E), U64(0x9C1633264DB49C89), U64(0xB3F22C3D0B0B38ED), U64(0x390E5FB44D01144B), U64(0x5BFEA5B4712768E9), U64(0x1E1032911FA78984), U64(0x9A74ACB964E78CB3), U64(0x4F80F7A035DAFB04), U64(0x6304D09A0B3738C4), U64(0x2171E64683023A08), U64(0x5B9B63EB9CEFF80C), U64(0x506AACF489889342), U64(0x1881AFC9A3A701D6), U64(0x6503080440750644), U64(0xDFD395339CDBF4A7), U64(0xEF927DBCF00C20F2), U64(0x7B32F7D1E03680EC), U64(0xB9FD7620E7316243), U64(0x05A7E8A57DB91B77), U64(0xB5889C6E15630A75), U64(0x4A750A09CE9573F7), U64(0xCF464CEC899A2F8A), U64(0xF538639CE705B824), U64(0x3C79A0FF5580EF7F), U64(0xEDE6C87F8477609D), U64(0x799E81F05BC93F31), U64(0x86536B8CF3428A8C), U64(0x97D7374C60087B73), U64(0xA246637CFF328532), U64(0x043FCAE60CC0EBA0), U64(0x920E449535DD359E), U64(0x70EB093B15B290CC), U64(0x73A1921916591CBD), U64(0x56436C9FE1A1AA8D), U64(0xEFAC4B70633B8F81), U64(0xBB215798D45DF7AF), U64(0x45F20042F24F1768), U64(0x930F80F4E8EB7462), U64(0xFF6712FFCFD75EA1), U64(0xAE623FD67468AA70), U64(0xDD2C5BC84BC8D8FC), U64(0x7EED120D54CF2DD9), U64(0x22FE545401165F1C), U64(0xC91800E98FB99929), U64(0x808BD68E6AC10365), U64(0xDEC468145B7605F6), U64(0x1BEDE3A3AEF53302), U64(0x43539603D6C55602), U64(0xAA969B5C691CCB7A), U64(0xA87832D392EFEE56), U64(0x65942C7B3C7E11AE), U64(0xDED2D633CAD004F6), U64(0x21F08570F420E565), U64(0xB415938D7DA94E3C), U64(0x91B859E59ECB6350), U64(0x10CFF333E0ED804A), U64(0x28AED140BE0BB7DD), U64(0xC5CC1D89724FA456), U64(0x5648F680F11A2741), U64(0x2D255069F0B7DAB3), U64(0x9BC5A38EF729ABD4), U64(0xEF2F054308F6A2BC), U64(0xAF2042F5CC5C2858), U64(0x480412BAB7F5BE2A), U64(0xAEF3AF4A563DFE43), U64(0x19AFE59AE451497F), U64(0x52593803DFF1E840), U64(0xF4F076E65F2CE6F0), U64(0x11379625747D5AF3), U64(0xBCE5D2248682C115), U64(0x9DA4243DE836994F), U64(0x066F70B33FE09017), U64(0x4DC4DE189B671A1C), U64(0x51039AB7712457C3), U64(0xC07A3F80C31FB4B4), U64(0xB46EE9C5E64A6E7C), U64(0xB3819A42ABE61C87), U64(0x21A007933A522A20), U64(0x2DF16F761598AA4F), U64(0x763C4A1371B368FD), U64(0xF793C46702E086A0), U64(0xD7288E012AEB8D31), U64(0xDE336A2A4BC1C44B), U64(0x0BF692B38D079F23), U64(0x2C604A7A177326B3), U64(0x4850E73E03EB6064), U64(0xCFC447F1E53C8E1B), U64(0xB05CA3F564268D99), U64(0x9AE182C8BC9474E8), U64(0xA4FC4BD4FC5558CA), U64(0xE755178D58FC4E76), U64(0x69B97DB1A4C03DFE), U64(0xF9B5B7C4ACC67C96), U64(0xFC6A82D64B8655FB), U64(0x9C684CB6C4D24417), U64(0x8EC97D2917456ED0), U64(0x6703DF9D2924E97E), U64(0xC547F57E42A7444E), U64(0x78E37644E7CAD29E), U64(0xFE9A44E9362F05FA), U64(0x08BD35CC38336615), U64(0x9315E5EB3A129ACE), U64(0x94061B871E04DF75), U64(0xDF1D9F9D784BA010), U64(0x3BBA57B68871B59D), U64(0xD2B7ADEEDED1F73F), U64(0xF7A255D83BC373F8), U64(0xD7F4F2448C0CEB81), U64(0xD95BE88CD210FFA7), U64(0x336F52F8FF4728E7), U64(0xA74049DAC312AC71), U64(0xA2F61BB6E437FDB5), U64(0x4F2A5CB07F6A35B3), U64(0x87D380BDA5BF7859), U64(0x16B9F7E06C453A21), U64(0x7BA2484C8A0FD54E), U64(0xF3A678CAD9A2E38C), U64(0x39B0BF7DDE437BA2), U64(0xFCAF55C1BF8A4424), U64(0x18FCF680573FA594), U64(0x4C0563B89F495AC3), U64(0x40E087931A00930D), U64(0x8CFFA9412EB642C1), U64(0x68CA39053261169F), U64(0x7A1EE967D27579E2), U64(0x9D1D60E5076F5B6F), U64(0x3810E399B6F65BA2), U64(0x32095B6D4AB5F9B1), U64(0x35CAB62109DD038A), U64(0xA90B24499FCFAFB1), U64(0x77A225A07CC2C6BD), U64(0x513E5E634C70E331), U64(0x4361C0CA3F692F12), U64(0xD941ACA44B20A45B), U64(0x528F7C8602C5807B), U64(0x52AB92BEB9613989), U64(0x9D1DFA2EFC557F73), U64(0x722FF175F572C348), U64(0x1D1260A51107FE97), U64(0x7A249A57EC0C9BA2), U64(0x04208FE9E8F7F2D6), U64(0x5A110C6058B920A0), U64(0x0CD9A497658A5698), U64(0x56FD23C8F9715A4C), U64(0x284C847B9D887AAE), U64(0x04FEABFBBDB619CB), U64(0x742E1E651C60BA83), U64(0x9A9632E65904AD3C), U64(0x881B82A13B51B9E2), U64(0x506E6744CD974924), U64(0xB0183DB56FFC6A79), U64(0x0ED9B915C66ED37E), U64(0x5E11E86D5873D484), U64(0xF678647E3519AC6E), U64(0x1B85D488D0F20CC5), U64(0xDAB9FE6525D89021), U64(0x0D151D86ADB73615), U64(0xA865A54EDCC0F019), U64(0x93C42566AEF98FFB), U64(0x99E7AFEABE000731), U64(0x48CBFF086DDF285A), U64(0x7F9B6AF1EBF78BAF), U64(0x58627E1A149BBA21), U64(0x2CD16E2ABD791E33), U64(0xD363EFF5F0977996), U64(0x0CE2A38C344A6EED), U64(0x1A804AADB9CFA741), U64(0x907F30421D78C5DE), U64(0x501F65EDB3034D07), U64(0x37624AE5A48FA6E9), U64(0x957BAF61700CFF4E), U64(0x3A6C27934E31188A), U64(0xD49503536ABCA345), U64(0x088E049589C432E0), U64(0xF943AEE7FEBF21B8), U64(0x6C3B8E3E336139D3), U64(0x364F6FFA464EE52E), U64(0xD60F6DCEDC314222), U64(0x56963B0DCA418FC0), U64(0x16F50EDF91E513AF), U64(0xEF1955914B609F93), U64(0x565601C0364E3228), U64(0xECB53939887E8175), U64(0xBAC7A9A18531294B), U64(0xB344C470397BBA52), U64(0x65D34954DAF3CEBD), U64(0xB4B81B3FA97511E2), U64(0xB422061193D6F6A7), U64(0x071582401C38434D), U64(0x7A13F18BBEDC4FF5), U64(0xBC4097B116C524D2), U64(0x59B97885E2F2EA28), U64(0x99170A5DC3115544), U64(0x6F423357E7C6A9F9), U64(0x325928EE6E6F8794), U64(0xD0E4366228B03343), U64(0x565C31F7DE89EA27), U64(0x30F5611484119414), U64(0xD873DB391292ED4F), U64(0x7BD94E1D8E17DEBC), U64(0xC7D9F16864A76E94), U64(0x947AE053EE56E63C), U64(0xC8C93882F9475F5F), U64(0x3A9BF55BA91F81CA), U64(0xD9A11FBB3D9808E4), U64(0x0FD22063EDC29FCA), U64(0xB3F256D8ACA0B0B9), U64(0xB03031A8B4516E84), U64(0x35DD37D5871448AF), U64(0xE9F6082B05542E4E), U64(0xEBFAFA33D7254B59), U64(0x9255ABB50D532280), U64(0xB9AB4CE57F2D34F3), U64(0x693501D628297551), U64(0xC62C58F97DD949BF), U64(0xCD454F8F19C5126A), U64(0xBBE83F4ECC2BDECB), U64(0xDC842B7E2819E230), U64(0xBA89142E007503B8), U64(0xA3BC941D0A5061CB), U64(0xE9F6760E32CD8021), U64(0x09C7E552BC76492F), U64(0x852F54934DA55CC9), U64(0x8107FCCF064FCF56), U64(0x098954D51FFF6580), U64(0x23B70EDB1955C4BF), U64(0xC330DE426430F69D), U64(0x4715ED43E8A45C0A), U64(0xA8D7E4DAB780A08D), U64(0x0572B974F03CE0BB), U64(0xB57D2E985E1419C7), U64(0xE8D9ECBE2CF3D73F), U64(0x2FE4B17170E59750), U64(0x11317BA87905E790), U64(0x7FBF21EC8A1F45EC), U64(0x1725CABFCB045B00), U64(0x964E915CD5E2B207), U64(0x3E2B8BCBF016D66D), U64(0xBE7444E39328A0AC), U64(0xF85B2B4FBCDE44B7), U64(0x49353FEA39BA63B1), U64(0x1DD01AAFCD53486A), U64(0x1FCA8A92FD719F85), U64(0xFC7C95D827357AFA), U64(0x18A6A990C8B35EBD), U64(0xCCCB7005C6B9C28D), U64(0x3BDBB92C43B17F26), U64(0xAA70B5B4F89695A2), U64(0xE94C39A54A98307F), U64(0xB7A0B174CFF6F36E), U64(0xD4DBA84729AF48AD), U64(0x2E18BC1AD9704A68), U64(0x2DE0966DAF2F8B1C), U64(0xB9C11D5B1E43A07E), U64(0x64972D68DEE33360), U64(0x94628D38D0C20584), U64(0xDBC0D2B6AB90A559), U64(0xD2733C4335C6A72F), U64(0x7E75D99D94A70F4D), U64(0x6CED1983376FA72B), U64(0x97FCAACBF030BC24), U64(0x7B77497B32503B12), U64(0x8547EDDFB81CCB94), U64(0x79999CDFF70902CB), U64(0xCFFE1939438E9B24), U64(0x829626E3892D95D7), U64(0x92FAE24291F2B3F1), U64(0x63E22C147B9C3403), U64(0xC678B6D860284A1C), U64(0x5873888850659AE7), U64(0x0981DCD296A8736D), U64(0x9F65789A6509A440), U64(0x9FF38FED72E9052F), U64(0xE479EE5B9930578C), U64(0xE7F28ECD2D49EECD), U64(0x56C074A581EA17FE), U64(0x5544F7D774B14AEF), U64(0x7B3F0195FC6F290F), U64(0x12153635B2C0CF57), U64(0x7F5126DBBA5E0CA7), U64(0x7A76956C3EAFB413), U64(0x3D5774A11D31AB39), U64(0x8A1B083821F40CB4), U64(0x7B4A38E32537DF62), U64(0x950113646D1D6E03), U64(0x4DA8979A0041E8A9), U64(0x3BC36E078F7515D7), U64(0x5D0A12F27AD310D1), U64(0x7F9D1A2E1EBE1327), U64(0xDA3A361B1C5157B1), U64(0xDCDD7D20903D0C25), U64(0x36833336D068F707), U64(0xCE68341F79893389), U64(0xAB9090168DD05F34), U64(0x43954B3252DC25E5), U64(0xB438C2B67F98E5E9), U64(0x10DCD78E3851A492), U64(0xDBC27AB5447822BF), U64(0x9B3CDB65F82CA382), U64(0xB67B7896167B4C84), U64(0xBFCED1B0048EAC50), U64(0xA9119B60369FFEBD), U64(0x1FFF7AC80904BF45), U64(0xAC12FB171817EEE7), U64(0xAF08DA9177DDA93D), U64(0x1B0CAB936E65C744), U64(0xB559EB1D04E5E932), U64(0xC37B45B3F8D6F2BA), U64(0xC3A9DC228CAAC9E9), U64(0xF3B8B6675A6507FF), U64(0x9FC477DE4ED681DA), U64(0x67378D8ECCEF96CB), U64(0x6DD856D94D259236), U64(0xA319CE15B0B4DB31), U64(0x073973751F12DD5E), U64(0x8A8E849EB32781A5), U64(0xE1925C71285279F5), U64(0x74C04BF1790C0EFE), U64(0x4DDA48153C94938A), U64(0x9D266D6A1CC0542C), U64(0x7440FB816508C4FE), U64(0x13328503DF48229F), U64(0xD6BF7BAEE43CAC40), U64(0x4838D65F6EF6748F), U64(0x1E152328F3318DEA), U64(0x8F8419A348F296BF), U64(0x72C8834A5957B511), U64(0xD7A023A73260B45C), U64(0x94EBC8ABCFB56DAE), U64(0x9FC10D0F989993E0), U64(0xDE68A2355B93CAE6), U64(0xA44CFE79AE538BBE), U64(0x9D1D84FCCE371425), U64(0x51D2B1AB2DDFB636), U64(0x2FD7E4B9E72CD38C), U64(0x65CA5B96B7552210), U64(0xDD69A0D8AB3B546D), U64(0x604D51B25FBF70E2), U64(0x73AA8A564FB7AC9E), U64(0x1A8C1E992B941148), U64(0xAAC40A2703D9BEA0), U64(0x764DBEAE7FA4F3A6), U64(0x1E99B96E70A9BE8B), U64(0x2C5E9DEB57EF4743), U64(0x3A938FEE32D29981), U64(0x26E6DB8FFDF5ADFE), U64(0x469356C504EC9F9D), U64(0xC8763C5B08D1908C), U64(0x3F6C6AF859D80055), U64(0x7F7CC39420A3A545), U64(0x9BFB227EBDF4C5CE), U64(0x89039D79D6FC5C5C), U64(0x8FE88B57305E2AB6), U64(0xA09E8C8C35AB96DE), U64(0xFA7E393983325753), U64(0xD6B6D0ECC617C699), U64(0xDFEA21EA9E7557E3), U64(0xB67C1FA481680AF8), U64(0xCA1E3785A9E724E5), U64(0x1CFC8BED0D681639), U64(0xD18D8549D140CAEA), U64(0x4ED0FE7E9DC91335), U64(0xE4DBF0634473F5D2), U64(0x1761F93A44D5AEFE), U64(0x53898E4C3910DA55), U64(0x734DE8181F6EC39A), U64(0x2680B122BAA28D97), U64(0x298AF231C85BAFAB), U64(0x7983EED3740847D5), U64(0x66C1A2A1A60CD889), U64(0x9E17E49642A3E4C1), U64(0xEDB454E7BADC0805), U64(0x50B704CAB602C329), U64(0x4CC317FB9CDDD023), U64(0x66B4835D9EAFEA22), U64(0x219B97E26FFC81BD), U64(0x261E4E4C0A333A9D), U64(0x1FE2CCA76517DB90), U64(0xD7504DFA8816EDBB), U64(0xB9571FA04DC089C8), U64(0x1DDC0325259B27DE), U64(0xCF3F4688801EB9AA), U64(0xF4F5D05C10CAB243), U64(0x38B6525C21A42B0E), U64(0x36F60E2BA4FA6800), U64(0xEB3593803173E0CE), U64(0x9C4CD6257C5A3603), U64(0xAF0C317D32ADAA8A), U64(0x258E5A80C7204C4B), U64(0x8B889D624D44885D), U64(0xF4D14597E660F855), U64(0xD4347F66EC8941C3), U64(0xE699ED85B0DFB40D), U64(0x2472F6207C2D0484), U64(0xC2A1E7B5B459AEB5), U64(0xAB4F6451CC1D45EC), U64(0x63767572AE3D6174), U64(0xA59E0BD101731A28), U64(0x116D0016CB948F09), U64(0x2CF9C8CA052F6E9F), U64(0x0B090A7560A968E3), U64(0xABEEDDB2DDE06FF1), U64(0x58EFC10B06A2068D), U64(0xC6E57A78FBD986E0), U64(0x2EAB8CA63CE802D7), U64(0x14A195640116F336), U64(0x7C0828DD624EC390), U64(0xD74BBE77E6116AC7), U64(0x804456AF10F5FB53), U64(0xEBE9EA2ADF4321C7), U64(0x03219A39EE587A30), U64(0x49787FEF17AF9924), U64(0xA1E9300CD8520548), U64(0x5B45E522E4B1B4EF), U64(0xB49C3B3995091A36), U64(0xD4490AD526F14431), U64(0x12A8F216AF9418C2), U64(0x001F837CC7350524), U64(0x1877B51E57A764D5), U64(0xA2853B80F17F58EE), U64(0x993E1DE72D36D310), U64(0xB3598080CE64A656), U64(0x252F59CF0D9F04BB), U64(0xD23C8E176D113600), U64(0x1BDA0492E7E4586E), U64(0x21E0BD5026C619BF), U64(0x3B097ADAF088F94E), U64(0x8D14DEDB30BE846E), U64(0xF95CFFA23AF5F6F4), U64(0x3871700761B3F743), U64(0xCA672B91E9E4FA16), U64(0x64C8E531BFF53B55), U64(0x241260ED4AD1E87D), U64(0x106C09B972D2E822), U64(0x7FBA195410E5CA30), U64(0x7884D9BC6CB569D8), U64(0x0647DFEDCD894A29), U64(0x63573FF03E224774), U64(0x4FC8E9560F91B123), U64(0x1DB956E450275779), U64(0xB8D91274B9E9D4FB), U64(0xA2EBEE47E2FBFCE1), U64(0xD9F1F30CCD97FB09), U64(0xEFED53D75FD64E6B), U64(0x2E6D02C36017F67F), U64(0xA9AA4D20DB084E9B), U64(0xB64BE8D8B25396C1), U64(0x70CB6AF7C2D5BCF0), U64(0x98F076A4F7A2322E), U64(0xBF84470805E69B5F), U64(0x94C3251F06F90CF3), U64(0x3E003E616A6591E9), U64(0xB925A6CD0421AFF3), U64(0x61BDD1307C66E300), U64(0xBF8D5108E27E0D48), U64(0x240AB57A8B888B20), U64(0xFC87614BAF287E07), U64(0xEF02CDD06FFDB432), U64(0xA1082C0466DF6C0A), U64(0x8215E577001332C8), U64(0xD39BB9C3A48DB6CF), U64(0x2738259634305C14), U64(0x61CF4F94C97DF93D), U64(0x1B6BACA2AE4E125B), U64(0x758F450C88572E0B), U64(0x959F587D507A8359), U64(0xB063E962E045F54D), U64(0x60E8ED72C0DFF5D1), U64(0x7B64978555326F9F), U64(0xFD080D236DA814BA), U64(0x8C90FD9B083F4558), U64(0x106F72FE81E2C590), U64(0x7976033A39F7D952), U64(0xA4EC0132764CA04B), U64(0x733EA705FAE4FA77), U64(0xB4D8F77BC3E56167), U64(0x9E21F4F903B33FD9), U64(0x9D765E419FB69F6D), U64(0xD30C088BA61EA5EF), U64(0x5D94337FBFAF7F5B), U64(0x1A4E4822EB4D7A59), U64(0x6FFE73E81B637FB3), U64(0xDDF957BC36D8B9CA), U64(0x64D0E29EEA8838B3), U64(0x08DD9BDFD96B9F63), U64(0x087E79E5A57D1D13), U64(0xE328E230E3E2B3FB), U64(0x1C2559E30F0946BE), U64(0x720BF5F26F4D2EAA), U64(0xB0774D261CC609DB), U64(0x443F64EC5A371195), U64(0x4112CF68649A260E), U64(0xD813F2FAB7F5C5CA), U64(0x660D3257380841EE), U64(0x59AC2C7873F910A3), U64(0xE846963877671A17), U64(0x93B633ABFA3469F8), U64(0xC0C0F5A60EF4CDCF), U64(0xCAF21ECD4377B28C), U64(0x57277707199B8175), U64(0x506C11B9D90E8B1D), U64(0xD83CC2687A19255F), U64(0x4A29C6465A314CD1), U64(0xED2DF21216235097), U64(0xB5635C95FF7296E2), U64(0x22AF003AB672E811), U64(0x52E762596BF68235), U64(0x9AEBA33AC6ECC6B0), U64(0x944F6DE09134DFB6), U64(0x6C47BEC883A7DE39), U64(0x6AD047C430A12104), U64(0xA5B1CFDBA0AB4067), U64(0x7C45D833AFF07862), U64(0x5092EF950A16DA0B), U64(0x9338E69C052B8E7B), U64(0x455A4B4CFE30E3F5), U64(0x6B02E63195AD0CF8), U64(0x6B17B224BAD6BF27), U64(0xD1E0CCD25BB9C169), U64(0xDE0C89A556B9AE70), U64(0x50065E535A213CF6), U64(0x9C1169FA2777B874), U64(0x78EDEFD694AF1EED), U64(0x6DC93D9526A50E68), U64(0xEE97F453F06791ED), U64(0x32AB0EDB696703D3), U64(0x3A6853C7E70757A7), U64(0x31865CED6120F37D), U64(0x67FEF95D92607890), U64(0x1F2B1D1F15F6DC9C), U64(0xB69E38A8965C6B65), U64(0xAA9119FF184CCCF4), U64(0xF43C732873F24C13), U64(0xFB4A3D794A9A80D2), U64(0x3550C2321FD6109C), U64(0x371F77E76BB8417E), U64(0x6BFA9AAE5EC05779), U64(0xCD04F3FF001A4778), U64(0xE3273522064480CA), U64(0x9F91508BFFCFC14A), U64(0x049A7F41061A9E60), U64(0xFCB6BE43A9F2FE9B), U64(0x08DE8A1C7797DA9B), U64(0x8F9887E6078735A1), U64(0xB5B4071DBFC73A66), U64(0x230E343DFBA08D33), U64(0x43ED7F5A0FAE657D), U64(0x3A88A0FBBCB05C63), U64(0x21874B8B4D2DBC4F), U64(0x1BDEA12E35F6A8C9), U64(0x53C065C6C8E63528), U64(0xE34A1D250E7A8D6B), U64(0xD6B04D3B7651DD7E), U64(0x5E90277E7CB39E2D), U64(0x2C046F22062DC67D), U64(0xB10BB459132D0A26), U64(0x3FA9DDFB67E2F199), U64(0x0E09B88E1914F7AF), U64(0x10E8B35AF3EEAB37), U64(0x9EEDECA8E272B933), U64(0xD4C718BC4AE8AE5F), U64(0x81536D601170FC20), U64(0x91B534F885818A06), U64(0xEC8177F83F900978), U64(0x190E714FADA5156E), U64(0xB592BF39B0364963), U64(0x89C350C893AE7DC1), U64(0xAC042E70F8B383F2), U64(0xB49B52E587A1EE60), U64(0xFB152FE3FF26DA89), U64(0x3E666E6F69AE2C15), U64(0x3B544EBE544C19F9), U64(0xE805A1E290CF2456), U64(0x24B33C9D7ED25117), U64(0xE74733427B72F0C1), U64(0x0A804D18B7097475), U64(0x57E3306D881EDB4F), U64(0x4AE7D6A36EB5DBCB), U64(0x2D8D5432157064C8), U64(0xD1E649DE1E7F268B), U64(0x8A328A1CEDFE552C), U64(0x07A3AEC79624C7DA), U64(0x84547DDC3E203C94), U64(0x990A98FD5071D263), U64(0x1A4FF12616EEFC89), U64(0xF6F7FD1431714200), U64(0x30C05B1BA332F41C), U64(0x8D2636B81555A786), U64(0x46C9FEB55D120902), U64(0xCCEC0A73B49C9921), U64(0x4E9D2827355FC492), U64(0x19EBB029435DCB0F), U64(0x4659D2B743848A2C), U64(0x963EF2C96B33BE31), U64(0x74F85198B05A2E7D), U64(0x5A0F544DD2B1FB18), U64(0x03727073C2E134B1), U64(0xC7F6AA2DE59AEA61), U64(0x352787BAA0D7C22F), U64(0x9853EAB63B5E0B35), U64(0xABBDCDD7ED5C0860), U64(0xCF05DAF5AC8D77B0), U64(0x49CAD48CEBF4A71E), U64(0x7A4C10EC2158C4A6), U64(0xD9E92AA246BF719E), U64(0x13AE978D09FE5557), U64(0x730499AF921549FF), U64(0x4E4B705B92903BA4), U64(0xFF577222C14F0A3A), U64(0x55B6344CF97AAFAE), U64(0xB862225B055B6960), U64(0xCAC09AFBDDD2CDB4), U64(0xDAF8E9829FE96B5F), U64(0xB5FDFC5D3132C498), U64(0x310CB380DB6F7503), U64(0xE87FBB46217A360E), U64(0x2102AE466EBB1148), U64(0xF8549E1A3AA5E00D), U64(0x07A69AFDCC42261A), U64(0xC4C118BFE78FEAAE), U64(0xF9F4892ED96BD438), U64(0x1AF3DBE25D8F45DA), U64(0xF5B4B0B0D2DEEEB4), U64(0x962ACEEFA82E1C84), U64(0x046E3ECAAF453CE9), U64(0xF05D129681949A4C), U64(0x964781CE734B3C84), U64(0x9C2ED44081CE5FBD), U64(0x522E23F3925E319E), U64(0x177E00F9FC32F791), U64(0x2BC60A63A6F3B3F2), U64(0x222BBFAE61725606), U64(0x486289DDCC3D6780), U64(0x7DC7785B8EFDFC80), U64(0x8AF38731C02BA980), U64(0x1FAB64EA29A2DDF7), U64(0xE4D9429322CD065A), U64(0x9DA058C67844F20C), U64(0x24C0E332B70019B0), U64(0x233003B5A6CFE6AD), U64(0xD586BD01C5C217F6), U64(0x5E5637885F29BC2B), U64(0x7EBA726D8C94094B), U64(0x0A56A5F0BFE39272), U64(0xD79476A84EE20D06), U64(0x9E4C1269BAA4BF37), U64(0x17EFEE45B0DEE640), U64(0x1D95B0A5FCF90BC6), U64(0x93CBE0B699C2585D), U64(0x65FA4F227A2B6D79), U64(0xD5F9E858292504D5), U64(0xC2B5A03F71471A6F), U64(0x59300222B4561E00), U64(0xCE2F8642CA0712DC), U64(0x7CA9723FBB2E8988), U64(0x2785338347F2BA08), U64(0xC61BB3A141E50E8C), U64(0x150F361DAB9DEC26), U64(0x9F6A419D382595F4), U64(0x64A53DC924FE7AC9), U64(0x142DE49FFF7A7C3D), U64(0x0C335248857FA9E7), U64(0x0A9C32D5EAE45305), U64(0xE6C42178C4BBB92E), U64(0x71F1CE2490D20B07), U64(0xF1BCC3D275AFE51A), U64(0xE728E8C83C334074), U64(0x96FBF83A12884624), U64(0x81A1549FD6573DA5), U64(0x5FA7867CAF35E149), U64(0x56986E2EF3ED091B), U64(0x917F1DD5F8886C61), U64(0xD20D8C88C8FFE65F), U64(0x31D71DCE64B2C310), U64(0xF165B587DF898190), U64(0xA57E6339DD2CF3A0), U64(0x1EF6E6DBB1961EC9), U64(0x70CC73D90BC26E24), U64(0xE21A6B35DF0C3AD7), U64(0x003A93D8B2806962), U64(0x1C99DED33CB890A1), U64(0xCF3145DE0ADD4289), U64(0xD0E4427A5514FB72), U64(0x77C621CC9FB3A483), U64(0x67A34DAC4356550B), U64(0xF8D626AAAF278509), }; // functions // random_init() void random_init() { if ((Random64[RandomNb-1] >> 32) != 0xF8D626AA) { // upper half of the last element of the array my_fatal("random_init(): broken 64-bit types\n"); } } // random_64() uint64 random_64(int n) { ASSERT(n>=0&&n. */ // random.h #ifndef RANDOM_H #define RANDOM_H // includes #include "util.h" namespace adapter { // constants const int RandomNb = 781; // macros #define RANDOM_64(n) (Random64[(n)]) // "constants" extern const uint64 Random64[RandomNb]; // functions extern void random_init (); extern uint64 random_64 (int n); } // namespace adapter #endif // !defined RANDOM_H // end of random.h gnuchess-6.2.2/src/adapter/san.cpp000644 000766 000024 00000026241 12451350155 017655 0ustar00antoniostaff000000 000000 /* san.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // san.cpp // includes #include #include #include #include #include "attack.h" #include "board.h" #include "list.h" #include "move.h" #include "move_gen.h" #include "move_legal.h" #include "piece.h" #include "san.h" #include "square.h" #include "util.h" namespace adapter { // constants static const bool UseSlowDebug = false; enum ambiguity_t { AMBIGUITY_NONE, AMBIGUITY_FILE, AMBIGUITY_RANK, AMBIGUITY_SQUARE }; // functions static bool san_to_lan (const char san[], const board_t * board, char string[], int size); static int move_from_lan (const char string[], const board_t * board); static int ambiguity (int move, const board_t * board); // move_to_san() bool move_to_san(int move, const board_t * board, char string[], int size) { int from, to, piece; char tmp_string[256]; ASSERT(move_is_ok(move)); ASSERT(board_is_ok(board)); ASSERT(string!=NULL); ASSERT(size>=8); ASSERT(move_is_legal(move,board)); if (size < 8) return false; // init from = move_from(move); to = move_to(move); string[0] = '\0'; // castle if (move_is_castle(move,board)) { if (to > from) { strcat(string,"O-O"); } else { strcat(string,"O-O-O"); } goto check; } // from piece = board->square[from]; if (piece_is_pawn(piece)) { // pawn if (move_is_capture(move,board)) { sprintf(tmp_string,"%c",file_to_char(square_file(from))); strcat(string,tmp_string); } } else { // piece sprintf(tmp_string,"%c",toupper(piece_to_char(piece))); strcat(string,tmp_string); // ambiguity switch (ambiguity(move,board)) { case AMBIGUITY_NONE: break; case AMBIGUITY_FILE: sprintf(tmp_string,"%c",file_to_char(square_file(from))); strcat(string,tmp_string); break; case AMBIGUITY_RANK: sprintf(tmp_string,"%c",rank_to_char(square_rank(from))); strcat(string,tmp_string); break; case AMBIGUITY_SQUARE: if (!square_to_string(from,tmp_string,256)) return false; strcat(string,tmp_string); break; default: ASSERT(false); break; } } // capture if (move_is_capture(move,board)) strcat(string,"x"); // to if (!square_to_string(to,tmp_string,256)) return false; strcat(string,tmp_string); // promote if (move_is_promote(move)) { sprintf(tmp_string,"=%c",toupper(piece_to_char(move_promote(move,board)))); strcat(string,tmp_string); } // check check: if (move_is_mate(move,board)) { strcat(string,"#"); } else if (move_is_check(move,board)) { strcat(string,"+"); } return true; } // move_from_san() int move_from_san(const char string[], const board_t * board) { char s[256]; int move; ASSERT(string!=NULL); ASSERT(board_is_ok(board)); san_to_lan(string,board,s,256); move = move_from_lan(s,board); ASSERT(!UseSlowDebug||move==move_from_san_debug(string,board)); return move; } // move_from_san_debug() int move_from_san_debug(const char string[], const board_t * board) { list_t list[1]; int i, move; char move_string[256]; ASSERT(string!=NULL); ASSERT(board_is_ok(board)); gen_legal_moves(list,board); for (i = 0; i < list_size(list); i++) { move = list_move(list,i); if (!move_to_san(move,board,move_string,256)) ASSERT(false); if (my_string_equal(move_string,string)) return move; } return MoveNone; } // san_to_lan() static bool san_to_lan(const char san[], const board_t * board, char string[], int size) { int len; int left, right; int c; int king, rook; char king_string[3], rook_string[3]; ASSERT(san!=NULL); ASSERT(board_is_ok(board)); ASSERT(string!=NULL); ASSERT(size>=8); // init if (size < 8) return false; strcpy(string,"???????"); len = strlen(san); left = 0; right = len; // skip trailing '+' or '#' if (left < right) { c = san[right-1]; if (c == '+' || c == '#') right--; } // castling ASSERT(left==0); if (false) { } else if (right == 3 && strncmp(san,"O-O",3) == 0) { if (board->castle[board->turn][SideH] == SquareNone) return false; king = king_pos(board,board->turn); rook = board->castle[board->turn][SideH]; square_to_string(king,king_string,3); square_to_string(rook,rook_string,3); sprintf(string,"K%s?%s?",king_string,rook_string); } else if (right == 5 && strncmp(san,"O-O-O",5) == 0) { if (board->castle[board->turn][SideA] == SquareNone) return false; king = king_pos(board,board->turn); rook = board->castle[board->turn][SideA]; square_to_string(king,king_string,3); square_to_string(rook,rook_string,3); sprintf(string,"K%s?%s?",king_string,rook_string); } else { // moved piece if (left < right) { c = san[left]; if (char_is_piece(c)) { string[0] = c; left++; } } // promotion if (left < right) { c = toupper(san[right-1]); if (char_is_piece(c)) { string[6] = c; right--; // skip '=' if (left < right && san[right-1] == '=') right--; } } // to-square rank if (left < right) { c = san[right-1]; if (char_is_rank(c)) { string[5] = c; right--; } } // to-square file if (left < right) { c = san[right-1]; if (char_is_file(c)) { string[4] = c; right--; } } // captured piece if (left < right) { c = san[right-1]; if (char_is_piece(c)) { string[3] = c; right--; } } // skip middle '-' or 'x' if (left < right) { c = san[right-1]; if (c == '-' || c == 'x') right--; } // from-square file if (left < right) { c = san[left]; if (char_is_file(c)) { string[1] = c; left++; } } // from-square rank if (left < right) { c = san[left]; if (char_is_rank(c)) { string[2] = c; left++; } } if (left != right) return false; } // end return true; } // move_from_lan() static int move_from_lan(const char string[], const board_t * board) { int len; int move; int promote; char s[256]; int from, to; int colour; int inc; int piece_char; int n; const uint8 * ptr; int piece; int side; ASSERT(string!=NULL); ASSERT(board_is_ok(board)); // init len = strlen(string); if (len != 7) return MoveNone; move = MoveNone; colour = board->turn; // promote promote = 0; switch (string[6]) { case '?': // not a promotion break; case 'N': promote = MovePromoteKnight; break; case 'B': promote = MovePromoteBishop; break; case 'R': promote = MovePromoteRook; break; case 'Q': promote = MovePromoteQueen; break; default: return MoveNone; break; } // to square s[0] = string[4]; s[1] = string[5]; s[2] = '\0'; to = square_from_string(s); if (to == SquareNone) return MoveNone; // known from square? if (string[1] != '?' && string[2] != '?') { // from square s[0] = string[1]; s[1] = string[2]; s[2] = '\0'; from = square_from_string(s); if (from == SquareNone) return MoveNone; // convert "king slide" castling to KxR if (piece_is_king(board->square[from]) && square_rank(to) == square_rank(from) && abs(to-from) > 1) { side = (to > from) ? SideH : SideA; to = board->castle[colour][side]; if (to == SquareNone) return MoveNone; } // move move = move_make(from,to) | promote; return move; } // pawn non-capture? if (string[0] == '?' && string[1] == '?') { if (board->square[to] != Empty) return MoveNone; // useful? inc = (colour_is_white(colour)) ? +16 : -16; from = to - inc; if (board->square[from] == Empty && square_side_rank(to,colour) == Rank4) { from -= inc; } if (board->square[from] != piece_make_pawn(colour)) { // useful? return MoveNone; } // move move = move_make(from,to) | promote; return move; } // pawn capture? piece_char = string[0]; if (piece_char == '?' && string[1] != '?') { piece_char = 'P'; } // attack loop n = 0; for (ptr = board->list[colour]; (from=*ptr) != SquareNone; ptr++) { piece = board->square[from]; if (toupper(piece_to_char(piece)) == piece_char) { if (piece_attack(board,piece,from,to)) { if (true && (string[1] == '?' || file_to_char(square_file(from)) == string[1]) && (string[2] == '?' || rank_to_char(square_rank(from)) == string[2])) { if (!is_pinned(board,from,to,colour)) { move = move_make(from,to) | promote; n++; } } } } } if (n != 1) move = MoveNone; return move; } // ambiguity() static int ambiguity(int move, const board_t * board) { int from, to, piece; list_t list[1]; int i, n, m; // init from = move_from(move); to = move_to(move); piece = move_piece(move,board); gen_legal_moves(list,board); // no ambiguity? n = 0; for (i = 0; i < list_size(list); i++) { m = list_move(list,i); if (move_piece(m,board) == piece && move_to(m) == to) { n++; } } if (n == 1) return AMBIGUITY_NONE; // file ambiguity? n = 0; for (i = 0; i < list_size(list); i++) { m = list_move(list,i); if (move_piece(m,board) == piece && move_to(m) == to) { if (square_file(move_from(m)) == square_file(from)) n++; } } if (n == 1) return AMBIGUITY_FILE; // rank ambiguity? n = 0; for (i = 0; i < list_size(list); i++) { m = list_move(list,i); if (move_piece(m,board) == piece && move_to(m) == to) { if (square_rank(move_from(m)) == square_rank(from)) n++; } } if (n == 1) return AMBIGUITY_RANK; // square ambiguity return AMBIGUITY_SQUARE; } } // namespace adapter // end of san.cpp gnuchess-6.2.2/src/adapter/san.h000644 000766 000024 00000002246 12451350160 017315 0ustar00antoniostaff000000 000000 /* san.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // san.h #ifndef SAN_H #define SAN_H // includes #include "board.h" #include "util.h" namespace adapter { // functions extern bool move_to_san (int move, const board_t * board, char string[], int size); extern int move_from_san (const char string[], const board_t * board); extern int move_from_san_debug (const char string[], const board_t * board); } // namespace adapter #endif // !defined SAN_H // end of san.h gnuchess-6.2.2/src/adapter/search.cpp000644 000766 000024 00000010414 12451350164 020334 0ustar00antoniostaff000000 000000 /* search.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // search.cpp // includes #include #include #include #include "attack.h" #include "board.h" #include "colour.h" #include "engine.h" #include "fen.h" #include "line.h" #include "list.h" #include "move.h" #include "move_do.h" #include "move_gen.h" #include "move_legal.h" #include "option.h" #include "parse.h" #include "san.h" #include "search.h" #include "uci.h" #include "util.h" namespace adapter { // variables static int Depth; static int BestMove; static int BestValue; static move_t BestPV[LineSize]; static sint64 NodeNb; static sint64 LeafNb; static double Time; static int Move; static int MovePos; static int MoveNb; // prototypes static bool depth_is_ok (int depth); static void perft (const board_t * board, int depth); // functions // depth_is_ok() static bool depth_is_ok(int depth) { return depth >= 0 && depth < DepthMax; } // search() void search(const board_t * board, int depth_max, double time_max) { char string[256]; ASSERT(board_is_ok(board)); ASSERT(depth_max>=1&&depth_max=0.0); // engine Depth = 0; BestMove = MoveNone; BestValue = 0; line_clear(BestPV); NodeNb = 0; LeafNb = 0; Time = 0.0; Move = MoveNone; MovePos = 0; MoveNb = 0; // init uci_send_ucinewgame(Uci); uci_send_isready_sync(Uci); // position if (!board_to_fen(board,string,256)) ASSERT(false); engine_send(Engine,"position fen %s",string); // search engine_send_queue(Engine,"go"); engine_send_queue(Engine," movetime %.0f",time_max*1000.0); engine_send_queue(Engine," depth %d",depth_max); engine_send(Engine,""); // newline // wait for feed-back while (true) { engine_get(Engine,string,256); if (false) { } else if (match(string,"bestmove * ponder *")) { BestMove = move_from_can(Star[0],board); ASSERT(BestMove!=MoveNone&&move_is_legal(BestMove,board)); break; } else if (match(string,"bestmove *")) { BestMove = move_from_can(Star[0],board); ASSERT(BestMove!=MoveNone&&move_is_legal(BestMove,board)); break; } } printf("\n"); } // search_perft() void search_perft(const board_t * board, int depth_max) { int depth; my_timer_t timer[1]; double time, speed; ASSERT(board_is_ok(board)); ASSERT(depth_max>=1&&depth_maxturn))); // init NodeNb++; // leaf if (depth == 0) { LeafNb++; return; } // more init me = board->turn; // move loop gen_moves(list,board); for (i = 0; i < list_size(list); i++) { move = list_move(list,i); board_copy(new_board,board); move_do(new_board,move); if (!is_in_check(new_board,me)) perft(new_board,depth-1); } } } // namespace adapter // end of search.cpp gnuchess-6.2.2/src/adapter/search.h000644 000766 000024 00000002172 12451350170 020000 0ustar00antoniostaff000000 000000 /* search.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // search.h #ifndef SEARCH_H #define SEARCH_H // includes #include "board.h" #include "util.h" namespace adapter { // constants const int DepthMax = 63; // functions extern void search (const board_t * board, int depth_max, double time_max); extern void search_perft (const board_t * board, int depth_max); } // namespace adapter #endif // !defined SEARCH_H // end of search.h gnuchess-6.2.2/src/adapter/square.cpp000644 000766 000024 00000010654 12451350174 020376 0ustar00antoniostaff000000 000000 /* square.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // square.cpp // includes #include "colour.h" #include "square.h" #include "util.h" namespace adapter { // "constants" static const uint8 SquareFrom64[64] = { A1, B1, C1, D1, E1, F1, G1, H1, A2, B2, C2, D2, E2, F2, G2, H2, A3, B3, C3, D3, E3, F3, G3, H3, A4, B4, C4, D4, E4, F4, G4, H4, A5, B5, C5, D5, E5, F5, G5, H5, A6, B6, C6, D6, E6, F6, G6, H6, A7, B7, C7, D7, E7, F7, G7, H7, A8, B8, C8, D8, E8, F8, G8, H8, }; // variables static sint8 SquareTo64[SquareNb]; // functions // square_init() void square_init() { int sq; for (sq = 0; sq < SquareNb; sq++) SquareTo64[sq] = -1; for (sq = 0; sq < 64; sq++) { SquareTo64[SquareFrom64[sq]] = sq; } } // square_is_ok() bool square_is_ok(int square) { if (square < 0 || square >= SquareNb) return false; if (SquareTo64[square] < 0) return false; return true; } // square_make() int square_make(int file, int rank) { int sq_64; ASSERT(file>=0&&file<8); ASSERT(rank>=0&&rank<8); sq_64 = (rank << 3) | file; return square_from_64(sq_64); } // square_file() int square_file(int square) { int file; ASSERT(square_is_ok(square)); file = (square - 4) & 7; ASSERT(file==(square_to_64(square)&7)); return file; } // square_rank() int square_rank(int square) { int rank; ASSERT(square_is_ok(square)); rank = (square >> 4) - 2; ASSERT(rank==square_to_64(square)>>3); return rank; } // square_side_rank() int square_side_rank(int square, int colour) { int rank; ASSERT(square_is_ok(square)); ASSERT(colour_is_ok(colour)); rank = square_rank(square); if (colour_is_black(colour)) rank = 7-rank; return rank; } // square_from_64() int square_from_64(int square) { ASSERT(square>=0&&square<64); return SquareFrom64[square]; } // square_to_64() int square_to_64(int square) { ASSERT(square_is_ok(square)); return SquareTo64[square]; } // square_is_promote() bool square_is_promote(int square) { int rank; ASSERT(square_is_ok(square)); rank = square_rank(square); return rank == Rank1 || rank == Rank8; } // square_ep_dual() int square_ep_dual(int square) { ASSERT(square_is_ok(square)); ASSERT(square_rank(square)>=2&&square_rank(square)<=5); return square ^ 16; } // square_colour() int square_colour(int square) { ASSERT(square_is_ok(square)); return (square ^ (square >> 4)) & 1; } // file_from_char() int file_from_char(int c) { ASSERT(c>='a'&&c<='h'); return c - 'a'; } // rank_from_char() int rank_from_char(int c) { ASSERT(c>='1'&&c<='8'); return c - '1'; } // file_to_char() int file_to_char(int file) { ASSERT(file>=0&&file<8); return 'a' + file; } // rank_to_char() int rank_to_char(int rank) { ASSERT(rank>=0&&rank<8); return '1' + rank; } // char_is_file() bool char_is_file(int c) { return c >= 'a' && c <= 'h'; } // char_is_rank() bool char_is_rank(int c) { return c >= '1' && c <= '8'; } // square_to_string() bool square_to_string(int square, char string[], int size) { ASSERT(square_is_ok(square)); ASSERT(string!=NULL); ASSERT(size>=3); if (size < 3) return false; string[0] = 'a' + square_file(square); string[1] = '1' + square_rank(square); string[2] = '\0'; return true; } // square_from_string() int square_from_string(const char string[]) { int file, rank; ASSERT(string!=NULL); if (string[0] < 'a' || string[0] > 'h') return SquareNone; if (string[1] < '1' || string[1] > '8') return SquareNone; if (string[2] != '\0') return SquareNone; file = file_from_char(string[0]); rank = rank_from_char(string[1]); return square_make(file,rank); } } // namespace adapter // end of square.cpp gnuchess-6.2.2/src/adapter/square.h000644 000766 000024 00000005567 12451350200 020040 0ustar00antoniostaff000000 000000 /* square.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // square.h #ifndef SQUARE_H #define SQUARE_H // includes #include "util.h" namespace adapter { // constants const int SquareNb = 16 * 12; const int FileA = 0; const int FileB = 1; const int FileC = 2; const int FileD = 3; const int FileE = 4; const int FileF = 5; const int FileG = 6; const int FileH = 7; const int Rank1 = 0; const int Rank2 = 1; const int Rank3 = 2; const int Rank4 = 3; const int Rank5 = 4; const int Rank6 = 5; const int Rank7 = 6; const int Rank8 = 7; const int SquareNone = 0; const int A1=0x24, B1=0x25, C1=0x26, D1=0x27, E1=0x28, F1=0x29, G1=0x2A, H1=0x2B; const int A2=0x34, B2=0x35, C2=0x36, D2=0x37, E2=0x38, F2=0x39, G2=0x3A, H2=0x3B; const int A3=0x44, B3=0x45, C3=0x46, D3=0x47, E3=0x48, F3=0x49, G3=0x4A, H3=0x4B; const int A4=0x54, B4=0x55, C4=0x56, D4=0x57, E4=0x58, F4=0x59, G4=0x5A, H4=0x5B; const int A5=0x64, B5=0x65, C5=0x66, D5=0x67, E5=0x68, F5=0x69, G5=0x6A, H5=0x6B; const int A6=0x74, B6=0x75, C6=0x76, D6=0x77, E6=0x78, F6=0x79, G6=0x7A, H6=0x7B; const int A7=0x84, B7=0x85, C7=0x86, D7=0x87, E7=0x88, F7=0x89, G7=0x8A, H7=0x8B; const int A8=0x94, B8=0x95, C8=0x96, D8=0x97, E8=0x98, F8=0x99, G8=0x9A, H8=0x9B; const int Dark = 0; const int Light = 1; // functions extern void square_init (); extern bool square_is_ok (int square); extern int square_make (int file, int rank); extern int square_file (int square); extern int square_rank (int square); extern int square_side_rank (int square, int colour); extern int square_from_64 (int square); extern int square_to_64 (int square); extern bool square_is_promote (int square); extern int square_ep_dual (int square); extern int square_colour (int square); extern bool char_is_file (int c); extern bool char_is_rank (int c); extern int file_from_char (int c); extern int rank_from_char (int c); extern int file_to_char (int file); extern int rank_to_char (int rank); extern bool square_to_string (int square, char string[], int size); extern int square_from_string (const char string[]); } // namespace adapter #endif // !defined SQUARE_H // end of square.h gnuchess-6.2.2/src/adapter/uci.cpp000644 000766 000024 00000045667 12451350203 017663 0ustar00antoniostaff000000 000000 /* uci.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // uci.cpp // includes #include #include #include #include #include "board.h" #include "engine.h" #include "move.h" #include "move_do.h" #include "move_legal.h" #include "option.h" #include "parse.h" #include "line.h" #include "uci.h" #include "util.h" namespace adapter { // constants static const bool UseDebug = false; static const int StringSize = 4096; // variables uci_t Uci[1]; unsigned int HashSize = 0; // prototypes static bool uci_is_ok (const uci_t * uci); static int parse_bestmove (uci_t * uci, const char string[]); static void parse_id (uci_t * uci, const char string[]); static int parse_info (uci_t * uci, const char string[]); static void parse_option (uci_t * uci, const char string[]); static void parse_score (uci_t * uci, const char string[]); static int mate_score (int dist); // functions // uci_is_ok() static bool uci_is_ok(const uci_t * uci) { if (uci == NULL) return false; if (uci->engine == NULL) return false; if (uci->option_nb < 0 || uci->option_nb >= OptionNb) return false; return true; } // uci_open() void uci_open(uci_t * uci, engine_t * engine) { char string[StringSize]; int event; ASSERT(uci!=NULL); ASSERT(engine!=NULL); // init uci->engine = engine; uci->name = NULL; my_string_set(&uci->name,""); uci->author = NULL; my_string_set(&uci->author,""); uci->option_nb = 0; uci->ready_nb = 0; uci->searching = 0; uci->pending_nb = 0; board_start(uci->board); uci_clear(uci); // send "uci" and wait for "uciok" engine_send(uci->engine,"uci"); do { engine_get(uci->engine,string,StringSize); event = uci_parse(uci,string); } while ((event & EVENT_UCI) == 0); } // uci_close() void uci_close(uci_t * uci) { int i; option_t * opt; ASSERT(uci_is_ok(uci)); engine_close(uci->engine); uci->engine = NULL; my_string_clear(&uci->name); my_string_clear(&uci->author); for (i = 0; i < uci->option_nb; i++) { opt = &uci->option[i]; my_string_clear(&opt->name); my_string_clear(&opt->value); } uci->option_nb = 0; } // uci_clear() void uci_clear(uci_t * uci) { ASSERT(uci_is_ok(uci)); ASSERT(!uci->searching); uci->best_move = MoveNone; uci->ponder_move = MoveNone; uci->score = 0; uci->depth = 0; uci->sel_depth = 0; line_clear(uci->pv); uci->best_score = 0; uci->best_depth = 0; uci->best_sel_depth = 0; line_clear(uci->best_pv); uci->node_nb = 0; uci->time = 0.0; uci->speed = 0.0; uci->cpu = 0.0; uci->hash = 0.0; line_clear(uci->current_line); uci->root_move = MoveNone; uci->root_move_pos = 0; uci->root_move_nb = board_mobility(uci->board); } // uci_send_isready() void uci_send_isready(uci_t * uci) { ASSERT(uci!=NULL); engine_send(uci->engine,"isready"); uci->ready_nb++; } // uci_send_isready_sync() void uci_send_isready_sync(uci_t * uci) { char string[StringSize]; int event; ASSERT(uci_is_ok(uci)); // send "isready" and wait for "readyok" uci_send_isready(uci); do { engine_get(uci->engine,string,StringSize); event = uci_parse(uci,string); } while ((event & EVENT_READY) == 0); } // uci_send_stop() void uci_send_stop(uci_t * uci) { ASSERT(uci_is_ok(uci)); ASSERT(uci->searching); ASSERT(uci->pending_nb>=1); engine_send(Engine,"stop"); uci->searching = false; } // uci_send_stop_sync() void uci_send_stop_sync(uci_t * uci) { char string[StringSize]; int event; ASSERT(uci_is_ok(uci)); ASSERT(uci->searching); ASSERT(uci->pending_nb>=1); // send "stop" and wait for "bestmove" uci_send_stop(uci); do { engine_get(uci->engine,string,StringSize); event = uci_parse(uci,string); } while ((event & EVENT_STOP) == 0); } // uci_send_ucinewgame() void uci_send_ucinewgame(uci_t * uci) { ASSERT(uci!=NULL); if (option_get_int("UCIVersion") >= 2) { engine_send(uci->engine,"ucinewgame"); } } // uci_option_exist() bool uci_option_exist(uci_t * uci, const char option[]) { int i; option_t * opt; ASSERT(uci_is_ok(uci)); ASSERT(option!=NULL); // scan options for (i = 0; i < uci->option_nb; i++) { opt = &uci->option[i]; if (my_string_case_equal(opt->name,option)) return true; } return false; } // uci_send_option() void uci_send_option(uci_t * uci, const char option[], const char format[], ...) { va_list arg_list; char value[StringSize]; int i; option_t * opt; ASSERT(uci_is_ok(uci)); ASSERT(option!=NULL); ASSERT(format!=NULL); // format va_start(arg_list,format); vsprintf(value,format,arg_list); va_end(arg_list); if (UseDebug) my_log("POLYGLOT OPTION %s VALUE %s\n",option,value); // scan options for (i = 0; i < uci->option_nb; i++) { opt = &uci->option[i]; if (my_string_case_equal(opt->name,option) && !my_string_equal(opt->value,value)) { engine_send(uci->engine,"setoption name %s value %s",option,value); my_string_set(&opt->value,value); } } } // uci_parse() int uci_parse(uci_t * uci, const char string[]) { int event; parse_t parse[1]; char command[StringSize]; char argument[StringSize]; ASSERT(uci_is_ok(uci)); ASSERT(string!=NULL); // init event = EVENT_NONE; // parse parse_open(parse,string); if (parse_get_word(parse,command,StringSize)) { parse_get_string(parse,argument,StringSize); if (UseDebug) my_log("POLYGLOT COMMAND \"%s\" ARGUMENT \"%s\"\n",command,argument); if (false) { } else if (my_string_equal(command,"bestmove")) { // search end ASSERT(uci->pending_nb>0); if (uci->searching && uci->pending_nb == 1) { // current search uci->searching = false; uci->pending_nb--; event = parse_bestmove(uci,argument); // updates uci->best_move and uci->ponder_move } else { // obsolete search if (uci->pending_nb > 0) { uci->pending_nb--; if (uci->pending_nb == 0) event = EVENT_STOP; } } } else if (my_string_equal(command,"id")) { parse_id(uci,argument); } else if (my_string_equal(command,"info")) { // search information if (uci->searching && uci->pending_nb == 1) { // current search event = parse_info(uci,argument); } } else if (my_string_equal(command,"option")) { parse_option(uci,argument); } else if (my_string_equal(command,"readyok")) { // engine is ready ASSERT(uci->ready_nb>0); if (uci->ready_nb > 0) { uci->ready_nb--; if (uci->ready_nb == 0) event = EVENT_READY; } } else if (my_string_equal(command,"uciok")) { event = EVENT_UCI; } else { if (UseDebug) my_log("POLYGLOT unknown command \"%s\"\n",command); } } parse_close(parse); return event; } // parse_bestmove() static int parse_bestmove(uci_t * uci, const char string[]) { parse_t parse[1]; char command[StringSize]; char option[StringSize]; char argument[StringSize]; board_t board[1]; ASSERT(uci_is_ok(uci)); ASSERT(string!=NULL); // init strcpy(command,"bestmove"); parse_open(parse,string); parse_add_keyword(parse,"ponder"); // bestmove if (!parse_get_string(parse,argument,StringSize)) { my_fatal("parse_bestmove(): missing argument\n"); } uci->best_move = move_from_can(argument,uci->board); if (uci->best_move == MoveNone) my_fatal("parse_bestmove(): not a move \"%s\"\n",argument); ASSERT(uci->best_move!=MoveNone); ASSERT(move_is_legal(uci->best_move,uci->board)); // loop while (parse_get_word(parse,option,StringSize)) { parse_get_string(parse,argument,StringSize); if (UseDebug) my_log("POLYGLOT COMMAND \"%s\" OPTION \"%s\" ARGUMENT \"%s\"\n",command,option,argument); if (false) { } else if (my_string_equal(option,"ponder")) { ASSERT(!my_string_empty(argument)); board_copy(board,uci->board); move_do(board,uci->best_move); uci->ponder_move = move_from_can(argument,board); // if (uci->ponder_move == MoveNone) my_fatal("parse_bestmove(): not a move \"%s\"\n",argument); ASSERT(uci->ponder_move!=MoveNone); ASSERT(move_is_legal(uci->ponder_move,board)); } else { my_log("POLYGLOT unknown option \"%s\" for command \"%s\"\n",option,command); } } parse_close(parse); return EVENT_MOVE; } // parse_id() static void parse_id(uci_t * uci, const char string[]) { parse_t parse[1]; char command[StringSize]; char option[StringSize]; char argument[StringSize]; ASSERT(uci!=NULL); ASSERT(string!=NULL); // init strcpy(command,"id"); parse_open(parse,string); parse_add_keyword(parse,"author"); parse_add_keyword(parse,"name"); // loop while (parse_get_word(parse,option,StringSize)) { parse_get_string(parse,argument,StringSize); if (UseDebug) my_log("POLYGLOT COMMAND \"%s\" OPTION \"%s\" ARGUMENT \"%s\"\n",command,option,argument); if (false) { } else if (my_string_equal(option,"author")) { ASSERT(!my_string_empty(argument)); my_string_set(&uci->author,argument); } else if (my_string_equal(option,"name")) { ASSERT(!my_string_empty(argument)); my_string_set(&uci->name,argument); } else { my_log("POLYGLOT unknown option \"%s\" for command \"%s\"\n",option,command); } } parse_close(parse); if (UseDebug) my_log("POLYGLOT engine name \"%s\" author \"%s\"\n",uci->name,uci->author); } // parse_info() static int parse_info(uci_t * uci, const char string[]) { int event; parse_t parse[1]; char command[StringSize]; char option[StringSize]; char argument[StringSize]; int n; sint64 ln; ASSERT(uci_is_ok(uci)); ASSERT(string!=NULL); // init event = EVENT_NONE; strcpy(command,"info"); parse_open(parse,string); parse_add_keyword(parse,"cpuload"); parse_add_keyword(parse,"currline"); parse_add_keyword(parse,"currmove"); parse_add_keyword(parse,"currmovenumber"); parse_add_keyword(parse,"depth"); parse_add_keyword(parse,"hashfull"); parse_add_keyword(parse,"multipv"); parse_add_keyword(parse,"nodes"); parse_add_keyword(parse,"nps"); parse_add_keyword(parse,"pv"); parse_add_keyword(parse,"refutation"); parse_add_keyword(parse,"score"); parse_add_keyword(parse,"seldepth"); parse_add_keyword(parse,"string"); parse_add_keyword(parse,"tbhits"); parse_add_keyword(parse,"time"); // loop while (parse_get_word(parse,option,StringSize)) { parse_get_string(parse,argument,StringSize); if (UseDebug) my_log("POLYGLOT COMMAND \"%s\" OPTION \"%s\" ARGUMENT \"%s\"\n",command,option,argument); if (false) { } else if (my_string_equal(option,"cpuload")) { ASSERT(!my_string_empty(argument)); n = atoi(argument); ASSERT(n>=0); if (n >= 0) uci->cpu = double(n) / 1000.0; } else if (my_string_equal(option,"currline")) { ASSERT(!my_string_empty(argument)); line_from_can(uci->current_line,uci->board,argument,LineSize); } else if (my_string_equal(option,"currmove")) { ASSERT(!my_string_empty(argument)); uci->root_move = move_from_can(argument,uci->board); ASSERT(uci->root_move!=MoveNone); } else if (my_string_equal(option,"currmovenumber")) { ASSERT(!my_string_empty(argument)); n = atoi(argument); ASSERT(n>=1&&n<=uci->root_move_nb); if (n >= 1 && n <= uci->root_move_nb) { uci->root_move_pos = n - 1; ASSERT(uci->root_move_pos>=0&&uci->root_move_posroot_move_nb); } } else if (my_string_equal(option,"depth")) { ASSERT(!my_string_empty(argument)); n = atoi(argument); ASSERT(n>=1); if (n >= 0) { if (n > uci->depth) event |= EVENT_DEPTH; uci->depth = n; } } else if (my_string_equal(option,"hashfull")) { ASSERT(!my_string_empty(argument)); n = atoi(argument); ASSERT(n>=0); if (n >= 0) uci->hash = double(n) / 1000.0; } else if (my_string_equal(option,"multipv")) { ASSERT(!my_string_empty(argument)); n = atoi(argument); ASSERT(n>=1); } else if (my_string_equal(option,"nodes")) { ASSERT(!my_string_empty(argument)); ln = my_atoll(argument); ASSERT(ln>=0); if (ln >= 0) uci->node_nb = ln; } else if (my_string_equal(option,"nps")) { ASSERT(!my_string_empty(argument)); n = atoi(argument); ASSERT(n>=0); if (n >= 0) uci->speed = double(n); } else if (my_string_equal(option,"pv")) { ASSERT(!my_string_empty(argument)); line_from_can(uci->pv,uci->board,argument,LineSize); event |= EVENT_PV; } else if (my_string_equal(option,"refutation")) { ASSERT(!my_string_empty(argument)); line_from_can(uci->pv,uci->board,argument,LineSize); } else if (my_string_equal(option,"score")) { ASSERT(!my_string_empty(argument)); parse_score(uci,argument); } else if (my_string_equal(option,"seldepth")) { ASSERT(!my_string_empty(argument)); n = atoi(argument); ASSERT(n>=0); if (n >= 0) uci->sel_depth = n; } else if (my_string_equal(option,"string")) { // TODO: argument to EOS ASSERT(!my_string_empty(argument)); } else if (my_string_equal(option,"tbhits")) { ASSERT(!my_string_empty(argument)); ln = my_atoll(argument); ASSERT(ln>=0); } else if (my_string_equal(option,"time")) { ASSERT(!my_string_empty(argument)); n = atoi(argument); ASSERT(n>=0); if (n >= 0) uci->time = double(n) / 1000.0; } else { my_log("POLYGLOT unknown option \"%s\" for command \"%s\"\n",option,command); } } parse_close(parse); // update display if ((event & EVENT_PV) != 0) { uci->best_score = uci->score; uci->best_depth = uci->depth; uci->best_sel_depth = uci->sel_depth; line_copy(uci->best_pv,uci->pv); } return event; } // parse_option() static void parse_option(uci_t * uci, const char string[]) { option_t * opt; parse_t parse[1]; char command[StringSize]; char option[StringSize]; char argument[StringSize]; ASSERT(uci!=NULL); ASSERT(string!=NULL); // init strcpy(command,"option"); if (uci->option_nb >= OptionNb) return; opt = &uci->option[uci->option_nb]; uci->option_nb++; opt->name = NULL; my_string_set(&opt->name,""); opt->value = NULL; my_string_set(&opt->value,""); parse_open(parse,string); parse_add_keyword(parse,"default"); parse_add_keyword(parse,"max"); parse_add_keyword(parse,"min"); parse_add_keyword(parse,"name"); parse_add_keyword(parse,"type"); parse_add_keyword(parse,"var"); // loop while (parse_get_word(parse,option,StringSize)) { parse_get_string(parse,argument,StringSize); if (UseDebug) my_log("POLYGLOT COMMAND \"%s\" OPTION \"%s\" ARGUMENT \"%s\"\n",command,option,argument); if (false) { } else if (my_string_equal(option,"default")) { // ASSERT(!my_string_empty(argument)); // HACK for Pepito if (!my_string_empty(argument)) { my_string_set(&opt->value,argument); } if ( strcmp(opt->name,"Hash") == 0 ) { sscanf( opt->value, "%d", &HashSize ); } } else if (my_string_equal(option,"max")) { ASSERT(!my_string_empty(argument)); } else if (my_string_equal(option,"min")) { ASSERT(!my_string_empty(argument)); } else if (my_string_equal(option,"name")) { ASSERT(!my_string_empty(argument)); if (!my_string_empty(argument)) { my_string_set(&opt->name,argument); } } else if (my_string_equal(option,"type")) { ASSERT(!my_string_empty(argument)); } else if (my_string_equal(option,"var")) { ASSERT(!my_string_empty(argument)); } else { my_log("POLYGLOT unknown option \"%s\" for command \"%s\"\n",option,command); } } parse_close(parse); if (UseDebug) my_log("POLYGLOT option name \"%s\" value \"%s\"\n",opt->name,opt->value); } // parse_score() static void parse_score(uci_t * uci, const char string[]) { parse_t parse[1]; char command[StringSize]; char option[StringSize]; char argument[StringSize]; int n; ASSERT(uci_is_ok(uci)); ASSERT(string!=NULL); // init strcpy(command,"score"); parse_open(parse,string); parse_add_keyword(parse,"cp"); parse_add_keyword(parse,"lowerbound"); parse_add_keyword(parse,"mate"); parse_add_keyword(parse,"upperbound"); // loop while (parse_get_word(parse,option,StringSize)) { parse_get_string(parse,argument,StringSize); if (UseDebug) my_log("POLYGLOT COMMAND \"%s\" OPTION \"%s\" ARGUMENT \"%s\"\n",command,option,argument); if (false) { } else if (my_string_equal(option,"cp")) { ASSERT(!my_string_empty(argument)); n = atoi(argument); uci->score = n; } else if (my_string_equal(option,"lowerbound")) { ASSERT(my_string_empty(argument)); } else if (my_string_equal(option,"mate")) { ASSERT(!my_string_empty(argument)); n = atoi(argument); ASSERT(n!=0); uci->score = mate_score(n); } else if (my_string_equal(option,"upperbound")) { ASSERT(my_string_empty(argument)); } else { my_log("POLYGLOT unknown option \"%s\" for command \"%s\"\n",option,command); } } parse_close(parse); } // mate_score() static int mate_score(int dist) { ASSERT(dist!=0); if (false) { } else if (dist > 0) { return +option_get_int("MateScore") - (+dist) * 2 + 1; } else if (dist < 0) { return -option_get_int("MateScore") + (-dist) * 2; } return 0; } } // namespace adapter // end of uci.cpp gnuchess-6.2.2/src/adapter/uci.h000644 000766 000024 00000005061 12451350206 017313 0ustar00antoniostaff000000 000000 /* uci.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // uci.h #ifndef UCI_H #define UCI_H // includes #include "board.h" #include "engine.h" #include "line.h" #include "move.h" #include "util.h" namespace adapter { // constants const int OptionNb = 256; // types struct option_t { const char * name; const char * value; }; struct uci_t { engine_t * engine; const char * name; const char * author; int option_nb; option_t option[OptionNb]; bool ready; int ready_nb; bool searching; int pending_nb; board_t board[1]; int best_move; int ponder_move; int score; int depth; int sel_depth; move_t pv[LineSize]; int best_score; int best_depth; int best_sel_depth; move_t best_pv[LineSize]; sint64 node_nb; double time; double speed; double cpu; double hash; move_t current_line[LineSize]; int root_move; int root_move_pos; int root_move_nb; }; enum dummy_event_t { EVENT_NONE = 0, EVENT_UCI = 1 << 0, EVENT_READY = 1 << 1, EVENT_STOP = 1 << 2, EVENT_MOVE = 1 << 3, EVENT_PV = 1 << 4, EVENT_DEPTH = 1 << 5 }; // variables extern uci_t Uci[1]; // functions extern void uci_open (uci_t * uci, engine_t * engine); extern void uci_close (uci_t * uci); extern void uci_clear (uci_t * uci); extern void uci_send_isready (uci_t * uci); extern void uci_send_isready_sync (uci_t * uci); extern void uci_send_stop (uci_t * uci); extern void uci_send_stop_sync (uci_t * uci); extern void uci_send_ucinewgame (uci_t * uci); extern bool uci_option_exist (uci_t * uci, const char option[]); extern void uci_send_option (uci_t * uci, const char option[], const char format[], ...); extern int uci_parse (uci_t * uci, const char string[]); } // namespace adapter #endif // !defined UCI_H // end of uci.h gnuchess-6.2.2/src/adapter/util.cpp000644 000766 000024 00000016143 12575116513 020056 0ustar00antoniostaff000000 000000 /* util.cpp GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // util.cpp // includes #include #include #include #include #include #include #include #include #include "main.h" #include "posix.h" #include "util.h" #include "configmake.h" namespace adapter { // constant variables const int MaxFileNameSize = 256; // variables static bool Error; static FILE * LogFile; // functions // util_init() void util_init() { Error = false; // init log file LogFile = NULL; // switch file buffering off setbuf(stdin,NULL); setbuf(stdout,NULL); } // my_random_init() void my_random_init() { srand(time(NULL)); } // my_random_int() int my_random_int(int n) { int r; ASSERT(n>0); r = int(floor(my_random_double()*double(n))); ASSERT(r>=0&&r=0.0&&r<1.0); return r; } // my_atoll() sint64 my_atoll(const char string[]) { sint64 n; sscanf(string,S64_FORMAT,&n); return n; } // my_round() int my_round(double x) { return int(floor(x+0.5)); } // my_malloc() void * my_malloc(int size) { void * address; ASSERT(size>0); address = malloc(size); if (address == NULL) my_fatal("my_malloc(): malloc(): %s\n",strerror(errno)); return address; } // my_realloc() void * my_realloc(void * address, int size) { ASSERT(address!=NULL); ASSERT(size>0); address = realloc(address,size); if (address == NULL) my_fatal("my_realloc(): realloc(): %s\n",strerror(errno)); return address; } // my_free() void my_free(void * address) { ASSERT(address!=NULL); free(address); } // my_log_open() void my_log_open(const char file_name[]) { ASSERT(file_name!=NULL); LogFile = fopen(file_name,"a"); if (LogFile != NULL) setvbuf(LogFile,NULL,_IOLBF,0); // line buffering } // my_log_close() void my_log_close() { if (LogFile != NULL) fclose(LogFile); } // my_log() void my_log(const char format[], ...) { va_list ap; ASSERT(format!=NULL); if (LogFile != NULL) { va_start(ap,format); vfprintf(LogFile,format,ap); va_end(ap); } } // my_fatal() void my_fatal(const char format[], ...) { va_list ap; ASSERT(format!=NULL); va_start(ap,format); vfprintf(stderr,format,ap); if (LogFile != NULL) vfprintf(LogFile,format,ap); va_end(ap); if (Error) { // recursive error my_log("POLYGLOT *** RECURSIVE ERROR ***\n"); exit(EXIT_FAILURE); // abort(); } else { Error = true; quit(); } } // my_file_read_line() bool my_file_read_line(FILE * file, char string[], int size) { int src, dst; int c; ASSERT(file!=NULL); ASSERT(string!=NULL); ASSERT(size>0); if (fgets(string,size,file) == NULL) { if (feof(file)) { return false; } else { // error my_fatal("my_file_read_line(): fgets(): %s\n",strerror(errno)); } } // remove CRs and LFs src = 0; dst = 0; while ((c=string[src++]) != '\0') { if (c != '\r' && c != '\n') string[dst++] = c; } string[dst] = '\0'; return true; } // my_string_empty() bool my_string_empty(const char string[]) { return string == NULL || string[0] == '\0'; } // my_string_equal() bool my_string_equal(const char string_1[], const char string_2[]) { ASSERT(string_1!=NULL); ASSERT(string_2!=NULL); return strcmp(string_1,string_2) == 0; } // my_string_case_equal() bool my_string_case_equal(const char string_1[], const char string_2[]) { int c1, c2; ASSERT(string_1!=NULL); ASSERT(string_2!=NULL); while (true) { c1 = *string_1++; c2 = *string_2++; if (tolower(c1) != tolower(c2)) return false; if (c1 == '\0') return true; } return false; } // my_strdup() char * my_strdup(const char string[]) { char * address; ASSERT(string!=NULL); // strdup() is not ANSI C address = (char *) my_malloc(strlen(string)+1); strcpy(address,string); return address; } // my_string_clear() void my_string_clear(const char * * variable) { ASSERT(variable!=NULL); if (*variable != NULL) { my_free((void*)(*variable)); *variable = NULL; } } // my_string_set() void my_string_set(const char * * variable, const char string[]) { ASSERT(variable!=NULL); ASSERT(string!=NULL); if (*variable != NULL) my_free((void*)(*variable)); *variable = my_strdup(string); } // my_timer_reset() void my_timer_reset(my_timer_t * timer) { ASSERT(timer!=NULL); timer->start_real = 0.0; timer->start_cpu = 0.0; timer->elapsed_real = 0.0; timer->elapsed_cpu = 0.0; timer->running = false; } // my_timer_start() void my_timer_start(my_timer_t * timer) { ASSERT(timer!=NULL); ASSERT(timer->start_real==0.0); ASSERT(timer->start_cpu==0.0); ASSERT(!timer->running); timer->running = true; timer->start_real = now_real(); timer->start_cpu = now_cpu(); } // my_timer_stop() void my_timer_stop(my_timer_t * timer) { ASSERT(timer!=NULL); ASSERT(timer->running); timer->elapsed_real += now_real() - timer->start_real; timer->elapsed_cpu += now_cpu() - timer->start_cpu; timer->start_real = 0.0; timer->start_cpu = 0.0; timer->running = false; } // my_timer_elapsed_real() double my_timer_elapsed_real(const my_timer_t * timer) { double elapsed; ASSERT(timer!=NULL); elapsed = timer->elapsed_real; if (timer->running) elapsed += now_real() - timer->start_real; if (elapsed < 0.0) elapsed = 0.0; return elapsed; } // my_timer_elapsed_cpu() double my_timer_elapsed_cpu(const my_timer_t * timer) { double elapsed; ASSERT(timer!=NULL); elapsed = timer->elapsed_cpu; if (timer->running) elapsed += now_cpu() - timer->start_cpu; if (elapsed < 0.0) elapsed = 0.0; return elapsed; } // my_timer_cpu_usage() double my_timer_cpu_usage(const my_timer_t * timer) { double real, cpu; double usage; ASSERT(timer!=NULL); real = my_timer_elapsed_real(timer); cpu = my_timer_elapsed_cpu(timer); if (real <= 0.0 || cpu <= 0.0) return 0.0; usage = cpu / real; if (usage >= 1.0) usage = 1.0; return usage; } // compute_pkgdatadir() char const * compute_pkgdatadir () { char const *pkgdatadir = getenv ("GNUCHESS_PKGDATADIR"); return pkgdatadir ? pkgdatadir : PKGDATADIR; } } // namespace adapter // end of util.cpp gnuchess-6.2.2/src/adapter/util.h000644 000766 000024 00000007171 12451350215 017514 0ustar00antoniostaff000000 000000 /* util.h GNU Chess protocol adapter Copyright (C) 2001-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ // util.h #ifndef UTIL_H #define UTIL_H // includes #include // constants #undef FALSE #define FALSE 0 #undef TRUE #define TRUE 1 #ifdef DEBUG # undef DEBUG # define DEBUG TRUE #else # define DEBUG FALSE #endif #ifdef _MSC_VER # define S64_FORMAT "%I64d" # define U64_FORMAT "%016I64X" #else # define S64_FORMAT "%lld" # define U64_FORMAT "%016llX" #endif // macros #ifdef _MSC_VER # define S64(u) (u##i64) # define U64(u) (u##ui64) #else # define S64(u) (u##LL) # define U64(u) (u##ULL) #endif #undef ASSERT #if DEBUG # define ASSERT(a) { if (!(a)) my_fatal("file \"%s\", line %d, assertion \"" #a "\" failed\n",__FILE__,__LINE__); } #else # define ASSERT(a) #endif namespace adapter { // constant variables extern const int MaxFileNameSize; // types typedef signed char sint8; typedef unsigned char uint8; typedef signed short sint16; typedef unsigned short uint16; typedef signed int sint32; typedef unsigned int uint32; #ifdef _MSC_VER typedef signed __int64 sint64; typedef unsigned __int64 uint64; #else typedef signed long long int sint64; typedef unsigned long long int uint64; #endif struct my_timer_t { double start_real; double start_cpu; double elapsed_real; double elapsed_cpu; bool running; }; // functions extern void util_init (); extern void my_random_init (); extern int my_random_int (int n); extern double my_random_double (); extern sint64 my_atoll (const char string[]); extern int my_round (double x); extern void * my_malloc (int size); extern void * my_realloc (void * address, int size); extern void my_free (void * address); extern void my_log_open (const char file_name[]); extern void my_log_close (); extern void my_log (const char format[], ...); extern void my_fatal (const char format[], ...); extern bool my_file_read_line (FILE * file, char string[], int size); extern bool my_string_empty (const char string[]); extern bool my_string_equal (const char string_1[], const char string_2[]); extern bool my_string_case_equal (const char string_1[], const char string_2[]); extern char * my_strdup (const char string[]); extern void my_string_clear (const char * * variable); extern void my_string_set (const char * * variable, const char string[]); extern void my_timer_reset (my_timer_t * timer); extern void my_timer_start (my_timer_t * timer); extern void my_timer_stop (my_timer_t * timer); extern double my_timer_elapsed_real (const my_timer_t * timer); extern double my_timer_elapsed_cpu (const my_timer_t * timer); extern double my_timer_cpu_usage (const my_timer_t * timer); extern char const * compute_pkgdatadir (); } // namespace adapter #endif // !defined UTIL_H // end of util.h gnuchess-6.2.2/po/boldquot.sed000644 000766 000024 00000000331 12205632536 017120 0ustar00antoniostaff000000 000000 s/"\([^"]*\)"/“\1â€/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“â€/""/g s/“/“/g s/â€/â€/g s/‘/‘/g s/’/’/g gnuchess-6.2.2/po/ChangeLog000644 000766 000024 00000000736 12205632536 016355 0ustar00antoniostaff000000 000000 2013-08-23 gettextize * Makefile.in.in: New file, from gettext-0.18.3. * Rules-quot: New file, from gettext-0.18.3. * boldquot.sed: New file, from gettext-0.18.3. * en@boldquot.header: New file, from gettext-0.18.3. * en@quot.header: New file, from gettext-0.18.3. * insert-header.sin: New file, from gettext-0.18.3. * quot.sed: New file, from gettext-0.18.3. * remove-potcdate.sin: New file, from gettext-0.18.3. * POTFILES.in: New file. gnuchess-6.2.2/po/de.gmo000644 000766 000024 00000032031 12610434564 015671 0ustar00antoniostaff000000 000000 Þ•kt•Ì ! # CC M‡ (Õ /þ '. 7V JŽ 9Ù ) &= #d &ˆ $¯ 2Ô  '& +N )z F¤ ‘ë 6} g´ (&E[l(È>ñ0F\9p/ª/Ú8 C"c†òž‘-’!À#â)#0FT%›Á&Ý-#2$V<{>¸÷%"8"[#~¢/³,ã-6>/u-¥+Ó,ÿ.,["t —¸Óíþ.E6Y£2µèø% 2Ec€œ° ÆÐ)é 58$n“>«ê%ð,CÑH!{>gº3"5V/Œ=¼oú=j,¨@Õ) D@ *… I° "ú 7!LU!F¢!Vé!¶@":÷"y2#/¬#4Ü#v$'ˆ$6°$ç$%%;0%$l%E‘%4×%' &'4&$\&& ˆ'0©(.Ú(( )92)&l)V“)1ê),*2I*2|*3¯*/ã*M+Na+"°+3Ó+7,0?,6p,§,:¾,7ù,81-Aj-:¬-8ç-6 .7W.E.#Õ.7ù./1/"a/ „/¥/¿/*×/00@00q0‰07ž0Ö0ì091/<1#l1 1±1Ð1æ1 2 2„"2§2!¸2@Ú2)3E3H_3¨31®33à34"G/&R g1PN%DE 3M`Bb!+ja_eH68C]2>-fSQTZ^#)Y$'  ;:=AJ\@4cW0dFI,K(U7 i<k*VLX95?h.O[ --silent same as -q -M size, --memory=size specify memory usage in MB for hashtable -a filename, --addbook=filename compile book.bin from pgn book 'filename' -g, --graphic enable graphic mode -h, --help display this help and exit -m, --manual enable manual mode -q, --quiet make the program silent on startup -u, --uci enable UCI protocol (externally behave as UCI engine) -v, --version display version information and exit -x, --xboard start in engine mode Advances one move in pgn loaded game. Backs up one move in game history. Backs up one move in pgn loaded game. Backs up two moves in game history. Disables graphic mode and display classical view. Displays command line syntax. Enables display board in graphic mode. Goes to begin position of pgn loaded game. Goes to end position of pgn loaded game. In analysis mode this stops analysis, otherwise it quits the program. Lets you input your name. Also writes the log.nnn and corresponding game.nnn files. For details please see the auxiliary file format sections. Loads a position in EPD format from disk into memory. Loads the game in the file into memory, and enables the commands 'first', 'last', 'next', 'previous'. Loads the game in the file into memory. Mostly used by Internet Chess Server. Options xboard and post are accepted without leading dashes for backward compatibility. Prints out the version of this program. Produces a help blurb corresponding to this list of commands. Program plays black. Program plays white. Quits the program. Saves game position into EPD format from memory to disk. Saves the game so far from memory to the file. Sets the hash table to permit storage of N MB. Sets up a new game (i.e. pieces in original positions). Shows moves from opening book. Solves the positions in FILENAME. Switches side to move. The file 'gnuchess.ini' allows setting config options. See 'info gnuchess' for details. The file will be looked up in the current directory or, if not found there, in the directory pointed to by environment variable GNUCHESS_PKGDATADIR. This command reactivates a game that has been terminated automatically due to checkmate or no more time on the clock. However, it does not alter those conditions. So you would have to undo a move or two, or add time to the clock with 'level' or 'time'. add - compiles book.bin from a pgn book file best - plays best move from book board - displays the current board evalspeed - tests speed of the evaluator game - shows moves in game history movelist - reads in an epd file and shows legal moves for its entries off - disables the memory hash table off - disables use of book off - disables use of xboard/winboard off - disables using the null-move heuristic on - enables use of book (default) on - enables use of xboard/winboard on - enables using the memory hash table to speed up search on - enables using the null-move heuristic to speed up search pin - shows pinned pieces prefer - same as 'book on' (default) random - plays any move from book time - displays the time settings worst - plays worst move from bookBoard is wrong! Command 'activate' is currently not supported. Command 'black' is currently not supported. Command 'random' is currently not supported. Command 'show eval/score' is currently not supported. Command 'show pin' is currently not supported. Command 'switch' is currently not supported. Command 'test' is currently not supported. Command 'white' is currently not supported. Could not create logfile, all slots occupied. Error reading file '%s' Failed to open %s for writing: %s Fischer increment of %d seconds Graphic mode is disabled. Graphic mode is enabled. Hashing is off. Hashing is on. Help for command %s not found Incorrect book option Incorrect epd file Initial position reached. There are no earlier moves. Invalid filename. Invalid move: %s List of commands: (help COMMAND to get more help) My rating = %d New TimeLimit = %g No more moves. Game reached the end. No moves to undo! No. of moves generated = %ld Null-move heuristic is off. Null-move heuristic is on. Old TimeLimit = %g Opponent rating = %d Options: Play the game of chess Report bugs to . Save to %s Search to a depth of %d The syntax to add a new book is: book add file.pgn Time Control: %d moves in %.2f secs Usage: %s [OPTION]... You may consider deleting or renaming your existing logfiles. movesmy rating = %d, opponent rating = %d name - list known players alphabetically timeProject-Id-Version: gnuchess 6.1.1 Report-Msgid-Bugs-To: bug-gnu-chess@gnu.org POT-Creation-Date: 2015-10-17 14:05+0200 PO-Revision-Date: 2014-03-30 18:01+0100 Last-Translator: Mario Blättermann Language-Team: German Language: de MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); X-Generator: Poedit 1.5.4 --silent genau wie -q -M size, --memory=Größe gibt die für die Hash-Tabelle zu nutzende Speichergröße in MB an. -a Dateiname, --addbook=Dateiname erstellt book.bin aus einer pgn-Buchdatei -g, --graphic aktiviert den grafischen Modus -h, --help diese Hilfe anzeigen und beenden -m, --manual manuellen Modus aktivieren -q, --quiet unterdrückt Programmausgaben beim Start -u, --uci aktiviert das UCI-Protokoll (verhält sich extern wie eine UCI-Engine) -v, --version Versionsinformation anzeigen und beenden -x, --xboard im Engine-Modus starten Geht in der aus einer pgn-Datei geladenen Partie einen Zug vor. Geht im Partieverlauf einen Zug zurück. Geht in der aus einer pgn-Datei geladenen Partie einen Zug zurück. Geht im Partieverlauf zwei Züge zurück. Deaktiviert den grafischen Modus und wechselt in die klassische Ansicht. Zeigt die Befehlszeilensyntax an. Aktiviert die Anzeige des Brettes im grafischen Modus. Geht in der aus einer pgn-Datei geladenen Partie zur Grundstellung zurück. Geht in der aus einer pgn-Datei geladenen Partie zur Endstellung vor. Im Analysemodus wird dadurch die Analyse gestoppt, anderenfalls das Programm beendet. Ermöglicht Ihnen die Eingabe Ihres Namens. Außerdem werden die Dateien log.nnn und die zugehörige game.nnn erstellt. Details finden Sie in den Abschnitten zu den Dateiformaten. Lädt eine Stellung im EPD-Format von einem Datenträger. Lädt das Spiel aus der Datei in den Speicher und aktiviert die Befehle »first«, »last«, »next« und »previous«. Lädt das Spiel aus der Datei in den Speicher. Wird meist vom »Internet Chess Server« verwendet. Die Optionen »xboard« und »post« werden zwecks Abwärtskompatibilität ohne führende Minuszeichen akzeptiert. Gibt die Version dieses Programms aus. Erzeugt eine Hilfemeldung anhand dieser Befehlsliste. Programm spielt Schwarz. Programm spielt Weiß. Beendet das Programm. Speichert die Spielposition im EPD auf einem Datenträger. Speichert das Spiel in einer Datei. Legt für die Hash-Tabelle einen festen Speicherplatz von N MB fest. Startet ein neues Spiel (Figuren in Grundstellung).Zeigt Züge aus dem Eröffnungsbuch an. Speichert die Positionen in DATEINAME. Wechselt die Seite, die am Zug ist. Die Datei »gnuchess.ini« ermöglicht die Angabe von Konfigurations- optionen. Siehen »info gnuchess« für Details. Nach der Datei wird im aktuellen Verzeichnis oder in dem durch die Umgebungsvariable GNUCHESS_PKGDATADIR angegebenen Verzeichnis gesucht. Dieser Befehl reaktiviert ein Spiel, das wegen Schachmatt oder wegen Zeitüberschreitung automatisch beendet wurde. Die Spielbedingungen werden dabei nicht geändert. Daher werden Sie einen oder zwei Züge zurücknehmen oder mit »level« oder »time« Bedenkzeit hinzufügen müssen. add - erstellt book.bin aus einer pgn-Buchdatei best - führt den besten Zug aus dem Buch aus board - zeigt das aktuelle Spielfeld an evalspeed - testet die Geschwindigkeit der Zugberechnung game - zeigt Züge im Spielverlauf an movelist - liest eine epd-Datei ein und zeigt mögliche Züge für deren Einträge an off - deaktiviert die Hash-Tabelle des Speichers off - deaktiviert die Verwendung des Buches off - deaktiviert die Nutzung von xboard/winboard off - deaktiviert die heuristische Null-Zug-Suche on - aktiviert die Verwendung des Buches (Vorgabe) on - aktiviert die Nutzung von xboard/winboard on - aktiviert die Hash-Tabelle des Speichers, um die Suche zu beschleunigen on - aktiviert die heuristische Null-Zug-Suche, um die Suche zu beschleunigen pin - zeigt gefesselte Figuren an prefer - gleichbedeutend mit »book on« (Vorgabe) random - führt einen zufälligen Zug aus dem Buch aus time - zeigt die aktuellen Zeiteinstellungen an worst - führt den schlechtesten Zug aus dem Buch ausDas Brett ist falsch! Befehl »activate« wird derzeit noch nicht unterstützt. Befehl »black« wird derzeit noch nicht unterstützt. Befehl »random« wird derzeit noch nicht unterstützt. Befehl »show eval/score« wird derzeit noch nicht unterstützt. Befehl »show pin« wird derzeit noch nicht unterstützt. Befehl »switch« wird derzeit noch nicht unterstützt. Befehl »test« wird derzeit noch nicht unterstützt. Befehl »white« wird derzeit noch nicht unterstützt. Protokolldatei konnte nicht erstellt werden, alle Slots sind belegt. Fehler beim Lesen der Datei »%s« »%s« konnte nicht zum Schreiben geöffnet werden: %s Addition im Fischer-Spielmodus von %d Sekunden Grafischer Modus ist deaktiviert. Grafischer Modus ist aktiviert. Hashing ist deaktiviert. Hashing ist aktiviert. Hilfe zum Befehl %s wurde nicht gefunden Inkorrekte book-Option Ungültige epd-Datei Anfangsposition wurde erreicht. Es gibt keine vorherigen Züge. Ungültiger Dateiname. Ungültiger Zug: %s Befehlsliste: (help BEFEHL, um mehr Hilfe zu erhalten) Meine Bewertung = %d Neues Zeitlimit = %g Keine Züge mehr möglich. Das Spielende wurde erreicht. Es können keine Züge zurückgenommen werden. Anzahl der generierten Züge = %ld Null-Zug-Suche ist deaktiviert. Null-Zug-Suche ist aktiviert. Altes Zeitlimit = %g Bewertung des Gegners = %d Optionen: Spielen Sie Schach Melden Sie Fehler an . Übersetzungsfehler melden Sie bitte an: In %s speichern Bis zu einer Tiefe von %d suchen Syntax zum Hinzufügen eines neuen Buches: book add Datei.pgn Zeitkontrolle: %d Züge in %.2f Sekunden Aufruf: %s [OPTION] … Sie sollten Ihre vorhandenen Protokolldateien löschen oder umbenennen. ZügeMeine Bewertung = %d, Bewertung des Gegners = %d name - listet bekannte Spieler alphabetisch auf Zeitgnuchess-6.2.2/po/de.po000644 000766 000024 00000051405 12610434564 015533 0ustar00antoniostaff000000 000000 # German translation of gnuchess. # Copyright (C) 2013 Free Software Foundation, Inc. # This file is distributed under the same license as the gnuchess package. # Mario Blättermann , 2013, 2014. # msgid "" msgstr "" "Project-Id-Version: gnuchess 6.1.1\n" "Report-Msgid-Bugs-To: bug-gnu-chess@gnu.org\n" "POT-Creation-Date: 2015-10-17 14:05+0200\n" "PO-Revision-Date: 2014-03-30 18:01+0100\n" "Last-Translator: Mario Blättermann \n" "Language-Team: German \n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Poedit 1.5.4\n" #: src/main.cc:317 #, c-format msgid "Memory out of Range or Invalid\n" msgstr "" #: src/main.cc:334 #, c-format msgid "File name is too long (max = %d)\n" msgstr "" #: src/main.cc:340 msgid "Option Processing Failed\n" msgstr "" #: src/main.cc:381 #, c-format msgid "" "Copyright (C) %s Free Software Foundation, Inc.\n" "License GPLv3+: GNU GPL version 3 or later \n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" msgstr "" #: src/main.cc:494 #, c-format msgid "Thinking...\n" msgstr "" #: src/frontend/cmd.cc:101 #, c-format msgid "Command 'activate' is currently not supported.\n" msgstr "Befehl »activate« wird derzeit noch nicht unterstützt.\n" #: src/frontend/cmd.cc:131 #, c-format msgid "Command 'black' is currently not supported.\n" msgstr "Befehl »black« wird derzeit noch nicht unterstützt.\n" #: src/frontend/cmd.cc:140 #, c-format msgid "" "The syntax to add a new book is:\n" "\n" "\tbook add file.pgn\n" msgstr "" "Syntax zum Hinzufügen eines neuen Buches:\n" "\n" "\tbook add Datei.pgn\n" #: src/frontend/cmd.cc:147 #, c-format msgid "book is now on\n" msgstr "" #: src/frontend/cmd.cc:150 #, c-format msgid "book is now off\n" msgstr "" #: src/frontend/cmd.cc:153 #, c-format msgid "book is now best\n" msgstr "" #: src/frontend/cmd.cc:156 #, c-format msgid "book is now worst\n" msgstr "" #: src/frontend/cmd.cc:159 #, c-format msgid "book is now random\n" msgstr "" #: src/frontend/cmd.cc:161 #, c-format msgid "Incorrect book option\n" msgstr "Inkorrekte book-Option\n" #: src/frontend/cmd.cc:174 #, c-format msgid "Search to a depth of %d\n" msgstr "Bis zu einer Tiefe von %d suchen\n" #: src/frontend/cmd.cc:240 #, c-format msgid "Hashing is on.\n" msgstr "Hashing ist aktiviert.\n" #: src/frontend/cmd.cc:242 #, c-format msgid "Hashing is off.\n" msgstr "Hashing ist deaktiviert.\n" #: src/frontend/cmd.cc:268 src/frontend/cmd.cc:278 #, c-format msgid "Fischer increment of %d seconds\n" msgstr "Addition im Fischer-Spielmodus von %d Sekunden\n" #. TRANSLATORS: Please be aware that the word 'move' is sometimes #. used as a synonym of 'ply', and sometimes in the sense of a #. full 2-ply move. #: src/frontend/cmd.cc:276 #, c-format msgid "Time Control: %d moves in %.2f secs\n" msgstr "Zeitkontrolle: %d Züge in %.2f Sekunden\n" #: src/frontend/cmd.cc:286 #, c-format msgid "name - list known players alphabetically\n" msgstr "name - listet bekannte Spieler alphabetisch auf\n" #: src/frontend/cmd.cc:287 #, c-format msgid "score - list by GNU best result first \n" msgstr "" #: src/frontend/cmd.cc:288 #, c-format msgid "reverse - list by GNU worst result first\n" msgstr "" #: src/frontend/cmd.cc:303 src/frontend/cmd.cc:1301 #, c-format msgid "Board is wrong!\n" msgstr "Das Brett ist falsch!\n" #: src/frontend/cmd.cc:309 src/frontend/cmd.cc:312 #, c-format msgid "Error reading file '%s'\n" msgstr "Fehler beim Lesen der Datei »%s«\n" #: src/frontend/cmd.cc:378 #, c-format msgid "Failed to open %s for writing: %s\n" msgstr "»%s« konnte nicht zum Schreiben geöffnet werden: %s\n" #: src/frontend/cmd.cc:384 #, c-format msgid "Could not create logfile, all slots occupied.\n" msgstr "Protokolldatei konnte nicht erstellt werden, alle Slots sind belegt.\n" #: src/frontend/cmd.cc:385 #, c-format msgid "You may consider deleting or renaming your existing logfiles.\n" msgstr "" "Sie sollten Ihre vorhandenen Protokolldateien löschen oder umbenennen.\n" #: src/frontend/cmd.cc:417 #, c-format msgid "Null-move heuristic is on.\n" msgstr "Null-Zug-Suche ist aktiviert.\n" #: src/frontend/cmd.cc:419 #, c-format msgid "Null-move heuristic is off.\n" msgstr "Null-Zug-Suche ist deaktiviert.\n" #: src/frontend/cmd.cc:439 src/frontend/cmd.cc:466 #, c-format msgid "Incorrect epd file\n" msgstr "Ungültige epd-Datei\n" #: src/frontend/cmd.cc:510 #, c-format msgid "No more moves. Game reached the end.\n" msgstr "Keine Züge mehr möglich. Das Spielende wurde erreicht.\n" #: src/frontend/cmd.cc:530 #, c-format msgid "Initial position reached. There are no earlier moves.\n" msgstr "Anfangsposition wurde erreicht. Es gibt keine vorherigen Züge.\n" #: src/frontend/cmd.cc:586 src/frontend/cmd.cc:692 #, c-format msgid "Invalid filename.\n" msgstr "Ungültiger Dateiname.\n" #: src/frontend/cmd.cc:592 #, c-format msgid "Graphic mode is enabled.\n" msgstr "Grafischer Modus ist aktiviert.\n" #: src/frontend/cmd.cc:598 #, c-format msgid "Graphic mode is disabled.\n" msgstr "Grafischer Modus ist deaktiviert.\n" #: src/frontend/cmd.cc:639 #, c-format msgid "Command 'random' is currently not supported.\n" msgstr "Befehl »random« wird derzeit noch nicht unterstützt.\n" #: src/frontend/cmd.cc:647 #, c-format msgid "my rating = %d, opponent rating = %d\n" msgstr "Meine Bewertung = %d, Bewertung des Gegners = %d\n" #: src/frontend/cmd.cc:671 src/frontend/cmd.cc:741 #, c-format msgid "No moves to undo!\n" msgstr "Es können keine Züge zurückgenommen werden.\n" #: src/frontend/cmd.cc:681 #, c-format msgid "Save to %s\n" msgstr "In %s speichern\n" #: src/frontend/cmd.cc:722 #, c-format msgid "Command 'switch' is currently not supported.\n" msgstr "Befehl »switch« wird derzeit noch nicht unterstützt.\n" #: src/frontend/cmd.cc:728 #, c-format msgid "Old TimeLimit = %g\n" msgstr "Altes Zeitlimit = %g\n" #: src/frontend/cmd.cc:730 #, c-format msgid "New TimeLimit = %g\n" msgstr "Neues Zeitlimit = %g\n" #: src/frontend/cmd.cc:750 #, c-format msgid "" "Usage: %s [OPTION]...\n" "\n" msgstr "" "Aufruf: %s [OPTION] …\n" "\n" #: src/frontend/cmd.cc:752 msgid "" "Play the game of chess\n" "\n" msgstr "" "Spielen Sie Schach\n" "\n" #: src/frontend/cmd.cc:754 msgid "Options:\n" msgstr "Optionen:\n" #: src/frontend/cmd.cc:755 msgid " -h, --help display this help and exit\n" msgstr " -h, --help diese Hilfe anzeigen und beenden\n" #: src/frontend/cmd.cc:757 msgid " -v, --version display version information and exit\n" msgstr " -v, --version Versionsinformation anzeigen und beenden\n" #: src/frontend/cmd.cc:759 msgid " -q, --quiet make the program silent on startup\n" msgstr " -q, --quiet unterdrückt Programmausgaben beim Start\n" #: src/frontend/cmd.cc:761 msgid " --silent same as -q\n" msgstr " --silent genau wie -q\n" #: src/frontend/cmd.cc:763 src/frontend/cmd.cc:781 msgid "\n" msgstr "\n" #: src/frontend/cmd.cc:765 msgid " -x, --xboard start in engine mode\n" msgstr " -x, --xboard im Engine-Modus starten\n" #: src/frontend/cmd.cc:767 msgid " -p, --post start up showing thinking\n" msgstr "" #: src/frontend/cmd.cc:769 msgid " -e, --easy disable thinking in opponents time\n" msgstr "" #: src/frontend/cmd.cc:771 msgid " -m, --manual enable manual mode\n" msgstr " -m, --manual manuellen Modus aktivieren\n" #: src/frontend/cmd.cc:773 msgid "" " -u, --uci enable UCI protocol (externally behave as UCI engine)\n" msgstr "" " -u, --uci aktiviert das UCI-Protokoll (verhält sich extern wie\n" " eine UCI-Engine)\n" #: src/frontend/cmd.cc:775 msgid " -M size, --memory=size specify memory usage in MB for hashtable\n" msgstr "" " -M size, --memory=Größe gibt die für die Hash-Tabelle zu nutzende\n" " Speichergröße in MB an.\n" #: src/frontend/cmd.cc:777 msgid "" " -a filename, --addbook=filename compile book.bin from pgn book " "'filename'\n" msgstr "" " -a Dateiname, --addbook=Dateiname\n" " erstellt book.bin aus einer pgn-Buchdatei\n" #: src/frontend/cmd.cc:779 msgid " -g, --graphic enable graphic mode\n" msgstr " -g, --graphic aktiviert den grafischen Modus\n" #: src/frontend/cmd.cc:783 msgid "" " Options xboard and post are accepted without leading dashes\n" " for backward compatibility.\n" "\n" msgstr "" " Die Optionen »xboard« und »post« werden zwecks Abwärtskompatibilität\n" " ohne führende Minuszeichen akzeptiert.\n" "\n" #: src/frontend/cmd.cc:787 msgid "" " Moves are accepted either in standard algebraic notation (SAN) or\n" " in coordinate algebraic notation.\n" "\n" msgstr "" #: src/frontend/cmd.cc:791 msgid "" " The file 'gnuchess.ini' allows setting config options. See\n" " 'info gnuchess' for details. The file will be looked up in the current\n" " directory or, if not found there, in the directory pointed to by\n" " environment variable GNUCHESS_PKGDATADIR.\n" "\n" msgstr "" " Die Datei »gnuchess.ini« ermöglicht die Angabe von Konfigurations-\n" " optionen. Siehen »info gnuchess« für Details. Nach der Datei wird\n" " im aktuellen Verzeichnis oder in dem durch die Umgebungsvariable\n" " GNUCHESS_PKGDATADIR angegebenen Verzeichnis gesucht.\n" "\n" #: src/frontend/cmd.cc:797 msgid "" "Report bugs to .\n" "\n" msgstr "" "Melden Sie Fehler an .\n" "Übersetzungsfehler melden Sie bitte an:\n" "\n" "\n" #: src/frontend/cmd.cc:844 src/frontend/cmd.cc:1280 #, c-format msgid "Invalid move: %s\n" msgstr "Ungültiger Zug: %s\n" #: src/frontend/cmd.cc:862 #, c-format msgid "Command 'white' is currently not supported.\n" msgstr "Befehl »white« wird derzeit noch nicht unterstützt.\n" #: src/frontend/cmd.cc:893 #, c-format msgid "My rating = %d\n" msgstr "Meine Bewertung = %d\n" #: src/frontend/cmd.cc:894 #, c-format msgid "Opponent rating = %d\n" msgstr "Bewertung des Gegners = %d\n" #: src/frontend/cmd.cc:896 msgid "time" msgstr "Zeit" #: src/frontend/cmd.cc:898 msgid "moves" msgstr "Züge" #: src/frontend/cmd.cc:903 src/frontend/cmd.cc:910 src/frontend/cmd.cc:919 #: src/frontend/cmd.cc:928 #, c-format msgid "No. of moves generated = %ld\n" msgstr "Anzahl der generierten Züge = %ld\n" #: src/frontend/cmd.cc:932 #, c-format msgid "Command 'show eval/score' is currently not supported.\n" msgstr "Befehl »show eval/score« wird derzeit noch nicht unterstützt.\n" #: src/frontend/cmd.cc:939 #, c-format msgid "Command 'show pin' is currently not supported.\n" msgstr "Befehl »show pin« wird derzeit noch nicht unterstützt.\n" #: src/frontend/cmd.cc:951 #, c-format msgid "Command 'test' is currently not supported.\n" msgstr "Befehl »test« wird derzeit noch nicht unterstützt.\n" #: src/frontend/cmd.cc:969 msgid " Quits the program." msgstr " Beendet das Programm." #: src/frontend/cmd.cc:971 msgid " In analysis mode this stops analysis, otherwise it quits the program." msgstr "" " Im Analysemodus wird dadurch die Analyse gestoppt, anderenfalls das " "Programm beendet." #: src/frontend/cmd.cc:973 msgid " Produces a help blurb corresponding to this list of commands." msgstr " Erzeugt eine Hilfemeldung anhand dieser Befehlsliste." #: src/frontend/cmd.cc:975 msgid " add - compiles book.bin from a pgn book file" msgstr " add - erstellt book.bin aus einer pgn-Buchdatei" #: src/frontend/cmd.cc:976 msgid " on - enables use of book (default)" msgstr " on - aktiviert die Verwendung des Buches (Vorgabe)" #: src/frontend/cmd.cc:977 msgid " off - disables use of book" msgstr " off - deaktiviert die Verwendung des Buches" #: src/frontend/cmd.cc:978 msgid " worst - plays worst move from book" msgstr " worst - führt den schlechtesten Zug aus dem Buch aus" #: src/frontend/cmd.cc:979 msgid " best - plays best move from book" msgstr " best - führt den besten Zug aus dem Buch aus" #: src/frontend/cmd.cc:980 msgid " prefer - same as 'book on' (default)" msgstr " prefer - gleichbedeutend mit »book on« (Vorgabe)" #: src/frontend/cmd.cc:981 msgid " random - plays any move from book" msgstr " random - führt einen zufälligen Zug aus dem Buch aus" #: src/frontend/cmd.cc:983 msgid " Prints out the version of this program." msgstr " Gibt die Version dieses Programms aus." #: src/frontend/cmd.cc:986 msgid " Backs up one move in pgn loaded game." msgstr " Geht in der aus einer pgn-Datei geladenen Partie einen Zug zurück." #: src/frontend/cmd.cc:988 msgid " Saves the game so far from memory to the file." msgstr " Speichert das Spiel in einer Datei." #: src/frontend/cmd.cc:990 msgid " Loads the game in the file into memory." msgstr " Lädt das Spiel aus der Datei in den Speicher." #: src/frontend/cmd.cc:992 msgid "" " Loads the game in the file into memory, and enables\n" " the commands 'first', 'last', 'next', 'previous'." msgstr "" " Lädt das Spiel aus der Datei in den Speicher und aktiviert\n" " die Befehle »first«, »last«, »next« und »previous«." #: src/frontend/cmd.cc:996 msgid " Advances one move in pgn loaded game." msgstr " Geht in der aus einer pgn-Datei geladenen Partie einen Zug vor." #: src/frontend/cmd.cc:998 msgid " Goes to begin position of pgn loaded game." msgstr "" " Geht in der aus einer pgn-Datei geladenen Partie zur Grundstellung zurück." #: src/frontend/cmd.cc:1000 msgid " Goes to end position of pgn loaded game." msgstr " Geht in der aus einer pgn-Datei geladenen Partie zur Endstellung vor." #: src/frontend/cmd.cc:1003 msgid "" " Makes the program stop moving. You may now enter moves\n" " to reach some position in the future." msgstr "" #: src/frontend/cmd.cc:1007 msgid " Program plays white." msgstr " Programm spielt Weiß." #: src/frontend/cmd.cc:1009 msgid " Program plays black." msgstr " Programm spielt Schwarz." #: src/frontend/cmd.cc:1011 msgid "" " Computer takes whichever side is on move and begins its\n" " thinking immediately." msgstr "" #: src/frontend/cmd.cc:1014 msgid "" " Arranges for verbose thinking output showing variation, score,\n" " time, depth, etc." msgstr "" #: src/frontend/cmd.cc:1017 msgid " Turns off verbose thinking output." msgstr "" #: src/frontend/cmd.cc:1019 msgid "" " Lets you input your name. Also writes the log.nnn and\n" " corresponding game.nnn files. For details please see\n" " the auxiliary file format sections." msgstr "" " Ermöglicht Ihnen die Eingabe Ihres Namens. Außerdem werden\n" " die Dateien log.nnn und die zugehörige game.nnn erstellt.\n" " Details finden Sie in den Abschnitten zu den Dateiformaten." #: src/frontend/cmd.cc:1023 msgid " Mostly used by Internet Chess Server." msgstr " Wird meist vom »Internet Chess Server« verwendet." #: src/frontend/cmd.cc:1025 msgid "" " This command reactivates a game that has been terminated automatically\n" " due to checkmate or no more time on the clock. However, it does not\n" " alter those conditions. So you would have to undo a move or two, or\n" " add time to the clock with 'level' or 'time'." msgstr "" " Dieser Befehl reaktiviert ein Spiel, das wegen Schachmatt oder wegen\n" " Zeitüberschreitung automatisch beendet wurde. Die Spielbedingungen\n" " werden dabei nicht geändert. Daher werden Sie einen oder zwei Züge\n" " zurücknehmen oder mit »level« oder »time« Bedenkzeit hinzufügen müssen." #: src/frontend/cmd.cc:1030 msgid " Inputs the estimated rating for computer and for its opponent." msgstr "" #: src/frontend/cmd.cc:1032 msgid " Sets up a new game (i.e. pieces in original positions)." msgstr " Startet ein neues Spiel (Figuren in Grundstellung)." #: src/frontend/cmd.cc:1034 msgid "" " Inputs time left in game for computer in hundredths of a second.\n" " Mostly used by Internet Chess Server." msgstr "" #: src/frontend/cmd.cc:1037 msgid " on - enables using the memory hash table to speed up search" msgstr "" " on - aktiviert die Hash-Tabelle des Speichers, um die Suche zu beschleunigen" #: src/frontend/cmd.cc:1038 msgid " off - disables the memory hash table" msgstr " off - deaktiviert die Hash-Tabelle des Speichers" #: src/frontend/cmd.cc:1040 msgid " Sets the hash table to permit storage of N MB." msgstr " Legt für die Hash-Tabelle einen festen Speicherplatz von N MB fest." #: src/frontend/cmd.cc:1042 msgid " on - enables using the null-move heuristic to speed up search" msgstr "" " on - aktiviert die heuristische Null-Zug-Suche, um die Suche zu " "beschleunigen" #: src/frontend/cmd.cc:1043 msgid " off - disables using the null-move heuristic" msgstr " off - deaktiviert die heuristische Null-Zug-Suche" #: src/frontend/cmd.cc:1045 msgid " on - enables use of xboard/winboard" msgstr " on - aktiviert die Nutzung von xboard/winboard" #: src/frontend/cmd.cc:1046 msgid " off - disables use of xboard/winboard" msgstr " off - deaktiviert die Nutzung von xboard/winboard" #: src/frontend/cmd.cc:1048 msgid "" " Sets the program to look N ply (half-moves) deep for every\n" " search it performs. If there is a checkmate or other condition\n" " that does not allow that depth, then it will not be." msgstr "" #: src/frontend/cmd.cc:1052 msgid "" " Sets time control to be MOVES in MINUTES, with each move giving\n" " an INCREMENT (in seconds, i.e. a Fischer-style clock)." msgstr "" #: src/frontend/cmd.cc:1056 msgid " Loads a position in EPD format from disk into memory." msgstr " Lädt eine Stellung im EPD-Format von einem Datenträger." #: src/frontend/cmd.cc:1059 msgid " Saves game position into EPD format from memory to disk." msgstr " Speichert die Spielposition im EPD auf einem Datenträger." #: src/frontend/cmd.cc:1061 msgid " Switches side to move." msgstr " Wechselt die Seite, die am Zug ist." #: src/frontend/cmd.cc:1064 msgid " Solves the positions in FILENAME." msgstr " Speichert die Positionen in DATEINAME." #: src/frontend/cmd.cc:1066 msgid " Backs up two moves in game history." msgstr " Geht im Partieverlauf zwei Züge zurück." #: src/frontend/cmd.cc:1068 msgid " Backs up one move in game history." msgstr " Geht im Partieverlauf einen Zug zurück." #: src/frontend/cmd.cc:1070 msgid " Displays command line syntax." msgstr " Zeigt die Befehlszeilensyntax an." #: src/frontend/cmd.cc:1072 msgid " board - displays the current board" msgstr " board - zeigt das aktuelle Spielfeld an" #: src/frontend/cmd.cc:1073 msgid " time - displays the time settings" msgstr " time - zeigt die aktuellen Zeiteinstellungen an" #: src/frontend/cmd.cc:1074 msgid " moves - shows all moves using one call to routine" msgstr "" #: src/frontend/cmd.cc:1075 msgid " escape - shows moves that escape from check using one call to routine" msgstr "" #: src/frontend/cmd.cc:1076 msgid " noncapture - shows non-capture moves" msgstr "" #: src/frontend/cmd.cc:1077 msgid " capture - shows capture moves" msgstr "" #: src/frontend/cmd.cc:1078 msgid " eval [or score] - shows the evaluation per piece and overall" msgstr "" #: src/frontend/cmd.cc:1079 msgid " game - shows moves in game history" msgstr " game - zeigt Züge im Spielverlauf an" #: src/frontend/cmd.cc:1080 msgid " pin - shows pinned pieces" msgstr " pin - zeigt gefesselte Figuren an" #: src/frontend/cmd.cc:1082 msgid " movelist - reads in an epd file and shows legal moves for its entries" msgstr "" " movelist - liest eine epd-Datei ein und zeigt mögliche Züge für deren " "Einträge an" #: src/frontend/cmd.cc:1083 msgid "" " capture - reads in an epd file and shows legal captures for its entries" msgstr "" #: src/frontend/cmd.cc:1084 msgid " movegenspeed - tests speed of move generator" msgstr "" #: src/frontend/cmd.cc:1085 msgid " capturespeed - tests speed of capture move generator" msgstr "" #: src/frontend/cmd.cc:1086 msgid " eval - reads in an epd file and shows evaluation for its entries" msgstr "" #: src/frontend/cmd.cc:1087 msgid " evalspeed - tests speed of the evaluator" msgstr " evalspeed - testet die Geschwindigkeit der Zugberechnung" #: src/frontend/cmd.cc:1089 msgid " Shows moves from opening book." msgstr "Zeigt Züge aus dem Eröffnungsbuch an." #: src/frontend/cmd.cc:1091 msgid " Enables display board in graphic mode." msgstr " Aktiviert die Anzeige des Brettes im grafischen Modus." #: src/frontend/cmd.cc:1093 msgid " Disables graphic mode and display classical view." msgstr "" " Deaktiviert den grafischen Modus und wechselt in die klassische Ansicht." #: src/frontend/cmd.cc:1119 #, c-format msgid "" "Help for command %s not found\n" "\n" msgstr "" "Hilfe zum Befehl %s wurde nicht gefunden\n" "\n" #: src/frontend/cmd.cc:1121 #, c-format msgid "List of commands: (help COMMAND to get more help)\n" msgstr "Befehlsliste: (help BEFEHL, um mehr Hilfe zu erhalten)\n" #: src/frontend/engine.cc:247 msgid "Black" msgstr "" #: src/frontend/engine.cc:247 msgid "White" msgstr "" #: src/frontend/engine.cc:333 #, c-format msgid "" "\n" "My move is : %s\n" msgstr "" gnuchess-6.2.2/po/en@boldquot.header000644 000766 000024 00000002471 12205632536 020227 0ustar00antoniostaff000000 000000 # All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # # This catalog furthermore displays the text between the quotation marks in # bold face, assuming the VT100/XTerm escape sequences. # gnuchess-6.2.2/po/en@quot.header000644 000766 000024 00000002263 12205632536 017365 0ustar00antoniostaff000000 000000 # All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # gnuchess-6.2.2/po/eo.gmo000644 000766 000024 00000040117 12610434564 015710 0ustar00antoniostaff000000 000000 Þ•†L³|H I K Ck M¯ 7ý (5 /^ 'Ž .¶ 7å J 9h )¢ &Ì Ró #F&j$‘O¶29'X+€)¬FÖ?h]‘Æ6Xg(÷^ &g¦[(j>“Òèþ9/L/|±¬x^8×"0Sòk^#_-ƒ!±#ÓH÷@5_F•AÜ=)\#†-ªFØ2%R%xž&º-á#$3<X>•Ô%ï""8#[/,À-í6/R-‚+°,Ü. 8"Q t•°ÊÛë " 66 m € 2’ Å Õ %é !"!@!]!y!! £!­!)Æ! ð!ü!5"$K"p">ˆ"Ç"Ù"ê"ú"#!#%'#,M#)z#)¤#Î#˜Ó#l%n%MŽ%IÜ%D&&+k&5—&0Í&1þ&60'Ng'9¶'/ð'+ (\L()©(*Ó()þ(U():~)%¹)1ß)1*.C*Or*JÂ*z +²ˆ+7;,js,+Þ,` -.k-gš-[.(^.C‡.Ë.ê. /; /5\/7’/¹Ê/‚„0?1'G1#o1“1õ®1ê¤2)3-¹3'ç3$4O44"„45§4JÝ4@(5>i5,¨5)Õ51ÿ5M16:6)º6*ä67)/7.Y7&ˆ7%¯7AÕ7?8W8&w8$ž8%Ã8+é89,,9)Y9*ƒ93®9,â9*:(::)c:6: Ä:&å: ;#+; O;p;‹;*£;Î;ë;5<8<O<8c<œ<¯<*Ã<î<=!&=H=g=~= ™= ¥=4³=è=ø=B>$W>|>Oš>ê>?"?AH@zm) "6Bp7RVS{Qd*\ lw4/g|t_O]`-nIZƒ3 --silent same as -q -M size, --memory=size specify memory usage in MB for hashtable -a filename, --addbook=filename compile book.bin from pgn book 'filename' -e, --easy disable thinking in opponents time -g, --graphic enable graphic mode -h, --help display this help and exit -m, --manual enable manual mode -p, --post start up showing thinking -q, --quiet make the program silent on startup -u, --uci enable UCI protocol (externally behave as UCI engine) -v, --version display version information and exit -x, --xboard start in engine mode Advances one move in pgn loaded game. Arranges for verbose thinking output showing variation, score, time, depth, etc. Backs up one move in game history. Backs up one move in pgn loaded game. Backs up two moves in game history. Computer takes whichever side is on move and begins its thinking immediately. Disables graphic mode and display classical view. Displays command line syntax. Enables display board in graphic mode. Goes to begin position of pgn loaded game. Goes to end position of pgn loaded game. In analysis mode this stops analysis, otherwise it quits the program. Inputs the estimated rating for computer and for its opponent. Inputs time left in game for computer in hundredths of a second. Mostly used by Internet Chess Server. Lets you input your name. Also writes the log.nnn and corresponding game.nnn files. For details please see the auxiliary file format sections. Loads a position in EPD format from disk into memory. Loads the game in the file into memory, and enables the commands 'first', 'last', 'next', 'previous'. Loads the game in the file into memory. Makes the program stop moving. You may now enter moves to reach some position in the future. Mostly used by Internet Chess Server. Moves are accepted either in standard algebraic notation (SAN) or in coordinate algebraic notation. Options xboard and post are accepted without leading dashes for backward compatibility. Prints out the version of this program. Produces a help blurb corresponding to this list of commands. Program plays black. Program plays white. Quits the program. Saves game position into EPD format from memory to disk. Saves the game so far from memory to the file. Sets the hash table to permit storage of N MB. Sets the program to look N ply (half-moves) deep for every search it performs. If there is a checkmate or other condition that does not allow that depth, then it will not be. Sets time control to be MOVES in MINUTES, with each move giving an INCREMENT (in seconds, i.e. a Fischer-style clock). Sets up a new game (i.e. pieces in original positions). Shows moves from opening book. Solves the positions in FILENAME. Switches side to move. The file 'gnuchess.ini' allows setting config options. See 'info gnuchess' for details. The file will be looked up in the current directory or, if not found there, in the directory pointed to by environment variable GNUCHESS_PKGDATADIR. This command reactivates a game that has been terminated automatically due to checkmate or no more time on the clock. However, it does not alter those conditions. So you would have to undo a move or two, or add time to the clock with 'level' or 'time'. Turns off verbose thinking output. add - compiles book.bin from a pgn book file best - plays best move from book board - displays the current board capture - reads in an epd file and shows legal captures for its entries capture - shows capture moves capturespeed - tests speed of capture move generator escape - shows moves that escape from check using one call to routine eval - reads in an epd file and shows evaluation for its entries eval [or score] - shows the evaluation per piece and overall evalspeed - tests speed of the evaluator game - shows moves in game history movegenspeed - tests speed of move generator movelist - reads in an epd file and shows legal moves for its entries moves - shows all moves using one call to routine noncapture - shows non-capture moves off - disables the memory hash table off - disables use of book off - disables use of xboard/winboard off - disables using the null-move heuristic on - enables use of book (default) on - enables use of xboard/winboard on - enables using the memory hash table to speed up search on - enables using the null-move heuristic to speed up search pin - shows pinned pieces prefer - same as 'book on' (default) random - plays any move from book time - displays the time settings worst - plays worst move from bookBoard is wrong! Command 'activate' is currently not supported. Command 'black' is currently not supported. Command 'random' is currently not supported. Command 'show eval/score' is currently not supported. Command 'show pin' is currently not supported. Command 'switch' is currently not supported. Command 'test' is currently not supported. Command 'white' is currently not supported. Could not create logfile, all slots occupied. Error reading file '%s' Failed to open %s for writing: %s Fischer increment of %d seconds Graphic mode is disabled. Graphic mode is enabled. Hashing is off. Hashing is on. Help for command %s not found Incorrect book option Incorrect epd file Initial position reached. There are no earlier moves. Invalid filename. Invalid move: %s List of commands: (help COMMAND to get more help) My rating = %d New TimeLimit = %g No more moves. Game reached the end. No moves to undo! No. of moves generated = %ld Null-move heuristic is off. Null-move heuristic is on. Old TimeLimit = %g Opponent rating = %d Options: Play the game of chess Report bugs to . Save to %s Search to a depth of %d The syntax to add a new book is: book add file.pgn Time Control: %d moves in %.2f secs Usage: %s [OPTION]... You may consider deleting or renaming your existing logfiles. book is now best book is now off book is now on book is now random book is now worst movesmy rating = %d, opponent rating = %d name - list known players alphabetically reverse - list by GNU worst result first score - list by GNU best result first timeProject-Id-Version: gnuchess 6.1.1 Report-Msgid-Bugs-To: bug-gnu-chess@gnu.org POT-Creation-Date: 2015-10-17 14:05+0200 PO-Revision-Date: 2013-11-25 08:03-0300 Last-Translator: Felipe Castro Language-Team: Esperanto Language: eo MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Generator: Poedit 1.5.4 --silent same ol -q -M grando, --memory=grando indiki uzadon de memoro laÅ­ MB por haket-tabelo -a dnomo, --addbook=dnomo kompili book.bin el pgn-libro 'dnomo' -e, --easy malebligi cerbumadon en la tempo de kontraÅ­ulo -g, --graphic ebligi grafika reÄimo -h, --help montri ĉi tiun helpon kaj eliri -m, --manual ebligi malaÅ­tomata reÄimo -p, --post komenci montrante cerbumadon -q, --quiet silentigi la programon je komenco -u, --uci ebligi protokolon UCI (ekstere konduti kiel maÅinon UCI) -v, --version montri informon pri versio kaj eliri -x, --xboard komenci en maÅina reÄimo AntaÅ­iras unu movon en Åargita ludo pgn. AranÄas detalan eligo pri cerbumado montranta variadon, poentojn, tempon, profundon, ktp. Restarigas unu movon en la lud-historio. Savkopias unu movon en Åargita ludo pgn. Restarigas du movojn en la lud-historio. La komputilo prenas iun ajn flanko kiu moviÄas kaj komencas Äian cerbumadon tuje. Malebligas grafikan reÄimon kaj montras klasika rigardo. Montras la sintakso de komand-linio. Ebligas montri la tabulon laŭ grafika reÄimo. Iras al la komenca pozicio de Åargita ludo pgn. Iras al la fina pozicio de Åargita ludo pgn. En analiza reÄimo tio ĉi haltigas la analizon, alie Äi eliras la programon. Enigas la kalkulitajn pritaksado por la komputilo kaj Äiaj kontraÅ­uloj. Enigas tempo restanta en la ludo por komputilo, laŭ centonoj da sekundo. Plejparte uzata de la Interreta Åœak-servilo. Permesas al vi enigi vian nomon. Ankaŭ skribas la dosieron log.nnn kaj korespondajn dosierojn game.nnn. Por pli da detaloj, bonvolu konsulti helpajn dosier-formajn sekciojn. Åœargas pozicion laÅ­ formo EPD el disko al la memoro. Åœargas la ludon el la dosiero en memoron, kaj ebligas la komandojn 'first', 'last', 'next', 'previous'. Åœargas la ludon el la dosiero en memoron. Igas ke la programo haltigu movi. Vi povas nun enigi movojn por atingi iun pozicion estontece. Plejparte uzata de la Interreta Åœak-servilo. Movoj estas akceptataj aŭ laŭ norma algebra notacio (SAN) aÅ­ laŭ koordinata algebra notacio. Modifiloj xboard kaj post estas akceptataj sen antaÅ­iraj streketoj pro retro-akordeco. Montras la version de tiu ĉi programo. Produktas helpan resumon korespondan al tiu ĉi listo de komandoj. La programo ludas la nigrajn. La programo ludas la blankajn. Eliras la programon. Åœargas lud-pozicion laÅ­ formo EPD el memoro al la disko. Konservas la ludon Äis nun el memoro al la dosiero. Difinas ke la haket-tabelo permesas konservon de N MB. Difinas ke la programo serĉu N ply (duon-movoj) profundon por ĉiu serĉo kiun Äi aplikas. Se estas Åakmato aŭ alia kondiĉo, kiu ne permesas tiun profundon, tiam Äi ne okazos. Difinas ke temp-kontrolo estu MOVOJ en MINUTOJ, kun ĉiu movo rezultanta en PLIIGO (laÅ­ sekundoj, t.e. Fischer-stila horloÄo). Komencigas novan ludon (t.e. figurojn en originalaj pozicioj). Montras movojn el libro pri malfermoj. Solvas la poziciojn en DOSIERNOMO. ÅœanÄas flanko por movi. La dosiero 'gnuchess.ini' permesas difini agordajn modifilojn. Konsultu 'info gnuchess' por detaloj. La dosiero estos serĉata en la kuranta dosierujo aÅ­, se ne trovita tie, en la dosierujo indikita de la medi-variablo GNUCHESS_PKGDATADIR. Tiu ĉi komando reaktivigas ludon kiu aÅ­tomate finis pro Åakmato aÅ­ pro tempo-fino de la horloÄo. Tamen, Äi ne modifas tiuj kondiĉoj. Vi devos fari unu aŭ du movojn, aÅ­ aldoni tempon al la horloÄo per 'level' aÅ­ 'time'. MalÅaltas detalan eligon pri cerbumado. add - kompilas book.bin el pgn-libra dosiero best - ludas plej bonan movon el libro board - montras la kurantan tabulon capture - legas epd-dosieron kaj montras permesatajn kaptigojn el Äiaj enigoj capture - montri kaptigajn movojn capturespeed - testas rapidon de la kaptmov-generilo escape - montras movojn kiuj eskapas el Åako uzante unu vokon al funkcio eval - legas epd-dosieron kaj montras pritakson el Äiaj enigoj eval [aŭ score] - montras la takson por peco kaj Äeneralan evalspeed - testas rapidon de la pritaksilo game - montras movojn en la lud-historio movegenspeed - testas rapidon de la mov-generilo movelist - legas epd-dosieron kaj montras permesatajn movojn el Äiaj enigoj moves - montras ĉiujn movojn uzante unu vokon al funkcio noncapture - montras ne-kaptigajn movojn off - malebligas la memoran haket-tabelon off - malebligas uzon de libro off - malebligas uzon de xboard/winboard off - malebligas uzon de nul-mova heÅ­ristiko on - ebligas uzon de libro (aprioras) on - ebligas uzon de xboard/winboard on - ebligas uzon de la memora haket-tabelo por rapidigi serĉon on - ebligas uzon de nul-mova heÅ­ristiko por rapidigi serĉon pin - montras fiksitajn pecojn prefer - same ol 'book on' (aprioras) random - ludas iu ajn movo el libro time - montras la agordojn pri tempo worst - ludas plej malbonan movon el libroLa tabulo malÄustas! Komando 'activate' nune ne estas subtenata. Komando 'black' nune ne estas subtenata. Komando 'random' nune ne estas subtenata. Komando 'show eval/score' nune ne estas subtenata. Komando 'show pin' nune ne estas subtenata. Komando 'switch' nune ne estas subtenata. Komando 'test' nune ne estas subtenata. Komando 'white' nune ne estas subtenata. Ne eblis krei protokolon, ĉiuj ingoj estas okupataj. Eraro dum lego de dosieron '%s' Ni fiaskis malfermi %s por skribi: %s Fischer-pliigo de %d sekundoj Grafika reÄimo estas malebligata. Grafika reÄimo estas ebligata. Haketo estas malÅaltita. Haketo estas Åaltita. Helpo por la komando %s ne estis trovata MalÄusta modifilo de libro MalÄusta dosiero epd Komenca pozicio estas atingita. Neniu movo pli frua. Malvalida dosiernomo. Malvalida movo: %s Listo de komandoj: (help KOMANDO por havi pli da helpo) Mia pritakso = %d Nova TempLimo = %g Neniu plia movo. La ludo atingis la fino. Neniu movo por malfari! n-ro da movoj generitaj = %ld Nul-mova heÅ­ristiko malaktivas. Nul-mova heÅ­ristiko aktivas. Malnova TempLimo = %g KontraÅ­ula pritakso = %d Modifiloj: Ludi Åakon Raportu program-misojn al . Konservi al %s Serĉi Äis profundo de %d La sintakso por aldoni novan libron estas: book add dosiero.pgn Temp-kontrolo: %d movoj en %.2f sek Uzmaniero: %s [MODIFILO]... Vi povas konsideri forigo aŭ renomigo de viaj ekzistantaj protokol-dosieroj. libro nun estas plej bona libro nun estas malÅaltita libro nun estas Åaltita libro nun estas hazarda libro nun estas plej malbona movojmia pritakso = %d, kontraÅ­ula pritakso = %d nomo - listigi konatajn ludantoj alfabet-orde inverse - listigi laŭ GNU-a plej malbona rezulto unue poentoj - listigi laŭ GNU-a plej bona rezulto unue tempognuchess-6.2.2/po/eo.po000644 000766 000024 00000053434 12610434564 015552 0ustar00antoniostaff000000 000000 # Esperanto translation # Copyright (C) 2013 Free Software Foundation, Inc. # This file is distributed under the same license as the gnuchess package. # Felipe Castro , 2013. # msgid "" msgstr "" "Project-Id-Version: gnuchess 6.1.1\n" "Report-Msgid-Bugs-To: bug-gnu-chess@gnu.org\n" "POT-Creation-Date: 2015-10-17 14:05+0200\n" "PO-Revision-Date: 2013-11-25 08:03-0300\n" "Last-Translator: Felipe Castro \n" "Language-Team: Esperanto \n" "Language: eo\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.5.4\n" #: src/main.cc:317 #, c-format msgid "Memory out of Range or Invalid\n" msgstr "" #: src/main.cc:334 #, c-format msgid "File name is too long (max = %d)\n" msgstr "" #: src/main.cc:340 msgid "Option Processing Failed\n" msgstr "" #: src/main.cc:381 #, c-format msgid "" "Copyright (C) %s Free Software Foundation, Inc.\n" "License GPLv3+: GNU GPL version 3 or later \n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" msgstr "" #: src/main.cc:494 #, c-format msgid "Thinking...\n" msgstr "" #: src/frontend/cmd.cc:101 #, c-format msgid "Command 'activate' is currently not supported.\n" msgstr "Komando 'activate' nune ne estas subtenata.\n" #: src/frontend/cmd.cc:131 #, c-format msgid "Command 'black' is currently not supported.\n" msgstr "Komando 'black' nune ne estas subtenata.\n" #: src/frontend/cmd.cc:140 #, c-format msgid "" "The syntax to add a new book is:\n" "\n" "\tbook add file.pgn\n" msgstr "" "La sintakso por aldoni novan libron estas:\n" "\n" "\tbook add dosiero.pgn\n" #: src/frontend/cmd.cc:147 #, c-format msgid "book is now on\n" msgstr "libro nun estas Åaltita\n" #: src/frontend/cmd.cc:150 #, c-format msgid "book is now off\n" msgstr "libro nun estas malÅaltita\n" #: src/frontend/cmd.cc:153 #, c-format msgid "book is now best\n" msgstr "libro nun estas plej bona\n" #: src/frontend/cmd.cc:156 #, c-format msgid "book is now worst\n" msgstr "libro nun estas plej malbona\n" #: src/frontend/cmd.cc:159 #, c-format msgid "book is now random\n" msgstr "libro nun estas hazarda\n" #: src/frontend/cmd.cc:161 #, c-format msgid "Incorrect book option\n" msgstr "MalÄusta modifilo de libro\n" #: src/frontend/cmd.cc:174 #, c-format msgid "Search to a depth of %d\n" msgstr "Serĉi Äis profundo de %d\n" #: src/frontend/cmd.cc:240 #, c-format msgid "Hashing is on.\n" msgstr "Haketo estas Åaltita.\n" #: src/frontend/cmd.cc:242 #, c-format msgid "Hashing is off.\n" msgstr "Haketo estas malÅaltita.\n" #: src/frontend/cmd.cc:268 src/frontend/cmd.cc:278 #, c-format msgid "Fischer increment of %d seconds\n" msgstr "Fischer-pliigo de %d sekundoj\n" #. TRANSLATORS: Please be aware that the word 'move' is sometimes #. used as a synonym of 'ply', and sometimes in the sense of a #. full 2-ply move. #: src/frontend/cmd.cc:276 #, c-format msgid "Time Control: %d moves in %.2f secs\n" msgstr "Temp-kontrolo: %d movoj en %.2f sek\n" #: src/frontend/cmd.cc:286 #, c-format msgid "name - list known players alphabetically\n" msgstr "nomo - listigi konatajn ludantoj alfabet-orde\n" #: src/frontend/cmd.cc:287 #, c-format msgid "score - list by GNU best result first \n" msgstr "poentoj - listigi laŭ GNU-a plej bona rezulto unue \n" #: src/frontend/cmd.cc:288 #, c-format msgid "reverse - list by GNU worst result first\n" msgstr "inverse - listigi laŭ GNU-a plej malbona rezulto unue\n" #: src/frontend/cmd.cc:303 src/frontend/cmd.cc:1301 #, c-format msgid "Board is wrong!\n" msgstr "La tabulo malÄustas!\n" #: src/frontend/cmd.cc:309 src/frontend/cmd.cc:312 #, c-format msgid "Error reading file '%s'\n" msgstr "Eraro dum lego de dosieron '%s'\n" #: src/frontend/cmd.cc:378 #, c-format msgid "Failed to open %s for writing: %s\n" msgstr "Ni fiaskis malfermi %s por skribi: %s\n" #: src/frontend/cmd.cc:384 #, c-format msgid "Could not create logfile, all slots occupied.\n" msgstr "Ne eblis krei protokolon, ĉiuj ingoj estas okupataj.\n" #: src/frontend/cmd.cc:385 #, c-format msgid "You may consider deleting or renaming your existing logfiles.\n" msgstr "" "Vi povas konsideri forigo aŭ renomigo de viaj ekzistantaj protokol-" "dosieroj.\n" #: src/frontend/cmd.cc:417 #, c-format msgid "Null-move heuristic is on.\n" msgstr "Nul-mova heÅ­ristiko aktivas.\n" #: src/frontend/cmd.cc:419 #, c-format msgid "Null-move heuristic is off.\n" msgstr "Nul-mova heÅ­ristiko malaktivas.\n" #: src/frontend/cmd.cc:439 src/frontend/cmd.cc:466 #, c-format msgid "Incorrect epd file\n" msgstr "MalÄusta dosiero epd\n" #: src/frontend/cmd.cc:510 #, c-format msgid "No more moves. Game reached the end.\n" msgstr "Neniu plia movo. La ludo atingis la fino.\n" #: src/frontend/cmd.cc:530 #, c-format msgid "Initial position reached. There are no earlier moves.\n" msgstr "Komenca pozicio estas atingita. Neniu movo pli frua.\n" #: src/frontend/cmd.cc:586 src/frontend/cmd.cc:692 #, c-format msgid "Invalid filename.\n" msgstr "Malvalida dosiernomo.\n" #: src/frontend/cmd.cc:592 #, c-format msgid "Graphic mode is enabled.\n" msgstr "Grafika reÄimo estas ebligata.\n" #: src/frontend/cmd.cc:598 #, c-format msgid "Graphic mode is disabled.\n" msgstr "Grafika reÄimo estas malebligata.\n" #: src/frontend/cmd.cc:639 #, c-format msgid "Command 'random' is currently not supported.\n" msgstr "Komando 'random' nune ne estas subtenata.\n" #: src/frontend/cmd.cc:647 #, c-format msgid "my rating = %d, opponent rating = %d\n" msgstr "mia pritakso = %d, kontraÅ­ula pritakso = %d\n" #: src/frontend/cmd.cc:671 src/frontend/cmd.cc:741 #, c-format msgid "No moves to undo!\n" msgstr "Neniu movo por malfari!\n" #: src/frontend/cmd.cc:681 #, c-format msgid "Save to %s\n" msgstr "Konservi al %s\n" #: src/frontend/cmd.cc:722 #, c-format msgid "Command 'switch' is currently not supported.\n" msgstr "Komando 'switch' nune ne estas subtenata.\n" #: src/frontend/cmd.cc:728 #, c-format msgid "Old TimeLimit = %g\n" msgstr "Malnova TempLimo = %g\n" #: src/frontend/cmd.cc:730 #, c-format msgid "New TimeLimit = %g\n" msgstr "Nova TempLimo = %g\n" #: src/frontend/cmd.cc:750 #, c-format msgid "" "Usage: %s [OPTION]...\n" "\n" msgstr "" "Uzmaniero: %s [MODIFILO]...\n" "\n" #: src/frontend/cmd.cc:752 msgid "" "Play the game of chess\n" "\n" msgstr "" "Ludi Åakon\n" "\n" #: src/frontend/cmd.cc:754 msgid "Options:\n" msgstr "Modifiloj:\n" #: src/frontend/cmd.cc:755 msgid " -h, --help display this help and exit\n" msgstr " -h, --help montri ĉi tiun helpon kaj eliri\n" #: src/frontend/cmd.cc:757 msgid " -v, --version display version information and exit\n" msgstr " -v, --version montri informon pri versio kaj eliri\n" #: src/frontend/cmd.cc:759 msgid " -q, --quiet make the program silent on startup\n" msgstr " -q, --quiet silentigi la programon je komenco\n" #: src/frontend/cmd.cc:761 msgid " --silent same as -q\n" msgstr " --silent same ol -q\n" #: src/frontend/cmd.cc:763 src/frontend/cmd.cc:781 msgid "\n" msgstr "\n" #: src/frontend/cmd.cc:765 msgid " -x, --xboard start in engine mode\n" msgstr " -x, --xboard komenci en maÅina reÄimo\n" #: src/frontend/cmd.cc:767 msgid " -p, --post start up showing thinking\n" msgstr " -p, --post komenci montrante cerbumadon\n" #: src/frontend/cmd.cc:769 msgid " -e, --easy disable thinking in opponents time\n" msgstr " -e, --easy malebligi cerbumadon en la tempo de kontraÅ­ulo\n" #: src/frontend/cmd.cc:771 msgid " -m, --manual enable manual mode\n" msgstr " -m, --manual ebligi malaÅ­tomata reÄimo\n" #: src/frontend/cmd.cc:773 msgid "" " -u, --uci enable UCI protocol (externally behave as UCI engine)\n" msgstr "" " -u, --uci ebligi protokolon UCI (ekstere konduti kiel maÅinon " "UCI)\n" #: src/frontend/cmd.cc:775 msgid " -M size, --memory=size specify memory usage in MB for hashtable\n" msgstr "" " -M grando, --memory=grando indiki uzadon de memoro laÅ­ MB por haket-tabelo\n" #: src/frontend/cmd.cc:777 msgid "" " -a filename, --addbook=filename compile book.bin from pgn book " "'filename'\n" msgstr "" " -a dnomo, --addbook=dnomo kompili book.bin el pgn-libro 'dnomo'\n" #: src/frontend/cmd.cc:779 msgid " -g, --graphic enable graphic mode\n" msgstr " -g, --graphic ebligi grafika reÄimo\n" #: src/frontend/cmd.cc:783 msgid "" " Options xboard and post are accepted without leading dashes\n" " for backward compatibility.\n" "\n" msgstr "" " Modifiloj xboard kaj post estas akceptataj sen antaÅ­iraj streketoj\n" " pro retro-akordeco.\n" "\n" #: src/frontend/cmd.cc:787 msgid "" " Moves are accepted either in standard algebraic notation (SAN) or\n" " in coordinate algebraic notation.\n" "\n" msgstr "" " Movoj estas akceptataj aŭ laŭ norma algebra notacio (SAN) aÅ­\n" " laŭ koordinata algebra notacio.\n" "\n" #: src/frontend/cmd.cc:791 msgid "" " The file 'gnuchess.ini' allows setting config options. See\n" " 'info gnuchess' for details. The file will be looked up in the current\n" " directory or, if not found there, in the directory pointed to by\n" " environment variable GNUCHESS_PKGDATADIR.\n" "\n" msgstr "" " La dosiero 'gnuchess.ini' permesas difini agordajn modifilojn.\n" " Konsultu 'info gnuchess' por detaloj. La dosiero estos serĉata en\n" " la kuranta dosierujo aÅ­, se ne trovita tie, en la dosierujo indikita\n" " de la medi-variablo GNUCHESS_PKGDATADIR.\n" #: src/frontend/cmd.cc:797 msgid "" "Report bugs to .\n" "\n" msgstr "" "Raportu program-misojn al .\n" "\n" #: src/frontend/cmd.cc:844 src/frontend/cmd.cc:1280 #, c-format msgid "Invalid move: %s\n" msgstr "Malvalida movo: %s\n" #: src/frontend/cmd.cc:862 #, c-format msgid "Command 'white' is currently not supported.\n" msgstr "Komando 'white' nune ne estas subtenata.\n" #: src/frontend/cmd.cc:893 #, c-format msgid "My rating = %d\n" msgstr "Mia pritakso = %d\n" #: src/frontend/cmd.cc:894 #, c-format msgid "Opponent rating = %d\n" msgstr "KontraÅ­ula pritakso = %d\n" #: src/frontend/cmd.cc:896 msgid "time" msgstr "tempo" #: src/frontend/cmd.cc:898 msgid "moves" msgstr "movoj" #: src/frontend/cmd.cc:903 src/frontend/cmd.cc:910 src/frontend/cmd.cc:919 #: src/frontend/cmd.cc:928 #, c-format msgid "No. of moves generated = %ld\n" msgstr "n-ro da movoj generitaj = %ld\n" #: src/frontend/cmd.cc:932 #, c-format msgid "Command 'show eval/score' is currently not supported.\n" msgstr "Komando 'show eval/score' nune ne estas subtenata.\n" #: src/frontend/cmd.cc:939 #, c-format msgid "Command 'show pin' is currently not supported.\n" msgstr "Komando 'show pin' nune ne estas subtenata.\n" #: src/frontend/cmd.cc:951 #, c-format msgid "Command 'test' is currently not supported.\n" msgstr "Komando 'test' nune ne estas subtenata.\n" #: src/frontend/cmd.cc:969 msgid " Quits the program." msgstr " Eliras la programon." #: src/frontend/cmd.cc:971 msgid " In analysis mode this stops analysis, otherwise it quits the program." msgstr "" " En analiza reÄimo tio ĉi haltigas la analizon, alie Äi eliras la programon." #: src/frontend/cmd.cc:973 msgid " Produces a help blurb corresponding to this list of commands." msgstr " Produktas helpan resumon korespondan al tiu ĉi listo de komandoj." #: src/frontend/cmd.cc:975 msgid " add - compiles book.bin from a pgn book file" msgstr " add - kompilas book.bin el pgn-libra dosiero" #: src/frontend/cmd.cc:976 msgid " on - enables use of book (default)" msgstr " on - ebligas uzon de libro (aprioras)" #: src/frontend/cmd.cc:977 msgid " off - disables use of book" msgstr " off - malebligas uzon de libro" #: src/frontend/cmd.cc:978 msgid " worst - plays worst move from book" msgstr " worst - ludas plej malbonan movon el libro" #: src/frontend/cmd.cc:979 msgid " best - plays best move from book" msgstr " best - ludas plej bonan movon el libro" #: src/frontend/cmd.cc:980 msgid " prefer - same as 'book on' (default)" msgstr " prefer - same ol 'book on' (aprioras)" #: src/frontend/cmd.cc:981 msgid " random - plays any move from book" msgstr " random - ludas iu ajn movo el libro" #: src/frontend/cmd.cc:983 msgid " Prints out the version of this program." msgstr " Montras la version de tiu ĉi programo." #: src/frontend/cmd.cc:986 msgid " Backs up one move in pgn loaded game." msgstr " Savkopias unu movon en Åargita ludo pgn." #: src/frontend/cmd.cc:988 msgid " Saves the game so far from memory to the file." msgstr " Konservas la ludon Äis nun el memoro al la dosiero." #: src/frontend/cmd.cc:990 msgid " Loads the game in the file into memory." msgstr " Åœargas la ludon el la dosiero en memoron." #: src/frontend/cmd.cc:992 msgid "" " Loads the game in the file into memory, and enables\n" " the commands 'first', 'last', 'next', 'previous'." msgstr "" " Åœargas la ludon el la dosiero en memoron, kaj ebligas\n" " la komandojn 'first', 'last', 'next', 'previous'." #: src/frontend/cmd.cc:996 msgid " Advances one move in pgn loaded game." msgstr " AntaÅ­iras unu movon en Åargita ludo pgn." #: src/frontend/cmd.cc:998 msgid " Goes to begin position of pgn loaded game." msgstr " Iras al la komenca pozicio de Åargita ludo pgn." #: src/frontend/cmd.cc:1000 msgid " Goes to end position of pgn loaded game." msgstr " Iras al la fina pozicio de Åargita ludo pgn." #: src/frontend/cmd.cc:1003 msgid "" " Makes the program stop moving. You may now enter moves\n" " to reach some position in the future." msgstr "" " Igas ke la programo haltigu movi. Vi povas nun enigi\n" " movojn por atingi iun pozicion estontece." #: src/frontend/cmd.cc:1007 msgid " Program plays white." msgstr " La programo ludas la blankajn." #: src/frontend/cmd.cc:1009 msgid " Program plays black." msgstr " La programo ludas la nigrajn." #: src/frontend/cmd.cc:1011 msgid "" " Computer takes whichever side is on move and begins its\n" " thinking immediately." msgstr "" " La komputilo prenas iun ajn flanko kiu moviÄas kaj komencas\n" " Äian cerbumadon tuje." #: src/frontend/cmd.cc:1014 msgid "" " Arranges for verbose thinking output showing variation, score,\n" " time, depth, etc." msgstr "" " AranÄas detalan eligo pri cerbumado montranta variadon, poentojn,\n" " tempon, profundon, ktp." #: src/frontend/cmd.cc:1017 msgid " Turns off verbose thinking output." msgstr " MalÅaltas detalan eligon pri cerbumado." #: src/frontend/cmd.cc:1019 msgid "" " Lets you input your name. Also writes the log.nnn and\n" " corresponding game.nnn files. For details please see\n" " the auxiliary file format sections." msgstr "" " Permesas al vi enigi vian nomon. Ankaŭ skribas la dosieron\n" " log.nnn kaj korespondajn dosierojn game.nnn. Por pli da\n" " detaloj, bonvolu konsulti helpajn dosier-formajn sekciojn." #: src/frontend/cmd.cc:1023 msgid " Mostly used by Internet Chess Server." msgstr " Plejparte uzata de la Interreta Åœak-servilo." #: src/frontend/cmd.cc:1025 msgid "" " This command reactivates a game that has been terminated automatically\n" " due to checkmate or no more time on the clock. However, it does not\n" " alter those conditions. So you would have to undo a move or two, or\n" " add time to the clock with 'level' or 'time'." msgstr "" " Tiu ĉi komando reaktivigas ludon kiu aÅ­tomate finis pro Åakmato aÅ­ pro\n" " tempo-fino de la horloÄo. Tamen, Äi ne modifas tiuj kondiĉoj. Vi devos\n" " fari unu aŭ du movojn, aÅ­ aldoni tempon al la horloÄo per 'level' aÅ­\n" " 'time'." #: src/frontend/cmd.cc:1030 msgid " Inputs the estimated rating for computer and for its opponent." msgstr "" " Enigas la kalkulitajn pritaksado por la komputilo kaj Äiaj kontraÅ­uloj." #: src/frontend/cmd.cc:1032 msgid " Sets up a new game (i.e. pieces in original positions)." msgstr " Komencigas novan ludon (t.e. figurojn en originalaj pozicioj)." #: src/frontend/cmd.cc:1034 msgid "" " Inputs time left in game for computer in hundredths of a second.\n" " Mostly used by Internet Chess Server." msgstr "" " Enigas tempo restanta en la ludo por komputilo, laŭ centonoj da sekundo.\n" " Plejparte uzata de la Interreta Åœak-servilo." #: src/frontend/cmd.cc:1037 msgid " on - enables using the memory hash table to speed up search" msgstr " on - ebligas uzon de la memora haket-tabelo por rapidigi serĉon" #: src/frontend/cmd.cc:1038 msgid " off - disables the memory hash table" msgstr " off - malebligas la memoran haket-tabelon" #: src/frontend/cmd.cc:1040 msgid " Sets the hash table to permit storage of N MB." msgstr " Difinas ke la haket-tabelo permesas konservon de N MB." #: src/frontend/cmd.cc:1042 msgid " on - enables using the null-move heuristic to speed up search" msgstr " on - ebligas uzon de nul-mova heÅ­ristiko por rapidigi serĉon" #: src/frontend/cmd.cc:1043 msgid " off - disables using the null-move heuristic" msgstr " off - malebligas uzon de nul-mova heÅ­ristiko" #: src/frontend/cmd.cc:1045 msgid " on - enables use of xboard/winboard" msgstr " on - ebligas uzon de xboard/winboard" #: src/frontend/cmd.cc:1046 msgid " off - disables use of xboard/winboard" msgstr " off - malebligas uzon de xboard/winboard" #: src/frontend/cmd.cc:1048 msgid "" " Sets the program to look N ply (half-moves) deep for every\n" " search it performs. If there is a checkmate or other condition\n" " that does not allow that depth, then it will not be." msgstr "" " Difinas ke la programo serĉu N ply (duon-movoj) profundon por ĉiu\n" " serĉo kiun Äi aplikas. Se estas Åakmato aŭ alia kondiĉo, kiu\n" " ne permesas tiun profundon, tiam Äi ne okazos." #: src/frontend/cmd.cc:1052 msgid "" " Sets time control to be MOVES in MINUTES, with each move giving\n" " an INCREMENT (in seconds, i.e. a Fischer-style clock)." msgstr "" " Difinas ke temp-kontrolo estu MOVOJ en MINUTOJ, kun ĉiu movo\n" " rezultanta en PLIIGO (laÅ­ sekundoj, t.e. Fischer-stila horloÄo)." #: src/frontend/cmd.cc:1056 msgid " Loads a position in EPD format from disk into memory." msgstr " Åœargas pozicion laÅ­ formo EPD el disko al la memoro." #: src/frontend/cmd.cc:1059 msgid " Saves game position into EPD format from memory to disk." msgstr " Åœargas lud-pozicion laÅ­ formo EPD el memoro al la disko." #: src/frontend/cmd.cc:1061 msgid " Switches side to move." msgstr " ÅœanÄas flanko por movi." #: src/frontend/cmd.cc:1064 msgid " Solves the positions in FILENAME." msgstr " Solvas la poziciojn en DOSIERNOMO." #: src/frontend/cmd.cc:1066 msgid " Backs up two moves in game history." msgstr " Restarigas du movojn en la lud-historio." #: src/frontend/cmd.cc:1068 msgid " Backs up one move in game history." msgstr " Restarigas unu movon en la lud-historio." #: src/frontend/cmd.cc:1070 msgid " Displays command line syntax." msgstr " Montras la sintakso de komand-linio." #: src/frontend/cmd.cc:1072 msgid " board - displays the current board" msgstr " board - montras la kurantan tabulon" #: src/frontend/cmd.cc:1073 msgid " time - displays the time settings" msgstr " time - montras la agordojn pri tempo" #: src/frontend/cmd.cc:1074 msgid " moves - shows all moves using one call to routine" msgstr " moves - montras ĉiujn movojn uzante unu vokon al funkcio" #: src/frontend/cmd.cc:1075 msgid " escape - shows moves that escape from check using one call to routine" msgstr "" " escape - montras movojn kiuj eskapas el Åako uzante unu vokon al funkcio" #: src/frontend/cmd.cc:1076 msgid " noncapture - shows non-capture moves" msgstr " noncapture - montras ne-kaptigajn movojn" #: src/frontend/cmd.cc:1077 msgid " capture - shows capture moves" msgstr " capture - montri kaptigajn movojn" #: src/frontend/cmd.cc:1078 msgid " eval [or score] - shows the evaluation per piece and overall" msgstr " eval [aŭ score] - montras la takson por peco kaj Äeneralan" #: src/frontend/cmd.cc:1079 msgid " game - shows moves in game history" msgstr " game - montras movojn en la lud-historio" #: src/frontend/cmd.cc:1080 msgid " pin - shows pinned pieces" msgstr " pin - montras fiksitajn pecojn" #: src/frontend/cmd.cc:1082 msgid " movelist - reads in an epd file and shows legal moves for its entries" msgstr "" " movelist - legas epd-dosieron kaj montras permesatajn movojn el Äiaj enigoj" #: src/frontend/cmd.cc:1083 msgid "" " capture - reads in an epd file and shows legal captures for its entries" msgstr "" " capture - legas epd-dosieron kaj montras permesatajn kaptigojn el Äiaj " "enigoj" #: src/frontend/cmd.cc:1084 msgid " movegenspeed - tests speed of move generator" msgstr " movegenspeed - testas rapidon de la mov-generilo" #: src/frontend/cmd.cc:1085 msgid " capturespeed - tests speed of capture move generator" msgstr " capturespeed - testas rapidon de la kaptmov-generilo" #: src/frontend/cmd.cc:1086 msgid " eval - reads in an epd file and shows evaluation for its entries" msgstr " eval - legas epd-dosieron kaj montras pritakson el Äiaj enigoj" #: src/frontend/cmd.cc:1087 msgid " evalspeed - tests speed of the evaluator" msgstr " evalspeed - testas rapidon de la pritaksilo" #: src/frontend/cmd.cc:1089 msgid " Shows moves from opening book." msgstr " Montras movojn el libro pri malfermoj." #: src/frontend/cmd.cc:1091 msgid " Enables display board in graphic mode." msgstr " Ebligas montri la tabulon laŭ grafika reÄimo." #: src/frontend/cmd.cc:1093 msgid " Disables graphic mode and display classical view." msgstr " Malebligas grafikan reÄimon kaj montras klasika rigardo." #: src/frontend/cmd.cc:1119 #, c-format msgid "" "Help for command %s not found\n" "\n" msgstr "" "Helpo por la komando %s ne estis trovata\n" "\n" #: src/frontend/cmd.cc:1121 #, c-format msgid "List of commands: (help COMMAND to get more help)\n" msgstr "Listo de komandoj: (help KOMANDO por havi pli da helpo)\n" #: src/frontend/engine.cc:247 msgid "Black" msgstr "" #: src/frontend/engine.cc:247 msgid "White" msgstr "" #: src/frontend/engine.cc:333 #, c-format msgid "" "\n" "My move is : %s\n" msgstr "" #~ msgid " an INCREMENT (in seconds, i.e. Fischer-style clock)." #~ msgstr " PLIIGO (laÅ­ sekundoj, t.e. Fischer-stila horloÄo)." gnuchess-6.2.2/po/es.gmo000644 000766 000024 00000043323 12610434564 015716 0ustar00antoniostaff000000 000000 Þ•ŽŒ¿üø ù û  C- Mq 7¿ (÷ / 'P .x 7§ Jß 9*)d&ŽRµ#&,$SOx2Èû'+B)nF˜?ßh‘ˆ6gQ(¹^â&Agh[Ð(,>U”ªÀ9Ô//>±nx 8™Ò"òò- #!-E!s#•H¹5!FWAž=à)#H-lFš2á%%:`&|-£#Ñ$õ<>W–%±"×"ú#AG/X,ˆ-µ6ã/-J+x,¤÷Ñ.É ø "!!4! V!w!’!¬!½!Í!í!"6"O"b"2t"§"Ç"×"%ë"#$#B#_#{##¥# ¿#É#)â# $$51$ g$$t$™$±$>·$ö$%%)%=%P%%V%,|%)©%)Ó%ý%”&—'™'!ª'jÌ'Q7(>‰(,È(1õ(*')<R)/)W¿)B*+Z*0†*`·*+32+f+Z‚+8Ý+.,%E,5k,3¡,UÕ,G+-Šs-Æþ-=Å.]/)a/|‹/40x=0a¶0&15?1u1”1´1AÈ18 2GC2Ä‹2•P3<æ30#46T4%‹4±4üÃ5(À6,é6*7"A7Jd75¯7Kå7P18R‚8>Õ8.9<C9@€9NÁ9B:;S:3:!Ã: å:2;9;W;Qt;IÆ;"<53<0i<+š<)Æ<ð<÷<7 =4C=5x=>®=7í=5%>3[>4>Ä>7Ø?@$,@6Q@"ˆ@«@È@%á@"A*AJAgA2A$²A×A8òA$+BPBeB+ƒB*¯B'ÚB5C28C kC ŒC­C ÈC ÓC0ôC%D4D@QD ’D,ŸD!ÌDîDgöD^E}EšE"´E×E õE5F=7F*uF+ FÌFKŽ PH->+„!'Y/(.Z xN†‚^‹5a|fer@cB~bvn?pRS&)zD\*m, ;1$`s_ƒ%‡A4Tq9dW€Q=jˆ<Љwh]U3V8o kEIL6g…GtF{":XJŒ C0O7M#}uy2l[i My move is : %s --silent same as -q -M size, --memory=size specify memory usage in MB for hashtable -a filename, --addbook=filename compile book.bin from pgn book 'filename' -e, --easy disable thinking in opponents time -g, --graphic enable graphic mode -h, --help display this help and exit -m, --manual enable manual mode -p, --post start up showing thinking -q, --quiet make the program silent on startup -u, --uci enable UCI protocol (externally behave as UCI engine) -v, --version display version information and exit -x, --xboard start in engine mode Advances one move in pgn loaded game. Arranges for verbose thinking output showing variation, score, time, depth, etc. Backs up one move in game history. Backs up one move in pgn loaded game. Backs up two moves in game history. Computer takes whichever side is on move and begins its thinking immediately. Disables graphic mode and display classical view. Displays command line syntax. Enables display board in graphic mode. Goes to begin position of pgn loaded game. Goes to end position of pgn loaded game. In analysis mode this stops analysis, otherwise it quits the program. Inputs the estimated rating for computer and for its opponent. Inputs time left in game for computer in hundredths of a second. Mostly used by Internet Chess Server. Lets you input your name. Also writes the log.nnn and corresponding game.nnn files. For details please see the auxiliary file format sections. Loads a position in EPD format from disk into memory. Loads the game in the file into memory, and enables the commands 'first', 'last', 'next', 'previous'. Loads the game in the file into memory. Makes the program stop moving. You may now enter moves to reach some position in the future. Mostly used by Internet Chess Server. Moves are accepted either in standard algebraic notation (SAN) or in coordinate algebraic notation. Options xboard and post are accepted without leading dashes for backward compatibility. Prints out the version of this program. Produces a help blurb corresponding to this list of commands. Program plays black. Program plays white. Quits the program. Saves game position into EPD format from memory to disk. Saves the game so far from memory to the file. Sets the hash table to permit storage of N MB. Sets the program to look N ply (half-moves) deep for every search it performs. If there is a checkmate or other condition that does not allow that depth, then it will not be. Sets time control to be MOVES in MINUTES, with each move giving an INCREMENT (in seconds, i.e. a Fischer-style clock). Sets up a new game (i.e. pieces in original positions). Shows moves from opening book. Solves the positions in FILENAME. Switches side to move. The file 'gnuchess.ini' allows setting config options. See 'info gnuchess' for details. The file will be looked up in the current directory or, if not found there, in the directory pointed to by environment variable GNUCHESS_PKGDATADIR. This command reactivates a game that has been terminated automatically due to checkmate or no more time on the clock. However, it does not alter those conditions. So you would have to undo a move or two, or add time to the clock with 'level' or 'time'. Turns off verbose thinking output. add - compiles book.bin from a pgn book file best - plays best move from book board - displays the current board capture - reads in an epd file and shows legal captures for its entries capture - shows capture moves capturespeed - tests speed of capture move generator escape - shows moves that escape from check using one call to routine eval - reads in an epd file and shows evaluation for its entries eval [or score] - shows the evaluation per piece and overall evalspeed - tests speed of the evaluator game - shows moves in game history movegenspeed - tests speed of move generator movelist - reads in an epd file and shows legal moves for its entries moves - shows all moves using one call to routine noncapture - shows non-capture moves off - disables the memory hash table off - disables use of book off - disables use of xboard/winboard off - disables using the null-move heuristic on - enables use of book (default) on - enables use of xboard/winboard on - enables using the memory hash table to speed up search on - enables using the null-move heuristic to speed up search pin - shows pinned pieces prefer - same as 'book on' (default) random - plays any move from book time - displays the time settings worst - plays worst move from bookBlackBoard is wrong! Command 'activate' is currently not supported. Command 'black' is currently not supported. Command 'random' is currently not supported. Command 'show eval/score' is currently not supported. Command 'show pin' is currently not supported. Command 'switch' is currently not supported. Command 'test' is currently not supported. Command 'white' is currently not supported. Copyright (C) %s Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Could not create logfile, all slots occupied. Error reading file '%s' Failed to open %s for writing: %s File name is too long (max = %d) Fischer increment of %d seconds Graphic mode is disabled. Graphic mode is enabled. Hashing is off. Hashing is on. Help for command %s not found Incorrect book option Incorrect epd file Initial position reached. There are no earlier moves. Invalid filename. Invalid move: %s List of commands: (help COMMAND to get more help) Memory out of Range or Invalid My rating = %d New TimeLimit = %g No more moves. Game reached the end. No moves to undo! No. of moves generated = %ld Null-move heuristic is off. Null-move heuristic is on. Old TimeLimit = %g Opponent rating = %d Option Processing Failed Options: Play the game of chess Report bugs to . Save to %s Search to a depth of %d The syntax to add a new book is: book add file.pgn Thinking... Time Control: %d moves in %.2f secs Usage: %s [OPTION]... WhiteYou may consider deleting or renaming your existing logfiles. book is now best book is now off book is now on book is now random book is now worst movesmy rating = %d, opponent rating = %d name - list known players alphabetically reverse - list by GNU worst result first score - list by GNU best result first timeProject-Id-Version: gnuchess 6.2.2-rc1 Report-Msgid-Bugs-To: bug-gnu-chess@gnu.org POT-Creation-Date: 2015-10-17 14:05+0200 PO-Revision-Date: 2015-09-16 23:32+0200 Last-Translator: Antonio Ceballos Language-Team: Spanish Language: es MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Mi jugada : %s --silent igual que -q -M tamaño, --memory=tamaño especifica el uso de memoria en MB para la tabla de transposición (hash) -a fichero, --addbook=fichero compila book.bin desde el libro pgn 'fichero' -e, --easy no piensa durante el turno del adversario -g, --graphic activa el modo gráfico -h, --help muestra esta ayuda y termina -m, --manual activa el modo manual -p, --post arranca en modo 'mostrar lo que piensa' -q, --quiet arranca de modo silencioso -u, --uci activa el protocolo UCI (externamente se exhibe como un motor UCI) -v, --version muestra información de la versión y termina -x, --xboard arranca en modo xboard Avanza un movimiento de la partida pgn cargada. Configura la salida en modo verboso mostrando variante, puntuación, tiempo, profundidad, etc. Retrocede un movimiento. Retrocede un movimiento en la partida pgn cargada. Retrocede dos movimientos. El ordenador juega con el color al que le toca mover y comienza a pensar inmediatamente. Desactiva el modo gráfico y muestra la vista clásica. Muestra la sintaxis de la línea de órdenes. Activa el modo gráfico del tablero. Va a la posición inicial de la partida pgn cargada. Va a la posición final de la partida pgn cargada. En el modo de análisis, detiene el análisis; en caso contrario, sale del programa. Introduce la puntuación estimada del ordenador y la de su adversario. Introduce el tiempo de partida que le queda al ordenador en centésimas de segundo. Principalmente utilizado por Internet Chess Server. Permite al jugador introducir su nombre. También escribe el fichero log.nnn y el correspondiente fichero game.nnn. Para detalles, véanse las secciones sobre formato de los ficheros auxiliares. Carga en memoria una posición de un fichero en formato EPD. Carga en memoria la partida del fichero y activa los commandos first, last, next, previous. Carga en memoria la partida del fichero. Hace que el programa deje de mover. Ahora se pueden introducir movimientos para llegar a una determinada posición futura. Principalmente utilizado por Internet Chess Server. Se aceptan movimientos en notación algebraica estándar (SAN, en inglés) o en notación algebraica de coordenadas. Se admiten las opciones xboard y post sin guiones por compatibilidad con versiones anteiores. Imprime la versión de este programa. Ofrece ayuda relacionada con esta lista de órdenes. El programa juega con negras. El programa juega con blancas. Sale del programa. Guarda la posición de una partida en un fichero en formato EPD. Guarda la posición actual de la partida en un fichero. Configura la tabla de transposiciones (hash) para poder almacenar N MB Configura el programa para buscar N ply (medios movimientos) de profundidad cada vez que busca. Si se llega a jaque mate o a otra condición que no permita esa profundidad, entonces no se hace. Configura el control de tiempo a MOVIMIENTOS en MINUTOS, aumentando INCREMENTO (en segundos) con cada movimiento (es decir, reloj de tipo Fischer). Prepara una nueva partida (piezas en la posición inicial). Muestra los movimientos del libro de aperturas. Resuelve las posiciones que se encuentran en FICHERO. Cambia el lado al que le toca mover. El fichero 'gnuchess.ini' permite establecer opciones de configuración. Véase 'info gnuchess' para consultar detalles. El fichero se busca en el directorio actual y, si no se encuentra allí, en el directorio indicado por la variable de entorno GNUCHESS_PKGDATADIR. Esta orden reactiva una partida que había terminado automáticamente por jaque mate o por tiempo agotado. Sin embargo, no altera esas condiciones. Habría que deshacer un movimiento o dos o añadir tiempo al reloj con 'level' o 'time' en ese caso. Desactiva el modo verboso de la salida. add - compila book.bin desde un fichero pgn worst - realiza la mejor jugada del libro board - muestra el tablero actual capture - lee un fichero epd y muestra las capturas válidas que contiene capture - muestra los movimientos que capturan pieza capturespeed - prueba la velocidad del generador de movimientos de captura escape - muestra los movimientos que sacan de jaque usando una llamada a rutina eval - lee un fichero epd y muestra la evaluación de las posiciones que contiene eval [o score] - muestra la evaluación por pieza y la global evalspeed - prueba la velocidad del evaluador game - muestra los movimientos de la historia de la partida movegenspeed - prueba la velocidad del generador de movimientos movelist - lee un fichero epd y muestra los movimientos válidos que contiene moves - muestra todos los movimientos usando una llamada a rutina noncapture - muestra los movimientos que no capturan pieza off - desactiva la tabla de transposiciones (hash) off - desactiva el uso del libro off - desactiva xboard/winboard off - desactiva la heurística de movimiento nulo on - activa el uso del libro no - activa xboard/winboard on - activa el uso de tabla de transposiciones (hash) para acelerar la búsqueda on - activa la heurística de movimiento nulo para acelerar la búsqueda pin - muestra las piezas clavadas prefer - opción predeterminada, igual que 'book on' worst - realiza una jugada cualquiera del libro time - muestra la configuración de tiempo worst - realiza la peor jugada del libroNegrasTablero incorrecto La orden 'activate' no está implementada actualmente. La orden 'black' no está implementada actualmente. La orden 'random' no está implementada actualmente. La orden 'show eval/score' no está implementada actualmente. La orden 'show pin' no está implementada actualmente. La orden 'switch' no está implementada actualmente. La orden 'test' no está implementada actualmente. La orden 'white' no está implementada actualmente. Copyright (C) %s Free Software Foundation, Inc. Licencia GPLv3+: GNU GPL versión 3 o posterior Esto es software libre: es usted libre de modificarlo y redistribuirlo. NO HAY NINGUNA GARANTÃA, dentro de los límites permitidos por la ley. No se pudo crear fichero de log, no hay espacio libre. Error leyendo fichero '%s' Fallo al abrir %s para escribir: %s El nombre del fichero es demasiado largo (máx. = %d) Incremento Fischer de %d segundos Modo gráfico desactiviado. Modo gráfico activado. Tabla de transposición desactivada. Tabla de transposición activada. No hay ayuda para la orden %s Opción de libro incorrecta Fichero epd incorrecto Posición inicial. No hay movimientos anteriores. El nombre de fichero no es válido. Movimiento no válido: %s Lista de órdenes: (help ORDEN para obtener más ayuda) Memoria fuera de rango o no válida Mi puntuación = %d Límite de tiempo nuevo = %g No hay más movimientos. Final de partida. ¡No hay ningún movimiento que deshacer! Número de movimientos generados = %ld La heurística de movimiento nulo está desactivada. La heurística de movimiento nulo está activada. Límite de tiempo anterior = %g Puntuación del adversario = %d Fallo al procesar opción Opciones: Programa para jugar al ajedrez Imformar de errores a . Guardar en %s Profundidad de búsqueda %d La sintaxis para añadir un nuevo libro es: book add file.pgn Pensando... Control de tiempo: %d movimientos en %.2f s Modo de empleo: %s [OPCIÓN]... Blancas Puede usted considerar la opción de borrar o renombrar los ficheros de log que existen actualmente. El libro está en modo mejor. El libro está desactivado. El libro está activado. El libro está en modo aleatorio. El libro está en modo peor. movimientosmi puntuación = %d, puntuación del adversario = %d name - lista de jugadores conocidos por orden alfabético inversa - lista por peor resultado de GNU puntos - lista por mejor resultado de GNU tiempognuchess-6.2.2/po/es.po000644 000766 000024 00000055627 12610434564 015564 0ustar00antoniostaff000000 000000 # Spanish translations for gnuchess package # Traducciones al español para el paquete gnuchess. # Copyright (C) 2013, 2014, 2015 Free Software Foundation, Inc. # This file is distributed under the same license as the gnuchess package. # Antonio Ceballos , 2013, 2014, 2015. # msgid "" msgstr "" "Project-Id-Version: gnuchess 6.2.2-rc1\n" "Report-Msgid-Bugs-To: bug-gnu-chess@gnu.org\n" "POT-Creation-Date: 2015-10-17 14:05+0200\n" "PO-Revision-Date: 2015-09-16 23:32+0200\n" "Last-Translator: Antonio Ceballos \n" "Language-Team: Spanish \n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: src/main.cc:317 #, c-format msgid "Memory out of Range or Invalid\n" msgstr "Memoria fuera de rango o no válida\n" #: src/main.cc:334 #, c-format msgid "File name is too long (max = %d)\n" msgstr "El nombre del fichero es demasiado largo (máx. = %d)\n" #: src/main.cc:340 msgid "Option Processing Failed\n" msgstr "Fallo al procesar opción\n" #: src/main.cc:381 #, c-format msgid "" "Copyright (C) %s Free Software Foundation, Inc.\n" "License GPLv3+: GNU GPL version 3 or later \n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" msgstr "" "Copyright (C) %s Free Software Foundation, Inc.\n" "Licencia GPLv3+: GNU GPL versión 3 o posterior\n" "\n" "Esto es software libre: es usted libre de modificarlo y redistribuirlo.\n" "NO HAY NINGUNA GARANTÃA, dentro de los límites permitidos por la ley.\n" #: src/main.cc:494 #, c-format msgid "Thinking...\n" msgstr "Pensando...\n" #: src/frontend/cmd.cc:101 #, c-format msgid "Command 'activate' is currently not supported.\n" msgstr "La orden 'activate' no está implementada actualmente.\n" #: src/frontend/cmd.cc:131 #, c-format msgid "Command 'black' is currently not supported.\n" msgstr "La orden 'black' no está implementada actualmente.\n" #: src/frontend/cmd.cc:140 #, c-format msgid "" "The syntax to add a new book is:\n" "\n" "\tbook add file.pgn\n" msgstr "" "La sintaxis para añadir un nuevo libro es:\n" "\n" "\tbook add file.pgn\n" #: src/frontend/cmd.cc:147 #, c-format msgid "book is now on\n" msgstr "El libro está activado.\n" #: src/frontend/cmd.cc:150 #, c-format msgid "book is now off\n" msgstr "El libro está desactivado.\n" #: src/frontend/cmd.cc:153 #, c-format msgid "book is now best\n" msgstr "El libro está en modo mejor.\n" #: src/frontend/cmd.cc:156 #, c-format msgid "book is now worst\n" msgstr "El libro está en modo peor.\n" #: src/frontend/cmd.cc:159 #, c-format msgid "book is now random\n" msgstr "El libro está en modo aleatorio.\n" #: src/frontend/cmd.cc:161 #, c-format msgid "Incorrect book option\n" msgstr "Opción de libro incorrecta\n" #: src/frontend/cmd.cc:174 #, c-format msgid "Search to a depth of %d\n" msgstr "Profundidad de búsqueda %d\n" #: src/frontend/cmd.cc:240 #, c-format msgid "Hashing is on.\n" msgstr "Tabla de transposición activada.\n" #: src/frontend/cmd.cc:242 #, c-format msgid "Hashing is off.\n" msgstr "Tabla de transposición desactivada.\n" #: src/frontend/cmd.cc:268 src/frontend/cmd.cc:278 #, c-format msgid "Fischer increment of %d seconds\n" msgstr "Incremento Fischer de %d segundos\n" #. TRANSLATORS: Please be aware that the word 'move' is sometimes #. used as a synonym of 'ply', and sometimes in the sense of a #. full 2-ply move. #: src/frontend/cmd.cc:276 #, c-format msgid "Time Control: %d moves in %.2f secs\n" msgstr "Control de tiempo: %d movimientos en %.2f s\n" #: src/frontend/cmd.cc:286 #, c-format msgid "name - list known players alphabetically\n" msgstr "name - lista de jugadores conocidos por orden alfabético\n" #: src/frontend/cmd.cc:287 #, c-format msgid "score - list by GNU best result first \n" msgstr "puntos - lista por mejor resultado de GNU\n" #: src/frontend/cmd.cc:288 #, c-format msgid "reverse - list by GNU worst result first\n" msgstr "inversa - lista por peor resultado de GNU\n" #: src/frontend/cmd.cc:303 src/frontend/cmd.cc:1301 #, c-format msgid "Board is wrong!\n" msgstr "Tablero incorrecto\n" #: src/frontend/cmd.cc:309 src/frontend/cmd.cc:312 #, c-format msgid "Error reading file '%s'\n" msgstr "Error leyendo fichero '%s'\n" #: src/frontend/cmd.cc:378 #, c-format msgid "Failed to open %s for writing: %s\n" msgstr "Fallo al abrir %s para escribir: %s\n" #: src/frontend/cmd.cc:384 #, c-format msgid "Could not create logfile, all slots occupied.\n" msgstr "No se pudo crear fichero de log, no hay espacio libre.\n" #: src/frontend/cmd.cc:385 #, c-format msgid "You may consider deleting or renaming your existing logfiles.\n" msgstr "" " Puede usted considerar la opción de borrar o renombrar los ficheros\n" " de log que existen actualmente.\n" #: src/frontend/cmd.cc:417 #, c-format msgid "Null-move heuristic is on.\n" msgstr "La heurística de movimiento nulo está activada.\n" #: src/frontend/cmd.cc:419 #, c-format msgid "Null-move heuristic is off.\n" msgstr "La heurística de movimiento nulo está desactivada.\n" #: src/frontend/cmd.cc:439 src/frontend/cmd.cc:466 #, c-format msgid "Incorrect epd file\n" msgstr "Fichero epd incorrecto\n" #: src/frontend/cmd.cc:510 #, c-format msgid "No more moves. Game reached the end.\n" msgstr "No hay más movimientos. Final de partida.\n" #: src/frontend/cmd.cc:530 #, c-format msgid "Initial position reached. There are no earlier moves.\n" msgstr "Posición inicial. No hay movimientos anteriores.\n" #: src/frontend/cmd.cc:586 src/frontend/cmd.cc:692 #, c-format msgid "Invalid filename.\n" msgstr "El nombre de fichero no es válido.\n" #: src/frontend/cmd.cc:592 #, c-format msgid "Graphic mode is enabled.\n" msgstr "Modo gráfico activado.\n" #: src/frontend/cmd.cc:598 #, c-format msgid "Graphic mode is disabled.\n" msgstr "Modo gráfico desactiviado.\n" #: src/frontend/cmd.cc:639 #, c-format msgid "Command 'random' is currently not supported.\n" msgstr "La orden 'random' no está implementada actualmente.\n" #: src/frontend/cmd.cc:647 #, c-format msgid "my rating = %d, opponent rating = %d\n" msgstr "mi puntuación = %d, puntuación del adversario = %d\n" #: src/frontend/cmd.cc:671 src/frontend/cmd.cc:741 #, c-format msgid "No moves to undo!\n" msgstr "¡No hay ningún movimiento que deshacer!\n" #: src/frontend/cmd.cc:681 #, c-format msgid "Save to %s\n" msgstr "Guardar en %s\n" #: src/frontend/cmd.cc:722 #, c-format msgid "Command 'switch' is currently not supported.\n" msgstr "La orden 'switch' no está implementada actualmente.\n" #: src/frontend/cmd.cc:728 #, c-format msgid "Old TimeLimit = %g\n" msgstr "Límite de tiempo anterior = %g\n" #: src/frontend/cmd.cc:730 #, c-format msgid "New TimeLimit = %g\n" msgstr "Límite de tiempo nuevo = %g\n" #: src/frontend/cmd.cc:750 #, c-format msgid "" "Usage: %s [OPTION]...\n" "\n" msgstr "" "Modo de empleo: %s [OPCIÓN]...\n" "\n" #: src/frontend/cmd.cc:752 msgid "" "Play the game of chess\n" "\n" msgstr "" "Programa para jugar al ajedrez\n" "\n" #: src/frontend/cmd.cc:754 msgid "Options:\n" msgstr "Opciones:\n" #: src/frontend/cmd.cc:755 msgid " -h, --help display this help and exit\n" msgstr " -h, --help muestra esta ayuda y termina\n" #: src/frontend/cmd.cc:757 msgid " -v, --version display version information and exit\n" msgstr " -v, --version muestra información de la versión y termina\n" #: src/frontend/cmd.cc:759 msgid " -q, --quiet make the program silent on startup\n" msgstr " -q, --quiet arranca de modo silencioso\n" #: src/frontend/cmd.cc:761 msgid " --silent same as -q\n" msgstr " --silent igual que -q\n" #: src/frontend/cmd.cc:763 src/frontend/cmd.cc:781 msgid "\n" msgstr "\n" #: src/frontend/cmd.cc:765 msgid " -x, --xboard start in engine mode\n" msgstr " -x, --xboard arranca en modo xboard\n" #: src/frontend/cmd.cc:767 msgid " -p, --post start up showing thinking\n" msgstr " -p, --post arranca en modo 'mostrar lo que piensa'\n" #: src/frontend/cmd.cc:769 msgid " -e, --easy disable thinking in opponents time\n" msgstr " -e, --easy no piensa durante el turno del adversario\n" #: src/frontend/cmd.cc:771 msgid " -m, --manual enable manual mode\n" msgstr " -m, --manual activa el modo manual\n" #: src/frontend/cmd.cc:773 msgid "" " -u, --uci enable UCI protocol (externally behave as UCI engine)\n" msgstr "" " -u, --uci activa el protocolo UCI (externamente se exhibe como un " "motor UCI)\n" #: src/frontend/cmd.cc:775 msgid " -M size, --memory=size specify memory usage in MB for hashtable\n" msgstr "" " -M tamaño, --memory=tamaño especifica el uso de memoria en MB para la " "tabla de transposición (hash)\n" #: src/frontend/cmd.cc:777 msgid "" " -a filename, --addbook=filename compile book.bin from pgn book " "'filename'\n" msgstr "" " -a fichero, --addbook=fichero compila book.bin desde el libro pgn " "'fichero'\n" #: src/frontend/cmd.cc:779 msgid " -g, --graphic enable graphic mode\n" msgstr " -g, --graphic activa el modo gráfico\n" #: src/frontend/cmd.cc:783 msgid "" " Options xboard and post are accepted without leading dashes\n" " for backward compatibility.\n" "\n" msgstr "" " Se admiten las opciones xboard y post sin guiones\n" " por compatibilidad con versiones anteiores.\n" "\n" #: src/frontend/cmd.cc:787 msgid "" " Moves are accepted either in standard algebraic notation (SAN) or\n" " in coordinate algebraic notation.\n" "\n" msgstr "" " Se aceptan movimientos en notación algebraica estándar (SAN, en inglés) o\n" " en notación algebraica de coordenadas.\n" "\n" #: src/frontend/cmd.cc:791 msgid "" " The file 'gnuchess.ini' allows setting config options. See\n" " 'info gnuchess' for details. The file will be looked up in the current\n" " directory or, if not found there, in the directory pointed to by\n" " environment variable GNUCHESS_PKGDATADIR.\n" "\n" msgstr "" " El fichero 'gnuchess.ini' permite establecer opciones de configuración.\n" " Véase 'info gnuchess' para consultar detalles. El fichero se busca en el\n" " directorio actual y, si no se encuentra allí, en el directorio\n" " indicado por la variable de entorno GNUCHESS_PKGDATADIR.\n" "\n" #: src/frontend/cmd.cc:797 msgid "" "Report bugs to .\n" "\n" msgstr "" "Imformar de errores a .\n" "\n" #: src/frontend/cmd.cc:844 src/frontend/cmd.cc:1280 #, c-format msgid "Invalid move: %s\n" msgstr "Movimiento no válido: %s\n" #: src/frontend/cmd.cc:862 #, c-format msgid "Command 'white' is currently not supported.\n" msgstr "La orden 'white' no está implementada actualmente.\n" #: src/frontend/cmd.cc:893 #, c-format msgid "My rating = %d\n" msgstr "Mi puntuación = %d\n" #: src/frontend/cmd.cc:894 #, c-format msgid "Opponent rating = %d\n" msgstr "Puntuación del adversario = %d\n" #: src/frontend/cmd.cc:896 msgid "time" msgstr "tiempo" #: src/frontend/cmd.cc:898 msgid "moves" msgstr "movimientos" #: src/frontend/cmd.cc:903 src/frontend/cmd.cc:910 src/frontend/cmd.cc:919 #: src/frontend/cmd.cc:928 #, c-format msgid "No. of moves generated = %ld\n" msgstr "Número de movimientos generados = %ld\n" #: src/frontend/cmd.cc:932 #, c-format msgid "Command 'show eval/score' is currently not supported.\n" msgstr "La orden 'show eval/score' no está implementada actualmente.\n" #: src/frontend/cmd.cc:939 #, c-format msgid "Command 'show pin' is currently not supported.\n" msgstr "La orden 'show pin' no está implementada actualmente.\n" #: src/frontend/cmd.cc:951 #, c-format msgid "Command 'test' is currently not supported.\n" msgstr "La orden 'test' no está implementada actualmente.\n" #: src/frontend/cmd.cc:969 msgid " Quits the program." msgstr " Sale del programa." #: src/frontend/cmd.cc:971 msgid " In analysis mode this stops analysis, otherwise it quits the program." msgstr "" " En el modo de análisis, detiene el análisis; en caso contrario, sale del " "programa." #: src/frontend/cmd.cc:973 msgid " Produces a help blurb corresponding to this list of commands." msgstr " Ofrece ayuda relacionada con esta lista de órdenes." #: src/frontend/cmd.cc:975 msgid " add - compiles book.bin from a pgn book file" msgstr " add - compila book.bin desde un fichero pgn" #: src/frontend/cmd.cc:976 msgid " on - enables use of book (default)" msgstr " on - activa el uso del libro" #: src/frontend/cmd.cc:977 msgid " off - disables use of book" msgstr " off - desactiva el uso del libro" #: src/frontend/cmd.cc:978 msgid " worst - plays worst move from book" msgstr " worst - realiza la peor jugada del libro" #: src/frontend/cmd.cc:979 msgid " best - plays best move from book" msgstr " worst - realiza la mejor jugada del libro" #: src/frontend/cmd.cc:980 msgid " prefer - same as 'book on' (default)" msgstr " prefer - opción predeterminada, igual que 'book on'" #: src/frontend/cmd.cc:981 msgid " random - plays any move from book" msgstr " worst - realiza una jugada cualquiera del libro" #: src/frontend/cmd.cc:983 msgid " Prints out the version of this program." msgstr " Imprime la versión de este programa." #: src/frontend/cmd.cc:986 msgid " Backs up one move in pgn loaded game." msgstr " Retrocede un movimiento en la partida pgn cargada." #: src/frontend/cmd.cc:988 msgid " Saves the game so far from memory to the file." msgstr " Guarda la posición actual de la partida en un fichero." #: src/frontend/cmd.cc:990 msgid " Loads the game in the file into memory." msgstr " Carga en memoria la partida del fichero." #: src/frontend/cmd.cc:992 msgid "" " Loads the game in the file into memory, and enables\n" " the commands 'first', 'last', 'next', 'previous'." msgstr "" " Carga en memoria la partida del fichero y activa\n" " los commandos first, last, next, previous." #: src/frontend/cmd.cc:996 msgid " Advances one move in pgn loaded game." msgstr " Avanza un movimiento de la partida pgn cargada." #: src/frontend/cmd.cc:998 msgid " Goes to begin position of pgn loaded game." msgstr " Va a la posición inicial de la partida pgn cargada." #: src/frontend/cmd.cc:1000 msgid " Goes to end position of pgn loaded game." msgstr " Va a la posición final de la partida pgn cargada." #: src/frontend/cmd.cc:1003 msgid "" " Makes the program stop moving. You may now enter moves\n" " to reach some position in the future." msgstr "" " Hace que el programa deje de mover. Ahora se pueden introducir movimientos\n" " para llegar a una determinada posición futura." #: src/frontend/cmd.cc:1007 msgid " Program plays white." msgstr " El programa juega con blancas." #: src/frontend/cmd.cc:1009 msgid " Program plays black." msgstr " El programa juega con negras." #: src/frontend/cmd.cc:1011 msgid "" " Computer takes whichever side is on move and begins its\n" " thinking immediately." msgstr "" " El ordenador juega con el color al que le toca mover y\n" " comienza a pensar inmediatamente." #: src/frontend/cmd.cc:1014 msgid "" " Arranges for verbose thinking output showing variation, score,\n" " time, depth, etc." msgstr "" " Configura la salida en modo verboso mostrando variante,\n" " puntuación, tiempo, profundidad, etc." #: src/frontend/cmd.cc:1017 msgid " Turns off verbose thinking output." msgstr " Desactiva el modo verboso de la salida." #: src/frontend/cmd.cc:1019 msgid "" " Lets you input your name. Also writes the log.nnn and\n" " corresponding game.nnn files. For details please see\n" " the auxiliary file format sections." msgstr "" " Permite al jugador introducir su nombre. También escribe el\n" " fichero log.nnn y el correspondiente fichero game.nnn. Para\n" " detalles, véanse las secciones sobre formato de los ficheros\n" " auxiliares." #: src/frontend/cmd.cc:1023 msgid " Mostly used by Internet Chess Server." msgstr " Principalmente utilizado por Internet Chess Server." #: src/frontend/cmd.cc:1025 msgid "" " This command reactivates a game that has been terminated automatically\n" " due to checkmate or no more time on the clock. However, it does not\n" " alter those conditions. So you would have to undo a move or two, or\n" " add time to the clock with 'level' or 'time'." msgstr "" " Esta orden reactiva una partida que había terminado automáticamente\n" " por jaque mate o por tiempo agotado. Sin embargo, no altera\n" " esas condiciones. Habría que deshacer un movimiento o dos o\n" " añadir tiempo al reloj con 'level' o 'time' en ese caso." #: src/frontend/cmd.cc:1030 msgid " Inputs the estimated rating for computer and for its opponent." msgstr " Introduce la puntuación estimada del ordenador y la de su adversario." #: src/frontend/cmd.cc:1032 msgid " Sets up a new game (i.e. pieces in original positions)." msgstr " Prepara una nueva partida (piezas en la posición inicial)." #: src/frontend/cmd.cc:1034 msgid "" " Inputs time left in game for computer in hundredths of a second.\n" " Mostly used by Internet Chess Server." msgstr "" " Introduce el tiempo de partida que le queda al ordenador en\n" " centésimas de segundo. Principalmente utilizado por\n" " Internet Chess Server." #: src/frontend/cmd.cc:1037 msgid " on - enables using the memory hash table to speed up search" msgstr "" " on - activa el uso de tabla de transposiciones (hash) para acelerar la " "búsqueda" #: src/frontend/cmd.cc:1038 msgid " off - disables the memory hash table" msgstr " off - desactiva la tabla de transposiciones (hash)" #: src/frontend/cmd.cc:1040 msgid " Sets the hash table to permit storage of N MB." msgstr "" " Configura la tabla de transposiciones (hash) para poder almacenar N MB" #: src/frontend/cmd.cc:1042 msgid " on - enables using the null-move heuristic to speed up search" msgstr "" " on - activa la heurística de movimiento nulo para acelerar la búsqueda" #: src/frontend/cmd.cc:1043 msgid " off - disables using the null-move heuristic" msgstr " off - desactiva la heurística de movimiento nulo" #: src/frontend/cmd.cc:1045 msgid " on - enables use of xboard/winboard" msgstr " no - activa xboard/winboard" #: src/frontend/cmd.cc:1046 msgid " off - disables use of xboard/winboard" msgstr " off - desactiva xboard/winboard" #: src/frontend/cmd.cc:1048 msgid "" " Sets the program to look N ply (half-moves) deep for every\n" " search it performs. If there is a checkmate or other condition\n" " that does not allow that depth, then it will not be." msgstr "" " Configura el programa para buscar N ply (medios movimientos) de\n" " profundidad cada vez que busca. Si se llega a jaque mate o a otra\n" " condición que no permita esa profundidad, entonces no se hace." #: src/frontend/cmd.cc:1052 msgid "" " Sets time control to be MOVES in MINUTES, with each move giving\n" " an INCREMENT (in seconds, i.e. a Fischer-style clock)." msgstr "" " Configura el control de tiempo a MOVIMIENTOS en MINUTOS, aumentando\n" " INCREMENTO (en segundos) con cada movimiento (es decir, reloj de tipo " "Fischer)." #: src/frontend/cmd.cc:1056 msgid " Loads a position in EPD format from disk into memory." msgstr " Carga en memoria una posición de un fichero en formato EPD." #: src/frontend/cmd.cc:1059 msgid " Saves game position into EPD format from memory to disk." msgstr " Guarda la posición de una partida en un fichero en formato EPD." #: src/frontend/cmd.cc:1061 msgid " Switches side to move." msgstr " Cambia el lado al que le toca mover." #: src/frontend/cmd.cc:1064 msgid " Solves the positions in FILENAME." msgstr " Resuelve las posiciones que se encuentran en FICHERO." #: src/frontend/cmd.cc:1066 msgid " Backs up two moves in game history." msgstr " Retrocede dos movimientos." #: src/frontend/cmd.cc:1068 msgid " Backs up one move in game history." msgstr " Retrocede un movimiento." #: src/frontend/cmd.cc:1070 msgid " Displays command line syntax." msgstr " Muestra la sintaxis de la línea de órdenes." #: src/frontend/cmd.cc:1072 msgid " board - displays the current board" msgstr " board - muestra el tablero actual" #: src/frontend/cmd.cc:1073 msgid " time - displays the time settings" msgstr " time - muestra la configuración de tiempo" #: src/frontend/cmd.cc:1074 msgid " moves - shows all moves using one call to routine" msgstr " moves - muestra todos los movimientos usando una llamada a rutina" #: src/frontend/cmd.cc:1075 msgid " escape - shows moves that escape from check using one call to routine" msgstr "" " escape - muestra los movimientos que sacan de jaque usando una llamada a " "rutina" #: src/frontend/cmd.cc:1076 msgid " noncapture - shows non-capture moves" msgstr " noncapture - muestra los movimientos que no capturan pieza" #: src/frontend/cmd.cc:1077 msgid " capture - shows capture moves" msgstr " capture - muestra los movimientos que capturan pieza" #: src/frontend/cmd.cc:1078 msgid " eval [or score] - shows the evaluation per piece and overall" msgstr " eval [o score] - muestra la evaluación por pieza y la global" #: src/frontend/cmd.cc:1079 msgid " game - shows moves in game history" msgstr " game - muestra los movimientos de la historia de la partida" #: src/frontend/cmd.cc:1080 msgid " pin - shows pinned pieces" msgstr " pin - muestra las piezas clavadas" #: src/frontend/cmd.cc:1082 msgid " movelist - reads in an epd file and shows legal moves for its entries" msgstr "" " movelist - lee un fichero epd y muestra los movimientos válidos que contiene" #: src/frontend/cmd.cc:1083 msgid "" " capture - reads in an epd file and shows legal captures for its entries" msgstr "" " capture - lee un fichero epd y muestra las capturas válidas que contiene" #: src/frontend/cmd.cc:1084 msgid " movegenspeed - tests speed of move generator" msgstr " movegenspeed - prueba la velocidad del generador de movimientos" #: src/frontend/cmd.cc:1085 msgid " capturespeed - tests speed of capture move generator" msgstr "" " capturespeed - prueba la velocidad del generador de movimientos de captura" #: src/frontend/cmd.cc:1086 msgid " eval - reads in an epd file and shows evaluation for its entries" msgstr "" " eval - lee un fichero epd y muestra la evaluación de las posiciones que " "contiene" #: src/frontend/cmd.cc:1087 msgid " evalspeed - tests speed of the evaluator" msgstr " evalspeed - prueba la velocidad del evaluador" #: src/frontend/cmd.cc:1089 msgid " Shows moves from opening book." msgstr " Muestra los movimientos del libro de aperturas." #: src/frontend/cmd.cc:1091 msgid " Enables display board in graphic mode." msgstr " Activa el modo gráfico del tablero." #: src/frontend/cmd.cc:1093 msgid " Disables graphic mode and display classical view." msgstr " Desactiva el modo gráfico y muestra la vista clásica." #: src/frontend/cmd.cc:1119 #, c-format msgid "" "Help for command %s not found\n" "\n" msgstr "" "No hay ayuda para la orden %s\n" "\n" #: src/frontend/cmd.cc:1121 #, c-format msgid "List of commands: (help COMMAND to get more help)\n" msgstr "Lista de órdenes: (help ORDEN para obtener más ayuda)\n" #: src/frontend/engine.cc:247 msgid "Black" msgstr "Negras" #: src/frontend/engine.cc:247 msgid "White" msgstr "Blancas" #: src/frontend/engine.cc:333 #, c-format msgid "" "\n" "My move is : %s\n" msgstr "" "\n" "Mi jugada : %s\n" gnuchess-6.2.2/po/fr.gmo000644 000766 000024 00000042044 12610434565 015716 0ustar00antoniostaff000000 000000 Þ•†L³|H I K Ck M¯ 7ý (5 /^ 'Ž .¶ 7å J 9h )¢ &Ì Ró #F&j$‘O¶29'X+€)¬FÖ?h]‘Æ6Xg(÷^ &g¦[(j>“Òèþ9/L/|±¬x^8×"0Sòk^#_-ƒ!±#ÓH÷@5_F•AÜ=)\#†-ªFØ2%R%xž&º-á#$3<X>•Ô%ï""8#[/,À-í6/R-‚+°,Ü. 8"Q t•°ÊÛë " 66 m € 2’ Å Õ %é !"!@!]!y!! £!­!)Æ! ð!ü!5"$K"p">ˆ"Ç"Ù"ê"ú"#!#%'#,M#)z#)¤#Î#cÓ#7%#9%[]%Z¹%L&.a&3&+Ä&0ð&7!'_Y'3¹'-í'3(^O(6®(7å(8)TV)>«),ê)&*;>*7z*Q²*?+…D+ÕÊ+? ,šà,8{-m´-3".oV.RÆ."/YR5/‘5%Á5Rç5-:6Ph6i¹6G#7Kk7,·79ä7W8^v8IÕ839/S9$ƒ95¨9,Þ9- :09:[j:EÆ:& ;=3;6q;*¨;'Ó;û;7<5G<<}<Nº<= =:G=5‚=7¸=Fð=(7>6`>"—>º>×>ð>?*?C?_?Cv?º?Õ?=ï?-@B@3a@•@&´@,Û@(A1A"PA sA~A.’AÁA+ÖAGB5JB€B8™BÒBñBCC%C @C7KC1ƒC2µC5èCD#…E:9v1JUq}5 bf0CehDY [2^c=(<Mo'i8 P‚!aK&?NX~;sG+jk.†yxWT,$r€F%L„ u>AH@zm) "6Bp7RVS{Qd*\ lw4/g|t_O]`-nIZƒ3 --silent same as -q -M size, --memory=size specify memory usage in MB for hashtable -a filename, --addbook=filename compile book.bin from pgn book 'filename' -e, --easy disable thinking in opponents time -g, --graphic enable graphic mode -h, --help display this help and exit -m, --manual enable manual mode -p, --post start up showing thinking -q, --quiet make the program silent on startup -u, --uci enable UCI protocol (externally behave as UCI engine) -v, --version display version information and exit -x, --xboard start in engine mode Advances one move in pgn loaded game. Arranges for verbose thinking output showing variation, score, time, depth, etc. Backs up one move in game history. Backs up one move in pgn loaded game. Backs up two moves in game history. Computer takes whichever side is on move and begins its thinking immediately. Disables graphic mode and display classical view. Displays command line syntax. Enables display board in graphic mode. Goes to begin position of pgn loaded game. Goes to end position of pgn loaded game. In analysis mode this stops analysis, otherwise it quits the program. Inputs the estimated rating for computer and for its opponent. Inputs time left in game for computer in hundredths of a second. Mostly used by Internet Chess Server. Lets you input your name. Also writes the log.nnn and corresponding game.nnn files. For details please see the auxiliary file format sections. Loads a position in EPD format from disk into memory. Loads the game in the file into memory, and enables the commands 'first', 'last', 'next', 'previous'. Loads the game in the file into memory. Makes the program stop moving. You may now enter moves to reach some position in the future. Mostly used by Internet Chess Server. Moves are accepted either in standard algebraic notation (SAN) or in coordinate algebraic notation. Options xboard and post are accepted without leading dashes for backward compatibility. Prints out the version of this program. Produces a help blurb corresponding to this list of commands. Program plays black. Program plays white. Quits the program. Saves game position into EPD format from memory to disk. Saves the game so far from memory to the file. Sets the hash table to permit storage of N MB. Sets the program to look N ply (half-moves) deep for every search it performs. If there is a checkmate or other condition that does not allow that depth, then it will not be. Sets time control to be MOVES in MINUTES, with each move giving an INCREMENT (in seconds, i.e. a Fischer-style clock). Sets up a new game (i.e. pieces in original positions). Shows moves from opening book. Solves the positions in FILENAME. Switches side to move. The file 'gnuchess.ini' allows setting config options. See 'info gnuchess' for details. The file will be looked up in the current directory or, if not found there, in the directory pointed to by environment variable GNUCHESS_PKGDATADIR. This command reactivates a game that has been terminated automatically due to checkmate or no more time on the clock. However, it does not alter those conditions. So you would have to undo a move or two, or add time to the clock with 'level' or 'time'. Turns off verbose thinking output. add - compiles book.bin from a pgn book file best - plays best move from book board - displays the current board capture - reads in an epd file and shows legal captures for its entries capture - shows capture moves capturespeed - tests speed of capture move generator escape - shows moves that escape from check using one call to routine eval - reads in an epd file and shows evaluation for its entries eval [or score] - shows the evaluation per piece and overall evalspeed - tests speed of the evaluator game - shows moves in game history movegenspeed - tests speed of move generator movelist - reads in an epd file and shows legal moves for its entries moves - shows all moves using one call to routine noncapture - shows non-capture moves off - disables the memory hash table off - disables use of book off - disables use of xboard/winboard off - disables using the null-move heuristic on - enables use of book (default) on - enables use of xboard/winboard on - enables using the memory hash table to speed up search on - enables using the null-move heuristic to speed up search pin - shows pinned pieces prefer - same as 'book on' (default) random - plays any move from book time - displays the time settings worst - plays worst move from bookBoard is wrong! Command 'activate' is currently not supported. Command 'black' is currently not supported. Command 'random' is currently not supported. Command 'show eval/score' is currently not supported. Command 'show pin' is currently not supported. Command 'switch' is currently not supported. Command 'test' is currently not supported. Command 'white' is currently not supported. Could not create logfile, all slots occupied. Error reading file '%s' Failed to open %s for writing: %s Fischer increment of %d seconds Graphic mode is disabled. Graphic mode is enabled. Hashing is off. Hashing is on. Help for command %s not found Incorrect book option Incorrect epd file Initial position reached. There are no earlier moves. Invalid filename. Invalid move: %s List of commands: (help COMMAND to get more help) My rating = %d New TimeLimit = %g No more moves. Game reached the end. No moves to undo! No. of moves generated = %ld Null-move heuristic is off. Null-move heuristic is on. Old TimeLimit = %g Opponent rating = %d Options: Play the game of chess Report bugs to . Save to %s Search to a depth of %d The syntax to add a new book is: book add file.pgn Time Control: %d moves in %.2f secs Usage: %s [OPTION]... You may consider deleting or renaming your existing logfiles. book is now best book is now off book is now on book is now random book is now worst movesmy rating = %d, opponent rating = %d name - list known players alphabetically reverse - list by GNU worst result first score - list by GNU best result first timeProject-Id-Version: gnuchess 6.1.1 Report-Msgid-Bugs-To: bug-gnu-chess@gnu.org POT-Creation-Date: 2015-10-17 14:05+0200 PO-Revision-Date: 2015-04-11 03:30+0200 Last-Translator: Stéphane Aulery Language-Team: French Language: fr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --silent identique à -q -M taille, --memory=taille spécifier la mémoire utilisée en Mo d’une table de hash -a fichier, --addbook=fichier compile book.bin à partir d’un fichier de livre pgn -e, --easy désactiver le calcul durant le temps de l’adversaire -g, --graphic activer le mode graphique -h, --help afficher cette aide et quitter -m, --manuel activer le mode manuel -p, --post démarrer le calcul verbeux -q, --quiet démarrage silencieux du programme -u, --uci activer le protocole UCI (ce comporte extérieurement comme un moteur UCI) -v, --version afficher la version et quitter -x, -xboard démarrer en mode moteur Avancer d’un coup dans le fichier de partie pgn. Active la sortie verbeuse du calcul montrant les variations, scores, temps, profondeur, etc. Sauvegarder un mouvement dans l'historique de partie. Sauvegarde un mouvement dans le fichier de partie pgn. Sauvegarder deux mouvement dans l'historique de partie. L’ordinateur prend n'importe quel côté et commence ses calculs immédiatement. Désactiver le mode graphique te jouer avec la vue classique. Afficher la syntax de la ligne de commande. Activer le plateau en mode graphique. Atteindre la position de départ du fichier de partie pgn. Atteindre la position finale du fichier de partie pgn. Dans le mode analyse ceci suspend l’analyse, à moins de quitter le programme.Entrer le score estimé de l’ordinateur et de son adversaire.Entrer le temps laisser àdans le jeu à l’ordinateur en centièmes de secondes. Principalement utilisé par Internet Chess Server. Permet de saisir votre nom. Vous pouvez aussi écrire un fichier journal journal.nnn et des fichiers de partie jeu.nnn. Pour plus de détails, veuillez consulter les sections de format des fichiers auxiliaires. Charger une position au format EPD du disque vers la mémoire. Charger en mémoire le jeu depuis le fichier de partie, et activer les commandes « premier », « dernier », « suivant », « précédent ». Charger en mémoire le jeu depuis le fichier de partie. Mettre la partie en pause. Vous pouvez maintenant saisir des mouvements pour atteindre une position future. Principalement utilisé par Internet Chess Server.Les mouvements sont acceptés en notation algébrique standard (SAN) ou notation algébrique de coordonnées. Les options xboard et post sont acceptées sans tiret long pour compatibilité. Afficher la version du programme. Produit un texte de présentation de l’aide correspondant à cette liste de commandes. L’ordinateur joue avec les noirs. L’ordinateur joue avec les blancs. Quitter le programme. Sauvegarder la position de la partie au format EPD de la mémoire vers le disque. Sauvegarde le jeu en mémoire dans le fichier. Sélectionner la table de hash pour autoriser le stockage de N Mo. Sélectionner une profondeur de recherche de N pli (demi mouvement) à chaque recherche. S’il y a un échec et mat ou une autre condition incompatible avec la profondeur, alors il ne le vera pas. Sélectionner le contrôleur de temps pour MOUVEMENTS en MINUTES, avec chaque mouvement donnant un INCRÉMENT (en secondes, ç-à-d une horloge Fischer).Configurer une nouvelle partie (ç-à-d les pièces dans leur position originale). Afficher les mouvements du livre ouvert. Calculer les positions dans le FICHIER. Changer de côté. Le fichier « gnuchess.ini » permet les options de configuration de préférences. Voir « info gnuchess » pour plus d’informations. Le fichier sera recherche dans le dossier courant ou, s’il est introuvable, dans le répertoire pointé par la variable d’environnement GNUCHESS_PKGDATADIR. Cette commande réactive un jeu qui a été terminé automatiquement suite à un échec et mat ou un temps épuisé. Par contre, elle ne modifie pas les conditions. Vous devrez donc annuler un coup ou deux, ou ajouter du temps à l’horloge avec « niveau » ou « temps ». Désactive la sortie verbeuse du calcul ajouter - compile book.bin à partir d’un fichier livre pgn meilleur - joue le meilleur mouvement du livre plateau - afficher le plateau actuel capture - lire un fichier epd et afficher les captures légales pour ses entrées capture - afficher les mouvements de capture vitesse de capture - tester la vitesse de capture du générateur de mouvements échapper - afficher les mouvements qui échappent à la vérification en utilisant un appel par routine eval - lire un fichier epd et afficher l’évaluation de ses entrées eval [ou score] - afficher l’évaluation par pièce et dans son ensemble temps écoulé - test la vitesse du solveur jeu - afficher les mouvements dans l’historique de jeu vitesse de génération de mouvement - tester la vitesse du générateur de mouvements liste de mouvement - lire un fichier epd et afficher les mouvements légaux pour ses entrées mouvements - afficher tous les mouvements utilisant un appel par routine non capture - afficher les mouvements sans capture off - désactiver la table de hash en mémoire off - désactive l’usage du livre off - désactiver l'utilisateur de xboard / winboard off - désactiver l'heuristique de coup nul on - active l’usage du livre (par défaut) on - activer l'utilisateur de xboard / winboard on - activer l’utilisation de la table de hash en mémoire pour accélérer la recherche on - activer l'heuristique de coup nul pour accélérer la recherche pin - afficher les pièces écartés préféré - identique à « livre activé » (par défaut) aléatoire - joue n’importe quel mouvement du livre temps - afficher les paramètres de temps pire - joue le pire mouvement du livrePlateau erroné ! La commande « activer » n’est pas prise en charge. La commande « noire » n’est pas prise en charge. La commande « aléatoire » n’est pas prise en charge. La commande « afficher / calculer le score » n’est pas prise en charge. La commande « montrer pin » n’est pas prise en charge. La commande « basculer » n’est pas prise en charge. La commande « test » n’est pas prise en charge. La commande « blanc » n’est pas prise en charge. Impossible de créer le journal, tous les emplacements sont occupés. Erreur de lecture du fichier « %s » Impossible d’ouvrir le fichier %s en écriture : %s Incrément Fischer de %d secondes Mode graphique désactivé. Mode graphique activé. Hashing désactivé. Hashing activé. L'aide de la commande %s est introuvable Option de livre incorrecte Fichier epd incorrect Position initial atteinte. Il n’y a pas de mouvement antérieur. Nom de fichier incorrect. Mouvement incorrect : %s Liste des commandes : (help COMMANDE pour obtenir de l'aide) Mon classement = %d Nouvelle limite de temps = %g Plus de mouvement légal. La partie est terminée. Aucun mouvement à annuler ! Nombre de mouvements générés = %ld Heuristique de mouvement null désactivée. Heuristique de mouvement null activée. Ancienne limite de temps = %g Classement de l’adversaire = %d Options : Jouez aux échecs Rapporter un bug à . Enregistrer vers %s Recherche d’une profondeur de %d coup(s) La syntaxe pour ajouter un nouveau livre est : book add fichier.pgn Contrôle du temps : %d mouvements en %.2f secondes Usage : %s [OPTION]… Vous devriez supprimer ou renommer le journal existant. livre est maintenant meilleur livre désactivé livre activé livre aléatoire livre est maintenant pire mouvementsmon classement = %d, classement de l’adversaire = %d nom - liste alphabétique des joueurs connus inversé - liste des pires joueurs GNU en premier score - liste des meilleurs joueurs GNU en premier tempsgnuchess-6.2.2/po/fr.po000644 000766 000024 00000055274 12610434564 015562 0ustar00antoniostaff000000 000000 # Traduction française de gnuchess # Copyright (C) 2013 Free Software Foundation, Inc. # This file is distributed under the same license as the gnuchess package. # Stéphane Aulery , 2015. # msgid "" msgstr "" "Project-Id-Version: gnuchess 6.1.1\n" "Report-Msgid-Bugs-To: bug-gnu-chess@gnu.org\n" "POT-Creation-Date: 2015-10-17 14:05+0200\n" "PO-Revision-Date: 2015-04-11 03:30+0200\n" "Last-Translator: Stéphane Aulery \n" "Language-Team: French \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: src/main.cc:317 #, c-format msgid "Memory out of Range or Invalid\n" msgstr "" #: src/main.cc:334 #, c-format msgid "File name is too long (max = %d)\n" msgstr "" #: src/main.cc:340 msgid "Option Processing Failed\n" msgstr "" #: src/main.cc:381 #, c-format msgid "" "Copyright (C) %s Free Software Foundation, Inc.\n" "License GPLv3+: GNU GPL version 3 or later \n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" msgstr "" #: src/main.cc:494 #, c-format msgid "Thinking...\n" msgstr "" #: src/frontend/cmd.cc:101 #, c-format msgid "Command 'activate' is currently not supported.\n" msgstr "La commande « activer » n’est pas prise en charge.\n" #: src/frontend/cmd.cc:131 #, c-format msgid "Command 'black' is currently not supported.\n" msgstr "La commande « noire » n’est pas prise en charge.\n" #: src/frontend/cmd.cc:140 #, c-format msgid "" "The syntax to add a new book is:\n" "\n" "\tbook add file.pgn\n" msgstr "" "La syntaxe pour ajouter un nouveau livre est :\n" "\n" "\tbook add fichier.pgn\n" #: src/frontend/cmd.cc:147 #, c-format msgid "book is now on\n" msgstr "livre activé\n" #: src/frontend/cmd.cc:150 #, c-format msgid "book is now off\n" msgstr "livre désactivé\n" #: src/frontend/cmd.cc:153 #, c-format msgid "book is now best\n" msgstr "livre est maintenant meilleur\n" #: src/frontend/cmd.cc:156 #, c-format msgid "book is now worst\n" msgstr "livre est maintenant pire\n" #: src/frontend/cmd.cc:159 #, c-format msgid "book is now random\n" msgstr "livre aléatoire\n" #: src/frontend/cmd.cc:161 #, c-format msgid "Incorrect book option\n" msgstr "Option de livre incorrecte\n" #: src/frontend/cmd.cc:174 #, c-format msgid "Search to a depth of %d\n" msgstr "Recherche d’une profondeur de %d coup(s)\n" #: src/frontend/cmd.cc:240 #, c-format msgid "Hashing is on.\n" msgstr "Hashing activé.\n" #: src/frontend/cmd.cc:242 #, c-format msgid "Hashing is off.\n" msgstr "Hashing désactivé.\n" #: src/frontend/cmd.cc:268 src/frontend/cmd.cc:278 #, c-format msgid "Fischer increment of %d seconds\n" msgstr "Incrément Fischer de %d secondes\n" #. TRANSLATORS: Please be aware that the word 'move' is sometimes #. used as a synonym of 'ply', and sometimes in the sense of a #. full 2-ply move. #: src/frontend/cmd.cc:276 #, c-format msgid "Time Control: %d moves in %.2f secs\n" msgstr "Contrôle du temps : %d mouvements en %.2f secondes\n" #: src/frontend/cmd.cc:286 #, c-format msgid "name - list known players alphabetically\n" msgstr "nom - liste alphabétique des joueurs connus\n" #: src/frontend/cmd.cc:287 #, c-format msgid "score - list by GNU best result first \n" msgstr "score - liste des meilleurs joueurs GNU en premier\n" #: src/frontend/cmd.cc:288 #, c-format msgid "reverse - list by GNU worst result first\n" msgstr "inversé - liste des pires joueurs GNU en premier\n" #: src/frontend/cmd.cc:303 src/frontend/cmd.cc:1301 #, c-format msgid "Board is wrong!\n" msgstr "Plateau erroné !\n" #: src/frontend/cmd.cc:309 src/frontend/cmd.cc:312 #, c-format msgid "Error reading file '%s'\n" msgstr "Erreur de lecture du fichier « %s »\n" #: src/frontend/cmd.cc:378 #, c-format msgid "Failed to open %s for writing: %s\n" msgstr "Impossible d’ouvrir le fichier %s en écriture : %s\n" #: src/frontend/cmd.cc:384 #, c-format msgid "Could not create logfile, all slots occupied.\n" msgstr "Impossible de créer le journal, tous les emplacements sont occupés.\n" #: src/frontend/cmd.cc:385 #, c-format msgid "You may consider deleting or renaming your existing logfiles.\n" msgstr "Vous devriez supprimer ou renommer le journal existant.\n" #: src/frontend/cmd.cc:417 #, c-format msgid "Null-move heuristic is on.\n" msgstr "Heuristique de mouvement null activée.\n" #: src/frontend/cmd.cc:419 #, c-format msgid "Null-move heuristic is off.\n" msgstr "Heuristique de mouvement null désactivée.\n" #: src/frontend/cmd.cc:439 src/frontend/cmd.cc:466 #, c-format msgid "Incorrect epd file\n" msgstr "Fichier epd incorrect\n" #: src/frontend/cmd.cc:510 #, c-format msgid "No more moves. Game reached the end.\n" msgstr "Plus de mouvement légal. La partie est terminée.\n" #: src/frontend/cmd.cc:530 #, c-format msgid "Initial position reached. There are no earlier moves.\n" msgstr "Position initial atteinte. Il n’y a pas de mouvement antérieur.\n" #: src/frontend/cmd.cc:586 src/frontend/cmd.cc:692 #, c-format msgid "Invalid filename.\n" msgstr "Nom de fichier incorrect.\n" #: src/frontend/cmd.cc:592 #, c-format msgid "Graphic mode is enabled.\n" msgstr "Mode graphique activé.\n" #: src/frontend/cmd.cc:598 #, c-format msgid "Graphic mode is disabled.\n" msgstr "Mode graphique désactivé.\n" #: src/frontend/cmd.cc:639 #, c-format msgid "Command 'random' is currently not supported.\n" msgstr "La commande « aléatoire » n’est pas prise en charge.\n" #: src/frontend/cmd.cc:647 #, c-format msgid "my rating = %d, opponent rating = %d\n" msgstr "mon classement = %d, classement de l’adversaire = %d\n" #: src/frontend/cmd.cc:671 src/frontend/cmd.cc:741 #, c-format msgid "No moves to undo!\n" msgstr "Aucun mouvement à annuler !\n" #: src/frontend/cmd.cc:681 #, c-format msgid "Save to %s\n" msgstr "Enregistrer vers %s\n" #: src/frontend/cmd.cc:722 #, c-format msgid "Command 'switch' is currently not supported.\n" msgstr "La commande « basculer » n’est pas prise en charge.\n" #: src/frontend/cmd.cc:728 #, c-format msgid "Old TimeLimit = %g\n" msgstr "Ancienne limite de temps = %g\n" #: src/frontend/cmd.cc:730 #, c-format msgid "New TimeLimit = %g\n" msgstr "Nouvelle limite de temps = %g\n" #: src/frontend/cmd.cc:750 #, c-format msgid "" "Usage: %s [OPTION]...\n" "\n" msgstr "" "Usage : %s [OPTION]…\n" "\n" #: src/frontend/cmd.cc:752 msgid "" "Play the game of chess\n" "\n" msgstr "" "Jouez aux échecs\n" "\n" #: src/frontend/cmd.cc:754 msgid "Options:\n" msgstr "Options :\n" #: src/frontend/cmd.cc:755 msgid " -h, --help display this help and exit\n" msgstr " -h, --help afficher cette aide et quitter\n" #: src/frontend/cmd.cc:757 msgid " -v, --version display version information and exit\n" msgstr " -v, --version afficher la version et quitter\n" #: src/frontend/cmd.cc:759 msgid " -q, --quiet make the program silent on startup\n" msgstr " -q, --quiet démarrage silencieux du programme\n" #: src/frontend/cmd.cc:761 msgid " --silent same as -q\n" msgstr " --silent identique à -q\n" #: src/frontend/cmd.cc:763 src/frontend/cmd.cc:781 msgid "\n" msgstr "\n" #: src/frontend/cmd.cc:765 msgid " -x, --xboard start in engine mode\n" msgstr " -x, -xboard démarrer en mode moteur\n" #: src/frontend/cmd.cc:767 msgid " -p, --post start up showing thinking\n" msgstr " -p, --post démarrer le calcul verbeux\n" #: src/frontend/cmd.cc:769 msgid " -e, --easy disable thinking in opponents time\n" msgstr "" " -e, --easy désactiver le calcul durant le temps de l’adversaire\n" #: src/frontend/cmd.cc:771 msgid " -m, --manual enable manual mode\n" msgstr " -m, --manuel activer le mode manuel\n" #: src/frontend/cmd.cc:773 msgid "" " -u, --uci enable UCI protocol (externally behave as UCI engine)\n" msgstr "" " -u, --uci activer le protocole UCI (ce comporte extérieurement " "comme un moteur UCI)\n" #: src/frontend/cmd.cc:775 msgid " -M size, --memory=size specify memory usage in MB for hashtable\n" msgstr "" " -M taille, --memory=taille spécifier la mémoire utilisée en Mo d’une " "table de hash\n" #: src/frontend/cmd.cc:777 msgid "" " -a filename, --addbook=filename compile book.bin from pgn book " "'filename'\n" msgstr "" " -a fichier, --addbook=fichier compile book.bin à partir d’un fichier de " "livre pgn\n" #: src/frontend/cmd.cc:779 msgid " -g, --graphic enable graphic mode\n" msgstr " -g, --graphic activer le mode graphique\n" #: src/frontend/cmd.cc:783 msgid "" " Options xboard and post are accepted without leading dashes\n" " for backward compatibility.\n" "\n" msgstr "" " Les options xboard et post sont acceptées sans tiret long pour " "compatibilité.\n" "\n" #: src/frontend/cmd.cc:787 msgid "" " Moves are accepted either in standard algebraic notation (SAN) or\n" " in coordinate algebraic notation.\n" "\n" msgstr "" "Les mouvements sont acceptés en notation algébrique standard (SAN) ou\n" "notation algébrique de coordonnées.\n" "\n" #: src/frontend/cmd.cc:791 msgid "" " The file 'gnuchess.ini' allows setting config options. See\n" " 'info gnuchess' for details. The file will be looked up in the current\n" " directory or, if not found there, in the directory pointed to by\n" " environment variable GNUCHESS_PKGDATADIR.\n" "\n" msgstr "" " Le fichier « gnuchess.ini » permet les options de configuration de\n" " préférences. Voir « info gnuchess » pour plus d’informations. Le fichier " "sera\n" " recherche dans le dossier courant ou, s’il est introuvable, dans le " "répertoire\n" " pointé par la variable d’environnement GNUCHESS_PKGDATADIR.\n" #: src/frontend/cmd.cc:797 msgid "" "Report bugs to .\n" "\n" msgstr "" "Rapporter un bug à .\n" "\n" #: src/frontend/cmd.cc:844 src/frontend/cmd.cc:1280 #, c-format msgid "Invalid move: %s\n" msgstr "Mouvement incorrect : %s\n" #: src/frontend/cmd.cc:862 #, c-format msgid "Command 'white' is currently not supported.\n" msgstr "La commande « blanc » n’est pas prise en charge.\n" #: src/frontend/cmd.cc:893 #, c-format msgid "My rating = %d\n" msgstr "Mon classement = %d\n" #: src/frontend/cmd.cc:894 #, c-format msgid "Opponent rating = %d\n" msgstr "Classement de l’adversaire = %d\n" #: src/frontend/cmd.cc:896 msgid "time" msgstr "temps" #: src/frontend/cmd.cc:898 msgid "moves" msgstr "mouvements" #: src/frontend/cmd.cc:903 src/frontend/cmd.cc:910 src/frontend/cmd.cc:919 #: src/frontend/cmd.cc:928 #, c-format msgid "No. of moves generated = %ld\n" msgstr "Nombre de mouvements générés = %ld\n" #: src/frontend/cmd.cc:932 #, c-format msgid "Command 'show eval/score' is currently not supported.\n" msgstr "" "La commande « afficher / calculer le score » n’est pas prise en charge.\n" #: src/frontend/cmd.cc:939 #, c-format msgid "Command 'show pin' is currently not supported.\n" msgstr "La commande « montrer pin » n’est pas prise en charge.\n" #: src/frontend/cmd.cc:951 #, c-format msgid "Command 'test' is currently not supported.\n" msgstr "La commande « test » n’est pas prise en charge.\n" #: src/frontend/cmd.cc:969 msgid " Quits the program." msgstr " Quitter le programme." #: src/frontend/cmd.cc:971 msgid " In analysis mode this stops analysis, otherwise it quits the program." msgstr "" " Dans le mode analyse ceci suspend l’analyse, à moins de quitter le " "programme." #: src/frontend/cmd.cc:973 msgid " Produces a help blurb corresponding to this list of commands." msgstr "" " Produit un texte de présentation de l’aide correspondant à cette liste de " "commandes." #: src/frontend/cmd.cc:975 msgid " add - compiles book.bin from a pgn book file" msgstr " ajouter - compile book.bin à partir d’un fichier livre pgn" #: src/frontend/cmd.cc:976 msgid " on - enables use of book (default)" msgstr " on - active l’usage du livre (par défaut)" #: src/frontend/cmd.cc:977 msgid " off - disables use of book" msgstr " off - désactive l’usage du livre" #: src/frontend/cmd.cc:978 msgid " worst - plays worst move from book" msgstr " pire - joue le pire mouvement du livre" #: src/frontend/cmd.cc:979 msgid " best - plays best move from book" msgstr " meilleur - joue le meilleur mouvement du livre" #: src/frontend/cmd.cc:980 msgid " prefer - same as 'book on' (default)" msgstr " préféré - identique à « livre activé » (par défaut)" #: src/frontend/cmd.cc:981 msgid " random - plays any move from book" msgstr " aléatoire - joue n’importe quel mouvement du livre" #: src/frontend/cmd.cc:983 msgid " Prints out the version of this program." msgstr " Afficher la version du programme." #: src/frontend/cmd.cc:986 msgid " Backs up one move in pgn loaded game." msgstr " Sauvegarde un mouvement dans le fichier de partie pgn." #: src/frontend/cmd.cc:988 msgid " Saves the game so far from memory to the file." msgstr " Sauvegarde le jeu en mémoire dans le fichier." #: src/frontend/cmd.cc:990 msgid " Loads the game in the file into memory." msgstr " Charger en mémoire le jeu depuis le fichier de partie." #: src/frontend/cmd.cc:992 msgid "" " Loads the game in the file into memory, and enables\n" " the commands 'first', 'last', 'next', 'previous'." msgstr "" " Charger en mémoire le jeu depuis le fichier de partie, et activer\n" " les commandes « premier », « dernier », « suivant », « précédent »." #: src/frontend/cmd.cc:996 msgid " Advances one move in pgn loaded game." msgstr " Avancer d’un coup dans le fichier de partie pgn." #: src/frontend/cmd.cc:998 msgid " Goes to begin position of pgn loaded game." msgstr " Atteindre la position de départ du fichier de partie pgn." #: src/frontend/cmd.cc:1000 msgid " Goes to end position of pgn loaded game." msgstr " Atteindre la position finale du fichier de partie pgn." #: src/frontend/cmd.cc:1003 msgid "" " Makes the program stop moving. You may now enter moves\n" " to reach some position in the future." msgstr "" " Mettre la partie en pause. Vous pouvez maintenant saisir des mouvements\n" " pour atteindre une position future." #: src/frontend/cmd.cc:1007 msgid " Program plays white." msgstr " L’ordinateur joue avec les blancs." #: src/frontend/cmd.cc:1009 msgid " Program plays black." msgstr " L’ordinateur joue avec les noirs." #: src/frontend/cmd.cc:1011 msgid "" " Computer takes whichever side is on move and begins its\n" " thinking immediately." msgstr "" " L’ordinateur prend n'importe quel côté\n" " et commence ses calculs immédiatement." #: src/frontend/cmd.cc:1014 msgid "" " Arranges for verbose thinking output showing variation, score,\n" " time, depth, etc." msgstr "" " Active la sortie verbeuse du calcul montrant les variations, scores,\n" " temps, profondeur, etc." #: src/frontend/cmd.cc:1017 msgid " Turns off verbose thinking output." msgstr " Désactive la sortie verbeuse du calcul" #: src/frontend/cmd.cc:1019 msgid "" " Lets you input your name. Also writes the log.nnn and\n" " corresponding game.nnn files. For details please see\n" " the auxiliary file format sections." msgstr "" " Permet de saisir votre nom. Vous pouvez aussi écrire un fichier journal\n" " journal.nnn et des fichiers de partie jeu.nnn. Pour plus de détails,\n" " veuillez consulter les sections de format des fichiers auxiliaires." #: src/frontend/cmd.cc:1023 msgid " Mostly used by Internet Chess Server." msgstr " Principalement utilisé par Internet Chess Server." #: src/frontend/cmd.cc:1025 msgid "" " This command reactivates a game that has been terminated automatically\n" " due to checkmate or no more time on the clock. However, it does not\n" " alter those conditions. So you would have to undo a move or two, or\n" " add time to the clock with 'level' or 'time'." msgstr "" "Cette commande réactive un jeu qui a été terminé automatiquement\n" "suite à un échec et mat ou un temps épuisé. Par contre, elle ne modifie pas\n" "les conditions. Vous devrez donc annuler un coup ou deux, ou ajouter du " "temps à\n" "l’horloge avec « niveau » ou « temps »." #: src/frontend/cmd.cc:1030 msgid " Inputs the estimated rating for computer and for its opponent." msgstr "Entrer le score estimé de l’ordinateur et de son adversaire." #: src/frontend/cmd.cc:1032 msgid " Sets up a new game (i.e. pieces in original positions)." msgstr "" "Configurer une nouvelle partie (ç-à-d les pièces dans leur position " "originale)." #: src/frontend/cmd.cc:1034 msgid "" " Inputs time left in game for computer in hundredths of a second.\n" " Mostly used by Internet Chess Server." msgstr "" "Entrer le temps laisser àdans le jeu à l’ordinateur en centièmes de " "secondes.\n" "Principalement utilisé par Internet Chess Server." #: src/frontend/cmd.cc:1037 msgid " on - enables using the memory hash table to speed up search" msgstr "" " on - activer l’utilisation de la table de hash en mémoire pour accélérer la " "recherche" #: src/frontend/cmd.cc:1038 msgid " off - disables the memory hash table" msgstr " off - désactiver la table de hash en mémoire" #: src/frontend/cmd.cc:1040 msgid " Sets the hash table to permit storage of N MB." msgstr " Sélectionner la table de hash pour autoriser le stockage de N Mo." #: src/frontend/cmd.cc:1042 msgid " on - enables using the null-move heuristic to speed up search" msgstr " on - activer l'heuristique de coup nul pour accélérer la recherche" #: src/frontend/cmd.cc:1043 msgid " off - disables using the null-move heuristic" msgstr " off - désactiver l'heuristique de coup nul" #: src/frontend/cmd.cc:1045 msgid " on - enables use of xboard/winboard" msgstr " on - activer l'utilisateur de xboard / winboard" #: src/frontend/cmd.cc:1046 msgid " off - disables use of xboard/winboard" msgstr " off - désactiver l'utilisateur de xboard / winboard" #: src/frontend/cmd.cc:1048 msgid "" " Sets the program to look N ply (half-moves) deep for every\n" " search it performs. If there is a checkmate or other condition\n" " that does not allow that depth, then it will not be." msgstr "" " Sélectionner une profondeur de recherche de N pli (demi mouvement) à " "chaque\n" " recherche. S’il y a un échec et mat ou une autre condition incompatible\n" " avec la profondeur, alors il ne le vera pas." #: src/frontend/cmd.cc:1052 msgid "" " Sets time control to be MOVES in MINUTES, with each move giving\n" " an INCREMENT (in seconds, i.e. a Fischer-style clock)." msgstr "" " Sélectionner le contrôleur de temps pour MOUVEMENTS en MINUTES,\n" " avec chaque mouvement donnant un INCRÉMENT (en secondes, ç-à-d une horloge " "Fischer)." #: src/frontend/cmd.cc:1056 msgid " Loads a position in EPD format from disk into memory." msgstr " Charger une position au format EPD du disque vers la mémoire." #: src/frontend/cmd.cc:1059 msgid " Saves game position into EPD format from memory to disk." msgstr "" " Sauvegarder la position de la partie au format EPD de la mémoire vers le " "disque." #: src/frontend/cmd.cc:1061 msgid " Switches side to move." msgstr " Changer de côté." #: src/frontend/cmd.cc:1064 msgid " Solves the positions in FILENAME." msgstr " Calculer les positions dans le FICHIER." #: src/frontend/cmd.cc:1066 msgid " Backs up two moves in game history." msgstr " Sauvegarder deux mouvement dans l'historique de partie." #: src/frontend/cmd.cc:1068 msgid " Backs up one move in game history." msgstr " Sauvegarder un mouvement dans l'historique de partie." #: src/frontend/cmd.cc:1070 msgid " Displays command line syntax." msgstr " Afficher la syntax de la ligne de commande." #: src/frontend/cmd.cc:1072 msgid " board - displays the current board" msgstr " plateau - afficher le plateau actuel" #: src/frontend/cmd.cc:1073 msgid " time - displays the time settings" msgstr " temps - afficher les paramètres de temps" #: src/frontend/cmd.cc:1074 msgid " moves - shows all moves using one call to routine" msgstr "" " mouvements - afficher tous les mouvements utilisant un appel par routine" #: src/frontend/cmd.cc:1075 msgid " escape - shows moves that escape from check using one call to routine" msgstr "" " échapper - afficher les mouvements qui échappent à la vérification en " "utilisant un appel par routine" #: src/frontend/cmd.cc:1076 msgid " noncapture - shows non-capture moves" msgstr " non capture - afficher les mouvements sans capture" #: src/frontend/cmd.cc:1077 msgid " capture - shows capture moves" msgstr " capture - afficher les mouvements de capture" #: src/frontend/cmd.cc:1078 msgid " eval [or score] - shows the evaluation per piece and overall" msgstr "" " eval [ou score] - afficher l’évaluation par pièce et dans son ensemble" #: src/frontend/cmd.cc:1079 msgid " game - shows moves in game history" msgstr " jeu - afficher les mouvements dans l’historique de jeu" #: src/frontend/cmd.cc:1080 msgid " pin - shows pinned pieces" msgstr " pin - afficher les pièces écartés" #: src/frontend/cmd.cc:1082 msgid " movelist - reads in an epd file and shows legal moves for its entries" msgstr "" " liste de mouvement - lire un fichier epd et afficher les mouvements légaux " "pour ses entrées" #: src/frontend/cmd.cc:1083 msgid "" " capture - reads in an epd file and shows legal captures for its entries" msgstr "" " capture - lire un fichier epd et afficher les captures légales pour ses " "entrées" #: src/frontend/cmd.cc:1084 msgid " movegenspeed - tests speed of move generator" msgstr "" " vitesse de génération de mouvement - tester la vitesse du générateur de " "mouvements" #: src/frontend/cmd.cc:1085 msgid " capturespeed - tests speed of capture move generator" msgstr "" " vitesse de capture - tester la vitesse de capture du générateur de " "mouvements" #: src/frontend/cmd.cc:1086 msgid " eval - reads in an epd file and shows evaluation for its entries" msgstr " eval - lire un fichier epd et afficher l’évaluation de ses entrées" #: src/frontend/cmd.cc:1087 msgid " evalspeed - tests speed of the evaluator" msgstr " temps écoulé - test la vitesse du solveur" #: src/frontend/cmd.cc:1089 msgid " Shows moves from opening book." msgstr " Afficher les mouvements du livre ouvert." #: src/frontend/cmd.cc:1091 msgid " Enables display board in graphic mode." msgstr " Activer le plateau en mode graphique." #: src/frontend/cmd.cc:1093 msgid " Disables graphic mode and display classical view." msgstr " Désactiver le mode graphique te jouer avec la vue classique." #: src/frontend/cmd.cc:1119 #, c-format msgid "" "Help for command %s not found\n" "\n" msgstr "" "L'aide de la commande %s est introuvable\n" "\n" #: src/frontend/cmd.cc:1121 #, c-format msgid "List of commands: (help COMMAND to get more help)\n" msgstr "Liste des commandes : (help COMMANDE pour obtenir de l'aide)\n" #: src/frontend/engine.cc:247 msgid "Black" msgstr "" #: src/frontend/engine.cc:247 msgid "White" msgstr "" #: src/frontend/engine.cc:333 #, c-format msgid "" "\n" "My move is : %s\n" msgstr "" gnuchess-6.2.2/po/gl.gmo000644 000766 000024 00000006030 12610434565 015704 0ustar00antoniostaff000000 000000 Þ• +ÈÉË(ë/9D&~+¥)Ñ(û&$(KtŠ ´"Íð %69pƒ%•» ÎØ)ñ '?EŸJê#ì,,=<j.§3Ö1 ,< 0i !š ¼ Ø õ , 14 #f Š « >Ä  " -= !k ˜ /ª Ú è         --silent same as -q -g, --graphic enable graphic mode -h, --help display this help and exit -v, --version display version information and exit Advances one move in pgn loaded game. Goes to begin position of pgn loaded game. Goes to end position of pgn loaded game. Loads the game in the file into memory. Mostly used by Internet Chess Server. Prints out the version of this program. Program plays black. Program plays white. Quits the program.Error reading file '%s' Failed to open %s for writing: %s Graphic mode is disabled. Graphic mode is enabled. Incorrect epd file Initial position reached. There are no earlier moves. Invalid filename. Invalid move: %s No more moves. Game reached the end. No moves to undo! Options: Play the game of chess Report bugs to . Save to %s Usage: %s [OPTION]... movestimeProject-Id-Version: gnuchess 6.1.1 Report-Msgid-Bugs-To: bug-gnu-chess@gnu.org POT-Creation-Date: 2015-10-17 14:05+0200 PO-Revision-Date: 2014-05-10 17:27+0100 Last-Translator: Leandro Regueiro Language-Team: Galician Language: gl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); --silent o mesmo que -q -g, --graphic activar o modo gráfico -h, --help mostra esta axuda e sae -v, --version mostra a información da versión e sae Avanza un movemento na partida de pgn cargada.Vai á posición inicial da partida de pgn cargada.Vai á posición final da partida de pgn cargada.Carga a partida á memoria desde o ficheiro. Empregado maiormente por Internet Chess Server.Mostra a versión deste programa.O programa xoga con negras.O programa xoga con brancas. Sae do programa.Produciuse un erro ao ler o ficheiro «%s» Produciuse un erro ao abrir %s para escribir: %s O modo gráfico está desactivado. O modo gráfico está activado. Ficheiro epd incorrecto Chegouse á posición inicial. Non hai movementos anteriores. Nome de ficheiro non válido. Movemento non válido: %s Non hai máis movementos. A partida rematou. Non hai movementos que desfacer! Opcións: Xogar ao xadrez Comunique os erros a . Gardar en %s Modo de uso: %s [OPCIÓN]... movementostempognuchess-6.2.2/po/gl.po000644 000766 000024 00000040204 12610434564 015540 0ustar00antoniostaff000000 000000 # Galician translation of gnuchess. # This file is distributed under the same license as the gnuchess package. # Copyright (C) 2014 Free Software Foundation, Inc. # Copyright (C) 2014 Leandro Regueiro. # # Leandro Regueiro , 2014. # # Proxecto Trasno - Adaptación do software libre á lingua galega: Se desexas # colaborar connosco, podes atopar máis información en http://www.trasno.net # msgid "" msgstr "" "Project-Id-Version: gnuchess 6.1.1\n" "Report-Msgid-Bugs-To: bug-gnu-chess@gnu.org\n" "POT-Creation-Date: 2015-10-17 14:05+0200\n" "PO-Revision-Date: 2014-05-10 17:27+0100\n" "Last-Translator: Leandro Regueiro \n" "Language-Team: Galician \n" "Language: gl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: src/main.cc:317 #, c-format msgid "Memory out of Range or Invalid\n" msgstr "" #: src/main.cc:334 #, c-format msgid "File name is too long (max = %d)\n" msgstr "" #: src/main.cc:340 msgid "Option Processing Failed\n" msgstr "" #: src/main.cc:381 #, c-format msgid "" "Copyright (C) %s Free Software Foundation, Inc.\n" "License GPLv3+: GNU GPL version 3 or later \n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" msgstr "" #: src/main.cc:494 #, c-format msgid "Thinking...\n" msgstr "" #: src/frontend/cmd.cc:101 #, c-format msgid "Command 'activate' is currently not supported.\n" msgstr "" #: src/frontend/cmd.cc:131 #, c-format msgid "Command 'black' is currently not supported.\n" msgstr "" #: src/frontend/cmd.cc:140 #, c-format msgid "" "The syntax to add a new book is:\n" "\n" "\tbook add file.pgn\n" msgstr "" #: src/frontend/cmd.cc:147 #, c-format msgid "book is now on\n" msgstr "" #: src/frontend/cmd.cc:150 #, c-format msgid "book is now off\n" msgstr "" #: src/frontend/cmd.cc:153 #, c-format msgid "book is now best\n" msgstr "" #: src/frontend/cmd.cc:156 #, c-format msgid "book is now worst\n" msgstr "" #: src/frontend/cmd.cc:159 #, c-format msgid "book is now random\n" msgstr "" #: src/frontend/cmd.cc:161 #, c-format msgid "Incorrect book option\n" msgstr "" #: src/frontend/cmd.cc:174 #, c-format msgid "Search to a depth of %d\n" msgstr "" #: src/frontend/cmd.cc:240 #, c-format msgid "Hashing is on.\n" msgstr "" #: src/frontend/cmd.cc:242 #, c-format msgid "Hashing is off.\n" msgstr "" #: src/frontend/cmd.cc:268 src/frontend/cmd.cc:278 #, c-format msgid "Fischer increment of %d seconds\n" msgstr "" #. TRANSLATORS: Please be aware that the word 'move' is sometimes #. used as a synonym of 'ply', and sometimes in the sense of a #. full 2-ply move. #: src/frontend/cmd.cc:276 #, c-format msgid "Time Control: %d moves in %.2f secs\n" msgstr "" #: src/frontend/cmd.cc:286 #, c-format msgid "name - list known players alphabetically\n" msgstr "" #: src/frontend/cmd.cc:287 #, c-format msgid "score - list by GNU best result first \n" msgstr "" #: src/frontend/cmd.cc:288 #, c-format msgid "reverse - list by GNU worst result first\n" msgstr "" #: src/frontend/cmd.cc:303 src/frontend/cmd.cc:1301 #, c-format msgid "Board is wrong!\n" msgstr "" #: src/frontend/cmd.cc:309 src/frontend/cmd.cc:312 #, c-format msgid "Error reading file '%s'\n" msgstr "Produciuse un erro ao ler o ficheiro «%s»\n" #: src/frontend/cmd.cc:378 #, c-format msgid "Failed to open %s for writing: %s\n" msgstr "Produciuse un erro ao abrir %s para escribir: %s\n" #: src/frontend/cmd.cc:384 #, c-format msgid "Could not create logfile, all slots occupied.\n" msgstr "" #: src/frontend/cmd.cc:385 #, c-format msgid "You may consider deleting or renaming your existing logfiles.\n" msgstr "" #: src/frontend/cmd.cc:417 #, c-format msgid "Null-move heuristic is on.\n" msgstr "" #: src/frontend/cmd.cc:419 #, c-format msgid "Null-move heuristic is off.\n" msgstr "" #: src/frontend/cmd.cc:439 src/frontend/cmd.cc:466 #, c-format msgid "Incorrect epd file\n" msgstr "Ficheiro epd incorrecto\n" #: src/frontend/cmd.cc:510 #, c-format msgid "No more moves. Game reached the end.\n" msgstr "Non hai máis movementos. A partida rematou.\n" #: src/frontend/cmd.cc:530 #, c-format msgid "Initial position reached. There are no earlier moves.\n" msgstr "Chegouse á posición inicial. Non hai movementos anteriores.\n" #: src/frontend/cmd.cc:586 src/frontend/cmd.cc:692 #, c-format msgid "Invalid filename.\n" msgstr "Nome de ficheiro non válido.\n" #: src/frontend/cmd.cc:592 #, c-format msgid "Graphic mode is enabled.\n" msgstr "O modo gráfico está activado.\n" #: src/frontend/cmd.cc:598 #, c-format msgid "Graphic mode is disabled.\n" msgstr "O modo gráfico está desactivado.\n" #: src/frontend/cmd.cc:639 #, c-format msgid "Command 'random' is currently not supported.\n" msgstr "" #: src/frontend/cmd.cc:647 #, c-format msgid "my rating = %d, opponent rating = %d\n" msgstr "" #: src/frontend/cmd.cc:671 src/frontend/cmd.cc:741 #, c-format msgid "No moves to undo!\n" msgstr "Non hai movementos que desfacer!\n" #: src/frontend/cmd.cc:681 #, c-format msgid "Save to %s\n" msgstr "Gardar en %s\n" #: src/frontend/cmd.cc:722 #, c-format msgid "Command 'switch' is currently not supported.\n" msgstr "" #: src/frontend/cmd.cc:728 #, c-format msgid "Old TimeLimit = %g\n" msgstr "" #: src/frontend/cmd.cc:730 #, c-format msgid "New TimeLimit = %g\n" msgstr "" #: src/frontend/cmd.cc:750 #, c-format msgid "" "Usage: %s [OPTION]...\n" "\n" msgstr "" "Modo de uso: %s [OPCIÓN]...\n" "\n" #: src/frontend/cmd.cc:752 msgid "" "Play the game of chess\n" "\n" msgstr "" "Xogar ao xadrez\n" "\n" #: src/frontend/cmd.cc:754 msgid "Options:\n" msgstr "Opcións:\n" #: src/frontend/cmd.cc:755 msgid " -h, --help display this help and exit\n" msgstr " -h, --help mostra esta axuda e sae\n" #: src/frontend/cmd.cc:757 msgid " -v, --version display version information and exit\n" msgstr " -v, --version mostra a información da versión e sae\n" #: src/frontend/cmd.cc:759 msgid " -q, --quiet make the program silent on startup\n" msgstr "" #: src/frontend/cmd.cc:761 msgid " --silent same as -q\n" msgstr " --silent o mesmo que -q\n" #: src/frontend/cmd.cc:763 src/frontend/cmd.cc:781 msgid "\n" msgstr "\n" #: src/frontend/cmd.cc:765 msgid " -x, --xboard start in engine mode\n" msgstr "" #: src/frontend/cmd.cc:767 msgid " -p, --post start up showing thinking\n" msgstr "" #: src/frontend/cmd.cc:769 msgid " -e, --easy disable thinking in opponents time\n" msgstr "" #: src/frontend/cmd.cc:771 msgid " -m, --manual enable manual mode\n" msgstr "" #: src/frontend/cmd.cc:773 msgid "" " -u, --uci enable UCI protocol (externally behave as UCI engine)\n" msgstr "" #: src/frontend/cmd.cc:775 msgid " -M size, --memory=size specify memory usage in MB for hashtable\n" msgstr "" #: src/frontend/cmd.cc:777 msgid "" " -a filename, --addbook=filename compile book.bin from pgn book " "'filename'\n" msgstr "" #: src/frontend/cmd.cc:779 msgid " -g, --graphic enable graphic mode\n" msgstr " -g, --graphic activar o modo gráfico\n" #: src/frontend/cmd.cc:783 msgid "" " Options xboard and post are accepted without leading dashes\n" " for backward compatibility.\n" "\n" msgstr "" #: src/frontend/cmd.cc:787 msgid "" " Moves are accepted either in standard algebraic notation (SAN) or\n" " in coordinate algebraic notation.\n" "\n" msgstr "" #: src/frontend/cmd.cc:791 msgid "" " The file 'gnuchess.ini' allows setting config options. See\n" " 'info gnuchess' for details. The file will be looked up in the current\n" " directory or, if not found there, in the directory pointed to by\n" " environment variable GNUCHESS_PKGDATADIR.\n" "\n" msgstr "" #: src/frontend/cmd.cc:797 msgid "" "Report bugs to .\n" "\n" msgstr "" "Comunique os erros a .\n" "\n" #: src/frontend/cmd.cc:844 src/frontend/cmd.cc:1280 #, c-format msgid "Invalid move: %s\n" msgstr "Movemento non válido: %s\n" #: src/frontend/cmd.cc:862 #, c-format msgid "Command 'white' is currently not supported.\n" msgstr "" #: src/frontend/cmd.cc:893 #, c-format msgid "My rating = %d\n" msgstr "" #: src/frontend/cmd.cc:894 #, c-format msgid "Opponent rating = %d\n" msgstr "" #: src/frontend/cmd.cc:896 msgid "time" msgstr "tempo" #: src/frontend/cmd.cc:898 msgid "moves" msgstr "movementos" #: src/frontend/cmd.cc:903 src/frontend/cmd.cc:910 src/frontend/cmd.cc:919 #: src/frontend/cmd.cc:928 #, c-format msgid "No. of moves generated = %ld\n" msgstr "" #: src/frontend/cmd.cc:932 #, c-format msgid "Command 'show eval/score' is currently not supported.\n" msgstr "" #: src/frontend/cmd.cc:939 #, c-format msgid "Command 'show pin' is currently not supported.\n" msgstr "" #: src/frontend/cmd.cc:951 #, c-format msgid "Command 'test' is currently not supported.\n" msgstr "" #: src/frontend/cmd.cc:969 msgid " Quits the program." msgstr " Sae do programa." #: src/frontend/cmd.cc:971 msgid " In analysis mode this stops analysis, otherwise it quits the program." msgstr "" #: src/frontend/cmd.cc:973 msgid " Produces a help blurb corresponding to this list of commands." msgstr "" #: src/frontend/cmd.cc:975 msgid " add - compiles book.bin from a pgn book file" msgstr "" #: src/frontend/cmd.cc:976 msgid " on - enables use of book (default)" msgstr "" #: src/frontend/cmd.cc:977 msgid " off - disables use of book" msgstr "" #: src/frontend/cmd.cc:978 msgid " worst - plays worst move from book" msgstr "" #: src/frontend/cmd.cc:979 msgid " best - plays best move from book" msgstr "" #: src/frontend/cmd.cc:980 msgid " prefer - same as 'book on' (default)" msgstr "" #: src/frontend/cmd.cc:981 msgid " random - plays any move from book" msgstr "" #: src/frontend/cmd.cc:983 msgid " Prints out the version of this program." msgstr "Mostra a versión deste programa." #: src/frontend/cmd.cc:986 msgid " Backs up one move in pgn loaded game." msgstr "" #: src/frontend/cmd.cc:988 msgid " Saves the game so far from memory to the file." msgstr "" #: src/frontend/cmd.cc:990 msgid " Loads the game in the file into memory." msgstr "Carga a partida á memoria desde o ficheiro." #: src/frontend/cmd.cc:992 msgid "" " Loads the game in the file into memory, and enables\n" " the commands 'first', 'last', 'next', 'previous'." msgstr "" #: src/frontend/cmd.cc:996 msgid " Advances one move in pgn loaded game." msgstr "Avanza un movemento na partida de pgn cargada." #: src/frontend/cmd.cc:998 msgid " Goes to begin position of pgn loaded game." msgstr "Vai á posición inicial da partida de pgn cargada." #: src/frontend/cmd.cc:1000 msgid " Goes to end position of pgn loaded game." msgstr "Vai á posición final da partida de pgn cargada." #: src/frontend/cmd.cc:1003 msgid "" " Makes the program stop moving. You may now enter moves\n" " to reach some position in the future." msgstr "" #: src/frontend/cmd.cc:1007 msgid " Program plays white." msgstr "O programa xoga con brancas." #: src/frontend/cmd.cc:1009 msgid " Program plays black." msgstr "O programa xoga con negras." #: src/frontend/cmd.cc:1011 msgid "" " Computer takes whichever side is on move and begins its\n" " thinking immediately." msgstr "" #: src/frontend/cmd.cc:1014 msgid "" " Arranges for verbose thinking output showing variation, score,\n" " time, depth, etc." msgstr "" #: src/frontend/cmd.cc:1017 msgid " Turns off verbose thinking output." msgstr "" #: src/frontend/cmd.cc:1019 msgid "" " Lets you input your name. Also writes the log.nnn and\n" " corresponding game.nnn files. For details please see\n" " the auxiliary file format sections." msgstr "" #: src/frontend/cmd.cc:1023 msgid " Mostly used by Internet Chess Server." msgstr " Empregado maiormente por Internet Chess Server." #: src/frontend/cmd.cc:1025 msgid "" " This command reactivates a game that has been terminated automatically\n" " due to checkmate or no more time on the clock. However, it does not\n" " alter those conditions. So you would have to undo a move or two, or\n" " add time to the clock with 'level' or 'time'." msgstr "" #: src/frontend/cmd.cc:1030 msgid " Inputs the estimated rating for computer and for its opponent." msgstr "" #: src/frontend/cmd.cc:1032 msgid " Sets up a new game (i.e. pieces in original positions)." msgstr "" #: src/frontend/cmd.cc:1034 msgid "" " Inputs time left in game for computer in hundredths of a second.\n" " Mostly used by Internet Chess Server." msgstr "" #: src/frontend/cmd.cc:1037 msgid " on - enables using the memory hash table to speed up search" msgstr "" #: src/frontend/cmd.cc:1038 msgid " off - disables the memory hash table" msgstr "" #: src/frontend/cmd.cc:1040 msgid " Sets the hash table to permit storage of N MB." msgstr "" #: src/frontend/cmd.cc:1042 msgid " on - enables using the null-move heuristic to speed up search" msgstr "" #: src/frontend/cmd.cc:1043 msgid " off - disables using the null-move heuristic" msgstr "" #: src/frontend/cmd.cc:1045 msgid " on - enables use of xboard/winboard" msgstr "" #: src/frontend/cmd.cc:1046 msgid " off - disables use of xboard/winboard" msgstr "" #: src/frontend/cmd.cc:1048 msgid "" " Sets the program to look N ply (half-moves) deep for every\n" " search it performs. If there is a checkmate or other condition\n" " that does not allow that depth, then it will not be." msgstr "" #: src/frontend/cmd.cc:1052 msgid "" " Sets time control to be MOVES in MINUTES, with each move giving\n" " an INCREMENT (in seconds, i.e. a Fischer-style clock)." msgstr "" #: src/frontend/cmd.cc:1056 msgid " Loads a position in EPD format from disk into memory." msgstr "" #: src/frontend/cmd.cc:1059 msgid " Saves game position into EPD format from memory to disk." msgstr "" #: src/frontend/cmd.cc:1061 msgid " Switches side to move." msgstr "" #: src/frontend/cmd.cc:1064 msgid " Solves the positions in FILENAME." msgstr "" #: src/frontend/cmd.cc:1066 msgid " Backs up two moves in game history." msgstr "" #: src/frontend/cmd.cc:1068 msgid " Backs up one move in game history." msgstr "" #: src/frontend/cmd.cc:1070 msgid " Displays command line syntax." msgstr "" #: src/frontend/cmd.cc:1072 msgid " board - displays the current board" msgstr "" #: src/frontend/cmd.cc:1073 #, fuzzy msgid " time - displays the time settings" msgstr "time - mostra as opcións de tempo" #: src/frontend/cmd.cc:1074 msgid " moves - shows all moves using one call to routine" msgstr "" #: src/frontend/cmd.cc:1075 msgid " escape - shows moves that escape from check using one call to routine" msgstr "" #: src/frontend/cmd.cc:1076 msgid " noncapture - shows non-capture moves" msgstr "" #: src/frontend/cmd.cc:1077 msgid " capture - shows capture moves" msgstr "" #: src/frontend/cmd.cc:1078 msgid " eval [or score] - shows the evaluation per piece and overall" msgstr "" #: src/frontend/cmd.cc:1079 msgid " game - shows moves in game history" msgstr "" #: src/frontend/cmd.cc:1080 msgid " pin - shows pinned pieces" msgstr "" #: src/frontend/cmd.cc:1082 msgid " movelist - reads in an epd file and shows legal moves for its entries" msgstr "" #: src/frontend/cmd.cc:1083 msgid "" " capture - reads in an epd file and shows legal captures for its entries" msgstr "" #: src/frontend/cmd.cc:1084 msgid " movegenspeed - tests speed of move generator" msgstr "" #: src/frontend/cmd.cc:1085 msgid " capturespeed - tests speed of capture move generator" msgstr "" #: src/frontend/cmd.cc:1086 msgid " eval - reads in an epd file and shows evaluation for its entries" msgstr "" #: src/frontend/cmd.cc:1087 msgid " evalspeed - tests speed of the evaluator" msgstr "" #: src/frontend/cmd.cc:1089 msgid " Shows moves from opening book." msgstr "" #: src/frontend/cmd.cc:1091 msgid " Enables display board in graphic mode." msgstr "" #: src/frontend/cmd.cc:1093 msgid " Disables graphic mode and display classical view." msgstr "" #: src/frontend/cmd.cc:1119 #, c-format msgid "" "Help for command %s not found\n" "\n" msgstr "" #: src/frontend/cmd.cc:1121 #, c-format msgid "List of commands: (help COMMAND to get more help)\n" msgstr "" #: src/frontend/engine.cc:247 msgid "Black" msgstr "" #: src/frontend/engine.cc:247 msgid "White" msgstr "" #: src/frontend/engine.cc:333 #, c-format msgid "" "\n" "My move is : %s\n" msgstr "" gnuchess-6.2.2/po/gnuchess.pot000644 000766 000024 00000035367 12610434564 017157 0ustar00antoniostaff000000 000000 # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Free Software Foundation, Inc. # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: gnuchess 6.2.2\n" "Report-Msgid-Bugs-To: bug-gnu-chess@gnu.org\n" "POT-Creation-Date: 2015-10-17 14:05+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: src/main.cc:317 #, c-format msgid "Memory out of Range or Invalid\n" msgstr "" #: src/main.cc:334 #, c-format msgid "File name is too long (max = %d)\n" msgstr "" #: src/main.cc:340 msgid "Option Processing Failed\n" msgstr "" #: src/main.cc:381 #, c-format msgid "" "Copyright (C) %s Free Software Foundation, Inc.\n" "License GPLv3+: GNU GPL version 3 or later \n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" msgstr "" #: src/main.cc:494 #, c-format msgid "Thinking...\n" msgstr "" #: src/frontend/cmd.cc:101 #, c-format msgid "Command 'activate' is currently not supported.\n" msgstr "" #: src/frontend/cmd.cc:131 #, c-format msgid "Command 'black' is currently not supported.\n" msgstr "" #: src/frontend/cmd.cc:140 #, c-format msgid "" "The syntax to add a new book is:\n" "\n" "\tbook add file.pgn\n" msgstr "" #: src/frontend/cmd.cc:147 #, c-format msgid "book is now on\n" msgstr "" #: src/frontend/cmd.cc:150 #, c-format msgid "book is now off\n" msgstr "" #: src/frontend/cmd.cc:153 #, c-format msgid "book is now best\n" msgstr "" #: src/frontend/cmd.cc:156 #, c-format msgid "book is now worst\n" msgstr "" #: src/frontend/cmd.cc:159 #, c-format msgid "book is now random\n" msgstr "" #: src/frontend/cmd.cc:161 #, c-format msgid "Incorrect book option\n" msgstr "" #: src/frontend/cmd.cc:174 #, c-format msgid "Search to a depth of %d\n" msgstr "" #: src/frontend/cmd.cc:240 #, c-format msgid "Hashing is on.\n" msgstr "" #: src/frontend/cmd.cc:242 #, c-format msgid "Hashing is off.\n" msgstr "" #: src/frontend/cmd.cc:268 src/frontend/cmd.cc:278 #, c-format msgid "Fischer increment of %d seconds\n" msgstr "" #. TRANSLATORS: Please be aware that the word 'move' is sometimes #. used as a synonym of 'ply', and sometimes in the sense of a #. full 2-ply move. #: src/frontend/cmd.cc:276 #, c-format msgid "Time Control: %d moves in %.2f secs\n" msgstr "" #: src/frontend/cmd.cc:286 #, c-format msgid "name - list known players alphabetically\n" msgstr "" #: src/frontend/cmd.cc:287 #, c-format msgid "score - list by GNU best result first \n" msgstr "" #: src/frontend/cmd.cc:288 #, c-format msgid "reverse - list by GNU worst result first\n" msgstr "" #: src/frontend/cmd.cc:303 src/frontend/cmd.cc:1301 #, c-format msgid "Board is wrong!\n" msgstr "" #: src/frontend/cmd.cc:309 src/frontend/cmd.cc:312 #, c-format msgid "Error reading file '%s'\n" msgstr "" #: src/frontend/cmd.cc:378 #, c-format msgid "Failed to open %s for writing: %s\n" msgstr "" #: src/frontend/cmd.cc:384 #, c-format msgid "Could not create logfile, all slots occupied.\n" msgstr "" #: src/frontend/cmd.cc:385 #, c-format msgid "You may consider deleting or renaming your existing logfiles.\n" msgstr "" #: src/frontend/cmd.cc:417 #, c-format msgid "Null-move heuristic is on.\n" msgstr "" #: src/frontend/cmd.cc:419 #, c-format msgid "Null-move heuristic is off.\n" msgstr "" #: src/frontend/cmd.cc:439 src/frontend/cmd.cc:466 #, c-format msgid "Incorrect epd file\n" msgstr "" #: src/frontend/cmd.cc:510 #, c-format msgid "No more moves. Game reached the end.\n" msgstr "" #: src/frontend/cmd.cc:530 #, c-format msgid "Initial position reached. There are no earlier moves.\n" msgstr "" #: src/frontend/cmd.cc:586 src/frontend/cmd.cc:692 #, c-format msgid "Invalid filename.\n" msgstr "" #: src/frontend/cmd.cc:592 #, c-format msgid "Graphic mode is enabled.\n" msgstr "" #: src/frontend/cmd.cc:598 #, c-format msgid "Graphic mode is disabled.\n" msgstr "" #: src/frontend/cmd.cc:639 #, c-format msgid "Command 'random' is currently not supported.\n" msgstr "" #: src/frontend/cmd.cc:647 #, c-format msgid "my rating = %d, opponent rating = %d\n" msgstr "" #: src/frontend/cmd.cc:671 src/frontend/cmd.cc:741 #, c-format msgid "No moves to undo!\n" msgstr "" #: src/frontend/cmd.cc:681 #, c-format msgid "Save to %s\n" msgstr "" #: src/frontend/cmd.cc:722 #, c-format msgid "Command 'switch' is currently not supported.\n" msgstr "" #: src/frontend/cmd.cc:728 #, c-format msgid "Old TimeLimit = %g\n" msgstr "" #: src/frontend/cmd.cc:730 #, c-format msgid "New TimeLimit = %g\n" msgstr "" #: src/frontend/cmd.cc:750 #, c-format msgid "" "Usage: %s [OPTION]...\n" "\n" msgstr "" #: src/frontend/cmd.cc:752 msgid "" "Play the game of chess\n" "\n" msgstr "" #: src/frontend/cmd.cc:754 msgid "Options:\n" msgstr "" #: src/frontend/cmd.cc:755 msgid " -h, --help display this help and exit\n" msgstr "" #: src/frontend/cmd.cc:757 msgid " -v, --version display version information and exit\n" msgstr "" #: src/frontend/cmd.cc:759 msgid " -q, --quiet make the program silent on startup\n" msgstr "" #: src/frontend/cmd.cc:761 msgid " --silent same as -q\n" msgstr "" #: src/frontend/cmd.cc:763 src/frontend/cmd.cc:781 msgid "\n" msgstr "" #: src/frontend/cmd.cc:765 msgid " -x, --xboard start in engine mode\n" msgstr "" #: src/frontend/cmd.cc:767 msgid " -p, --post start up showing thinking\n" msgstr "" #: src/frontend/cmd.cc:769 msgid " -e, --easy disable thinking in opponents time\n" msgstr "" #: src/frontend/cmd.cc:771 msgid " -m, --manual enable manual mode\n" msgstr "" #: src/frontend/cmd.cc:773 msgid "" " -u, --uci enable UCI protocol (externally behave as UCI engine)\n" msgstr "" #: src/frontend/cmd.cc:775 msgid " -M size, --memory=size specify memory usage in MB for hashtable\n" msgstr "" #: src/frontend/cmd.cc:777 msgid "" " -a filename, --addbook=filename compile book.bin from pgn book " "'filename'\n" msgstr "" #: src/frontend/cmd.cc:779 msgid " -g, --graphic enable graphic mode\n" msgstr "" #: src/frontend/cmd.cc:783 msgid "" " Options xboard and post are accepted without leading dashes\n" " for backward compatibility.\n" "\n" msgstr "" #: src/frontend/cmd.cc:787 msgid "" " Moves are accepted either in standard algebraic notation (SAN) or\n" " in coordinate algebraic notation.\n" "\n" msgstr "" #: src/frontend/cmd.cc:791 msgid "" " The file 'gnuchess.ini' allows setting config options. See\n" " 'info gnuchess' for details. The file will be looked up in the current\n" " directory or, if not found there, in the directory pointed to by\n" " environment variable GNUCHESS_PKGDATADIR.\n" "\n" msgstr "" #: src/frontend/cmd.cc:797 msgid "" "Report bugs to .\n" "\n" msgstr "" #: src/frontend/cmd.cc:844 src/frontend/cmd.cc:1280 #, c-format msgid "Invalid move: %s\n" msgstr "" #: src/frontend/cmd.cc:862 #, c-format msgid "Command 'white' is currently not supported.\n" msgstr "" #: src/frontend/cmd.cc:893 #, c-format msgid "My rating = %d\n" msgstr "" #: src/frontend/cmd.cc:894 #, c-format msgid "Opponent rating = %d\n" msgstr "" #: src/frontend/cmd.cc:896 msgid "time" msgstr "" #: src/frontend/cmd.cc:898 msgid "moves" msgstr "" #: src/frontend/cmd.cc:903 src/frontend/cmd.cc:910 src/frontend/cmd.cc:919 #: src/frontend/cmd.cc:928 #, c-format msgid "No. of moves generated = %ld\n" msgstr "" #: src/frontend/cmd.cc:932 #, c-format msgid "Command 'show eval/score' is currently not supported.\n" msgstr "" #: src/frontend/cmd.cc:939 #, c-format msgid "Command 'show pin' is currently not supported.\n" msgstr "" #: src/frontend/cmd.cc:951 #, c-format msgid "Command 'test' is currently not supported.\n" msgstr "" #: src/frontend/cmd.cc:969 msgid " Quits the program." msgstr "" #: src/frontend/cmd.cc:971 msgid " In analysis mode this stops analysis, otherwise it quits the program." msgstr "" #: src/frontend/cmd.cc:973 msgid " Produces a help blurb corresponding to this list of commands." msgstr "" #: src/frontend/cmd.cc:975 msgid " add - compiles book.bin from a pgn book file" msgstr "" #: src/frontend/cmd.cc:976 msgid " on - enables use of book (default)" msgstr "" #: src/frontend/cmd.cc:977 msgid " off - disables use of book" msgstr "" #: src/frontend/cmd.cc:978 msgid " worst - plays worst move from book" msgstr "" #: src/frontend/cmd.cc:979 msgid " best - plays best move from book" msgstr "" #: src/frontend/cmd.cc:980 msgid " prefer - same as 'book on' (default)" msgstr "" #: src/frontend/cmd.cc:981 msgid " random - plays any move from book" msgstr "" #: src/frontend/cmd.cc:983 msgid " Prints out the version of this program." msgstr "" #: src/frontend/cmd.cc:986 msgid " Backs up one move in pgn loaded game." msgstr "" #: src/frontend/cmd.cc:988 msgid " Saves the game so far from memory to the file." msgstr "" #: src/frontend/cmd.cc:990 msgid " Loads the game in the file into memory." msgstr "" #: src/frontend/cmd.cc:992 msgid "" " Loads the game in the file into memory, and enables\n" " the commands 'first', 'last', 'next', 'previous'." msgstr "" #: src/frontend/cmd.cc:996 msgid " Advances one move in pgn loaded game." msgstr "" #: src/frontend/cmd.cc:998 msgid " Goes to begin position of pgn loaded game." msgstr "" #: src/frontend/cmd.cc:1000 msgid " Goes to end position of pgn loaded game." msgstr "" #: src/frontend/cmd.cc:1003 msgid "" " Makes the program stop moving. You may now enter moves\n" " to reach some position in the future." msgstr "" #: src/frontend/cmd.cc:1007 msgid " Program plays white." msgstr "" #: src/frontend/cmd.cc:1009 msgid " Program plays black." msgstr "" #: src/frontend/cmd.cc:1011 msgid "" " Computer takes whichever side is on move and begins its\n" " thinking immediately." msgstr "" #: src/frontend/cmd.cc:1014 msgid "" " Arranges for verbose thinking output showing variation, score,\n" " time, depth, etc." msgstr "" #: src/frontend/cmd.cc:1017 msgid " Turns off verbose thinking output." msgstr "" #: src/frontend/cmd.cc:1019 msgid "" " Lets you input your name. Also writes the log.nnn and\n" " corresponding game.nnn files. For details please see\n" " the auxiliary file format sections." msgstr "" #: src/frontend/cmd.cc:1023 msgid " Mostly used by Internet Chess Server." msgstr "" #: src/frontend/cmd.cc:1025 msgid "" " This command reactivates a game that has been terminated automatically\n" " due to checkmate or no more time on the clock. However, it does not\n" " alter those conditions. So you would have to undo a move or two, or\n" " add time to the clock with 'level' or 'time'." msgstr "" #: src/frontend/cmd.cc:1030 msgid " Inputs the estimated rating for computer and for its opponent." msgstr "" #: src/frontend/cmd.cc:1032 msgid " Sets up a new game (i.e. pieces in original positions)." msgstr "" #: src/frontend/cmd.cc:1034 msgid "" " Inputs time left in game for computer in hundredths of a second.\n" " Mostly used by Internet Chess Server." msgstr "" #: src/frontend/cmd.cc:1037 msgid " on - enables using the memory hash table to speed up search" msgstr "" #: src/frontend/cmd.cc:1038 msgid " off - disables the memory hash table" msgstr "" #: src/frontend/cmd.cc:1040 msgid " Sets the hash table to permit storage of N MB." msgstr "" #: src/frontend/cmd.cc:1042 msgid " on - enables using the null-move heuristic to speed up search" msgstr "" #: src/frontend/cmd.cc:1043 msgid " off - disables using the null-move heuristic" msgstr "" #: src/frontend/cmd.cc:1045 msgid " on - enables use of xboard/winboard" msgstr "" #: src/frontend/cmd.cc:1046 msgid " off - disables use of xboard/winboard" msgstr "" #: src/frontend/cmd.cc:1048 msgid "" " Sets the program to look N ply (half-moves) deep for every\n" " search it performs. If there is a checkmate or other condition\n" " that does not allow that depth, then it will not be." msgstr "" #: src/frontend/cmd.cc:1052 msgid "" " Sets time control to be MOVES in MINUTES, with each move giving\n" " an INCREMENT (in seconds, i.e. a Fischer-style clock)." msgstr "" #: src/frontend/cmd.cc:1056 msgid " Loads a position in EPD format from disk into memory." msgstr "" #: src/frontend/cmd.cc:1059 msgid " Saves game position into EPD format from memory to disk." msgstr "" #: src/frontend/cmd.cc:1061 msgid " Switches side to move." msgstr "" #: src/frontend/cmd.cc:1064 msgid " Solves the positions in FILENAME." msgstr "" #: src/frontend/cmd.cc:1066 msgid " Backs up two moves in game history." msgstr "" #: src/frontend/cmd.cc:1068 msgid " Backs up one move in game history." msgstr "" #: src/frontend/cmd.cc:1070 msgid " Displays command line syntax." msgstr "" #: src/frontend/cmd.cc:1072 msgid " board - displays the current board" msgstr "" #: src/frontend/cmd.cc:1073 msgid " time - displays the time settings" msgstr "" #: src/frontend/cmd.cc:1074 msgid " moves - shows all moves using one call to routine" msgstr "" #: src/frontend/cmd.cc:1075 msgid " escape - shows moves that escape from check using one call to routine" msgstr "" #: src/frontend/cmd.cc:1076 msgid " noncapture - shows non-capture moves" msgstr "" #: src/frontend/cmd.cc:1077 msgid " capture - shows capture moves" msgstr "" #: src/frontend/cmd.cc:1078 msgid " eval [or score] - shows the evaluation per piece and overall" msgstr "" #: src/frontend/cmd.cc:1079 msgid " game - shows moves in game history" msgstr "" #: src/frontend/cmd.cc:1080 msgid " pin - shows pinned pieces" msgstr "" #: src/frontend/cmd.cc:1082 msgid " movelist - reads in an epd file and shows legal moves for its entries" msgstr "" #: src/frontend/cmd.cc:1083 msgid "" " capture - reads in an epd file and shows legal captures for its entries" msgstr "" #: src/frontend/cmd.cc:1084 msgid " movegenspeed - tests speed of move generator" msgstr "" #: src/frontend/cmd.cc:1085 msgid " capturespeed - tests speed of capture move generator" msgstr "" #: src/frontend/cmd.cc:1086 msgid " eval - reads in an epd file and shows evaluation for its entries" msgstr "" #: src/frontend/cmd.cc:1087 msgid " evalspeed - tests speed of the evaluator" msgstr "" #: src/frontend/cmd.cc:1089 msgid " Shows moves from opening book." msgstr "" #: src/frontend/cmd.cc:1091 msgid " Enables display board in graphic mode." msgstr "" #: src/frontend/cmd.cc:1093 msgid " Disables graphic mode and display classical view." msgstr "" #: src/frontend/cmd.cc:1119 #, c-format msgid "" "Help for command %s not found\n" "\n" msgstr "" #: src/frontend/cmd.cc:1121 #, c-format msgid "List of commands: (help COMMAND to get more help)\n" msgstr "" #: src/frontend/engine.cc:247 msgid "Black" msgstr "" #: src/frontend/engine.cc:247 msgid "White" msgstr "" #: src/frontend/engine.cc:333 #, c-format msgid "" "\n" "My move is : %s\n" msgstr "" gnuchess-6.2.2/po/insert-header.sin000644 000766 000024 00000001240 12205632536 020037 0ustar00antoniostaff000000 000000 # Sed script that inserts the file called HEADER before the header entry. # # At each occurrence of a line starting with "msgid ", we execute the following # commands. At the first occurrence, insert the file. At the following # occurrences, do nothing. The distinction between the first and the following # occurrences is achieved by looking at the hold space. /^msgid /{ x # Test if the hold space is empty. s/m/m/ ta # Yes it was empty. First occurrence. Read the file. r HEADER # Output the file's contents by reading the next line. But don't lose the # current line while doing this. g N bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } gnuchess-6.2.2/po/LINGUAS000644 000766 000024 00000000044 12607035044 015615 0ustar00antoniostaff000000 000000 de es uk sr nl eo pt_BR gl vi nb fr gnuchess-6.2.2/po/Makefile.in.in000644 000766 000024 00000040423 12232311021 017231 0ustar00antoniostaff000000 000000 # Makefile for PO directory in any package using GNU gettext. # Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public # License but which still want to provide support for the GNU gettext # functionality. # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # # Origin: gettext-0.18.3 GETTEXT_MACRO_VERSION = 0.18 PACKAGE = @PACKAGE@ VERSION = @VERSION@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ SED = @SED@ SHELL = /bin/sh @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ datadir = @datadir@ localedir = @localedir@ gettextsrcdir = $(datadir)/gettext/po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ # We use $(mkdir_p). # In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as # "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, # @install_sh@ does not start with $(SHELL), so we add it. # In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake # versions, $(mkinstalldirs) and $(install_sh) are unused. mkinstalldirs = $(SHELL) @install_sh@ -d install_sh = $(SHELL) @install_sh@ MKDIR_P = @MKDIR_P@ mkdir_p = @mkdir_p@ GMSGFMT_ = @GMSGFMT@ GMSGFMT_no = @GMSGFMT@ GMSGFMT_yes = @GMSGFMT_015@ GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) MSGFMT_ = @MSGFMT@ MSGFMT_no = @MSGFMT@ MSGFMT_yes = @MSGFMT_015@ MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) XGETTEXT_ = @XGETTEXT@ XGETTEXT_no = @XGETTEXT@ XGETTEXT_yes = @XGETTEXT_015@ XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) MSGMERGE = msgmerge MSGMERGE_UPDATE = @MSGMERGE@ --update MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter POFILES = @POFILES@ GMOFILES = @GMOFILES@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) POTFILES = \ CATALOGS = @CATALOGS@ # Makevars gets inserted here. (Don't remove this line!) .SUFFIXES: .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update .po.mo: @echo "$(MSGFMT) -c -o $@ $<"; \ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all: all-@USE_NLS@ all-yes: stamp-po all-no: # Ensure that the gettext macros and this Makefile.in.in are in sync. CHECK_MACRO_VERSION = \ test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ exit 1; \ } # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because # we don't want to bother translators with empty POT files). We assume that # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. # In this case, stamp-po is a nop (i.e. a phony target). # stamp-po is a timestamp denoting the last time at which the CATALOGS have # been loosely updated. Its purpose is that when a developer or translator # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent # invocations of "make" will do nothing. This timestamp would not be necessary # if updating the $(CATALOGS) would always touch them; however, the rule for # $(POFILES) has been designed to not touch files that don't need to be # changed. stamp-po: $(srcdir)/$(DOMAIN).pot @$(CHECK_MACRO_VERSION) test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @test ! -f $(srcdir)/$(DOMAIN).pot || { \ echo "touch stamp-po" && \ echo timestamp > stamp-poT && \ mv stamp-poT stamp-po; \ } # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. # The determination of whether the package xyz is a GNU one is based on the # heuristic whether some file in the top level directory mentions "GNU xyz". # If GNU 'find' is available, we avoid grepping through monster files. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep 'GNU @PACKAGE@' /dev/null '{}' ';' 2>/dev/null; \ else \ LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \ fi; \ } | grep -v 'libtool:' >/dev/null; then \ package_gnu='GNU '; \ else \ package_gnu=''; \ fi; \ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ else \ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ fi; \ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ *) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --package-name="$${package_gnu}@PACKAGE@" \ --package-version='@VERSION@' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ esac test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ else \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ else \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ } # This rule has no dependencies: we don't need to update $(DOMAIN).pot at # every "make" invocation, only create it when it is missing. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) \ && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \ esac; \ }; \ else \ $(MAKE) $${lang}.po-create; \ fi install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ for file in Makevars; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-data-no: all install-data-yes: all @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ fi; \ done; \ done install-strip: install installdirs: installdirs-exec installdirs-data installdirs-exec: installdirs-data: installdirs-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi installdirs-data-no: installdirs-data-yes: @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done # Define this as empty until I found a useful application. installcheck: uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ for file in $(DISTFILES.common) Makevars.template; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi uninstall-data-no: uninstall-data-yes: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ done; \ done check: all info dvi ps pdf html tags TAGS ctags CTAGS ID: mostlyclean: rm -f remove-potcdate.sed rm -f stamp-poT rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f stamp-po $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(MAKE) update-po @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. dist2: stamp-po $(DISTFILES) dists="$(DISTFILES)"; \ if test "$(PACKAGE)" = "gettext-tools"; then \ dists="$$dists Makevars.template"; \ fi; \ if test -f $(srcdir)/$(DOMAIN).pot; then \ dists="$$dists $(DOMAIN).pot stamp-po"; \ fi; \ if test -f $(srcdir)/ChangeLog; then \ dists="$$dists ChangeLog"; \ fi; \ for i in 0 1 2 3 4 5 6 7 8 9; do \ if test -f $(srcdir)/ChangeLog.$$i; then \ dists="$$dists ChangeLog.$$i"; \ fi; \ done; \ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ if test -f $$file; then \ cp -p $$file $(distdir) || exit 1; \ else \ cp -p $(srcdir)/$$file $(distdir) || exit 1; \ fi; \ done update-po: Makefile $(MAKE) $(DOMAIN).pot-update test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for creating PO files. .nop.po-create: @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ exit 1 # General rule for updating PO files. .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ esac; \ }; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: # Recreate Makefile by invoking config.status. Explicitly invoke the shell, # because execution permission bits may not work on the current file system. # Use @SHELL@, which is the shell determined by autoconf for the use by its # scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ && @SHELL@ ./config.status $(subdir)/$@.in po-directories force: # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: gnuchess-6.2.2/po/Makevars000644 000766 000024 00000004500 12205632763 016272 0ustar00antoniostaff000000 000000 # Makefile variables for PO directory in any package using GNU gettext. # Usually the message domain is the same as the package name. DOMAIN = $(PACKAGE) # These two variables depend on the location of this directory. subdir = po top_builddir = .. # These options get passed to xgettext. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = Free Software Foundation, Inc. # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines # in the GNU gettext documentation, section 'Preparing Strings'. # - Strings which use unclear terms or require additional context to be # understood. # - Strings which make invalid assumptions about notation of date, time or # money. # - Pluralisation problems. # - Incorrect English spelling. # - Incorrect formatting. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. MSGID_BUGS_ADDRESS = bug-gnu-chess@gnu.org # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = # This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' # context. Possible values are "yes" and "no". Set this to yes if the # package uses functions taking also a message context, like pgettext(), or # if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. USE_MSGCTXT = no # These options get passed to msgmerge. # Useful options are in particular: # --previous to keep previous msgids of translated messages, # --quiet to reduce the verbosity. MSGMERGE_OPTIONS = gnuchess-6.2.2/po/nb.gmo000644 000766 000024 00000037534 12610434565 015716 0ustar00antoniostaff000000 000000 Þ•†L³|H I K Ck M¯ 7ý (5 /^ 'Ž .¶ 7å J 9h )¢ &Ì Ró #F&j$‘O¶29'X+€)¬FÖ?h]‘Æ6Xg(÷^ &g¦[(j>“Òèþ9/L/|±¬x^8×"0Sòk^#_-ƒ!±#ÓH÷@5_F•AÜ=)\#†-ªFØ2%R%xž&º-á#$3<X>•Ô%ï""8#[/,À-í6/R-‚+°,Ü. 8"Q t•°ÊÛë " 66 m € 2’ Å Õ %é !"!@!]!y!! £!­!)Æ! ð!ü!5"$K"p">ˆ"Ç"Ù"ê"ú"#!#%'#,M#)z#)¤#Î#¾Ó#’%!”%S¶%L &:W&+’&1¾&,ð&+'9I'Pƒ'<Ô''((9(Vb(/¹(1é(.)SJ)3ž)Ò)%ï)0*+F*Hr*F»*v+ƒy+4ý+l2,%Ÿ,kÅ,$1-iV-]À-*.CI..¦.¿.7Ö.//5>/·t/,0C¬0ð01-1öI1@2$Q3,v3#£3&Ç3Qî3@4@`4K¡4Fí4=45/r5$¢57Ç5Mÿ5?M6'6$µ6Ú6*ù6/$7&T7'{7@£7Dä7)8*E81p8 ¢8%Ã8é8'û8$#9%H9.n9'9%Å9#ë9$:44:i:%ˆ:®:Î:ë:;;%%;K;d;5u;«;½;<Ð; <!<-5<c<z<—<´<Ò<ê<= =-= G=U=9n='¨=Ð=Må=3>F>W>i>>•>-›>*É>1ô>1&?X?#…E:9v1JUq}5 bf0CehDY [2^c=(<Mo'i8 P‚!aK&?NX~;sG+jk.†yxWT,$r€F%L„ u>AH@zm) "6Bp7RVS{Qd*\ lw4/g|t_O]`-nIZƒ3 --silent same as -q -M size, --memory=size specify memory usage in MB for hashtable -a filename, --addbook=filename compile book.bin from pgn book 'filename' -e, --easy disable thinking in opponents time -g, --graphic enable graphic mode -h, --help display this help and exit -m, --manual enable manual mode -p, --post start up showing thinking -q, --quiet make the program silent on startup -u, --uci enable UCI protocol (externally behave as UCI engine) -v, --version display version information and exit -x, --xboard start in engine mode Advances one move in pgn loaded game. Arranges for verbose thinking output showing variation, score, time, depth, etc. Backs up one move in game history. Backs up one move in pgn loaded game. Backs up two moves in game history. Computer takes whichever side is on move and begins its thinking immediately. Disables graphic mode and display classical view. Displays command line syntax. Enables display board in graphic mode. Goes to begin position of pgn loaded game. Goes to end position of pgn loaded game. In analysis mode this stops analysis, otherwise it quits the program. Inputs the estimated rating for computer and for its opponent. Inputs time left in game for computer in hundredths of a second. Mostly used by Internet Chess Server. Lets you input your name. Also writes the log.nnn and corresponding game.nnn files. For details please see the auxiliary file format sections. Loads a position in EPD format from disk into memory. Loads the game in the file into memory, and enables the commands 'first', 'last', 'next', 'previous'. Loads the game in the file into memory. Makes the program stop moving. You may now enter moves to reach some position in the future. Mostly used by Internet Chess Server. Moves are accepted either in standard algebraic notation (SAN) or in coordinate algebraic notation. Options xboard and post are accepted without leading dashes for backward compatibility. Prints out the version of this program. Produces a help blurb corresponding to this list of commands. Program plays black. Program plays white. Quits the program. Saves game position into EPD format from memory to disk. Saves the game so far from memory to the file. Sets the hash table to permit storage of N MB. Sets the program to look N ply (half-moves) deep for every search it performs. If there is a checkmate or other condition that does not allow that depth, then it will not be. Sets time control to be MOVES in MINUTES, with each move giving an INCREMENT (in seconds, i.e. a Fischer-style clock). Sets up a new game (i.e. pieces in original positions). Shows moves from opening book. Solves the positions in FILENAME. Switches side to move. The file 'gnuchess.ini' allows setting config options. See 'info gnuchess' for details. The file will be looked up in the current directory or, if not found there, in the directory pointed to by environment variable GNUCHESS_PKGDATADIR. This command reactivates a game that has been terminated automatically due to checkmate or no more time on the clock. However, it does not alter those conditions. So you would have to undo a move or two, or add time to the clock with 'level' or 'time'. Turns off verbose thinking output. add - compiles book.bin from a pgn book file best - plays best move from book board - displays the current board capture - reads in an epd file and shows legal captures for its entries capture - shows capture moves capturespeed - tests speed of capture move generator escape - shows moves that escape from check using one call to routine eval - reads in an epd file and shows evaluation for its entries eval [or score] - shows the evaluation per piece and overall evalspeed - tests speed of the evaluator game - shows moves in game history movegenspeed - tests speed of move generator movelist - reads in an epd file and shows legal moves for its entries moves - shows all moves using one call to routine noncapture - shows non-capture moves off - disables the memory hash table off - disables use of book off - disables use of xboard/winboard off - disables using the null-move heuristic on - enables use of book (default) on - enables use of xboard/winboard on - enables using the memory hash table to speed up search on - enables using the null-move heuristic to speed up search pin - shows pinned pieces prefer - same as 'book on' (default) random - plays any move from book time - displays the time settings worst - plays worst move from bookBoard is wrong! Command 'activate' is currently not supported. Command 'black' is currently not supported. Command 'random' is currently not supported. Command 'show eval/score' is currently not supported. Command 'show pin' is currently not supported. Command 'switch' is currently not supported. Command 'test' is currently not supported. Command 'white' is currently not supported. Could not create logfile, all slots occupied. Error reading file '%s' Failed to open %s for writing: %s Fischer increment of %d seconds Graphic mode is disabled. Graphic mode is enabled. Hashing is off. Hashing is on. Help for command %s not found Incorrect book option Incorrect epd file Initial position reached. There are no earlier moves. Invalid filename. Invalid move: %s List of commands: (help COMMAND to get more help) My rating = %d New TimeLimit = %g No more moves. Game reached the end. No moves to undo! No. of moves generated = %ld Null-move heuristic is off. Null-move heuristic is on. Old TimeLimit = %g Opponent rating = %d Options: Play the game of chess Report bugs to . Save to %s Search to a depth of %d The syntax to add a new book is: book add file.pgn Time Control: %d moves in %.2f secs Usage: %s [OPTION]... You may consider deleting or renaming your existing logfiles. book is now best book is now off book is now on book is now random book is now worst movesmy rating = %d, opponent rating = %d name - list known players alphabetically reverse - list by GNU worst result first score - list by GNU best result first timeProject-Id-Version: gnuchess 6.1.1 Report-Msgid-Bugs-To: bug-gnu-chess@gnu.org POT-Creation-Date: 2015-10-17 14:05+0200 PO-Revision-Date: 2014-07-22 21:27+0100 Last-Translator: Johnny A. Solbu Language-Team: Norwegian Bokmaal Language: nb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); X-Generator: Poedit 1.5.4 --silent samme som -q -M størrelse, --memory=størrelse spesifiser minnebruken i MB for hashtabellen -a filnavn, --addbook=filnavn kompilere book.bin fra pgn-bok «filnavn» -e, --easy deaktiver tenkning i motstanderes tid -g, --graphic aktiverer grafikkmodus -h, --help vis denne hjelpen og avslutt -m, --manual aktiverer manuell modus -p, --post oppstart viser tenking -q, --quiet gjør programmet stille ved oppstart -u, --uci aktiver UCI-protokoll (oppføre seg som UCI motor eksternt) -v, --version skriv ut versjonsinformasjon og avslutt -x, --xboard start i motormodus Avanserer ett trekk i pgn-lastet spill. Arrangerer for detaljert tenkningsutdata, viser variasjon, poengsum, tid, dybde osv. Sikkerhetskopierer ett trekk i spillhistorikk. Sikkerhetskopierer ett trekk i pgn-lastet spill. Sikkerhetskopierer to trekk i spillhistorikk. Datamaskinen tar den siden som er pÃ¥ trekk og begynner sin tenkning umiddelbart. Deaktiverer grafisk modus og vis klassisk visning. Viser kommandolinjesyntaks. Aktiverer vis brett i grafisk modus. GÃ¥r til start posisjonen til pgn lastet spill. GÃ¥r til endeposisjon av pgn-lastet spill. I analysemodus stopper dette analysen, ellers avslutter det programmet. Setter inn estimert rangering for datamaskinen og for sin motstander. Setter inn gjenværende tid i spill for datamaskinen i hundredeler av et sekund. Mest brukt av internettsjakkserver. Lar deg angi ditt navn. OgsÃ¥ skriver log.nnn og tilsvarende game.nnn filer. For detaljer vennligst se hjelpefilformatseksjoner. Laster en posisjon i EPD-format fra disk til minne. Laster spillet i filen inn i minnet, og aktiverer kommandoene «first», «last», «next», «previous». Laster spillet i filen inn i minnet. Gjør at programmet slutter Ã¥ bevege seg. Du kan nÃ¥ taste inn trekk for Ã¥ nÃ¥ en stilling i fremtiden. Mest brukt av internettsjakkserver. Trekk er akseptert enten i standard algebraisk notasjon (SAN) eller i koordinert algebraisk notasjon. Alternativene Xboard og post er akseptert uten ledende streker for bakoverkompatibilitet. Skriver ut versjonen av dette programmet. Produserer hjelpe-oppsummering som tilsvarer denne kommandolisten. Programmet spiller sort Programmet spiller hvit Avslutter programmet. Lagrer spillposisjon i EPD-format fra minnet til disk. Lagrer spillet sÃ¥ langt fra minnet til filen. Stiller hashtabellen for Ã¥ tillate lagring av N MB. Stiller programmet til Ã¥ se N ply (halv-trekk) dypt for hver søk den utfører. Hvis det er et sjakkmatt eller annen tilstand som ikke tillater den dybden, sÃ¥ vil det ikke være. Stiller tidskontroll for Ã¥ være TREKK i MINUTTER, med hvert trekk gir en ØKNING (i sekunder, dvs. en Fischer-stil klokke). Setter opp et nytt spill (dvs. brikker i opprinnelige posisjoner). Viser trekk fra Ã¥pningsbok. Løser posisjonene i FILNAVN. Bytter side for Ã¥ trekke. Filen «gnuchess.ini» kan sette konfigurasjonsalternativer. Se «info gnuchess» for detaljer. Filen vil bli slÃ¥tt opp i den nÃ¥værende katalog eller, hvis ikke finnes der, i katalogen pÃ¥pekt til av miljøvariabelen GNUCHESS_PKGDATADIR. Denne kommandoen reaktiverer et spill som har blitt avsluttet automatisk pÃ¥ grunn av sjakkmatt eller ikke mer tid pÃ¥ klokken. Men det endrer ikke disse forholdene. SÃ¥ du vil mÃ¥tte angre et trekk eller to, eller legge til tid i klokken med «level» eller «time». SlÃ¥r av detaljert tenkningsutdata. add - kompilerer book.bin fra en pgn-bokfil best - spiller beste trekk fra bok board - viser det nÃ¥værende brettet capture - leser inn en epd-fil og viser lovlige erobringer for dens oppføringer capture - viser erobringstrekk capturespeed - tester hastigheten pÃ¥ erobringstrekkgeneratoren escape - viser trekk som unnslipper sjekk ved hjelp av ett kall til rutine eval - leser inn en epd-fil og viser evaluering for dens oppføringer eval [eller score] - viser evalueringen per brikke og samlet evalspeed - tester hastigheten pÃ¥ evaluatoren game - viser trekk i spillhistorikk movegenspeed - tester hastigheten pÃ¥ trekkgeneratoren movelist - leser inn en epd-fil og viser lovlige trekk for dens oppføringer moves - viser alle bevegelser ved hjelp av ett kall til rutine noncapture - viser ikke-erobringstrekk off - deaktiverer minnehashtabellen off - deaktiverer bruk av bok off - deaktiverer bruk av xboard/winboard off - deaktiverer bruk av nulltrekk heuristisk on - aktiverer bruk av bok (standard) on - aktiverer bruk av xboard/winboard on - aktiverer bruk av minnehashtabellen for Ã¥ fremskynde søk pÃ¥ - aktiverer bruk av nulltrekk-heuristisk for Ã¥ fremskynde søk pin - viser lÃ¥ste brikker prefer - samme som «book on» (standard) random - spiller hvilket som helst trekk fra bok time - viser tidsinnstillingene worst - spiller verste trekk fra bokBrettet er feil! Kommandoen «activate» støttes ikke. Kommandoen «black» støttes ikke. Kommandoen «random» støttes ikke. Kommandoen «show eval/score» støttes ikke. Kommandoen «show pin» støttes ikke. Kommandoen «switch» støttes ikke. Kommandoen «test» støttes ikke. Kommandoen «white» støttes ikke. Kunne ikke opprette loggfil, alle plasser okkupert. Feil ved lesing av fil «%s» Kunne ikke Ã¥pne %s for skriving: %s Fisher-økning pÃ¥ %d sekunder Grafikkmodus er deaktivert. Grafikkmodus er aktivert. Hashing er av Hashing er pÃ¥ Hjelp for kommandoen %s ikke funnet Ugyldig book-alternativ Ugyldig epd-fil Utgangsstilling nÃ¥dd. Det er ingen tidligere trekk. Ugyldig filnavn. Ugyldig trekk: %s Liste over kommandoer: (help KOMMANDO for Ã¥ fÃ¥ mer hjelp) Min rangering = %d Ny tidsgrense = %g Ingen flere trekk. Spille har nÃ¥dd slutten. Ingen trekk Ã¥ angre! Antall trekk generert = %ld Nulltrekk-heuristisk er av. Nulltrekk-heuristisk er pÃ¥. Gammel tidsgrense = %g Motstanderrangering = %d Valg: Spill sjakk Rapporter feil til . Lagre til %s Søk til en dybde av %d Syntaksen for Ã¥ legge til en bok er: book add fil.pgn Tidskontroll: %d trekk i %.2f sekunder Bruk: %s [VALG]... Du kan vurdere Ã¥ slette eller gi nytt navn til dine eksisterende loggfiler. Boken er nÃ¥ best Boken er nÃ¥ av Boken er nÃ¥ pÃ¥ Boken er nÃ¥ tilfeldig Boken er nÃ¥ verst trekkmin rangering = %d, motstanderrangering = %d name - list kjente spillere alfabetisk reverse - vis etter GNU verste resultater først score - vis etter GNU beste resultater først tidgnuchess-6.2.2/po/nb.po000644 000766 000024 00000052715 12610434564 015547 0ustar00antoniostaff000000 000000 # Norwegian Bokmal translations for gnuchess package. # Copyright (C) 2014 Free Software Foundation, Inc. # This file is distributed under the same license as the gnuchess package. # Johnny A. Solbu , 2014. # msgid "" msgstr "" "Project-Id-Version: gnuchess 6.1.1\n" "Report-Msgid-Bugs-To: bug-gnu-chess@gnu.org\n" "POT-Creation-Date: 2015-10-17 14:05+0200\n" "PO-Revision-Date: 2014-07-22 21:27+0100\n" "Last-Translator: Johnny A. Solbu \n" "Language-Team: Norwegian Bokmaal \n" "Language: nb\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Poedit 1.5.4\n" #: src/main.cc:317 #, c-format msgid "Memory out of Range or Invalid\n" msgstr "" #: src/main.cc:334 #, c-format msgid "File name is too long (max = %d)\n" msgstr "" #: src/main.cc:340 msgid "Option Processing Failed\n" msgstr "" #: src/main.cc:381 #, c-format msgid "" "Copyright (C) %s Free Software Foundation, Inc.\n" "License GPLv3+: GNU GPL version 3 or later \n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" msgstr "" #: src/main.cc:494 #, c-format msgid "Thinking...\n" msgstr "" #: src/frontend/cmd.cc:101 #, c-format msgid "Command 'activate' is currently not supported.\n" msgstr "Kommandoen «activate» støttes ikke.\n" #: src/frontend/cmd.cc:131 #, c-format msgid "Command 'black' is currently not supported.\n" msgstr "Kommandoen «black» støttes ikke.\n" #: src/frontend/cmd.cc:140 #, c-format msgid "" "The syntax to add a new book is:\n" "\n" "\tbook add file.pgn\n" msgstr "" "Syntaksen for Ã¥ legge til en bok er:\n" "\n" "\tbook add fil.pgn\n" #: src/frontend/cmd.cc:147 #, c-format msgid "book is now on\n" msgstr "Boken er nÃ¥ pÃ¥\n" #: src/frontend/cmd.cc:150 #, c-format msgid "book is now off\n" msgstr "Boken er nÃ¥ av\n" #: src/frontend/cmd.cc:153 #, c-format msgid "book is now best\n" msgstr "Boken er nÃ¥ best\n" #: src/frontend/cmd.cc:156 #, c-format msgid "book is now worst\n" msgstr "Boken er nÃ¥ verst\n" #: src/frontend/cmd.cc:159 #, c-format msgid "book is now random\n" msgstr "Boken er nÃ¥ tilfeldig\n" #: src/frontend/cmd.cc:161 #, c-format msgid "Incorrect book option\n" msgstr "Ugyldig book-alternativ\n" #: src/frontend/cmd.cc:174 #, c-format msgid "Search to a depth of %d\n" msgstr "Søk til en dybde av %d\n" #: src/frontend/cmd.cc:240 #, c-format msgid "Hashing is on.\n" msgstr "Hashing er pÃ¥\n" #: src/frontend/cmd.cc:242 #, c-format msgid "Hashing is off.\n" msgstr "Hashing er av\n" #: src/frontend/cmd.cc:268 src/frontend/cmd.cc:278 #, c-format msgid "Fischer increment of %d seconds\n" msgstr "Fisher-økning pÃ¥ %d sekunder\n" #. TRANSLATORS: Please be aware that the word 'move' is sometimes #. used as a synonym of 'ply', and sometimes in the sense of a #. full 2-ply move. #: src/frontend/cmd.cc:276 #, c-format msgid "Time Control: %d moves in %.2f secs\n" msgstr "Tidskontroll: %d trekk i %.2f sekunder\n" #: src/frontend/cmd.cc:286 #, c-format msgid "name - list known players alphabetically\n" msgstr "name - list kjente spillere alfabetisk\n" #: src/frontend/cmd.cc:287 #, c-format msgid "score - list by GNU best result first \n" msgstr "score - vis etter GNU beste resultater først \n" #: src/frontend/cmd.cc:288 #, c-format msgid "reverse - list by GNU worst result first\n" msgstr "reverse - vis etter GNU verste resultater først\n" #: src/frontend/cmd.cc:303 src/frontend/cmd.cc:1301 #, c-format msgid "Board is wrong!\n" msgstr "Brettet er feil!\n" #: src/frontend/cmd.cc:309 src/frontend/cmd.cc:312 #, c-format msgid "Error reading file '%s'\n" msgstr "Feil ved lesing av fil «%s»\n" #: src/frontend/cmd.cc:378 #, c-format msgid "Failed to open %s for writing: %s\n" msgstr "Kunne ikke Ã¥pne %s for skriving: %s\n" #: src/frontend/cmd.cc:384 #, c-format msgid "Could not create logfile, all slots occupied.\n" msgstr "Kunne ikke opprette loggfil, alle plasser okkupert.\n" #: src/frontend/cmd.cc:385 #, c-format msgid "You may consider deleting or renaming your existing logfiles.\n" msgstr "" "Du kan vurdere Ã¥ slette eller gi nytt navn til dine eksisterende loggfiler.\n" #: src/frontend/cmd.cc:417 #, c-format msgid "Null-move heuristic is on.\n" msgstr "Nulltrekk-heuristisk er pÃ¥.\n" #: src/frontend/cmd.cc:419 #, c-format msgid "Null-move heuristic is off.\n" msgstr "Nulltrekk-heuristisk er av.\n" #: src/frontend/cmd.cc:439 src/frontend/cmd.cc:466 #, c-format msgid "Incorrect epd file\n" msgstr "Ugyldig epd-fil\n" #: src/frontend/cmd.cc:510 #, c-format msgid "No more moves. Game reached the end.\n" msgstr "Ingen flere trekk. Spille har nÃ¥dd slutten.\n" #: src/frontend/cmd.cc:530 #, c-format msgid "Initial position reached. There are no earlier moves.\n" msgstr "Utgangsstilling nÃ¥dd. Det er ingen tidligere trekk.\n" #: src/frontend/cmd.cc:586 src/frontend/cmd.cc:692 #, c-format msgid "Invalid filename.\n" msgstr "Ugyldig filnavn.\n" #: src/frontend/cmd.cc:592 #, c-format msgid "Graphic mode is enabled.\n" msgstr "Grafikkmodus er aktivert.\n" #: src/frontend/cmd.cc:598 #, c-format msgid "Graphic mode is disabled.\n" msgstr "Grafikkmodus er deaktivert.\n" #: src/frontend/cmd.cc:639 #, c-format msgid "Command 'random' is currently not supported.\n" msgstr "Kommandoen «random» støttes ikke.\n" #: src/frontend/cmd.cc:647 #, c-format msgid "my rating = %d, opponent rating = %d\n" msgstr "min rangering = %d, motstanderrangering = %d\n" #: src/frontend/cmd.cc:671 src/frontend/cmd.cc:741 #, c-format msgid "No moves to undo!\n" msgstr "Ingen trekk Ã¥ angre!\n" #: src/frontend/cmd.cc:681 #, c-format msgid "Save to %s\n" msgstr "Lagre til %s\n" #: src/frontend/cmd.cc:722 #, c-format msgid "Command 'switch' is currently not supported.\n" msgstr "Kommandoen «switch» støttes ikke.\n" #: src/frontend/cmd.cc:728 #, c-format msgid "Old TimeLimit = %g\n" msgstr "Gammel tidsgrense = %g\n" #: src/frontend/cmd.cc:730 #, c-format msgid "New TimeLimit = %g\n" msgstr "Ny tidsgrense = %g\n" #: src/frontend/cmd.cc:750 #, c-format msgid "" "Usage: %s [OPTION]...\n" "\n" msgstr "" "Bruk: %s [VALG]...\n" "\n" #: src/frontend/cmd.cc:752 msgid "" "Play the game of chess\n" "\n" msgstr "" "Spill sjakk\n" "\n" #: src/frontend/cmd.cc:754 msgid "Options:\n" msgstr "Valg:\n" #: src/frontend/cmd.cc:755 msgid " -h, --help display this help and exit\n" msgstr " -h, --help vis denne hjelpen og avslutt\n" #: src/frontend/cmd.cc:757 msgid " -v, --version display version information and exit\n" msgstr " -v, --version skriv ut versjonsinformasjon og avslutt\n" #: src/frontend/cmd.cc:759 msgid " -q, --quiet make the program silent on startup\n" msgstr " -q, --quiet gjør programmet stille ved oppstart\n" #: src/frontend/cmd.cc:761 msgid " --silent same as -q\n" msgstr " --silent samme som -q\n" #: src/frontend/cmd.cc:763 src/frontend/cmd.cc:781 msgid "\n" msgstr "\n" #: src/frontend/cmd.cc:765 msgid " -x, --xboard start in engine mode\n" msgstr " -x, --xboard start i motormodus\n" #: src/frontend/cmd.cc:767 msgid " -p, --post start up showing thinking\n" msgstr " -p, --post oppstart viser tenking\n" #: src/frontend/cmd.cc:769 msgid " -e, --easy disable thinking in opponents time\n" msgstr " -e, --easy deaktiver tenkning i motstanderes tid\n" #: src/frontend/cmd.cc:771 msgid " -m, --manual enable manual mode\n" msgstr " -m, --manual aktiverer manuell modus\n" #: src/frontend/cmd.cc:773 msgid "" " -u, --uci enable UCI protocol (externally behave as UCI engine)\n" msgstr "" " -u, --uci aktiver UCI-protokoll (oppføre seg som UCI motor " "eksternt)\n" #: src/frontend/cmd.cc:775 msgid " -M size, --memory=size specify memory usage in MB for hashtable\n" msgstr "" " -M størrelse, --memory=størrelse spesifiser minnebruken i MB for " "hashtabellen\n" #: src/frontend/cmd.cc:777 msgid "" " -a filename, --addbook=filename compile book.bin from pgn book " "'filename'\n" msgstr "" " -a filnavn, --addbook=filnavn kompilere book.bin fra pgn-bok «filnavn»\n" #: src/frontend/cmd.cc:779 msgid " -g, --graphic enable graphic mode\n" msgstr " -g, --graphic aktiverer grafikkmodus\n" #: src/frontend/cmd.cc:783 msgid "" " Options xboard and post are accepted without leading dashes\n" " for backward compatibility.\n" "\n" msgstr "" " Alternativene Xboard og post er akseptert uten ledende streker\n" " for bakoverkompatibilitet.\n" "\n" #: src/frontend/cmd.cc:787 msgid "" " Moves are accepted either in standard algebraic notation (SAN) or\n" " in coordinate algebraic notation.\n" "\n" msgstr "" " Trekk er akseptert enten i standard algebraisk notasjon (SAN) eller\n" " i koordinert algebraisk notasjon.\n" "\n" #: src/frontend/cmd.cc:791 msgid "" " The file 'gnuchess.ini' allows setting config options. See\n" " 'info gnuchess' for details. The file will be looked up in the current\n" " directory or, if not found there, in the directory pointed to by\n" " environment variable GNUCHESS_PKGDATADIR.\n" "\n" msgstr "" " Filen «gnuchess.ini» kan sette konfigurasjonsalternativer. Se\n" " «info gnuchess» for detaljer. Filen vil bli slÃ¥tt opp i den nÃ¥værende\n" " katalog eller, hvis ikke finnes der, i katalogen pÃ¥pekt til av\n" " miljøvariabelen GNUCHESS_PKGDATADIR.\n" "\n" #: src/frontend/cmd.cc:797 msgid "" "Report bugs to .\n" "\n" msgstr "" "Rapporter feil til .\n" "\n" #: src/frontend/cmd.cc:844 src/frontend/cmd.cc:1280 #, c-format msgid "Invalid move: %s\n" msgstr "Ugyldig trekk: %s\n" #: src/frontend/cmd.cc:862 #, c-format msgid "Command 'white' is currently not supported.\n" msgstr "Kommandoen «white» støttes ikke.\n" #: src/frontend/cmd.cc:893 #, c-format msgid "My rating = %d\n" msgstr "Min rangering = %d\n" #: src/frontend/cmd.cc:894 #, c-format msgid "Opponent rating = %d\n" msgstr "Motstanderrangering = %d\n" #: src/frontend/cmd.cc:896 msgid "time" msgstr "tid" #: src/frontend/cmd.cc:898 msgid "moves" msgstr "trekk" #: src/frontend/cmd.cc:903 src/frontend/cmd.cc:910 src/frontend/cmd.cc:919 #: src/frontend/cmd.cc:928 #, c-format msgid "No. of moves generated = %ld\n" msgstr "Antall trekk generert = %ld\n" #: src/frontend/cmd.cc:932 #, c-format msgid "Command 'show eval/score' is currently not supported.\n" msgstr "Kommandoen «show eval/score» støttes ikke.\n" #: src/frontend/cmd.cc:939 #, c-format msgid "Command 'show pin' is currently not supported.\n" msgstr "Kommandoen «show pin» støttes ikke.\n" #: src/frontend/cmd.cc:951 #, c-format msgid "Command 'test' is currently not supported.\n" msgstr "Kommandoen «test» støttes ikke.\n" #: src/frontend/cmd.cc:969 msgid " Quits the program." msgstr " Avslutter programmet." #: src/frontend/cmd.cc:971 msgid " In analysis mode this stops analysis, otherwise it quits the program." msgstr "" " I analysemodus stopper dette analysen, ellers avslutter det programmet." #: src/frontend/cmd.cc:973 msgid " Produces a help blurb corresponding to this list of commands." msgstr " Produserer hjelpe-oppsummering som tilsvarer denne kommandolisten." #: src/frontend/cmd.cc:975 msgid " add - compiles book.bin from a pgn book file" msgstr " add - kompilerer book.bin fra en pgn-bokfil" #: src/frontend/cmd.cc:976 msgid " on - enables use of book (default)" msgstr " on - aktiverer bruk av bok (standard)" #: src/frontend/cmd.cc:977 msgid " off - disables use of book" msgstr " off - deaktiverer bruk av bok" #: src/frontend/cmd.cc:978 msgid " worst - plays worst move from book" msgstr " worst - spiller verste trekk fra bok" #: src/frontend/cmd.cc:979 msgid " best - plays best move from book" msgstr " best - spiller beste trekk fra bok" #: src/frontend/cmd.cc:980 msgid " prefer - same as 'book on' (default)" msgstr " prefer - samme som «book on» (standard)" #: src/frontend/cmd.cc:981 msgid " random - plays any move from book" msgstr " random - spiller hvilket som helst trekk fra bok" #: src/frontend/cmd.cc:983 msgid " Prints out the version of this program." msgstr " Skriver ut versjonen av dette programmet." #: src/frontend/cmd.cc:986 msgid " Backs up one move in pgn loaded game." msgstr " Sikkerhetskopierer ett trekk i pgn-lastet spill." #: src/frontend/cmd.cc:988 msgid " Saves the game so far from memory to the file." msgstr " Lagrer spillet sÃ¥ langt fra minnet til filen." #: src/frontend/cmd.cc:990 msgid " Loads the game in the file into memory." msgstr " Laster spillet i filen inn i minnet." #: src/frontend/cmd.cc:992 msgid "" " Loads the game in the file into memory, and enables\n" " the commands 'first', 'last', 'next', 'previous'." msgstr "" " Laster spillet i filen inn i minnet, og aktiverer\n" " kommandoene «first», «last», «next», «previous»." #: src/frontend/cmd.cc:996 msgid " Advances one move in pgn loaded game." msgstr " Avanserer ett trekk i pgn-lastet spill." #: src/frontend/cmd.cc:998 msgid " Goes to begin position of pgn loaded game." msgstr " GÃ¥r til start posisjonen til pgn lastet spill." #: src/frontend/cmd.cc:1000 msgid " Goes to end position of pgn loaded game." msgstr " GÃ¥r til endeposisjon av pgn-lastet spill." #: src/frontend/cmd.cc:1003 msgid "" " Makes the program stop moving. You may now enter moves\n" " to reach some position in the future." msgstr "" " Gjør at programmet slutter Ã¥ bevege seg. Du kan nÃ¥ taste inn trekk\n" " for Ã¥ nÃ¥ en stilling i fremtiden." #: src/frontend/cmd.cc:1007 msgid " Program plays white." msgstr " Programmet spiller hvit" #: src/frontend/cmd.cc:1009 msgid " Program plays black." msgstr " Programmet spiller sort" #: src/frontend/cmd.cc:1011 msgid "" " Computer takes whichever side is on move and begins its\n" " thinking immediately." msgstr "" " Datamaskinen tar den siden som er pÃ¥ trekk og begynner sin\n" " tenkning umiddelbart." #: src/frontend/cmd.cc:1014 msgid "" " Arranges for verbose thinking output showing variation, score,\n" " time, depth, etc." msgstr "" " Arrangerer for detaljert tenkningsutdata, viser variasjon, poengsum,\n" " tid, dybde osv." #: src/frontend/cmd.cc:1017 msgid " Turns off verbose thinking output." msgstr " SlÃ¥r av detaljert tenkningsutdata." #: src/frontend/cmd.cc:1019 msgid "" " Lets you input your name. Also writes the log.nnn and\n" " corresponding game.nnn files. For details please see\n" " the auxiliary file format sections." msgstr "" " Lar deg angi ditt navn. OgsÃ¥ skriver log.nnn og\n" " tilsvarende game.nnn filer. For detaljer vennligst se\n" " hjelpefilformatseksjoner." #: src/frontend/cmd.cc:1023 msgid " Mostly used by Internet Chess Server." msgstr " Mest brukt av internettsjakkserver." #: src/frontend/cmd.cc:1025 msgid "" " This command reactivates a game that has been terminated automatically\n" " due to checkmate or no more time on the clock. However, it does not\n" " alter those conditions. So you would have to undo a move or two, or\n" " add time to the clock with 'level' or 'time'." msgstr "" " Denne kommandoen reaktiverer et spill som har blitt avsluttet automatisk\n" " pÃ¥ grunn av sjakkmatt eller ikke mer tid pÃ¥ klokken. Men det endrer ikke\n" " disse forholdene. SÃ¥ du vil mÃ¥tte angre et trekk eller to, eller\n" " legge til tid i klokken med «level» eller «time»." #: src/frontend/cmd.cc:1030 msgid " Inputs the estimated rating for computer and for its opponent." msgstr " Setter inn estimert rangering for datamaskinen og for sin motstander." #: src/frontend/cmd.cc:1032 msgid " Sets up a new game (i.e. pieces in original positions)." msgstr " Setter opp et nytt spill (dvs. brikker i opprinnelige posisjoner)." #: src/frontend/cmd.cc:1034 msgid "" " Inputs time left in game for computer in hundredths of a second.\n" " Mostly used by Internet Chess Server." msgstr "" " Setter inn gjenværende tid i spill for datamaskinen i hundredeler av et " "sekund.\n" " Mest brukt av internettsjakkserver." #: src/frontend/cmd.cc:1037 msgid " on - enables using the memory hash table to speed up search" msgstr " on - aktiverer bruk av minnehashtabellen for Ã¥ fremskynde søk" #: src/frontend/cmd.cc:1038 msgid " off - disables the memory hash table" msgstr " off - deaktiverer minnehashtabellen" #: src/frontend/cmd.cc:1040 msgid " Sets the hash table to permit storage of N MB." msgstr " Stiller hashtabellen for Ã¥ tillate lagring av N MB." #: src/frontend/cmd.cc:1042 msgid " on - enables using the null-move heuristic to speed up search" msgstr " pÃ¥ - aktiverer bruk av nulltrekk-heuristisk for Ã¥ fremskynde søk" #: src/frontend/cmd.cc:1043 msgid " off - disables using the null-move heuristic" msgstr " off - deaktiverer bruk av nulltrekk heuristisk" #: src/frontend/cmd.cc:1045 msgid " on - enables use of xboard/winboard" msgstr " on - aktiverer bruk av xboard/winboard" #: src/frontend/cmd.cc:1046 msgid " off - disables use of xboard/winboard" msgstr " off - deaktiverer bruk av xboard/winboard" #: src/frontend/cmd.cc:1048 msgid "" " Sets the program to look N ply (half-moves) deep for every\n" " search it performs. If there is a checkmate or other condition\n" " that does not allow that depth, then it will not be." msgstr "" " Stiller programmet til Ã¥ se N ply (halv-trekk) dypt for hver\n" " søk den utfører. Hvis det er et sjakkmatt eller annen tilstand\n" " som ikke tillater den dybden, sÃ¥ vil det ikke være." #: src/frontend/cmd.cc:1052 msgid "" " Sets time control to be MOVES in MINUTES, with each move giving\n" " an INCREMENT (in seconds, i.e. a Fischer-style clock)." msgstr "" " Stiller tidskontroll for Ã¥ være TREKK i MINUTTER, med hvert trekk gir\n" " en ØKNING (i sekunder, dvs. en Fischer-stil klokke)." #: src/frontend/cmd.cc:1056 msgid " Loads a position in EPD format from disk into memory." msgstr " Laster en posisjon i EPD-format fra disk til minne." #: src/frontend/cmd.cc:1059 msgid " Saves game position into EPD format from memory to disk." msgstr " Lagrer spillposisjon i EPD-format fra minnet til disk." #: src/frontend/cmd.cc:1061 msgid " Switches side to move." msgstr " Bytter side for Ã¥ trekke." #: src/frontend/cmd.cc:1064 msgid " Solves the positions in FILENAME." msgstr " Løser posisjonene i FILNAVN." #: src/frontend/cmd.cc:1066 msgid " Backs up two moves in game history." msgstr " Sikkerhetskopierer to trekk i spillhistorikk." #: src/frontend/cmd.cc:1068 msgid " Backs up one move in game history." msgstr " Sikkerhetskopierer ett trekk i spillhistorikk." #: src/frontend/cmd.cc:1070 msgid " Displays command line syntax." msgstr " Viser kommandolinjesyntaks." #: src/frontend/cmd.cc:1072 msgid " board - displays the current board" msgstr " board - viser det nÃ¥værende brettet" #: src/frontend/cmd.cc:1073 msgid " time - displays the time settings" msgstr " time - viser tidsinnstillingene" #: src/frontend/cmd.cc:1074 msgid " moves - shows all moves using one call to routine" msgstr " moves - viser alle bevegelser ved hjelp av ett kall til rutine" #: src/frontend/cmd.cc:1075 msgid " escape - shows moves that escape from check using one call to routine" msgstr "" " escape - viser trekk som unnslipper sjekk ved hjelp av ett kall til rutine" #: src/frontend/cmd.cc:1076 msgid " noncapture - shows non-capture moves" msgstr " noncapture - viser ikke-erobringstrekk" #: src/frontend/cmd.cc:1077 msgid " capture - shows capture moves" msgstr " capture - viser erobringstrekk" #: src/frontend/cmd.cc:1078 msgid " eval [or score] - shows the evaluation per piece and overall" msgstr " eval [eller score] - viser evalueringen per brikke og samlet" #: src/frontend/cmd.cc:1079 msgid " game - shows moves in game history" msgstr " game - viser trekk i spillhistorikk" #: src/frontend/cmd.cc:1080 msgid " pin - shows pinned pieces" msgstr " pin - viser lÃ¥ste brikker" #: src/frontend/cmd.cc:1082 msgid " movelist - reads in an epd file and shows legal moves for its entries" msgstr "" " movelist - leser inn en epd-fil og viser lovlige trekk for dens oppføringer" #: src/frontend/cmd.cc:1083 msgid "" " capture - reads in an epd file and shows legal captures for its entries" msgstr "" " capture - leser inn en epd-fil og viser lovlige erobringer for dens " "oppføringer" #: src/frontend/cmd.cc:1084 msgid " movegenspeed - tests speed of move generator" msgstr " movegenspeed - tester hastigheten pÃ¥ trekkgeneratoren" #: src/frontend/cmd.cc:1085 msgid " capturespeed - tests speed of capture move generator" msgstr " capturespeed - tester hastigheten pÃ¥ erobringstrekkgeneratoren" #: src/frontend/cmd.cc:1086 msgid " eval - reads in an epd file and shows evaluation for its entries" msgstr " eval - leser inn en epd-fil og viser evaluering for dens oppføringer" #: src/frontend/cmd.cc:1087 msgid " evalspeed - tests speed of the evaluator" msgstr " evalspeed - tester hastigheten pÃ¥ evaluatoren" #: src/frontend/cmd.cc:1089 msgid " Shows moves from opening book." msgstr " Viser trekk fra Ã¥pningsbok." #: src/frontend/cmd.cc:1091 msgid " Enables display board in graphic mode." msgstr " Aktiverer vis brett i grafisk modus." #: src/frontend/cmd.cc:1093 msgid " Disables graphic mode and display classical view." msgstr " Deaktiverer grafisk modus og vis klassisk visning." #: src/frontend/cmd.cc:1119 #, c-format msgid "" "Help for command %s not found\n" "\n" msgstr "" "Hjelp for kommandoen %s ikke funnet\n" "\n" #: src/frontend/cmd.cc:1121 #, c-format msgid "List of commands: (help COMMAND to get more help)\n" msgstr "Liste over kommandoer: (help KOMMANDO for Ã¥ fÃ¥ mer hjelp)\n" #: src/frontend/engine.cc:247 msgid "Black" msgstr "" #: src/frontend/engine.cc:247 msgid "White" msgstr "" #: src/frontend/engine.cc:333 #, c-format msgid "" "\n" "My move is : %s\n" msgstr "" gnuchess-6.2.2/po/nl.gmo000644 000766 000024 00000042670 12610434564 015724 0ustar00antoniostaff000000 000000 Þ•ŽŒ¿üø ù û  C- Mq 7¿ (÷ / 'P .x 7§ Jß 9*)d&ŽRµ#&,$SOx2Èû'+B)nF˜?ßh‘ˆ6gQ(¹^â&Agh[Ð(,>U”ªÀ9Ô//>±nx 8™Ò"òò- #!-E!s#•H¹5!FWAž=à)#H-lFš2á%%:`&|-£#Ñ$õ<>W–%±"×"ú#AG/X,ˆ-µ6ã/-J+x,¤÷Ñ.É ø "!!4! V!w!’!¬!½!Í!í!"6"O"b"2t"§"Ç"×"%ë"#$#B#_#{##¥# ¿#É#)â# $$51$ g$$t$™$±$>·$ö$%%)%=%P%%V%,|%)©%)Ó%ý%¸&»'½',Ð'Gý'EE(A‹(0Í(4þ(13)3e)H™)Râ)55*.k*1š*UÌ*0"+0S+/„+E´+>ú+ 9,*Z,6…,5¼,Jò,4=-xr-Åë-B±.yô.2n/ˆ¡/6*0~a0qà0R1n1†1£1¾1DØ172DU2qš2‘ 3>ž3%Ý3-4 14R4 [5*i67”6)Ì6 ö6E7]7=}7J»7G8<N8/‹81»89í8B'9/j9'š9+Â9)î9/:)H:3r:.¦:EÕ:C;'_;.‡;3¶;#ê;.<=<C<0Z<-‹<.¹<7è<0 =.Q=,€=-­=Û=8Ü>"?+8?.d?'“?"»?!Þ?@@(3@\@r@6‰@À@Ù@Hì@+5AaAsA6ŒA*ÃA!îA$B#5BYBpB ‹B¬BµB€ÔBUCeCH„C ÍC,ØCDDD#DhD|D“D©DÃDÛD,âD/E;?E7{E³EKŽ PH->+„!'Y/(.Z xN†‚^‹5a|fer@cB~bvn?pRS&)zD\*m, ;1$`s_ƒ%‡A4Tq9dW€Q=jˆ<Љwh]U3V8o kEIL6g…GtF{":XJŒ C0O7M#}uy2l[i My move is : %s --silent same as -q -M size, --memory=size specify memory usage in MB for hashtable -a filename, --addbook=filename compile book.bin from pgn book 'filename' -e, --easy disable thinking in opponents time -g, --graphic enable graphic mode -h, --help display this help and exit -m, --manual enable manual mode -p, --post start up showing thinking -q, --quiet make the program silent on startup -u, --uci enable UCI protocol (externally behave as UCI engine) -v, --version display version information and exit -x, --xboard start in engine mode Advances one move in pgn loaded game. Arranges for verbose thinking output showing variation, score, time, depth, etc. Backs up one move in game history. Backs up one move in pgn loaded game. Backs up two moves in game history. Computer takes whichever side is on move and begins its thinking immediately. Disables graphic mode and display classical view. Displays command line syntax. Enables display board in graphic mode. Goes to begin position of pgn loaded game. Goes to end position of pgn loaded game. In analysis mode this stops analysis, otherwise it quits the program. Inputs the estimated rating for computer and for its opponent. Inputs time left in game for computer in hundredths of a second. Mostly used by Internet Chess Server. Lets you input your name. Also writes the log.nnn and corresponding game.nnn files. For details please see the auxiliary file format sections. Loads a position in EPD format from disk into memory. Loads the game in the file into memory, and enables the commands 'first', 'last', 'next', 'previous'. Loads the game in the file into memory. Makes the program stop moving. You may now enter moves to reach some position in the future. Mostly used by Internet Chess Server. Moves are accepted either in standard algebraic notation (SAN) or in coordinate algebraic notation. Options xboard and post are accepted without leading dashes for backward compatibility. Prints out the version of this program. Produces a help blurb corresponding to this list of commands. Program plays black. Program plays white. Quits the program. Saves game position into EPD format from memory to disk. Saves the game so far from memory to the file. Sets the hash table to permit storage of N MB. Sets the program to look N ply (half-moves) deep for every search it performs. If there is a checkmate or other condition that does not allow that depth, then it will not be. Sets time control to be MOVES in MINUTES, with each move giving an INCREMENT (in seconds, i.e. a Fischer-style clock). Sets up a new game (i.e. pieces in original positions). Shows moves from opening book. Solves the positions in FILENAME. Switches side to move. The file 'gnuchess.ini' allows setting config options. See 'info gnuchess' for details. The file will be looked up in the current directory or, if not found there, in the directory pointed to by environment variable GNUCHESS_PKGDATADIR. This command reactivates a game that has been terminated automatically due to checkmate or no more time on the clock. However, it does not alter those conditions. So you would have to undo a move or two, or add time to the clock with 'level' or 'time'. Turns off verbose thinking output. add - compiles book.bin from a pgn book file best - plays best move from book board - displays the current board capture - reads in an epd file and shows legal captures for its entries capture - shows capture moves capturespeed - tests speed of capture move generator escape - shows moves that escape from check using one call to routine eval - reads in an epd file and shows evaluation for its entries eval [or score] - shows the evaluation per piece and overall evalspeed - tests speed of the evaluator game - shows moves in game history movegenspeed - tests speed of move generator movelist - reads in an epd file and shows legal moves for its entries moves - shows all moves using one call to routine noncapture - shows non-capture moves off - disables the memory hash table off - disables use of book off - disables use of xboard/winboard off - disables using the null-move heuristic on - enables use of book (default) on - enables use of xboard/winboard on - enables using the memory hash table to speed up search on - enables using the null-move heuristic to speed up search pin - shows pinned pieces prefer - same as 'book on' (default) random - plays any move from book time - displays the time settings worst - plays worst move from bookBlackBoard is wrong! Command 'activate' is currently not supported. Command 'black' is currently not supported. Command 'random' is currently not supported. Command 'show eval/score' is currently not supported. Command 'show pin' is currently not supported. Command 'switch' is currently not supported. Command 'test' is currently not supported. Command 'white' is currently not supported. Copyright (C) %s Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Could not create logfile, all slots occupied. Error reading file '%s' Failed to open %s for writing: %s File name is too long (max = %d) Fischer increment of %d seconds Graphic mode is disabled. Graphic mode is enabled. Hashing is off. Hashing is on. Help for command %s not found Incorrect book option Incorrect epd file Initial position reached. There are no earlier moves. Invalid filename. Invalid move: %s List of commands: (help COMMAND to get more help) Memory out of Range or Invalid My rating = %d New TimeLimit = %g No more moves. Game reached the end. No moves to undo! No. of moves generated = %ld Null-move heuristic is off. Null-move heuristic is on. Old TimeLimit = %g Opponent rating = %d Option Processing Failed Options: Play the game of chess Report bugs to . Save to %s Search to a depth of %d The syntax to add a new book is: book add file.pgn Thinking... Time Control: %d moves in %.2f secs Usage: %s [OPTION]... WhiteYou may consider deleting or renaming your existing logfiles. book is now best book is now off book is now on book is now random book is now worst movesmy rating = %d, opponent rating = %d name - list known players alphabetically reverse - list by GNU worst result first score - list by GNU best result first timeProject-Id-Version: gnuchess 6.2.2-rc1 Report-Msgid-Bugs-To: bug-gnu-chess@gnu.org POT-Creation-Date: 2015-10-17 14:05+0200 PO-Revision-Date: 2015-09-24 10:06+0200 Last-Translator: Benno Schulenberg Language-Team: Dutch Language: nl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); X-Generator: Lokalize 1.0 Mijn zet is : %s --silent hetzelfde als '--quiet' -M, --memory=GROOTTE te gebruiken aantal megabytes voor hash-tabel -a, --addbook=BESTAND «book.bin» compileren uit dit PGN-bestand -e, --easy denken in tijd van tegenstander uitschakelen -g, --graphic grafische modus inschakelen -h, --help deze hulptekst tonen en stoppen -m, --manual handmatige modus inschakelen -p, --post opstarten met tonen van denken -q, --quiet stil zijn (tijdens starten geen uitvoer produceren) -u, --uci UCI-protocol inschakelen (extern als UCI-engine functioneren) -v, --version programmaversie tonen en stoppen -x, --xboard opstarten in engine-modus Gaat één ply verder in de geladen PGN-partij. Schakelt gedetailleerde denkuitvoer in: variatie, score, tijd, diepte, enzovoort. Gaat één ply terug in de partijgeschiedenis. Gaat één ply terug in de geladen PGN-partij. Gaat twee ply terug in de partijgeschiedenis. Computer neemt de kleur die aan zet is en begint gelijk met denken. Schakelt grafische modus uit en toont de klassieke weergave. Toont de opdrachtregel-syntax. Schakelt weergave in grafische modus in. Gaat naar de beginpositie van de geladen PGN-partij. Gaat naar de eindpositie van de geladen PGN-partij. In analysemodus stopt het de analyse, anders sluit het het programma af. Geschatte ratings voor computer en diens opponent. Resterende speeltijd voor computer in honderdsten van seconden. Voornamelijk gebruikt door de Internet Chess Server. Geeft u de mogelijkheid uw naam in te voeren. Ook schrijft het de log.nnn en bijbehorende game.nnn bestanden. Voor de details, zie de handleiding, de secties over de hulpbestandsindelingen. Laadt een partijpositie in EPD-opmaak, van schijf naar geheugen. Laadt de partij van het bestand in het geheugen, en schakelt de commando's 'first', 'last', 'next', en 'previous' in. Laadt de partij van het bestand in het geheugen. Stopt het programma van het spelen van zetten. U kunt nu handmatig zetten invoeren om een bepaalde toekomstige positie te bereiken. Voornamelijk gebruikt door de Internet Chess Server. Zetten worden geaccepteerd in de standaard algebraïsche notatie (SAN), of in de algebraïsche notatie met coördinaten. Opties '--xboard' en '--post' worden ook geaccepteerd zonder streepjes, voor achterwaartse compatibiliteit. De programmaversie tonen. Toont deze hulptekst. Computer speelt met zwart. Computer speelt met wit. Sluit het programma af. Slaat de partijpositie in EPD-opmaak op, van geheugen naar schijf. Slaat de partij tot de huidige zet op in het bestand. Stelt de hash-tabel in om maximaal N MB aan geheugen te gebruiken. Stelt het programma in om maximaal N ply (halfzetten) diep te kijken voor elke zoekopdracht die het uitvoert. Stelt de tijdsbeperking in op MOVES zetten in MINUTES minuten, terwijl elke zet INCREMENT seconden toevoegt (oftewel een Fischer-stijl klok). Zet een nieuwe partij op (alle stukken in hun beginpositie). Toont zetten uit het openingenboek. Lost de posities in het gegeven bestand op. Maakt de andere kleur aan zet. In het bestand «gnuchess.ini» kunnen configuratie-opties ingesteld worden; zie 'info gnuchess' voor de details. Het bestand wordt in de huidige map gezocht of, als daar niet gevonden, in de map waarnaar omgevingsvariabele GNUCHESS_PKGDATADIR verwijst. Dit commando reactiveert een partij die automatisch werd beëindigd wegens schaakmat of tijdsoverschrijding. Maar het verandert die toestand niet, dus u dient zelf een zet of twee ongedaan te maken, of tijd toe te voegen middels het commando 'level' of 'time'. Schakelt gedetailleerde denkuitvoer uit. add - compileert «book.bin» uit een PGN-boekbestand best - speelt de beste zet uit het boek board - toont het huidige bord capture - leest een EPD-bestand in en toont de mogelijke neemzetten capture - toont de neemzetten capturespeed - test de snelheid van de neemzetten-generator escape - toont de zetten om aan schaak te ontsnappen (met één aanroep) eval - leest een EPD-bestand in en toont de evaluatie van diens items eval [of: score] - toont de evaluatie per stuk en algeheel evalspeed - test de snelheid van de evaluator game - toont de zetten in de partijgeschiedenis movegenspeed - test de snelheid van de zetten-generator movelist - leest een EPD-bestand in en toont de mogelijke zetten moves - toont alle zetten (met één aanroep) noncapture - toont de niet-neemzetten off - schakelt gebruik van hash-tabel uit off - schakelt gebruik van het boek uit off- schakelt gebruik van xboard/winboard uit off - schakelt de nulzet-heuristiek uit on - schakelt gebruik van het boek in (standaard) on - schakelt gebruik van xboard/winboard in on - schakelt gebruik van hash-tabel in om het zoeken te versnellen on - schakelt de nulzet-heuristiek in om het zoeken te versnellen pin - toont welke stukken gepend zijn prefer - hetzelfde als 'book on' (standaard) random - speelt een willekeurige zet uit het boek time - toont de tijdsinstellingen worst - speelt de slechtste zet uit het boekZwartHet bord is verkeerd! Commando 'activate' wordt nog niet ondersteund. Commando 'black' wordt nog niet ondersteund. Commando 'random' wordt nog niet ondersteund. Commando 'show eval/score' wordt nog niet ondersteund. Commando 'show pin' wordt nog niet ondersteund. Commando 'switch' wordt nog niet ondersteund. Commando 'test' wordt nog niet ondersteund. Commando 'white' wordt nog niet ondersteund. Copyright (C) %s Free Software Foundation, Inc. Licentie GPLv3+: GNU GPL versie 3 of nieuwer Dit is vrije software: u mag het vrijelijk wijzigen en verder verspreiden. Er is GEEN GARANTIE, voor zover de wet dit toestaat. Kan geen logbestand aanmaken, alle plaatsen zijn bezet. Fout bij lezen van bestand «%s» Kan «%s» niet openen om te schrijven: %s Bestandsnaam is te lang (maximum lengte = %d) Een Fischer-increment van %d seconden. Grafische modus is uitgeschakeld. Grafische modus is ingeschakeld. Hashen is uitgeschakeld. Hashen is ingeschakeld. Geen hulp voor commando '%s' gevonden. Ongeldige boekoptie. Ongeldig EPD-bestand. Dit is de beginpositie. Er zijn geen eerdere zetten. Ongeldige bestandsnaam. Ongeldige zet: %s Lijst van commando's: (gebruik 'help COMMANDO' om meer hulp te krijgen) Geheugen valt buiten bereik of is ongeldig Mijn rating = %d Nieuwe tijdslimiet = %g Er zijn geen verdere zetten. De partij is ten einde. Er zijn geen zetten om ongedaan te maken! Aantal gegenereerde zetten = %ld Nulzet-heuristiek is uitgeschakeld. Nulzet-heuristiek is ingeschakeld. Oude tijdslimiet = %g Tegenstanders rating = %d Verwerken van opties is mislukt Opties: Speelt een spelletje schaak. Rapporteer gebreken in het programma aan ; meld fouten in de vertaling aan . Opslaan in %s Zoeken tot een diepte van %d. De syntax om een nieuw boek toe te voegen is: book add BESTAND.PGN Denken... Tijdsbeperking: %d zetten in %.2f seconden. Gebruik: %s [OPTIE]... WitOverweeg om de huidige logbestanden te verwijderen of te hernoemen. boek is nu 'beste' boek is uitgeschakeld boek is ingeschakeld boek is nu 'willekeurig' boek is nu 'slechtste' zettenmijn rating =%d, tegenstanders rating = %d name - bekende spelers alfabetisch opsommen reverse - opsommen op volgorde van GNU slechtste resultaat score - opsommen op volgorde van GNU beste resultaat tijdgnuchess-6.2.2/po/nl.po000644 000766 000024 00000055030 12610434564 015552 0ustar00antoniostaff000000 000000 # Dutch translations for GNU chess. # Copyright (C) 2015 Free Software Foundation, Inc. # This file is distributed under the same license as the gnuchess package. # # "Tu ce faci de apocalipsă?" # # Benno Schulenberg , 2013, 2015. msgid "" msgstr "" "Project-Id-Version: gnuchess 6.2.2-rc1\n" "Report-Msgid-Bugs-To: bug-gnu-chess@gnu.org\n" "POT-Creation-Date: 2015-10-17 14:05+0200\n" "PO-Revision-Date: 2015-09-24 10:06+0200\n" "Last-Translator: Benno Schulenberg \n" "Language-Team: Dutch \n" "Language: nl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Lokalize 1.0\n" #: src/main.cc:317 #, c-format msgid "Memory out of Range or Invalid\n" msgstr "Geheugen valt buiten bereik of is ongeldig\n" #: src/main.cc:334 #, c-format msgid "File name is too long (max = %d)\n" msgstr "Bestandsnaam is te lang (maximum lengte = %d)\n" #: src/main.cc:340 msgid "Option Processing Failed\n" msgstr "Verwerken van opties is mislukt\n" #: src/main.cc:381 #, c-format msgid "" "Copyright (C) %s Free Software Foundation, Inc.\n" "License GPLv3+: GNU GPL version 3 or later \n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" msgstr "" "Copyright (C) %s Free Software Foundation, Inc.\n" "Licentie GPLv3+: GNU GPL versie 3 of nieuwer \n" "Dit is vrije software: u mag het vrijelijk wijzigen en verder verspreiden.\n" "Er is GEEN GARANTIE, voor zover de wet dit toestaat.\n" #: src/main.cc:494 #, c-format msgid "Thinking...\n" msgstr "Denken...\n" #: src/frontend/cmd.cc:101 #, c-format msgid "Command 'activate' is currently not supported.\n" msgstr "Commando 'activate' wordt nog niet ondersteund.\n" #: src/frontend/cmd.cc:131 #, c-format msgid "Command 'black' is currently not supported.\n" msgstr "Commando 'black' wordt nog niet ondersteund.\n" #: src/frontend/cmd.cc:140 #, c-format msgid "" "The syntax to add a new book is:\n" "\n" "\tbook add file.pgn\n" msgstr "" "De syntax om een nieuw boek toe te voegen is:\n" "\n" " book add BESTAND.PGN\n" #: src/frontend/cmd.cc:147 #, c-format msgid "book is now on\n" msgstr "boek is ingeschakeld\n" #: src/frontend/cmd.cc:150 #, c-format msgid "book is now off\n" msgstr "boek is uitgeschakeld\n" #: src/frontend/cmd.cc:153 #, c-format msgid "book is now best\n" msgstr "boek is nu 'beste'\n" #: src/frontend/cmd.cc:156 #, c-format msgid "book is now worst\n" msgstr "boek is nu 'slechtste'\n" #: src/frontend/cmd.cc:159 #, c-format msgid "book is now random\n" msgstr "boek is nu 'willekeurig'\n" #: src/frontend/cmd.cc:161 #, c-format msgid "Incorrect book option\n" msgstr "Ongeldige boekoptie.\n" #: src/frontend/cmd.cc:174 #, c-format msgid "Search to a depth of %d\n" msgstr "Zoeken tot een diepte van %d.\n" #: src/frontend/cmd.cc:240 #, c-format msgid "Hashing is on.\n" msgstr "Hashen is ingeschakeld.\n" #: src/frontend/cmd.cc:242 #, c-format msgid "Hashing is off.\n" msgstr "Hashen is uitgeschakeld.\n" #: src/frontend/cmd.cc:268 src/frontend/cmd.cc:278 #, c-format msgid "Fischer increment of %d seconds\n" msgstr "Een Fischer-increment van %d seconden.\n" #. TRANSLATORS: Please be aware that the word 'move' is sometimes #. used as a synonym of 'ply', and sometimes in the sense of a #. full 2-ply move. #: src/frontend/cmd.cc:276 #, c-format msgid "Time Control: %d moves in %.2f secs\n" msgstr "Tijdsbeperking: %d zetten in %.2f seconden.\n" #: src/frontend/cmd.cc:286 #, c-format msgid "name - list known players alphabetically\n" msgstr "name - bekende spelers alfabetisch opsommen\n" #: src/frontend/cmd.cc:287 #, c-format msgid "score - list by GNU best result first \n" msgstr "score - opsommen op volgorde van GNU beste resultaat\n" #: src/frontend/cmd.cc:288 #, c-format msgid "reverse - list by GNU worst result first\n" msgstr "reverse - opsommen op volgorde van GNU slechtste resultaat\n" #: src/frontend/cmd.cc:303 src/frontend/cmd.cc:1301 #, c-format msgid "Board is wrong!\n" msgstr "Het bord is verkeerd!\n" #: src/frontend/cmd.cc:309 src/frontend/cmd.cc:312 #, c-format msgid "Error reading file '%s'\n" msgstr "Fout bij lezen van bestand «%s»\n" #: src/frontend/cmd.cc:378 #, c-format msgid "Failed to open %s for writing: %s\n" msgstr "Kan «%s» niet openen om te schrijven: %s\n" #: src/frontend/cmd.cc:384 #, c-format msgid "Could not create logfile, all slots occupied.\n" msgstr "Kan geen logbestand aanmaken, alle plaatsen zijn bezet.\n" #: src/frontend/cmd.cc:385 #, c-format msgid "You may consider deleting or renaming your existing logfiles.\n" msgstr "Overweeg om de huidige logbestanden te verwijderen of te hernoemen.\n" #: src/frontend/cmd.cc:417 #, c-format msgid "Null-move heuristic is on.\n" msgstr "Nulzet-heuristiek is ingeschakeld.\n" #: src/frontend/cmd.cc:419 #, c-format msgid "Null-move heuristic is off.\n" msgstr "Nulzet-heuristiek is uitgeschakeld.\n" #: src/frontend/cmd.cc:439 src/frontend/cmd.cc:466 #, c-format msgid "Incorrect epd file\n" msgstr "Ongeldig EPD-bestand.\n" #: src/frontend/cmd.cc:510 #, c-format msgid "No more moves. Game reached the end.\n" msgstr "Er zijn geen verdere zetten. De partij is ten einde.\n" #: src/frontend/cmd.cc:530 #, c-format msgid "Initial position reached. There are no earlier moves.\n" msgstr "Dit is de beginpositie. Er zijn geen eerdere zetten.\n" #: src/frontend/cmd.cc:586 src/frontend/cmd.cc:692 #, c-format msgid "Invalid filename.\n" msgstr "Ongeldige bestandsnaam.\n" #: src/frontend/cmd.cc:592 #, c-format msgid "Graphic mode is enabled.\n" msgstr "Grafische modus is ingeschakeld.\n" #: src/frontend/cmd.cc:598 #, c-format msgid "Graphic mode is disabled.\n" msgstr "Grafische modus is uitgeschakeld.\n" #: src/frontend/cmd.cc:639 #, c-format msgid "Command 'random' is currently not supported.\n" msgstr "Commando 'random' wordt nog niet ondersteund.\n" #: src/frontend/cmd.cc:647 #, c-format msgid "my rating = %d, opponent rating = %d\n" msgstr "mijn rating =%d, tegenstanders rating = %d\n" #: src/frontend/cmd.cc:671 src/frontend/cmd.cc:741 #, c-format msgid "No moves to undo!\n" msgstr "Er zijn geen zetten om ongedaan te maken!\n" #: src/frontend/cmd.cc:681 #, c-format msgid "Save to %s\n" msgstr "Opslaan in %s\n" #: src/frontend/cmd.cc:722 #, c-format msgid "Command 'switch' is currently not supported.\n" msgstr "Commando 'switch' wordt nog niet ondersteund.\n" #: src/frontend/cmd.cc:728 #, c-format msgid "Old TimeLimit = %g\n" msgstr "Oude tijdslimiet = %g\n" #: src/frontend/cmd.cc:730 #, c-format msgid "New TimeLimit = %g\n" msgstr "Nieuwe tijdslimiet = %g\n" #: src/frontend/cmd.cc:750 #, c-format msgid "" "Usage: %s [OPTION]...\n" "\n" msgstr "" "Gebruik: %s [OPTIE]...\n" "\n" #: src/frontend/cmd.cc:752 msgid "" "Play the game of chess\n" "\n" msgstr "" "Speelt een spelletje schaak.\n" "\n" #: src/frontend/cmd.cc:754 msgid "Options:\n" msgstr "Opties:\n" #: src/frontend/cmd.cc:755 msgid " -h, --help display this help and exit\n" msgstr " -h, --help deze hulptekst tonen en stoppen\n" #: src/frontend/cmd.cc:757 msgid " -v, --version display version information and exit\n" msgstr " -v, --version programmaversie tonen en stoppen\n" #: src/frontend/cmd.cc:759 msgid " -q, --quiet make the program silent on startup\n" msgstr "" " -q, --quiet stil zijn (tijdens starten geen uitvoer produceren)\n" #: src/frontend/cmd.cc:761 msgid " --silent same as -q\n" msgstr " --silent hetzelfde als '--quiet'\n" #: src/frontend/cmd.cc:763 src/frontend/cmd.cc:781 msgid "\n" msgstr "\n" #: src/frontend/cmd.cc:765 msgid " -x, --xboard start in engine mode\n" msgstr " -x, --xboard opstarten in engine-modus\n" #: src/frontend/cmd.cc:767 msgid " -p, --post start up showing thinking\n" msgstr " -p, --post opstarten met tonen van denken\n" #: src/frontend/cmd.cc:769 msgid " -e, --easy disable thinking in opponents time\n" msgstr " -e, --easy denken in tijd van tegenstander uitschakelen\n" #: src/frontend/cmd.cc:771 msgid " -m, --manual enable manual mode\n" msgstr " -m, --manual handmatige modus inschakelen\n" #: src/frontend/cmd.cc:773 msgid "" " -u, --uci enable UCI protocol (externally behave as UCI engine)\n" msgstr "" " -u, --uci UCI-protocol inschakelen (extern als UCI-engine " "functioneren)\n" #: src/frontend/cmd.cc:775 msgid " -M size, --memory=size specify memory usage in MB for hashtable\n" msgstr "" " -M, --memory=GROOTTE te gebruiken aantal megabytes voor hash-tabel\n" #: src/frontend/cmd.cc:777 msgid "" " -a filename, --addbook=filename compile book.bin from pgn book " "'filename'\n" msgstr " -a, --addbook=BESTAND «book.bin» compileren uit dit PGN-bestand\n" #: src/frontend/cmd.cc:779 msgid " -g, --graphic enable graphic mode\n" msgstr " -g, --graphic grafische modus inschakelen\n" #: src/frontend/cmd.cc:783 msgid "" " Options xboard and post are accepted without leading dashes\n" " for backward compatibility.\n" "\n" msgstr "" " Opties '--xboard' en '--post' worden ook geaccepteerd zonder streepjes,\n" " voor achterwaartse compatibiliteit.\n" "\n" #: src/frontend/cmd.cc:787 msgid "" " Moves are accepted either in standard algebraic notation (SAN) or\n" " in coordinate algebraic notation.\n" "\n" msgstr "" " Zetten worden geaccepteerd in de standaard algebraïsche notatie (SAN),\n" " of in de algebraïsche notatie met coördinaten.\n" "\n" #: src/frontend/cmd.cc:791 msgid "" " The file 'gnuchess.ini' allows setting config options. See\n" " 'info gnuchess' for details. The file will be looked up in the current\n" " directory or, if not found there, in the directory pointed to by\n" " environment variable GNUCHESS_PKGDATADIR.\n" "\n" msgstr "" " In het bestand «gnuchess.ini» kunnen configuratie-opties ingesteld " "worden;\n" " zie 'info gnuchess' voor de details. Het bestand wordt in de huidige map\n" " gezocht of, als daar niet gevonden, in de map waarnaar omgevingsvariabele\n" " GNUCHESS_PKGDATADIR verwijst.\n" "\n" #: src/frontend/cmd.cc:797 msgid "" "Report bugs to .\n" "\n" msgstr "" "Rapporteer gebreken in het programma aan ;\n" "meld fouten in de vertaling aan .\n" "\n" #: src/frontend/cmd.cc:844 src/frontend/cmd.cc:1280 #, c-format msgid "Invalid move: %s\n" msgstr "Ongeldige zet: %s\n" #: src/frontend/cmd.cc:862 #, c-format msgid "Command 'white' is currently not supported.\n" msgstr "Commando 'white' wordt nog niet ondersteund.\n" #: src/frontend/cmd.cc:893 #, c-format msgid "My rating = %d\n" msgstr "Mijn rating = %d\n" #: src/frontend/cmd.cc:894 #, c-format msgid "Opponent rating = %d\n" msgstr "Tegenstanders rating = %d\n" #: src/frontend/cmd.cc:896 msgid "time" msgstr "tijd" #: src/frontend/cmd.cc:898 msgid "moves" msgstr "zetten" #: src/frontend/cmd.cc:903 src/frontend/cmd.cc:910 src/frontend/cmd.cc:919 #: src/frontend/cmd.cc:928 #, c-format msgid "No. of moves generated = %ld\n" msgstr "Aantal gegenereerde zetten = %ld\n" #: src/frontend/cmd.cc:932 #, c-format msgid "Command 'show eval/score' is currently not supported.\n" msgstr "Commando 'show eval/score' wordt nog niet ondersteund.\n" #: src/frontend/cmd.cc:939 #, c-format msgid "Command 'show pin' is currently not supported.\n" msgstr "Commando 'show pin' wordt nog niet ondersteund.\n" #: src/frontend/cmd.cc:951 #, c-format msgid "Command 'test' is currently not supported.\n" msgstr "Commando 'test' wordt nog niet ondersteund.\n" #: src/frontend/cmd.cc:969 msgid " Quits the program." msgstr " Sluit het programma af." #: src/frontend/cmd.cc:971 msgid " In analysis mode this stops analysis, otherwise it quits the program." msgstr "" " In analysemodus stopt het de analyse, anders sluit het het programma af." #: src/frontend/cmd.cc:973 msgid " Produces a help blurb corresponding to this list of commands." msgstr " Toont deze hulptekst." #: src/frontend/cmd.cc:975 msgid " add - compiles book.bin from a pgn book file" msgstr " add - compileert «book.bin» uit een PGN-boekbestand" #: src/frontend/cmd.cc:976 msgid " on - enables use of book (default)" msgstr " on - schakelt gebruik van het boek in (standaard)" #: src/frontend/cmd.cc:977 msgid " off - disables use of book" msgstr " off - schakelt gebruik van het boek uit" #: src/frontend/cmd.cc:978 msgid " worst - plays worst move from book" msgstr " worst - speelt de slechtste zet uit het boek" #: src/frontend/cmd.cc:979 msgid " best - plays best move from book" msgstr " best - speelt de beste zet uit het boek" #: src/frontend/cmd.cc:980 msgid " prefer - same as 'book on' (default)" msgstr " prefer - hetzelfde als 'book on' (standaard)" #: src/frontend/cmd.cc:981 msgid " random - plays any move from book" msgstr " random - speelt een willekeurige zet uit het boek" #: src/frontend/cmd.cc:983 msgid " Prints out the version of this program." msgstr " De programmaversie tonen." #: src/frontend/cmd.cc:986 msgid " Backs up one move in pgn loaded game." msgstr " Gaat één ply terug in de geladen PGN-partij." #: src/frontend/cmd.cc:988 msgid " Saves the game so far from memory to the file." msgstr " Slaat de partij tot de huidige zet op in het bestand." #: src/frontend/cmd.cc:990 msgid " Loads the game in the file into memory." msgstr " Laadt de partij van het bestand in het geheugen." #: src/frontend/cmd.cc:992 msgid "" " Loads the game in the file into memory, and enables\n" " the commands 'first', 'last', 'next', 'previous'." msgstr "" " Laadt de partij van het bestand in het geheugen, en schakelt\n" " de commando's 'first', 'last', 'next', en 'previous' in." #: src/frontend/cmd.cc:996 msgid " Advances one move in pgn loaded game." msgstr " Gaat één ply verder in de geladen PGN-partij." #: src/frontend/cmd.cc:998 msgid " Goes to begin position of pgn loaded game." msgstr " Gaat naar de beginpositie van de geladen PGN-partij." #: src/frontend/cmd.cc:1000 msgid " Goes to end position of pgn loaded game." msgstr " Gaat naar de eindpositie van de geladen PGN-partij." #: src/frontend/cmd.cc:1003 msgid "" " Makes the program stop moving. You may now enter moves\n" " to reach some position in the future." msgstr "" " Stopt het programma van het spelen van zetten. U kunt nu handmatig\n" " zetten invoeren om een bepaalde toekomstige positie te bereiken." #: src/frontend/cmd.cc:1007 msgid " Program plays white." msgstr " Computer speelt met wit." #: src/frontend/cmd.cc:1009 msgid " Program plays black." msgstr " Computer speelt met zwart." #: src/frontend/cmd.cc:1011 msgid "" " Computer takes whichever side is on move and begins its\n" " thinking immediately." msgstr " Computer neemt de kleur die aan zet is en begint gelijk met denken." #: src/frontend/cmd.cc:1014 msgid "" " Arranges for verbose thinking output showing variation, score,\n" " time, depth, etc." msgstr "" " Schakelt gedetailleerde denkuitvoer in: variatie, score,\n" " tijd, diepte, enzovoort." #: src/frontend/cmd.cc:1017 msgid " Turns off verbose thinking output." msgstr " Schakelt gedetailleerde denkuitvoer uit." #: src/frontend/cmd.cc:1019 msgid "" " Lets you input your name. Also writes the log.nnn and\n" " corresponding game.nnn files. For details please see\n" " the auxiliary file format sections." msgstr "" " Geeft u de mogelijkheid uw naam in te voeren. Ook schrijft het\n" " de log.nnn en bijbehorende game.nnn bestanden. Voor de details,\n" " zie de handleiding, de secties over de hulpbestandsindelingen." #: src/frontend/cmd.cc:1023 msgid " Mostly used by Internet Chess Server." msgstr " Voornamelijk gebruikt door de Internet Chess Server." #: src/frontend/cmd.cc:1025 msgid "" " This command reactivates a game that has been terminated automatically\n" " due to checkmate or no more time on the clock. However, it does not\n" " alter those conditions. So you would have to undo a move or two, or\n" " add time to the clock with 'level' or 'time'." msgstr "" " Dit commando reactiveert een partij die automatisch werd beëindigd wegens\n" " schaakmat of tijdsoverschrijding. Maar het verandert die toestand niet,\n" " dus u dient zelf een zet of twee ongedaan te maken, of tijd toe te voegen\n" " middels het commando 'level' of 'time'." #: src/frontend/cmd.cc:1030 msgid " Inputs the estimated rating for computer and for its opponent." msgstr " Geschatte ratings voor computer en diens opponent." #: src/frontend/cmd.cc:1032 msgid " Sets up a new game (i.e. pieces in original positions)." msgstr " Zet een nieuwe partij op (alle stukken in hun beginpositie)." #: src/frontend/cmd.cc:1034 msgid "" " Inputs time left in game for computer in hundredths of a second.\n" " Mostly used by Internet Chess Server." msgstr "" " Resterende speeltijd voor computer in honderdsten van seconden.\n" " Voornamelijk gebruikt door de Internet Chess Server." #: src/frontend/cmd.cc:1037 msgid " on - enables using the memory hash table to speed up search" msgstr " on - schakelt gebruik van hash-tabel in om het zoeken te versnellen" #: src/frontend/cmd.cc:1038 msgid " off - disables the memory hash table" msgstr " off - schakelt gebruik van hash-tabel uit" #: src/frontend/cmd.cc:1040 msgid " Sets the hash table to permit storage of N MB." msgstr " Stelt de hash-tabel in om maximaal N MB aan geheugen te gebruiken." #: src/frontend/cmd.cc:1042 msgid " on - enables using the null-move heuristic to speed up search" msgstr " on - schakelt de nulzet-heuristiek in om het zoeken te versnellen" #: src/frontend/cmd.cc:1043 msgid " off - disables using the null-move heuristic" msgstr " off - schakelt de nulzet-heuristiek uit" #: src/frontend/cmd.cc:1045 msgid " on - enables use of xboard/winboard" msgstr " on - schakelt gebruik van xboard/winboard in" #: src/frontend/cmd.cc:1046 msgid " off - disables use of xboard/winboard" msgstr " off- schakelt gebruik van xboard/winboard uit" #: src/frontend/cmd.cc:1048 msgid "" " Sets the program to look N ply (half-moves) deep for every\n" " search it performs. If there is a checkmate or other condition\n" " that does not allow that depth, then it will not be." msgstr "" " Stelt het programma in om maximaal N ply (halfzetten) diep te\n" " kijken voor elke zoekopdracht die het uitvoert." #: src/frontend/cmd.cc:1052 msgid "" " Sets time control to be MOVES in MINUTES, with each move giving\n" " an INCREMENT (in seconds, i.e. a Fischer-style clock)." msgstr "" " Stelt de tijdsbeperking in op MOVES zetten in MINUTES minuten, terwijl\n" " elke zet INCREMENT seconden toevoegt (oftewel een Fischer-stijl klok)." #: src/frontend/cmd.cc:1056 msgid " Loads a position in EPD format from disk into memory." msgstr " Laadt een partijpositie in EPD-opmaak, van schijf naar geheugen." #: src/frontend/cmd.cc:1059 msgid " Saves game position into EPD format from memory to disk." msgstr " Slaat de partijpositie in EPD-opmaak op, van geheugen naar schijf." #: src/frontend/cmd.cc:1061 msgid " Switches side to move." msgstr " Maakt de andere kleur aan zet." #: src/frontend/cmd.cc:1064 msgid " Solves the positions in FILENAME." msgstr " Lost de posities in het gegeven bestand op." #: src/frontend/cmd.cc:1066 msgid " Backs up two moves in game history." msgstr " Gaat twee ply terug in de partijgeschiedenis." #: src/frontend/cmd.cc:1068 msgid " Backs up one move in game history." msgstr " Gaat één ply terug in de partijgeschiedenis." #: src/frontend/cmd.cc:1070 msgid " Displays command line syntax." msgstr " Toont de opdrachtregel-syntax." #: src/frontend/cmd.cc:1072 msgid " board - displays the current board" msgstr " board - toont het huidige bord" #: src/frontend/cmd.cc:1073 msgid " time - displays the time settings" msgstr " time - toont de tijdsinstellingen" #: src/frontend/cmd.cc:1074 msgid " moves - shows all moves using one call to routine" msgstr " moves - toont alle zetten (met één aanroep)" #: src/frontend/cmd.cc:1075 msgid " escape - shows moves that escape from check using one call to routine" msgstr "" " escape - toont de zetten om aan schaak te ontsnappen (met één aanroep)" #: src/frontend/cmd.cc:1076 msgid " noncapture - shows non-capture moves" msgstr " noncapture - toont de niet-neemzetten" #: src/frontend/cmd.cc:1077 msgid " capture - shows capture moves" msgstr " capture - toont de neemzetten" #: src/frontend/cmd.cc:1078 msgid " eval [or score] - shows the evaluation per piece and overall" msgstr " eval [of: score] - toont de evaluatie per stuk en algeheel" #: src/frontend/cmd.cc:1079 msgid " game - shows moves in game history" msgstr " game - toont de zetten in de partijgeschiedenis" #: src/frontend/cmd.cc:1080 msgid " pin - shows pinned pieces" msgstr " pin - toont welke stukken gepend zijn" #: src/frontend/cmd.cc:1082 msgid " movelist - reads in an epd file and shows legal moves for its entries" msgstr " movelist - leest een EPD-bestand in en toont de mogelijke zetten" #: src/frontend/cmd.cc:1083 msgid "" " capture - reads in an epd file and shows legal captures for its entries" msgstr " capture - leest een EPD-bestand in en toont de mogelijke neemzetten" #: src/frontend/cmd.cc:1084 msgid " movegenspeed - tests speed of move generator" msgstr " movegenspeed - test de snelheid van de zetten-generator" #: src/frontend/cmd.cc:1085 msgid " capturespeed - tests speed of capture move generator" msgstr " capturespeed - test de snelheid van de neemzetten-generator" #: src/frontend/cmd.cc:1086 msgid " eval - reads in an epd file and shows evaluation for its entries" msgstr "" " eval - leest een EPD-bestand in en toont de evaluatie van diens items" #: src/frontend/cmd.cc:1087 msgid " evalspeed - tests speed of the evaluator" msgstr " evalspeed - test de snelheid van de evaluator" #: src/frontend/cmd.cc:1089 msgid " Shows moves from opening book." msgstr " Toont zetten uit het openingenboek." #: src/frontend/cmd.cc:1091 msgid " Enables display board in graphic mode." msgstr " Schakelt weergave in grafische modus in." #: src/frontend/cmd.cc:1093 msgid " Disables graphic mode and display classical view." msgstr " Schakelt grafische modus uit en toont de klassieke weergave." #: src/frontend/cmd.cc:1119 #, c-format msgid "" "Help for command %s not found\n" "\n" msgstr "" "Geen hulp voor commando '%s' gevonden.\n" "\n" #: src/frontend/cmd.cc:1121 #, c-format msgid "List of commands: (help COMMAND to get more help)\n" msgstr "" "Lijst van commando's: (gebruik 'help COMMANDO' om meer hulp te krijgen)\n" #: src/frontend/engine.cc:247 msgid "Black" msgstr "Zwart" #: src/frontend/engine.cc:247 msgid "White" msgstr "Wit" #: src/frontend/engine.cc:333 #, c-format msgid "" "\n" "My move is : %s\n" msgstr "" "\n" "Mijn zet is : %s\n" gnuchess-6.2.2/po/POTFILES.in000644 000766 000024 00000000574 12461161273 016357 0ustar00antoniostaff000000 000000 # Copyright (C) 2001-2015 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. # # List of source files which contain translatable strings. # Package source files. src/main.cc src/frontend/cmd.cc src/frontend/engine.cc gnuchess-6.2.2/po/pt_BR.gmo000644 000766 000024 00000041360 12610434565 016315 0ustar00antoniostaff000000 000000 Þ•†L³|H I K Ck M¯ 7ý (5 /^ 'Ž .¶ 7å J 9h )¢ &Ì Ró #F&j$‘O¶29'X+€)¬FÖ?h]‘Æ6Xg(÷^ &g¦[(j>“Òèþ9/L/|±¬x^8×"0Sòk^#_-ƒ!±#ÓH÷@5_F•AÜ=)\#†-ªFØ2%R%xž&º-á#$3<X>•Ô%ï""8#[/,À-í6/R-‚+°,Ü. 8"Q t•°ÊÛë " 66 m € 2’ Å Õ %é !"!@!]!y!! £!­!)Æ! ð!ü!5"$K"p">ˆ"Ç"Ù"ê"ú"#!#%'#,M#)z#)¤#Î#ÕÓ#©%#«%`Ï%^0&=&+Í&7ù&+1'5]'J“'nÞ':M()ˆ(/²(nâ(*Q)-|)-ª)WØ)90*%j*.*7¿*5÷*D-+Jr+½+«=,?é,f)-+-p¼-1-.¥_.p/ v/E—/Ý/ø/0C&08j0=£0×á0”¹1=N2#Œ2"°2Ó2 î2ü3.5235'f5 Ž5N¯5/þ5E.6Yt6GÎ697,P7/}7:­7Qè7D:8782·8 ê8* 9869'o9'—9H¿9G:P:'l:+”:)À:&ê:;.*;+Y;,…;5²;.è;,<*D<+o<D›<à<&ü<"#="F= i=Š=¤=)»=å=>>>W>s>8Œ>Å>á>+ü>(? G?1h?.š?É?!æ? @@,"@O@#_@Bƒ@2Æ@ù@@A#QAuA•A)¯A"ÙA üA=B4EB6zB8±BêB#…E:9v1JUq}5 bf0CehDY [2^c=(<Mo'i8 P‚!aK&?NX~;sG+jk.†yxWT,$r€F%L„ u>AH@zm) "6Bp7RVS{Qd*\ lw4/g|t_O]`-nIZƒ3 --silent same as -q -M size, --memory=size specify memory usage in MB for hashtable -a filename, --addbook=filename compile book.bin from pgn book 'filename' -e, --easy disable thinking in opponents time -g, --graphic enable graphic mode -h, --help display this help and exit -m, --manual enable manual mode -p, --post start up showing thinking -q, --quiet make the program silent on startup -u, --uci enable UCI protocol (externally behave as UCI engine) -v, --version display version information and exit -x, --xboard start in engine mode Advances one move in pgn loaded game. Arranges for verbose thinking output showing variation, score, time, depth, etc. Backs up one move in game history. Backs up one move in pgn loaded game. Backs up two moves in game history. Computer takes whichever side is on move and begins its thinking immediately. Disables graphic mode and display classical view. Displays command line syntax. Enables display board in graphic mode. Goes to begin position of pgn loaded game. Goes to end position of pgn loaded game. In analysis mode this stops analysis, otherwise it quits the program. Inputs the estimated rating for computer and for its opponent. Inputs time left in game for computer in hundredths of a second. Mostly used by Internet Chess Server. Lets you input your name. Also writes the log.nnn and corresponding game.nnn files. For details please see the auxiliary file format sections. Loads a position in EPD format from disk into memory. Loads the game in the file into memory, and enables the commands 'first', 'last', 'next', 'previous'. Loads the game in the file into memory. Makes the program stop moving. You may now enter moves to reach some position in the future. Mostly used by Internet Chess Server. Moves are accepted either in standard algebraic notation (SAN) or in coordinate algebraic notation. Options xboard and post are accepted without leading dashes for backward compatibility. Prints out the version of this program. Produces a help blurb corresponding to this list of commands. Program plays black. Program plays white. Quits the program. Saves game position into EPD format from memory to disk. Saves the game so far from memory to the file. Sets the hash table to permit storage of N MB. Sets the program to look N ply (half-moves) deep for every search it performs. If there is a checkmate or other condition that does not allow that depth, then it will not be. Sets time control to be MOVES in MINUTES, with each move giving an INCREMENT (in seconds, i.e. a Fischer-style clock). Sets up a new game (i.e. pieces in original positions). Shows moves from opening book. Solves the positions in FILENAME. Switches side to move. The file 'gnuchess.ini' allows setting config options. See 'info gnuchess' for details. The file will be looked up in the current directory or, if not found there, in the directory pointed to by environment variable GNUCHESS_PKGDATADIR. This command reactivates a game that has been terminated automatically due to checkmate or no more time on the clock. However, it does not alter those conditions. So you would have to undo a move or two, or add time to the clock with 'level' or 'time'. Turns off verbose thinking output. add - compiles book.bin from a pgn book file best - plays best move from book board - displays the current board capture - reads in an epd file and shows legal captures for its entries capture - shows capture moves capturespeed - tests speed of capture move generator escape - shows moves that escape from check using one call to routine eval - reads in an epd file and shows evaluation for its entries eval [or score] - shows the evaluation per piece and overall evalspeed - tests speed of the evaluator game - shows moves in game history movegenspeed - tests speed of move generator movelist - reads in an epd file and shows legal moves for its entries moves - shows all moves using one call to routine noncapture - shows non-capture moves off - disables the memory hash table off - disables use of book off - disables use of xboard/winboard off - disables using the null-move heuristic on - enables use of book (default) on - enables use of xboard/winboard on - enables using the memory hash table to speed up search on - enables using the null-move heuristic to speed up search pin - shows pinned pieces prefer - same as 'book on' (default) random - plays any move from book time - displays the time settings worst - plays worst move from bookBoard is wrong! Command 'activate' is currently not supported. Command 'black' is currently not supported. Command 'random' is currently not supported. Command 'show eval/score' is currently not supported. Command 'show pin' is currently not supported. Command 'switch' is currently not supported. Command 'test' is currently not supported. Command 'white' is currently not supported. Could not create logfile, all slots occupied. Error reading file '%s' Failed to open %s for writing: %s Fischer increment of %d seconds Graphic mode is disabled. Graphic mode is enabled. Hashing is off. Hashing is on. Help for command %s not found Incorrect book option Incorrect epd file Initial position reached. There are no earlier moves. Invalid filename. Invalid move: %s List of commands: (help COMMAND to get more help) My rating = %d New TimeLimit = %g No more moves. Game reached the end. No moves to undo! No. of moves generated = %ld Null-move heuristic is off. Null-move heuristic is on. Old TimeLimit = %g Opponent rating = %d Options: Play the game of chess Report bugs to . Save to %s Search to a depth of %d The syntax to add a new book is: book add file.pgn Time Control: %d moves in %.2f secs Usage: %s [OPTION]... You may consider deleting or renaming your existing logfiles. book is now best book is now off book is now on book is now random book is now worst movesmy rating = %d, opponent rating = %d name - list known players alphabetically reverse - list by GNU worst result first score - list by GNU best result first timeProject-Id-Version: gnuchess 6.1.1 Report-Msgid-Bugs-To: bug-gnu-chess@gnu.org POT-Creation-Date: 2015-10-17 14:05+0200 PO-Revision-Date: 2013-11-25 01:19-0300 Last-Translator: Rafael Ferreira Language-Team: Brazilian Portuguese Language: pt_BR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Generator: Poedit 1.5.7 Plural-Forms: nplurals=2; plural=(n > 1); --silent o mesmo que -q -M tam, --memory=tam especifica o uso de memória em MB para a tabela hash -a arquivo, --addbook=arquivo compila book.bin de um livro pgn "arquivo" -e, --easy desabilita pensamento na vez do oponente -g, --graphic habilita modo gráfico -h, --help exibe essa mensagem de ajuda e sai -m, --manual habilita o modo manual -p, --post inicializa mostrando pensamentos -q, --quiet torna o programa silencioso durante a inicialização -u, --uci habilita o protocolo UCI (se comporta externamente como um motor UCI) -v, --version exibe a informação da versão e sai -x, --xboard inicia no modo motor Avança um movimento no jogo carregado de pgn. Organiza para exibição de pensamento detalhado mostrando variação pontuação, tempo, profundidade, etc. Volta um movimento no histórico de jogo. Volta um movimento no jogo carregado de pgn. Volta dois movimentos no histórico de jogo. O computador pega o lado que deva fazer o movimento e começa a pensar imediatamente. Desabilita o modo gráfico e exibe uma visão clássica. Exibe a sintaxe de linha de comando. Habilita exibir o tabuleiro em modo gráfico. Vai para a posição inicial do jogo carregado de pgn. Vai para a posição final do jogo carregado de pgn. No modo análise, pára a análise; do contrário, sai do programa. Informa a classificação estimada para o computador e para seu oponente. Informa o tempo restante de jogo para computador com centenas de um segundo. Usado principalmente pelo Internet Chess Server. Permite que você informe seu nome. Também grava o log.nnn e os arquivos game.nnn correspondente. Para mais detalhes, veja as seções de formato de arquivo auxiliar. Carrega uma posição no formato EPD do disco para a memória. Carrega o jogo no arquivo para a memória e permite os comandos "first", "last", "next", "previous". Carrega o jogo no arquivo para a memória. Faz o programa parar de mover. Você pode agora informar movimentos para alcançar alguma posição no futuro. Usado principalmente pelo Internet Chess Server. Movimentos são aceitos tanto no sistema de notação algébrica (SAN, que significa standard algebraic notation) ou em notação de algébrica de coordenadas. As opções xboard e post são aceitas sem os hífens por motivo de compatibilidade com versões anteriores. Exibe a versão deste programa. Produz uma sinopse de ajuda correspondendo a esta lista de comandos. Programa joga como preto. Programa joga como branco. Sai do programa. Salva a posição do jogo no formato EPD da memória para o disco. Salva o jogo até o momento da memória para o arquivo. Configura a tabela hash para permitir armazenamento de N MB. Configura o programa para procurar em uma profundidade de N ply (semi-movimentos) para cada pesquisa realizada. Se há um xeque-mate ou outra condição que não permita aquela profundidade, então não haverá. Configura o controle de tempo para ser MOVIMENTOS em MINUTOS com cada movimento dando um INCREMENTO (em segundos, i.e. um relógio estilo Fischer). Prepara um novo jogo (i.e. peças nas posições originais). Mostra movimentos do livro aberto. Resolve as posições no ARQUIVO. Troca de lado para mover. O arquivo "gnuchess.ini" permite definir opções de configuração. Veja "info gnuchess" para mais detalhes. O arquivo será procurado no atual diretório ou, caso não seja encontrado neste, no diretório apontado pela variável de ambiente GNUCHESS_PKGDATADIR. Esse comando reativa um jogo que terminou automaticamente por causa de um xeque-mate ou sem mais tempo no relógio. Porém, ele não altera essas condições. Você teria que desfazer um ou outro movimento ou adicionar tempo ao relógio com "level" ou "time". Desliga a exibição de pensamento detalhado. add - compila book.bin de um arquivo de livro pgn best - usa o melhor movimento do livro board - exibe o tabuleiro atual capture - lê em um arquivo epd e mostra capturas válidas para suas entradas capture - mostra movimentos em que há captura capturespeed - testa a velocidade do gerador de movimento de captura escape - mostra movimentos que escapam da verificação usando uma chamada para a rotina eval - lê em um arquivo epd e mostra a avaliação para suas entradas eval [ou score] - mostra a avaliação por peça e geral evalspeed - testa a velocidade do avaliador game - mostra movimentos no histórico de jogo movegenspeed - testa a velocidade do gerador de movimento movelist - lê em um arquivo epd e mostra movimentos válidos para suas entradas moves - mostra todos os movimentos usando uma chamada para a rotina noncapture - mostra movimentos em que não há captura off - desabilita o uso de tabela hash de memória off - desabilita o uso de livro off - desabilita o uso de xboard/winboard off - desabilita o uso de heurística de movimento nulo on - habilita o uso de livro (padrão) on - habilita o uso de xboard/winboard on - habilita o uso de tabela hash de memória para agilizar a pesquisa on - habilita a heurística de movimento nulo para agilizar a pesquisa pin - mostra peças presas prefer - mesmo que "book on" (padrão) random - usa quaisquer movimentos do livro time - exibe as configurações de tempo worst - usa o pior movimento do livroTabuleiro está errado! Sem suporte ao comando "activate" no momento. Sem suporte ao comando "blank" no momento. Sem suporte ao comando "random" no momento. Sem suporte ao comando "show eval/score" no momento. Sem suporte ao comando "show pin" no momento. Sem suporte ao comando "switch" no momento. Sem suporte ao comando "test" no momento. Sem suporte ao comando "white" no momento. Não foi possível criar o arquivo de log: todos os slots ocupados. Erro ao ler o arquivo "%s" Falha ao abrir %s para gravação: %s Incremento Fischer de %d segundos Modo gráfico está desabilitado. Modo gráfico está habilitado. Hashing está desligado. Hashing está ligado. Ajuda para o comando %s não encontrada Opção de livro incorreta Arquivo epd incorreto Posição inicial alcançada. Não há movimentos anteriores. Nome de arquivo incorreto. Movimento inválido: %s Lista de comandos: (help COMANDO para obter mais ajuda) Minha classificação = %d Limite de tempo novo = %g Sem mais movimentos. O jogo chegou ao fim. Sem movimentos para desfazer! Nº de movimentos gerados = %ld Heurística de movimentos nulos está desligada. Heurística de movimentos nulos está ligada. Limite de tempo antigo = %g Classificação do oponente = %d Opções: Jogue xadrez Relate erros para . Salvar para %s Pesquisar a uma profundidade de %d A sintaxe para adicionar um novo livro é: book add arquivo.pgn Controle de tempo: %d movimentos em %.2f segundos Uso: %s [OPÇÃO]... Considere excluir ou renomear seus arquivos de logs existentes. livro agora está em melhor (best) livro agora está em desligado livro agora está ligado livro agora está em aleatório (random) livro agora está em pior (worst) movimentosminha classificação = %d, classificação do oponente = %d name - lista alfabética de jogadores conhecidos reverse - lista pelo pior resultado do GNU no início score - lista pelo melhor resultado do GNU no início tempognuchess-6.2.2/po/pt_BR.po000644 000766 000024 00000055055 12610434564 016156 0ustar00antoniostaff000000 000000 # Brazilian Portuguese translation for gnuchess # Copyright (C) 2013 Free Software Foundation, Inc. # This file is distributed under the same license as the gnuchess package. # Rafael Ferreira , 2013. # msgid "" msgstr "" "Project-Id-Version: gnuchess 6.1.1\n" "Report-Msgid-Bugs-To: bug-gnu-chess@gnu.org\n" "POT-Creation-Date: 2015-10-17 14:05+0200\n" "PO-Revision-Date: 2013-11-25 01:19-0300\n" "Last-Translator: Rafael Ferreira \n" "Language-Team: Brazilian Portuguese \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.5.7\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: src/main.cc:317 #, c-format msgid "Memory out of Range or Invalid\n" msgstr "" #: src/main.cc:334 #, c-format msgid "File name is too long (max = %d)\n" msgstr "" #: src/main.cc:340 msgid "Option Processing Failed\n" msgstr "" #: src/main.cc:381 #, c-format msgid "" "Copyright (C) %s Free Software Foundation, Inc.\n" "License GPLv3+: GNU GPL version 3 or later \n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" msgstr "" #: src/main.cc:494 #, c-format msgid "Thinking...\n" msgstr "" #: src/frontend/cmd.cc:101 #, c-format msgid "Command 'activate' is currently not supported.\n" msgstr "Sem suporte ao comando \"activate\" no momento.\n" #: src/frontend/cmd.cc:131 #, c-format msgid "Command 'black' is currently not supported.\n" msgstr "Sem suporte ao comando \"blank\" no momento.\n" #: src/frontend/cmd.cc:140 #, c-format msgid "" "The syntax to add a new book is:\n" "\n" "\tbook add file.pgn\n" msgstr "" "A sintaxe para adicionar um novo livro é:\n" "\n" "\tbook add arquivo.pgn\n" #: src/frontend/cmd.cc:147 #, c-format msgid "book is now on\n" msgstr "livro agora está ligado\n" #: src/frontend/cmd.cc:150 #, c-format msgid "book is now off\n" msgstr "livro agora está em desligado\n" #: src/frontend/cmd.cc:153 #, c-format msgid "book is now best\n" msgstr "livro agora está em melhor (best)\n" #: src/frontend/cmd.cc:156 #, c-format msgid "book is now worst\n" msgstr "livro agora está em pior (worst)\n" #: src/frontend/cmd.cc:159 #, c-format msgid "book is now random\n" msgstr "livro agora está em aleatório (random)\n" #: src/frontend/cmd.cc:161 #, c-format msgid "Incorrect book option\n" msgstr "Opção de livro incorreta\n" #: src/frontend/cmd.cc:174 #, c-format msgid "Search to a depth of %d\n" msgstr "Pesquisar a uma profundidade de %d\n" #: src/frontend/cmd.cc:240 #, c-format msgid "Hashing is on.\n" msgstr "Hashing está ligado.\n" #: src/frontend/cmd.cc:242 #, c-format msgid "Hashing is off.\n" msgstr "Hashing está desligado.\n" #: src/frontend/cmd.cc:268 src/frontend/cmd.cc:278 #, c-format msgid "Fischer increment of %d seconds\n" msgstr "Incremento Fischer de %d segundos\n" #. TRANSLATORS: Please be aware that the word 'move' is sometimes #. used as a synonym of 'ply', and sometimes in the sense of a #. full 2-ply move. #: src/frontend/cmd.cc:276 #, c-format msgid "Time Control: %d moves in %.2f secs\n" msgstr "Controle de tempo: %d movimentos em %.2f segundos\n" #: src/frontend/cmd.cc:286 #, c-format msgid "name - list known players alphabetically\n" msgstr "name - lista alfabética de jogadores conhecidos\n" #: src/frontend/cmd.cc:287 #, c-format msgid "score - list by GNU best result first \n" msgstr "score - lista pelo melhor resultado do GNU no início\n" #: src/frontend/cmd.cc:288 #, c-format msgid "reverse - list by GNU worst result first\n" msgstr "reverse - lista pelo pior resultado do GNU no início\n" #: src/frontend/cmd.cc:303 src/frontend/cmd.cc:1301 #, c-format msgid "Board is wrong!\n" msgstr "Tabuleiro está errado!\n" #: src/frontend/cmd.cc:309 src/frontend/cmd.cc:312 #, c-format msgid "Error reading file '%s'\n" msgstr "Erro ao ler o arquivo \"%s\"\n" #: src/frontend/cmd.cc:378 #, c-format msgid "Failed to open %s for writing: %s\n" msgstr "Falha ao abrir %s para gravação: %s\n" #: src/frontend/cmd.cc:384 #, c-format msgid "Could not create logfile, all slots occupied.\n" msgstr "Não foi possível criar o arquivo de log: todos os slots ocupados.\n" #: src/frontend/cmd.cc:385 #, c-format msgid "You may consider deleting or renaming your existing logfiles.\n" msgstr "Considere excluir ou renomear seus arquivos de logs existentes.\n" #: src/frontend/cmd.cc:417 #, c-format msgid "Null-move heuristic is on.\n" msgstr "Heurística de movimentos nulos está ligada.\n" #: src/frontend/cmd.cc:419 #, c-format msgid "Null-move heuristic is off.\n" msgstr "Heurística de movimentos nulos está desligada.\n" #: src/frontend/cmd.cc:439 src/frontend/cmd.cc:466 #, c-format msgid "Incorrect epd file\n" msgstr "Arquivo epd incorreto\n" #: src/frontend/cmd.cc:510 #, c-format msgid "No more moves. Game reached the end.\n" msgstr "Sem mais movimentos. O jogo chegou ao fim.\n" #: src/frontend/cmd.cc:530 #, c-format msgid "Initial position reached. There are no earlier moves.\n" msgstr "Posição inicial alcançada. Não há movimentos anteriores.\n" #: src/frontend/cmd.cc:586 src/frontend/cmd.cc:692 #, c-format msgid "Invalid filename.\n" msgstr "Nome de arquivo incorreto.\n" #: src/frontend/cmd.cc:592 #, c-format msgid "Graphic mode is enabled.\n" msgstr "Modo gráfico está habilitado.\n" #: src/frontend/cmd.cc:598 #, c-format msgid "Graphic mode is disabled.\n" msgstr "Modo gráfico está desabilitado.\n" #: src/frontend/cmd.cc:639 #, c-format msgid "Command 'random' is currently not supported.\n" msgstr "Sem suporte ao comando \"random\" no momento.\n" #: src/frontend/cmd.cc:647 #, c-format msgid "my rating = %d, opponent rating = %d\n" msgstr "minha classificação = %d, classificação do oponente = %d\n" #: src/frontend/cmd.cc:671 src/frontend/cmd.cc:741 #, c-format msgid "No moves to undo!\n" msgstr "Sem movimentos para desfazer!\n" #: src/frontend/cmd.cc:681 #, c-format msgid "Save to %s\n" msgstr "Salvar para %s\n" #: src/frontend/cmd.cc:722 #, c-format msgid "Command 'switch' is currently not supported.\n" msgstr "Sem suporte ao comando \"switch\" no momento.\n" #: src/frontend/cmd.cc:728 #, c-format msgid "Old TimeLimit = %g\n" msgstr "Limite de tempo antigo = %g\n" #: src/frontend/cmd.cc:730 #, c-format msgid "New TimeLimit = %g\n" msgstr "Limite de tempo novo = %g\n" #: src/frontend/cmd.cc:750 #, c-format msgid "" "Usage: %s [OPTION]...\n" "\n" msgstr "" "Uso: %s [OPÇÃO]...\n" "\n" #: src/frontend/cmd.cc:752 msgid "" "Play the game of chess\n" "\n" msgstr "" "Jogue xadrez\n" "\n" #: src/frontend/cmd.cc:754 msgid "Options:\n" msgstr "Opções:\n" #: src/frontend/cmd.cc:755 msgid " -h, --help display this help and exit\n" msgstr " -h, --help exibe essa mensagem de ajuda e sai\n" #: src/frontend/cmd.cc:757 msgid " -v, --version display version information and exit\n" msgstr " -v, --version exibe a informação da versão e sai\n" #: src/frontend/cmd.cc:759 msgid " -q, --quiet make the program silent on startup\n" msgstr "" " -q, --quiet torna o programa silencioso durante a inicialização\n" #: src/frontend/cmd.cc:761 msgid " --silent same as -q\n" msgstr " --silent o mesmo que -q\n" #: src/frontend/cmd.cc:763 src/frontend/cmd.cc:781 msgid "\n" msgstr "\n" #: src/frontend/cmd.cc:765 msgid " -x, --xboard start in engine mode\n" msgstr " -x, --xboard inicia no modo motor\n" #: src/frontend/cmd.cc:767 msgid " -p, --post start up showing thinking\n" msgstr " -p, --post inicializa mostrando pensamentos\n" #: src/frontend/cmd.cc:769 msgid " -e, --easy disable thinking in opponents time\n" msgstr " -e, --easy desabilita pensamento na vez do oponente\n" #: src/frontend/cmd.cc:771 msgid " -m, --manual enable manual mode\n" msgstr " -m, --manual habilita o modo manual\n" #: src/frontend/cmd.cc:773 msgid "" " -u, --uci enable UCI protocol (externally behave as UCI engine)\n" msgstr "" " -u, --uci habilita o protocolo UCI (se comporta externamente como\n" " um motor UCI)\n" #: src/frontend/cmd.cc:775 msgid " -M size, --memory=size specify memory usage in MB for hashtable\n" msgstr "" " -M tam, --memory=tam\n" " especifica o uso de memória em MB para a tabela hash\n" #: src/frontend/cmd.cc:777 msgid "" " -a filename, --addbook=filename compile book.bin from pgn book " "'filename'\n" msgstr "" " -a arquivo, --addbook=arquivo\n" " compila book.bin de um livro pgn \"arquivo\"\n" #: src/frontend/cmd.cc:779 msgid " -g, --graphic enable graphic mode\n" msgstr " -g, --graphic habilita modo gráfico\n" #: src/frontend/cmd.cc:783 msgid "" " Options xboard and post are accepted without leading dashes\n" " for backward compatibility.\n" "\n" msgstr "" " As opções xboard e post são aceitas sem os hífens por motivo\n" " de compatibilidade com versões anteriores.\n" "\n" #: src/frontend/cmd.cc:787 msgid "" " Moves are accepted either in standard algebraic notation (SAN) or\n" " in coordinate algebraic notation.\n" "\n" msgstr "" " Movimentos são aceitos tanto no sistema de notação algébrica (SAN,\n" " que significa standard algebraic notation) ou em notação de algébrica \n" " de coordenadas.\n" "\n" #: src/frontend/cmd.cc:791 msgid "" " The file 'gnuchess.ini' allows setting config options. See\n" " 'info gnuchess' for details. The file will be looked up in the current\n" " directory or, if not found there, in the directory pointed to by\n" " environment variable GNUCHESS_PKGDATADIR.\n" "\n" msgstr "" " O arquivo \"gnuchess.ini\" permite definir opções de configuração.\n" " Veja \"info gnuchess\" para mais detalhes. O arquivo será procurado\n" " no atual diretório ou, caso não seja encontrado neste, no diretório\n" " apontado pela variável de ambiente GNUCHESS_PKGDATADIR.\n" "\n" #: src/frontend/cmd.cc:797 msgid "" "Report bugs to .\n" "\n" msgstr "" "Relate erros para .\n" "\n" #: src/frontend/cmd.cc:844 src/frontend/cmd.cc:1280 #, c-format msgid "Invalid move: %s\n" msgstr "Movimento inválido: %s\n" #: src/frontend/cmd.cc:862 #, c-format msgid "Command 'white' is currently not supported.\n" msgstr "Sem suporte ao comando \"white\" no momento.\n" #: src/frontend/cmd.cc:893 #, c-format msgid "My rating = %d\n" msgstr "Minha classificação = %d\n" #: src/frontend/cmd.cc:894 #, c-format msgid "Opponent rating = %d\n" msgstr "Classificação do oponente = %d\n" #: src/frontend/cmd.cc:896 msgid "time" msgstr "tempo" #: src/frontend/cmd.cc:898 msgid "moves" msgstr "movimentos" #: src/frontend/cmd.cc:903 src/frontend/cmd.cc:910 src/frontend/cmd.cc:919 #: src/frontend/cmd.cc:928 #, c-format msgid "No. of moves generated = %ld\n" msgstr "Nº de movimentos gerados = %ld\n" #: src/frontend/cmd.cc:932 #, c-format msgid "Command 'show eval/score' is currently not supported.\n" msgstr "Sem suporte ao comando \"show eval/score\" no momento.\n" #: src/frontend/cmd.cc:939 #, c-format msgid "Command 'show pin' is currently not supported.\n" msgstr "Sem suporte ao comando \"show pin\" no momento.\n" #: src/frontend/cmd.cc:951 #, c-format msgid "Command 'test' is currently not supported.\n" msgstr "Sem suporte ao comando \"test\" no momento.\n" #: src/frontend/cmd.cc:969 msgid " Quits the program." msgstr " Sai do programa." #: src/frontend/cmd.cc:971 msgid " In analysis mode this stops analysis, otherwise it quits the program." msgstr " No modo análise, pára a análise; do contrário, sai do programa." #: src/frontend/cmd.cc:973 msgid " Produces a help blurb corresponding to this list of commands." msgstr " Produz uma sinopse de ajuda correspondendo a esta lista de comandos." #: src/frontend/cmd.cc:975 msgid " add - compiles book.bin from a pgn book file" msgstr " add - compila book.bin de um arquivo de livro pgn" #: src/frontend/cmd.cc:976 msgid " on - enables use of book (default)" msgstr " on - habilita o uso de livro (padrão)" #: src/frontend/cmd.cc:977 msgid " off - disables use of book" msgstr " off - desabilita o uso de livro" #: src/frontend/cmd.cc:978 msgid " worst - plays worst move from book" msgstr " worst - usa o pior movimento do livro" #: src/frontend/cmd.cc:979 msgid " best - plays best move from book" msgstr " best - usa o melhor movimento do livro" #: src/frontend/cmd.cc:980 msgid " prefer - same as 'book on' (default)" msgstr " prefer - mesmo que \"book on\" (padrão)" #: src/frontend/cmd.cc:981 msgid " random - plays any move from book" msgstr " random - usa quaisquer movimentos do livro" #: src/frontend/cmd.cc:983 msgid " Prints out the version of this program." msgstr " Exibe a versão deste programa." #: src/frontend/cmd.cc:986 msgid " Backs up one move in pgn loaded game." msgstr " Volta um movimento no jogo carregado de pgn." #: src/frontend/cmd.cc:988 msgid " Saves the game so far from memory to the file." msgstr " Salva o jogo até o momento da memória para o arquivo." #: src/frontend/cmd.cc:990 msgid " Loads the game in the file into memory." msgstr " Carrega o jogo no arquivo para a memória." #: src/frontend/cmd.cc:992 msgid "" " Loads the game in the file into memory, and enables\n" " the commands 'first', 'last', 'next', 'previous'." msgstr "" " Carrega o jogo no arquivo para a memória e permite os\n" " comandos \"first\", \"last\", \"next\", \"previous\"." #: src/frontend/cmd.cc:996 msgid " Advances one move in pgn loaded game." msgstr " Avança um movimento no jogo carregado de pgn." #: src/frontend/cmd.cc:998 msgid " Goes to begin position of pgn loaded game." msgstr " Vai para a posição inicial do jogo carregado de pgn." #: src/frontend/cmd.cc:1000 msgid " Goes to end position of pgn loaded game." msgstr " Vai para a posição final do jogo carregado de pgn." #: src/frontend/cmd.cc:1003 msgid "" " Makes the program stop moving. You may now enter moves\n" " to reach some position in the future." msgstr "" " Faz o programa parar de mover. Você pode agora informar\n" " movimentos para alcançar alguma posição no futuro." #: src/frontend/cmd.cc:1007 msgid " Program plays white." msgstr " Programa joga como branco." #: src/frontend/cmd.cc:1009 msgid " Program plays black." msgstr " Programa joga como preto." #: src/frontend/cmd.cc:1011 msgid "" " Computer takes whichever side is on move and begins its\n" " thinking immediately." msgstr "" " O computador pega o lado que deva fazer o movimento e\n" " começa a pensar imediatamente." #: src/frontend/cmd.cc:1014 msgid "" " Arranges for verbose thinking output showing variation, score,\n" " time, depth, etc." msgstr "" " Organiza para exibição de pensamento detalhado mostrando variação\n" " pontuação, tempo, profundidade, etc." #: src/frontend/cmd.cc:1017 msgid " Turns off verbose thinking output." msgstr " Desliga a exibição de pensamento detalhado." #: src/frontend/cmd.cc:1019 msgid "" " Lets you input your name. Also writes the log.nnn and\n" " corresponding game.nnn files. For details please see\n" " the auxiliary file format sections." msgstr "" " Permite que você informe seu nome. Também grava o\n" " log.nnn e os arquivos game.nnn correspondente. Para\n" " mais detalhes, veja as seções de formato de arquivo\n" " auxiliar." #: src/frontend/cmd.cc:1023 msgid " Mostly used by Internet Chess Server." msgstr " Usado principalmente pelo Internet Chess Server." #: src/frontend/cmd.cc:1025 msgid "" " This command reactivates a game that has been terminated automatically\n" " due to checkmate or no more time on the clock. However, it does not\n" " alter those conditions. So you would have to undo a move or two, or\n" " add time to the clock with 'level' or 'time'." msgstr "" " Esse comando reativa um jogo que terminou automaticamente por causa de\n" " um xeque-mate ou sem mais tempo no relógio. Porém, ele não altera essas\n" " condições. Você teria que desfazer um ou outro movimento ou adicionar\n" " tempo ao relógio com \"level\" ou \"time\"." #: src/frontend/cmd.cc:1030 msgid " Inputs the estimated rating for computer and for its opponent." msgstr "" " Informa a classificação estimada para o computador e para seu oponente." #: src/frontend/cmd.cc:1032 msgid " Sets up a new game (i.e. pieces in original positions)." msgstr " Prepara um novo jogo (i.e. peças nas posições originais)." #: src/frontend/cmd.cc:1034 msgid "" " Inputs time left in game for computer in hundredths of a second.\n" " Mostly used by Internet Chess Server." msgstr "" " Informa o tempo restante de jogo para computador com centenas de um " "segundo.\n" " Usado principalmente pelo Internet Chess Server." #: src/frontend/cmd.cc:1037 msgid " on - enables using the memory hash table to speed up search" msgstr "" " on - habilita o uso de tabela hash de memória para agilizar a pesquisa" # Acrescentei "o uso da", em que pese não existir na msgid, para ficar igual às demais mensagens próximas a esta. -- Rafael Ferreira #: src/frontend/cmd.cc:1038 msgid " off - disables the memory hash table" msgstr " off - desabilita o uso de tabela hash de memória" #: src/frontend/cmd.cc:1040 msgid " Sets the hash table to permit storage of N MB." msgstr " Configura a tabela hash para permitir armazenamento de N MB." #: src/frontend/cmd.cc:1042 msgid " on - enables using the null-move heuristic to speed up search" msgstr " on - habilita a heurística de movimento nulo para agilizar a pesquisa" #: src/frontend/cmd.cc:1043 msgid " off - disables using the null-move heuristic" msgstr " off - desabilita o uso de heurística de movimento nulo" #: src/frontend/cmd.cc:1045 msgid " on - enables use of xboard/winboard" msgstr " on - habilita o uso de xboard/winboard" #: src/frontend/cmd.cc:1046 msgid " off - disables use of xboard/winboard" msgstr " off - desabilita o uso de xboard/winboard" #: src/frontend/cmd.cc:1048 msgid "" " Sets the program to look N ply (half-moves) deep for every\n" " search it performs. If there is a checkmate or other condition\n" " that does not allow that depth, then it will not be." msgstr "" " Configura o programa para procurar em uma profundidade de\n" " N ply (semi-movimentos) para cada pesquisa realizada. Se há\n" " um xeque-mate ou outra condição que não permita aquela\n" " profundidade, então não haverá." #: src/frontend/cmd.cc:1052 msgid "" " Sets time control to be MOVES in MINUTES, with each move giving\n" " an INCREMENT (in seconds, i.e. a Fischer-style clock)." msgstr "" " Configura o controle de tempo para ser MOVIMENTOS em MINUTOS\n" "com cada movimento dando um INCREMENTO (em segundos, i.e. um\n" "relógio estilo Fischer)." #: src/frontend/cmd.cc:1056 msgid " Loads a position in EPD format from disk into memory." msgstr " Carrega uma posição no formato EPD do disco para a memória." #: src/frontend/cmd.cc:1059 msgid " Saves game position into EPD format from memory to disk." msgstr " Salva a posição do jogo no formato EPD da memória para o disco." #: src/frontend/cmd.cc:1061 msgid " Switches side to move." msgstr " Troca de lado para mover." #: src/frontend/cmd.cc:1064 msgid " Solves the positions in FILENAME." msgstr " Resolve as posições no ARQUIVO." #: src/frontend/cmd.cc:1066 msgid " Backs up two moves in game history." msgstr " Volta dois movimentos no histórico de jogo." #: src/frontend/cmd.cc:1068 msgid " Backs up one move in game history." msgstr " Volta um movimento no histórico de jogo." #: src/frontend/cmd.cc:1070 msgid " Displays command line syntax." msgstr " Exibe a sintaxe de linha de comando." #: src/frontend/cmd.cc:1072 msgid " board - displays the current board" msgstr " board - exibe o tabuleiro atual" #: src/frontend/cmd.cc:1073 msgid " time - displays the time settings" msgstr " time - exibe as configurações de tempo" #: src/frontend/cmd.cc:1074 msgid " moves - shows all moves using one call to routine" msgstr " moves - mostra todos os movimentos usando uma chamada para a rotina" #: src/frontend/cmd.cc:1075 msgid " escape - shows moves that escape from check using one call to routine" msgstr "" " escape - mostra movimentos que escapam da verificação usando uma chamada " "para a rotina" #: src/frontend/cmd.cc:1076 msgid " noncapture - shows non-capture moves" msgstr " noncapture - mostra movimentos em que não há captura" #: src/frontend/cmd.cc:1077 msgid " capture - shows capture moves" msgstr " capture - mostra movimentos em que há captura" #: src/frontend/cmd.cc:1078 msgid " eval [or score] - shows the evaluation per piece and overall" msgstr " eval [ou score] - mostra a avaliação por peça e geral" #: src/frontend/cmd.cc:1079 msgid " game - shows moves in game history" msgstr " game - mostra movimentos no histórico de jogo" #: src/frontend/cmd.cc:1080 msgid " pin - shows pinned pieces" msgstr " pin - mostra peças presas" #: src/frontend/cmd.cc:1082 msgid " movelist - reads in an epd file and shows legal moves for its entries" msgstr "" " movelist - lê em um arquivo epd e mostra movimentos válidos para suas " "entradas" #: src/frontend/cmd.cc:1083 msgid "" " capture - reads in an epd file and shows legal captures for its entries" msgstr "" " capture - lê em um arquivo epd e mostra capturas válidas para suas entradas" #: src/frontend/cmd.cc:1084 msgid " movegenspeed - tests speed of move generator" msgstr " movegenspeed - testa a velocidade do gerador de movimento" #: src/frontend/cmd.cc:1085 msgid " capturespeed - tests speed of capture move generator" msgstr " capturespeed - testa a velocidade do gerador de movimento de captura" #: src/frontend/cmd.cc:1086 msgid " eval - reads in an epd file and shows evaluation for its entries" msgstr " eval - lê em um arquivo epd e mostra a avaliação para suas entradas" #: src/frontend/cmd.cc:1087 msgid " evalspeed - tests speed of the evaluator" msgstr " evalspeed - testa a velocidade do avaliador" #: src/frontend/cmd.cc:1089 msgid " Shows moves from opening book." msgstr " Mostra movimentos do livro aberto." #: src/frontend/cmd.cc:1091 msgid " Enables display board in graphic mode." msgstr " Habilita exibir o tabuleiro em modo gráfico." #: src/frontend/cmd.cc:1093 msgid " Disables graphic mode and display classical view." msgstr " Desabilita o modo gráfico e exibe uma visão clássica." #: src/frontend/cmd.cc:1119 #, c-format msgid "" "Help for command %s not found\n" "\n" msgstr "" "Ajuda para o comando %s não encontrada\n" "\n" #: src/frontend/cmd.cc:1121 #, c-format msgid "List of commands: (help COMMAND to get more help)\n" msgstr "Lista de comandos: (help COMANDO para obter mais ajuda)\n" #: src/frontend/engine.cc:247 msgid "Black" msgstr "" #: src/frontend/engine.cc:247 msgid "White" msgstr "" #: src/frontend/engine.cc:333 #, c-format msgid "" "\n" "My move is : %s\n" msgstr "" gnuchess-6.2.2/po/quot.sed000644 000766 000024 00000000231 12205632536 016256 0ustar00antoniostaff000000 000000 s/"\([^"]*\)"/“\1â€/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“â€/""/g gnuchess-6.2.2/po/remove-potcdate.sin000644 000766 000024 00000000660 12205632536 020410 0ustar00antoniostaff000000 000000 # Sed script that remove the POT-Creation-Date line in the header entry # from a POT file. # # The distinction between the first and the following occurrences of the # pattern is achieved by looking at the hold space. /^"POT-Creation-Date: .*"$/{ x # Test if the hold space is empty. s/P/P/ ta # Yes it was empty. First occurrence. Remove the line. g d bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } gnuchess-6.2.2/po/Rules-quot000644 000766 000024 00000003411 12205632536 016577 0ustar00antoniostaff000000 000000 # Special Makefile rules for English message catalogs with quotation marks. DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot .SUFFIXES: .insert-header .po-update-en en@quot.po-create: $(MAKE) en@quot.po-update en@boldquot.po-create: $(MAKE) en@boldquot.po-update en@quot.po-update: en@quot.po-update-en en@boldquot.po-update: en@boldquot.po-update-en .insert-header.po-update-en: @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ ll=`echo $$lang | sed -e 's/@.*//'`; \ LC_ALL=C; export LC_ALL; \ cd $(srcdir); \ if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "creation of $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi en@quot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header en@boldquot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header mostlyclean: mostlyclean-quot mostlyclean-quot: rm -f *.insert-header gnuchess-6.2.2/po/sr.gmo000644 000766 000024 00000051507 12610434564 015736 0ustar00antoniostaff000000 000000 Þ•†L³|H I K Ck M¯ 7ý (5 /^ 'Ž .¶ 7å J 9h )¢ &Ì Ró #F&j$‘O¶29'X+€)¬FÖ?h]‘Æ6Xg(÷^ &g¦[(j>“Òèþ9/L/|±¬x^8×"0Sòk^#_-ƒ!±#ÓH÷@5_F•AÜ=)\#†-ªFØ2%R%xž&º-á#$3<X>•Ô%ï""8#[/,À-í6/R-‚+°,Ü. 8"Q t•°ÊÛë " 66 m € 2’ Å Õ %é !"!@!]!y!! £!­!)Æ! ð!ü!5"$K"p">ˆ"Ç"Ù"ê"ú"#!#%'#,M#)z#)¤#Î#ñÓ#Å%-Ç%õ%£…&p)'\š'I÷';A(K}([É(w%)T)Eò)N8*›‡*V#+Yz+PÔ+•%,f»,A"-Md-J²-Hý-ŒF.nÓ.ÇB/  0Z1šr1C 2¼Q2U3Ôd3²949ì4^&5$…5$ª5$Ï5]ô5=R6V6<ç6é$8^9@m9?®91î9´ :¤Õ;Ez=NÀ=<>5L>˜‚>I?he?‹Î?iZ@`Ä@E%AHkAK´A|Bj}BQèB@:C5{CG±CaùCS[DD¯DqôDfE9æEF FAgF@©F=êF"(GJKGG–GHÞGQ'HJyHHÄHF IGTIvœI4JGHJ9J3ÊJ1þJ*0K([KE„K'ÊK-òK] L2~L$±LTÖL+MGMLaM3®M0âMLNJ`N«N)ÇNñN)O>*OiO#OU£OGùO(AP™jP(Q,-Q*ZQ,…Q(²Q ÛQGèQU0RZ†RZáR AH@zm) "6Bp7RVS{Qd*\ lw4/g|t_O]`-nIZƒ3 --silent same as -q -M size, --memory=size specify memory usage in MB for hashtable -a filename, --addbook=filename compile book.bin from pgn book 'filename' -e, --easy disable thinking in opponents time -g, --graphic enable graphic mode -h, --help display this help and exit -m, --manual enable manual mode -p, --post start up showing thinking -q, --quiet make the program silent on startup -u, --uci enable UCI protocol (externally behave as UCI engine) -v, --version display version information and exit -x, --xboard start in engine mode Advances one move in pgn loaded game. Arranges for verbose thinking output showing variation, score, time, depth, etc. Backs up one move in game history. Backs up one move in pgn loaded game. Backs up two moves in game history. Computer takes whichever side is on move and begins its thinking immediately. Disables graphic mode and display classical view. Displays command line syntax. Enables display board in graphic mode. Goes to begin position of pgn loaded game. Goes to end position of pgn loaded game. In analysis mode this stops analysis, otherwise it quits the program. Inputs the estimated rating for computer and for its opponent. Inputs time left in game for computer in hundredths of a second. Mostly used by Internet Chess Server. Lets you input your name. Also writes the log.nnn and corresponding game.nnn files. For details please see the auxiliary file format sections. Loads a position in EPD format from disk into memory. Loads the game in the file into memory, and enables the commands 'first', 'last', 'next', 'previous'. Loads the game in the file into memory. Makes the program stop moving. You may now enter moves to reach some position in the future. Mostly used by Internet Chess Server. Moves are accepted either in standard algebraic notation (SAN) or in coordinate algebraic notation. Options xboard and post are accepted without leading dashes for backward compatibility. Prints out the version of this program. Produces a help blurb corresponding to this list of commands. Program plays black. Program plays white. Quits the program. Saves game position into EPD format from memory to disk. Saves the game so far from memory to the file. Sets the hash table to permit storage of N MB. Sets the program to look N ply (half-moves) deep for every search it performs. If there is a checkmate or other condition that does not allow that depth, then it will not be. Sets time control to be MOVES in MINUTES, with each move giving an INCREMENT (in seconds, i.e. a Fischer-style clock). Sets up a new game (i.e. pieces in original positions). Shows moves from opening book. Solves the positions in FILENAME. Switches side to move. The file 'gnuchess.ini' allows setting config options. See 'info gnuchess' for details. The file will be looked up in the current directory or, if not found there, in the directory pointed to by environment variable GNUCHESS_PKGDATADIR. This command reactivates a game that has been terminated automatically due to checkmate or no more time on the clock. However, it does not alter those conditions. So you would have to undo a move or two, or add time to the clock with 'level' or 'time'. Turns off verbose thinking output. add - compiles book.bin from a pgn book file best - plays best move from book board - displays the current board capture - reads in an epd file and shows legal captures for its entries capture - shows capture moves capturespeed - tests speed of capture move generator escape - shows moves that escape from check using one call to routine eval - reads in an epd file and shows evaluation for its entries eval [or score] - shows the evaluation per piece and overall evalspeed - tests speed of the evaluator game - shows moves in game history movegenspeed - tests speed of move generator movelist - reads in an epd file and shows legal moves for its entries moves - shows all moves using one call to routine noncapture - shows non-capture moves off - disables the memory hash table off - disables use of book off - disables use of xboard/winboard off - disables using the null-move heuristic on - enables use of book (default) on - enables use of xboard/winboard on - enables using the memory hash table to speed up search on - enables using the null-move heuristic to speed up search pin - shows pinned pieces prefer - same as 'book on' (default) random - plays any move from book time - displays the time settings worst - plays worst move from bookBoard is wrong! Command 'activate' is currently not supported. Command 'black' is currently not supported. Command 'random' is currently not supported. Command 'show eval/score' is currently not supported. Command 'show pin' is currently not supported. Command 'switch' is currently not supported. Command 'test' is currently not supported. Command 'white' is currently not supported. Could not create logfile, all slots occupied. Error reading file '%s' Failed to open %s for writing: %s Fischer increment of %d seconds Graphic mode is disabled. Graphic mode is enabled. Hashing is off. Hashing is on. Help for command %s not found Incorrect book option Incorrect epd file Initial position reached. There are no earlier moves. Invalid filename. Invalid move: %s List of commands: (help COMMAND to get more help) My rating = %d New TimeLimit = %g No more moves. Game reached the end. No moves to undo! No. of moves generated = %ld Null-move heuristic is off. Null-move heuristic is on. Old TimeLimit = %g Opponent rating = %d Options: Play the game of chess Report bugs to . Save to %s Search to a depth of %d The syntax to add a new book is: book add file.pgn Time Control: %d moves in %.2f secs Usage: %s [OPTION]... You may consider deleting or renaming your existing logfiles. book is now best book is now off book is now on book is now random book is now worst movesmy rating = %d, opponent rating = %d name - list known players alphabetically reverse - list by GNU worst result first score - list by GNU best result first timeProject-Id-Version: gnuchess 6.1.1 Report-Msgid-Bugs-To: bug-gnu-chess@gnu.org POT-Creation-Date: 2015-10-17 14:05+0200 PO-Revision-Date: 2014-01-13 17:20+0200 Last-Translator: МироÑлав Ðиколић Language-Team: Serbian <(nothing)> Language: sr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2); --silent иÑто као „-q“ -M величина, --memory=величина наводи коришћење меморије у MB за хеш табелу -a назив датотеке, --addbook=назив датотеке преводи „book.bin“ из „назива датотеке“ пгн књиге -e, --easy иÑкључује размишљање у току противничког времена -g, --graphic укључује графички режим -h, --help приказује ову помоћ и излази -m, --manual укључује ручни режим -p, --post почиње показујући размишљања -q, --quiet чини програм тихим приликом покретања -u, --uci укључује УЦИ протокол (Ñпоља Ñе понаша као УЦИ машина) -v, --version иÑпиÑује податке о издању и излази -x, --xboard покреће Ñе у ређиму машине Ðапредује један потез у пгн учитаној игри. Ређа за излаз опширног размишљања приказујући промене, резултат, време, дубину, итд. Прави резерву једног потеза у иÑторијату игре. Прави резерву једног потеза у пгн учитаној игри. Прави резерву два потеза у иÑторијату игре. Рачунар заузима Ñтрану онога ко је на потезу и одмах започиње његово размишљање. ИÑкључује графички режим и приказује клаÑичан преглед. Приказује ÑинтакÑу линије наредби. Укључује приказ табле у графичком режиму. Иде на почетни положај пгн учитане игре. Иде на крајњи положај пгн учитане игре. У режиму анализирања зауÑтавља анализирање, у Ñупротном излази из програма. УноÑи процењени плаÑман за рачунар и за његовог противника. УноÑи преоÑтало време у игри за рачунар у Ñтотинкама Ñекунде. Углавном га кориÑти Интернет шаховÑки Ñервер. Даје вам да унеÑете ваше име. Такође пише „log.nnn“ и одговарајућу „game.nnn“ датотеку. За појединоÑти погледајте одељке обликовања помоћне датотеке. Учитава положај у ЕПД запиÑу Ñа диÑка у меморију. Учитава игру у датотеци у меморију, и укључује наредбе „first“, „last“, „next“, „previous“. Учитава игру из датотеке у меморију. Чини да програм преÑтане да Ñе креће. Сада можете да унеÑете потезе да доÑтигнете неки будући положај. Углавном га кориÑти Интернет шаховÑки Ñервер. Потези Ñе прихватају и у Ñтандардном алгебарÑком предÑтављању (СÐП) или у координатном алгебарÑком предÑтављању. Опције „xboard“ и „post“ Ñу прихваћене без водећих цртица зарад ÑаглаÑноÑти Ñа Ñтаријим издањима. ИÑпиÑује издање овог програма. Приказује помоћ која одговара овом ÑпиÑку наредби. Програм игра црног. Програм игра белог. Излази из програма. Чува положај игре у ЕПД запиÑу Ñа меморије на диÑк. Чува игру из меморије у датотеку. Подешава хеш табелу да дозволи Ñкладиштење N MB. Подешава програм да тражи дубину N игре (пола потеза) за Ñваку претрагу коју обавља. Ðко је дошло до шах-мата или другог уÑлова који не дозвољава ту дубину, онда га неће бити. Подешава управљање временом на ПОТЕЗРу МИÐУТИМÐ, Ñа Ñваким потезом који даје ПОВЕЋÐЊЕ (у Ñекундама, тј. Ñат у Фишеровом Ñтилу). Подешава нову игру (тј. фигуре на почетне положаје). Показује потезе из отворене књиге. Решава положаје у ÐÐЗИВУДÐТОТЕКЕ. Пребацује Ñтране за потез. Датотека „gnuchess.ini“ омогућава поÑтављање опција подешавања. Видите „info gnuchess“ за појединоÑти. Датотека ће бити потражена у текућем директоријуму или, ако је тамо нема, у директоријуму на који указује променљива окружења „GNUCHESS_PKGDATADIR“. Ова наредба поново покреће игру која је ÑамоÑтално завршена уÑлед шах-мата или због недоÑтатка времена на Ñату. Међутим, не мења ове уÑлове. Моћи ћете да поништите потез или два или да додате време на Ñату помоћу „level“ или „time“. ИÑкључује излаз опширног размишљања. add — преводи „book.bin“ из датотеке пгн књиге best — игра најбољи потез из књиге board — приказује текућу таблу capture — чита у епд датотеци и показује иÑправне потезе који задају шах за њене уноÑе capture — приказује потезе који задају шах capturespeed — иÑпробава брзину творца потеза који задају шах escape — приказује потезе који измичу провери кориÑтећи један позив по рутини eval — чита у епд датотеци и показује процене за њене уноÑе eval [или score] — приказује процену по фигури и укупноÑÑ‚ evalspeed — иÑпробава брзину процењивача game — показује потезе у иÑторијату игре movegenspeed — иÑпробава брзину творца потеза movelist — чита у епд датотеци и показује иÑправне потезе за њене уноÑе moves — показује Ñве потезе кориÑтећи један позив по рутини noncapture — приказује потезе који не задају шах off — иÑкључује хеш табелу меморије off иÑкључује коришћење књиге off — иÑкључује коришћење „xboard/winboard“-а off — иÑкључује коришћење откривања ништавног потеза on — укључује коришћење књиге (подразумевано) on — укључује коришћење „xboard/winboard“-а on — укључује коришћење хеш табеле меморије да убрза претрагу on — укључује коришћење откривања ништавног потеза да убрза претрагу pin — показује прикачене фигуре prefer — иÑто као „book on“ (подразумевано) random — игра било који потез из књиге time — приказује подешавања времена worst — игра најгори потез из књигеТабла је погрешна! Ðаредба „activate“ тренутно није подржана. Ðаредба „black“ тренутно није подржана. Ðаредба „random“ тренутно није подржана. Ðаредба „show eval/score“ тренутно није подржана. Ðаредба „show pin“ тренутно није подржана. Ðаредба „switch“ тренутно није подржана. Ðаредба „test“ тренутно није подржана. Ðаредба „white“ тренутно није подржана. Ðе могу да направим датотеку дневника, Ñви прикључци Ñу заузети. Грешка читања датотеке „%s“ Ðе могу да отворим „%s“ за упиÑивање: %s Фишерово повећање од %d Ñекунде Графички режим је иÑкључен. Графички режим је укључен. Хеширање је иÑкључено: Хеширање је укључено: ÐиÑам пронашао помоћ за наредбу „%s“ Ðетачна опција књиге ÐеиÑправна епд датотека ДоÑтигнут је почетни положај. Ðема ранијих потеза. ÐеиÑправан назив датотеке. ÐеиÑправан потез: %s СпиÑак наредби: (помоћ ÐÐРЕДБРза више помоћи) Мој плаÑман = %d Ðово време = %g Ðема више потеза. Игра је Ñтигла до краја. Ðема потеза за поништавање! Бр. направљених потеза = %ld Откривање ништавног потеза је иÑкључено. Откривање ништавног потеза је укључено. Старо време = %g ПлаÑман противника = %d Опције: Играјте шаховÑку игру Пријавите грешке на . Сачувај у %s Тражи у дубину до %d СинтакÑа за додавање нове књиге је: book add file.pgn Управљање временом: %d потеза за %.2f Ñек. Употреба: %s [ОПЦИЈÐ]... Можете да размотрите бриÑање или преименовање ваших поÑтојећих датотека дневника. књига је Ñада најбоља књига је Ñада иÑкључена књига је Ñада укључена књига је Ñада наÑумична књига је Ñада најгора потезимој плаÑман = %d, противников плаÑман = %d name — иÑпиÑује познате играче азбучним редом score — иÑпиÑује према Гнуу прво најгори резултат score — иÑпиÑује према Гнуу прво најбољи резултат времеgnuchess-6.2.2/po/sr.po000644 000766 000024 00000065146 12610434564 015576 0ustar00antoniostaff000000 000000 # Serbian translation of gnuchess. # Copyright (C) 2013 Free Software Foundation, Inc. # This file is distributed under the same license as the gnuchess package. # МироÑлав Ðиколић , 2013, 2014. msgid "" msgstr "" "Project-Id-Version: gnuchess 6.1.1\n" "Report-Msgid-Bugs-To: bug-gnu-chess@gnu.org\n" "POT-Creation-Date: 2015-10-17 14:05+0200\n" "PO-Revision-Date: 2014-01-13 17:20+0200\n" "Last-Translator: МироÑлав Ðиколић \n" "Language-Team: Serbian <(nothing)>\n" "Language: sr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #: src/main.cc:317 #, c-format msgid "Memory out of Range or Invalid\n" msgstr "" #: src/main.cc:334 #, c-format msgid "File name is too long (max = %d)\n" msgstr "" #: src/main.cc:340 msgid "Option Processing Failed\n" msgstr "" #: src/main.cc:381 #, c-format msgid "" "Copyright (C) %s Free Software Foundation, Inc.\n" "License GPLv3+: GNU GPL version 3 or later \n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" msgstr "" #: src/main.cc:494 #, c-format msgid "Thinking...\n" msgstr "" #: src/frontend/cmd.cc:101 #, c-format msgid "Command 'activate' is currently not supported.\n" msgstr "Ðаредба „activate“ тренутно није подржана.\n" #: src/frontend/cmd.cc:131 #, c-format msgid "Command 'black' is currently not supported.\n" msgstr "Ðаредба „black“ тренутно није подржана.\n" #: src/frontend/cmd.cc:140 #, c-format msgid "" "The syntax to add a new book is:\n" "\n" "\tbook add file.pgn\n" msgstr "" "СинтакÑа за додавање нове књиге је:\n" "\n" "\tbook add file.pgn\n" #: src/frontend/cmd.cc:147 #, c-format msgid "book is now on\n" msgstr "књига је Ñада укључена\n" #: src/frontend/cmd.cc:150 #, c-format msgid "book is now off\n" msgstr "књига је Ñада иÑкључена\n" #: src/frontend/cmd.cc:153 #, c-format msgid "book is now best\n" msgstr "књига је Ñада најбоља\n" #: src/frontend/cmd.cc:156 #, c-format msgid "book is now worst\n" msgstr "књига је Ñада најгора\n" #: src/frontend/cmd.cc:159 #, c-format msgid "book is now random\n" msgstr "књига је Ñада наÑумична\n" #: src/frontend/cmd.cc:161 #, c-format msgid "Incorrect book option\n" msgstr "Ðетачна опција књиге\n" #: src/frontend/cmd.cc:174 #, c-format msgid "Search to a depth of %d\n" msgstr "Тражи у дубину до %d\n" #: src/frontend/cmd.cc:240 #, c-format msgid "Hashing is on.\n" msgstr "Хеширање је укључено:\n" #: src/frontend/cmd.cc:242 #, c-format msgid "Hashing is off.\n" msgstr "Хеширање је иÑкључено:\n" #: src/frontend/cmd.cc:268 src/frontend/cmd.cc:278 #, c-format msgid "Fischer increment of %d seconds\n" msgstr "Фишерово повећање од %d Ñекунде\n" #. TRANSLATORS: Please be aware that the word 'move' is sometimes #. used as a synonym of 'ply', and sometimes in the sense of a #. full 2-ply move. #: src/frontend/cmd.cc:276 #, c-format msgid "Time Control: %d moves in %.2f secs\n" msgstr "Управљање временом: %d потеза за %.2f Ñек.\n" #: src/frontend/cmd.cc:286 #, c-format msgid "name - list known players alphabetically\n" msgstr "name — иÑпиÑује познате играче азбучним редом\n" #: src/frontend/cmd.cc:287 #, c-format msgid "score - list by GNU best result first \n" msgstr "score — иÑпиÑује према Гнуу прво најбољи резултат\n" #: src/frontend/cmd.cc:288 #, c-format msgid "reverse - list by GNU worst result first\n" msgstr "score — иÑпиÑује према Гнуу прво најгори резултат\n" #: src/frontend/cmd.cc:303 src/frontend/cmd.cc:1301 #, c-format msgid "Board is wrong!\n" msgstr "Табла је погрешна!\n" #: src/frontend/cmd.cc:309 src/frontend/cmd.cc:312 #, c-format msgid "Error reading file '%s'\n" msgstr "Грешка читања датотеке „%s“\n" #: src/frontend/cmd.cc:378 #, c-format msgid "Failed to open %s for writing: %s\n" msgstr "Ðе могу да отворим „%s“ за упиÑивање: %s\n" #: src/frontend/cmd.cc:384 #, c-format msgid "Could not create logfile, all slots occupied.\n" msgstr "Ðе могу да направим датотеку дневника, Ñви прикључци Ñу заузети.\n" #: src/frontend/cmd.cc:385 #, c-format msgid "You may consider deleting or renaming your existing logfiles.\n" msgstr "" "Можете да размотрите бриÑање или преименовање ваших поÑтојећих датотека " "дневника.\n" #: src/frontend/cmd.cc:417 #, c-format msgid "Null-move heuristic is on.\n" msgstr "Откривање ништавног потеза је укључено.\n" #: src/frontend/cmd.cc:419 #, c-format msgid "Null-move heuristic is off.\n" msgstr "Откривање ништавног потеза је иÑкључено.\n" #: src/frontend/cmd.cc:439 src/frontend/cmd.cc:466 #, c-format msgid "Incorrect epd file\n" msgstr "ÐеиÑправна епд датотека\n" #: src/frontend/cmd.cc:510 #, c-format msgid "No more moves. Game reached the end.\n" msgstr "Ðема више потеза. Игра је Ñтигла до краја.\n" #: src/frontend/cmd.cc:530 #, c-format msgid "Initial position reached. There are no earlier moves.\n" msgstr "ДоÑтигнут је почетни положај. Ðема ранијих потеза.\n" #: src/frontend/cmd.cc:586 src/frontend/cmd.cc:692 #, c-format msgid "Invalid filename.\n" msgstr "ÐеиÑправан назив датотеке.\n" #: src/frontend/cmd.cc:592 #, c-format msgid "Graphic mode is enabled.\n" msgstr "Графички режим је укључен.\n" #: src/frontend/cmd.cc:598 #, c-format msgid "Graphic mode is disabled.\n" msgstr "Графички режим је иÑкључен.\n" #: src/frontend/cmd.cc:639 #, c-format msgid "Command 'random' is currently not supported.\n" msgstr "Ðаредба „random“ тренутно није подржана.\n" #: src/frontend/cmd.cc:647 #, c-format msgid "my rating = %d, opponent rating = %d\n" msgstr "мој плаÑман = %d, противников плаÑман = %d\n" #: src/frontend/cmd.cc:671 src/frontend/cmd.cc:741 #, c-format msgid "No moves to undo!\n" msgstr "Ðема потеза за поништавање!\n" #: src/frontend/cmd.cc:681 #, c-format msgid "Save to %s\n" msgstr "Сачувај у %s\n" #: src/frontend/cmd.cc:722 #, c-format msgid "Command 'switch' is currently not supported.\n" msgstr "Ðаредба „switch“ тренутно није подржана.\n" #: src/frontend/cmd.cc:728 #, c-format msgid "Old TimeLimit = %g\n" msgstr "Старо време = %g\n" #: src/frontend/cmd.cc:730 #, c-format msgid "New TimeLimit = %g\n" msgstr "Ðово време = %g\n" #: src/frontend/cmd.cc:750 #, c-format msgid "" "Usage: %s [OPTION]...\n" "\n" msgstr "" "Употреба: %s [ОПЦИЈÐ]...\n" "\n" #: src/frontend/cmd.cc:752 msgid "" "Play the game of chess\n" "\n" msgstr "Играјте шаховÑку игру\n" #: src/frontend/cmd.cc:754 msgid "Options:\n" msgstr "Опције:\n" #: src/frontend/cmd.cc:755 msgid " -h, --help display this help and exit\n" msgstr " -h, --help приказује ову помоћ и излази\n" #: src/frontend/cmd.cc:757 msgid " -v, --version display version information and exit\n" msgstr " -v, --version иÑпиÑује податке о издању и излази\n" #: src/frontend/cmd.cc:759 msgid " -q, --quiet make the program silent on startup\n" msgstr " -q, --quiet чини програм тихим приликом покретања\n" #: src/frontend/cmd.cc:761 msgid " --silent same as -q\n" msgstr " --silent иÑто као „-q“\n" #: src/frontend/cmd.cc:763 src/frontend/cmd.cc:781 msgid "\n" msgstr "\n" #: src/frontend/cmd.cc:765 msgid " -x, --xboard start in engine mode\n" msgstr " -x, --xboard покреће Ñе у ређиму машине\n" #: src/frontend/cmd.cc:767 msgid " -p, --post start up showing thinking\n" msgstr " -p, --post почиње показујући размишљања\n" #: src/frontend/cmd.cc:769 msgid " -e, --easy disable thinking in opponents time\n" msgstr " -e, --easy иÑкључује размишљање у току противничког времена\n" #: src/frontend/cmd.cc:771 msgid " -m, --manual enable manual mode\n" msgstr " -m, --manual укључује ручни режим\n" #: src/frontend/cmd.cc:773 msgid "" " -u, --uci enable UCI protocol (externally behave as UCI engine)\n" msgstr "" " -u, --uci укључује УЦИ протокол (Ñпоља Ñе понаша као УЦИ машина)\n" #: src/frontend/cmd.cc:775 msgid " -M size, --memory=size specify memory usage in MB for hashtable\n" msgstr "" " -M величина, --memory=величина наводи коришћење меморије у " "MB за хеш табелу\n" #: src/frontend/cmd.cc:777 msgid "" " -a filename, --addbook=filename compile book.bin from pgn book " "'filename'\n" msgstr "" " -a назив датотеке, --addbook=назив датотеке преводи „book.bin“ из „назива " "датотеке“ пгн књиге\n" #: src/frontend/cmd.cc:779 msgid " -g, --graphic enable graphic mode\n" msgstr "" " -g, --graphic укључује графички режим\n" #: src/frontend/cmd.cc:783 msgid "" " Options xboard and post are accepted without leading dashes\n" " for backward compatibility.\n" "\n" msgstr "" " Опције „xboard“ и „post“ Ñу прихваћене без водећих цртица\n" " зарад ÑаглаÑноÑти Ñа Ñтаријим издањима.\n" "\n" #: src/frontend/cmd.cc:787 msgid "" " Moves are accepted either in standard algebraic notation (SAN) or\n" " in coordinate algebraic notation.\n" "\n" msgstr "" " Потези Ñе прихватају и у Ñтандардном алгебарÑком предÑтављању (СÐП)\n" " или у координатном алгебарÑком предÑтављању.\n" "\n" #: src/frontend/cmd.cc:791 msgid "" " The file 'gnuchess.ini' allows setting config options. See\n" " 'info gnuchess' for details. The file will be looked up in the current\n" " directory or, if not found there, in the directory pointed to by\n" " environment variable GNUCHESS_PKGDATADIR.\n" "\n" msgstr "" " Датотека „gnuchess.ini“ омогућава поÑтављање опција подешавања. Видите\n" " „info gnuchess“ за појединоÑти. Датотека ће бити потражена у текућем\n" " директоријуму или, ако је тамо нема, у директоријуму на који указује\n" " променљива окружења „GNUCHESS_PKGDATADIR“.\n" "\n" #: src/frontend/cmd.cc:797 msgid "" "Report bugs to .\n" "\n" msgstr "Пријавите грешке на .\n" #: src/frontend/cmd.cc:844 src/frontend/cmd.cc:1280 #, c-format msgid "Invalid move: %s\n" msgstr "ÐеиÑправан потез: %s\n" #: src/frontend/cmd.cc:862 #, c-format msgid "Command 'white' is currently not supported.\n" msgstr "Ðаредба „white“ тренутно није подржана.\n" #: src/frontend/cmd.cc:893 #, c-format msgid "My rating = %d\n" msgstr "Мој плаÑман = %d\n" #: src/frontend/cmd.cc:894 #, c-format msgid "Opponent rating = %d\n" msgstr "ПлаÑман противника = %d\n" #: src/frontend/cmd.cc:896 msgid "time" msgstr "време" #: src/frontend/cmd.cc:898 msgid "moves" msgstr "потези" #: src/frontend/cmd.cc:903 src/frontend/cmd.cc:910 src/frontend/cmd.cc:919 #: src/frontend/cmd.cc:928 #, c-format msgid "No. of moves generated = %ld\n" msgstr "Бр. направљених потеза = %ld\n" #: src/frontend/cmd.cc:932 #, c-format msgid "Command 'show eval/score' is currently not supported.\n" msgstr "Ðаредба „show eval/score“ тренутно није подржана.\n" #: src/frontend/cmd.cc:939 #, c-format msgid "Command 'show pin' is currently not supported.\n" msgstr "Ðаредба „show pin“ тренутно није подржана.\n" #: src/frontend/cmd.cc:951 #, c-format msgid "Command 'test' is currently not supported.\n" msgstr "Ðаредба „test“ тренутно није подржана.\n" #: src/frontend/cmd.cc:969 msgid " Quits the program." msgstr " Излази из програма." #: src/frontend/cmd.cc:971 msgid " In analysis mode this stops analysis, otherwise it quits the program." msgstr "" " У режиму анализирања зауÑтавља анализирање, у Ñупротном излази из програма." #: src/frontend/cmd.cc:973 msgid " Produces a help blurb corresponding to this list of commands." msgstr " Приказује помоћ која одговара овом ÑпиÑку наредби." #: src/frontend/cmd.cc:975 msgid " add - compiles book.bin from a pgn book file" msgstr " add — преводи „book.bin“ из датотеке пгн књиге" #: src/frontend/cmd.cc:976 msgid " on - enables use of book (default)" msgstr " on — укључује коришћење књиге (подразумевано)" #: src/frontend/cmd.cc:977 msgid " off - disables use of book" msgstr " off иÑкључује коришћење књиге" #: src/frontend/cmd.cc:978 msgid " worst - plays worst move from book" msgstr " worst — игра најгори потез из књиге" #: src/frontend/cmd.cc:979 msgid " best - plays best move from book" msgstr " best — игра најбољи потез из књиге" #: src/frontend/cmd.cc:980 msgid " prefer - same as 'book on' (default)" msgstr " prefer — иÑто као „book on“ (подразумевано)" #: src/frontend/cmd.cc:981 msgid " random - plays any move from book" msgstr " random — игра било који потез из књиге" #: src/frontend/cmd.cc:983 msgid " Prints out the version of this program." msgstr " ИÑпиÑује издање овог програма." #: src/frontend/cmd.cc:986 msgid " Backs up one move in pgn loaded game." msgstr " Прави резерву једног потеза у пгн учитаној игри." #: src/frontend/cmd.cc:988 msgid " Saves the game so far from memory to the file." msgstr " Чува игру из меморије у датотеку." #: src/frontend/cmd.cc:990 msgid " Loads the game in the file into memory." msgstr " Учитава игру из датотеке у меморију." #: src/frontend/cmd.cc:992 msgid "" " Loads the game in the file into memory, and enables\n" " the commands 'first', 'last', 'next', 'previous'." msgstr "" " Учитава игру у датотеци у меморију, и укључује\n" " наредбе „first“, „last“, „next“, „previous“." #: src/frontend/cmd.cc:996 msgid " Advances one move in pgn loaded game." msgstr " Ðапредује један потез у пгн учитаној игри." #: src/frontend/cmd.cc:998 msgid " Goes to begin position of pgn loaded game." msgstr " Иде на почетни положај пгн учитане игре." #: src/frontend/cmd.cc:1000 msgid " Goes to end position of pgn loaded game." msgstr " Иде на крајњи положај пгн учитане игре." #: src/frontend/cmd.cc:1003 msgid "" " Makes the program stop moving. You may now enter moves\n" " to reach some position in the future." msgstr "" " Чини да програм преÑтане да Ñе креће. Сада можете да унеÑете\n" " потезе да доÑтигнете неки будући положај." #: src/frontend/cmd.cc:1007 msgid " Program plays white." msgstr " Програм игра белог." #: src/frontend/cmd.cc:1009 msgid " Program plays black." msgstr " Програм игра црног." #: src/frontend/cmd.cc:1011 msgid "" " Computer takes whichever side is on move and begins its\n" " thinking immediately." msgstr "" " Рачунар заузима Ñтрану онога ко је на потезу и одмах\n" " започиње његово размишљање." #: src/frontend/cmd.cc:1014 msgid "" " Arranges for verbose thinking output showing variation, score,\n" " time, depth, etc." msgstr "" " Ређа за излаз опширног размишљања приказујући промене, резултат,\n" " време, дубину, итд." #: src/frontend/cmd.cc:1017 msgid " Turns off verbose thinking output." msgstr " ИÑкључује излаз опширног размишљања." #: src/frontend/cmd.cc:1019 msgid "" " Lets you input your name. Also writes the log.nnn and\n" " corresponding game.nnn files. For details please see\n" " the auxiliary file format sections." msgstr "" " Даје вам да унеÑете ваше име. Такође пише „log.nnn“\n" " и одговарајућу „game.nnn“ датотеку. За појединоÑти\n" " погледајте одељке обликовања помоћне датотеке." #: src/frontend/cmd.cc:1023 msgid " Mostly used by Internet Chess Server." msgstr " Углавном га кориÑти Интернет шаховÑки Ñервер." #: src/frontend/cmd.cc:1025 msgid "" " This command reactivates a game that has been terminated automatically\n" " due to checkmate or no more time on the clock. However, it does not\n" " alter those conditions. So you would have to undo a move or two, or\n" " add time to the clock with 'level' or 'time'." msgstr "" " Ова наредба поново покреће игру која је ÑамоÑтално завршена уÑлед\n" " шах-мата или због недоÑтатка времена на Ñату. Међутим, не мења ове\n" " уÑлове. Моћи ћете да поништите потез или два или да додате време на\n" " Ñату помоћу „level“ или „time“." #: src/frontend/cmd.cc:1030 msgid " Inputs the estimated rating for computer and for its opponent." msgstr " УноÑи процењени плаÑман за рачунар и за његовог противника." #: src/frontend/cmd.cc:1032 msgid " Sets up a new game (i.e. pieces in original positions)." msgstr " Подешава нову игру (тј. фигуре на почетне положаје)." #: src/frontend/cmd.cc:1034 msgid "" " Inputs time left in game for computer in hundredths of a second.\n" " Mostly used by Internet Chess Server." msgstr "" " УноÑи преоÑтало време у игри за рачунар у Ñтотинкама Ñекунде.\n" " Углавном га кориÑти Интернет шаховÑки Ñервер." #: src/frontend/cmd.cc:1037 msgid " on - enables using the memory hash table to speed up search" msgstr " on — укључује коришћење хеш табеле меморије да убрза претрагу" #: src/frontend/cmd.cc:1038 msgid " off - disables the memory hash table" msgstr " off — иÑкључује хеш табелу меморије" #: src/frontend/cmd.cc:1040 msgid " Sets the hash table to permit storage of N MB." msgstr " Подешава хеш табелу да дозволи Ñкладиштење N MB." #: src/frontend/cmd.cc:1042 msgid " on - enables using the null-move heuristic to speed up search" msgstr " on — укључује коришћење откривања ништавног потеза да убрза претрагу" #: src/frontend/cmd.cc:1043 msgid " off - disables using the null-move heuristic" msgstr " off — иÑкључује коришћење откривања ништавног потеза" #: src/frontend/cmd.cc:1045 msgid " on - enables use of xboard/winboard" msgstr " on — укључује коришћење „xboard/winboard“-а" #: src/frontend/cmd.cc:1046 msgid " off - disables use of xboard/winboard" msgstr " off — иÑкључује коришћење „xboard/winboard“-а" #: src/frontend/cmd.cc:1048 msgid "" " Sets the program to look N ply (half-moves) deep for every\n" " search it performs. If there is a checkmate or other condition\n" " that does not allow that depth, then it will not be." msgstr "" " Подешава програм да тражи дубину N игре (пола потеза) за Ñваку\n" " претрагу коју обавља. Ðко је дошло до шах-мата или другог уÑлова\n" " који не дозвољава ту дубину, онда га неће бити." #: src/frontend/cmd.cc:1052 msgid "" " Sets time control to be MOVES in MINUTES, with each move giving\n" " an INCREMENT (in seconds, i.e. a Fischer-style clock)." msgstr "" " Подешава управљање временом на ПОТЕЗРу МИÐУТИМÐ, Ñа Ñваким потезом\n" " који даје ПОВЕЋÐЊЕ (у Ñекундама, тј. Ñат у Фишеровом Ñтилу)." #: src/frontend/cmd.cc:1056 msgid " Loads a position in EPD format from disk into memory." msgstr " Учитава положај у ЕПД запиÑу Ñа диÑка у меморију." #: src/frontend/cmd.cc:1059 msgid " Saves game position into EPD format from memory to disk." msgstr " Чува положај игре у ЕПД запиÑу Ñа меморије на диÑк." #: src/frontend/cmd.cc:1061 msgid " Switches side to move." msgstr " Пребацује Ñтране за потез." #: src/frontend/cmd.cc:1064 msgid " Solves the positions in FILENAME." msgstr " Решава положаје у ÐÐЗИВУДÐТОТЕКЕ." #: src/frontend/cmd.cc:1066 msgid " Backs up two moves in game history." msgstr " Прави резерву два потеза у иÑторијату игре." #: src/frontend/cmd.cc:1068 msgid " Backs up one move in game history." msgstr " Прави резерву једног потеза у иÑторијату игре." #: src/frontend/cmd.cc:1070 msgid " Displays command line syntax." msgstr " Приказује ÑинтакÑу линије наредби." #: src/frontend/cmd.cc:1072 msgid " board - displays the current board" msgstr " board — приказује текућу таблу" #: src/frontend/cmd.cc:1073 msgid " time - displays the time settings" msgstr " time — приказује подешавања времена" #: src/frontend/cmd.cc:1074 msgid " moves - shows all moves using one call to routine" msgstr " moves — показује Ñве потезе кориÑтећи један позив по рутини" #: src/frontend/cmd.cc:1075 msgid " escape - shows moves that escape from check using one call to routine" msgstr "" " escape — приказује потезе који измичу провери кориÑтећи један позив по " "рутини" #: src/frontend/cmd.cc:1076 msgid " noncapture - shows non-capture moves" msgstr " noncapture — приказује потезе који не задају шах" #: src/frontend/cmd.cc:1077 msgid " capture - shows capture moves" msgstr " capture — приказује потезе који задају шах" #: src/frontend/cmd.cc:1078 msgid " eval [or score] - shows the evaluation per piece and overall" msgstr " eval [или score] — приказује процену по фигури и укупноÑÑ‚" #: src/frontend/cmd.cc:1079 msgid " game - shows moves in game history" msgstr " game — показује потезе у иÑторијату игре" #: src/frontend/cmd.cc:1080 msgid " pin - shows pinned pieces" msgstr " pin — показује прикачене фигуре" #: src/frontend/cmd.cc:1082 msgid " movelist - reads in an epd file and shows legal moves for its entries" msgstr "" " movelist — чита у епд датотеци и показује иÑправне потезе за њене уноÑе" #: src/frontend/cmd.cc:1083 msgid "" " capture - reads in an epd file and shows legal captures for its entries" msgstr "" " capture — чита у епд датотеци и показује иÑправне потезе који задају шах за " "њене уноÑе" #: src/frontend/cmd.cc:1084 msgid " movegenspeed - tests speed of move generator" msgstr " movegenspeed — иÑпробава брзину творца потеза" #: src/frontend/cmd.cc:1085 msgid " capturespeed - tests speed of capture move generator" msgstr " capturespeed — иÑпробава брзину творца потеза који задају шах" #: src/frontend/cmd.cc:1086 msgid " eval - reads in an epd file and shows evaluation for its entries" msgstr " eval — чита у епд датотеци и показује процене за њене уноÑе" #: src/frontend/cmd.cc:1087 msgid " evalspeed - tests speed of the evaluator" msgstr " evalspeed — иÑпробава брзину процењивача" #: src/frontend/cmd.cc:1089 msgid " Shows moves from opening book." msgstr " Показује потезе из отворене књиге." #: src/frontend/cmd.cc:1091 msgid " Enables display board in graphic mode." msgstr " Укључује приказ табле у графичком режиму." #: src/frontend/cmd.cc:1093 msgid " Disables graphic mode and display classical view." msgstr " ИÑкључује графички режим и приказује клаÑичан преглед." #: src/frontend/cmd.cc:1119 #, c-format msgid "" "Help for command %s not found\n" "\n" msgstr "" "ÐиÑам пронашао помоћ за наредбу „%s“\n" "\n" #: src/frontend/cmd.cc:1121 #, c-format msgid "List of commands: (help COMMAND to get more help)\n" msgstr "СпиÑак наредби: (помоћ ÐÐРЕДБРза више помоћи)\n" #: src/frontend/engine.cc:247 msgid "Black" msgstr "" #: src/frontend/engine.cc:247 msgid "White" msgstr "" #: src/frontend/engine.cc:333 #, c-format msgid "" "\n" "My move is : %s\n" msgstr "" #~ msgid " an INCREMENT (in seconds, i.e. Fischer-style clock)." #~ msgstr " ПОВЕЋÐЊЕ (у Ñекундама, тј. Ñат у Фишеровом Ñтилу)." gnuchess-6.2.2/po/stamp-po000644 000766 000024 00000000012 12610434565 016253 0ustar00antoniostaff000000 000000 timestamp gnuchess-6.2.2/po/uk.gmo000644 000766 000024 00000057126 12610434564 015734 0ustar00antoniostaff000000 000000 Þ•ŽŒ¿üø ù û  C- Mq 7¿ (÷ / 'P .x 7§ Jß 9*)d&ŽRµ#&,$SOx2Èû'+B)nF˜?ßh‘ˆ6gQ(¹^â&Agh[Ð(,>U”ªÀ9Ô//>±nx 8™Ò"òò- #!-E!s#•H¹5!FWAž=à)#H-lFš2á%%:`&|-£#Ñ$õ<>W–%±"×"ú#AG/X,ˆ-µ6ã/-J+x,¤÷Ñ.É ø "!!4! V!w!’!¬!½!Í!í!"6"O"b"2t"§"Ç"×"%ë"#$#B#_#{##¥# ¿#É#)â# $$51$ g$$t$™$±$>·$ö$%%)%=%P%%V%,|%)©%)Ó%ý%&((.+(°Z(Š ){–)E*WX*?°*[ð*lL+“¹+gM,Bµ,nø,Íg-Z5.r.Z/Ä^/‹#0W¯0I1qQ1mÃ1‹12g½2è%34u 5Œ–5@#6Ád6f&7Ö7ªd8B9lR9*¿9(ê90:oD:V´:X ;Ed;ݪ<sˆ=@ü=S=><‘>üÎ>ÚË@C¦BNêBF9CE€CÆC6VDcD›ñDpEkþEYjF8ÄFOýFŽMGrÜG9OH[‰HNåH>4I]sIZÑI;,J…hJ‡îJ4vK;«KJçK22LGeL ­L3¸LzìLwgMxßMXNzÚNxUOvÎOwEP½P|ÆRMCSU‘S<çS/$T0TT2…T%¸T'ÞTAU9HU"‚U\¥U,V"/VlRV[¿VW17W?iW=©W2çWAXC\X; X'ÜXNYSYhYW}YÕY"ïYlZZD–Z4ÛZ[m[X‡[;à[=\ZZ\Xµ\]C]M[]P©]Tú]O^KŽ PH->+„!'Y/(.Z xN†‚^‹5a|fer@cB~bvn?pRS&)zD\*m, ;1$`s_ƒ%‡A4Tq9dW€Q=jˆ<Љwh]U3V8o kEIL6g…GtF{":XJŒ C0O7M#}uy2l[i My move is : %s --silent same as -q -M size, --memory=size specify memory usage in MB for hashtable -a filename, --addbook=filename compile book.bin from pgn book 'filename' -e, --easy disable thinking in opponents time -g, --graphic enable graphic mode -h, --help display this help and exit -m, --manual enable manual mode -p, --post start up showing thinking -q, --quiet make the program silent on startup -u, --uci enable UCI protocol (externally behave as UCI engine) -v, --version display version information and exit -x, --xboard start in engine mode Advances one move in pgn loaded game. Arranges for verbose thinking output showing variation, score, time, depth, etc. Backs up one move in game history. Backs up one move in pgn loaded game. Backs up two moves in game history. Computer takes whichever side is on move and begins its thinking immediately. Disables graphic mode and display classical view. Displays command line syntax. Enables display board in graphic mode. Goes to begin position of pgn loaded game. Goes to end position of pgn loaded game. In analysis mode this stops analysis, otherwise it quits the program. Inputs the estimated rating for computer and for its opponent. Inputs time left in game for computer in hundredths of a second. Mostly used by Internet Chess Server. Lets you input your name. Also writes the log.nnn and corresponding game.nnn files. For details please see the auxiliary file format sections. Loads a position in EPD format from disk into memory. Loads the game in the file into memory, and enables the commands 'first', 'last', 'next', 'previous'. Loads the game in the file into memory. Makes the program stop moving. You may now enter moves to reach some position in the future. Mostly used by Internet Chess Server. Moves are accepted either in standard algebraic notation (SAN) or in coordinate algebraic notation. Options xboard and post are accepted without leading dashes for backward compatibility. Prints out the version of this program. Produces a help blurb corresponding to this list of commands. Program plays black. Program plays white. Quits the program. Saves game position into EPD format from memory to disk. Saves the game so far from memory to the file. Sets the hash table to permit storage of N MB. Sets the program to look N ply (half-moves) deep for every search it performs. If there is a checkmate or other condition that does not allow that depth, then it will not be. Sets time control to be MOVES in MINUTES, with each move giving an INCREMENT (in seconds, i.e. a Fischer-style clock). Sets up a new game (i.e. pieces in original positions). Shows moves from opening book. Solves the positions in FILENAME. Switches side to move. The file 'gnuchess.ini' allows setting config options. See 'info gnuchess' for details. The file will be looked up in the current directory or, if not found there, in the directory pointed to by environment variable GNUCHESS_PKGDATADIR. This command reactivates a game that has been terminated automatically due to checkmate or no more time on the clock. However, it does not alter those conditions. So you would have to undo a move or two, or add time to the clock with 'level' or 'time'. Turns off verbose thinking output. add - compiles book.bin from a pgn book file best - plays best move from book board - displays the current board capture - reads in an epd file and shows legal captures for its entries capture - shows capture moves capturespeed - tests speed of capture move generator escape - shows moves that escape from check using one call to routine eval - reads in an epd file and shows evaluation for its entries eval [or score] - shows the evaluation per piece and overall evalspeed - tests speed of the evaluator game - shows moves in game history movegenspeed - tests speed of move generator movelist - reads in an epd file and shows legal moves for its entries moves - shows all moves using one call to routine noncapture - shows non-capture moves off - disables the memory hash table off - disables use of book off - disables use of xboard/winboard off - disables using the null-move heuristic on - enables use of book (default) on - enables use of xboard/winboard on - enables using the memory hash table to speed up search on - enables using the null-move heuristic to speed up search pin - shows pinned pieces prefer - same as 'book on' (default) random - plays any move from book time - displays the time settings worst - plays worst move from bookBlackBoard is wrong! Command 'activate' is currently not supported. Command 'black' is currently not supported. Command 'random' is currently not supported. Command 'show eval/score' is currently not supported. Command 'show pin' is currently not supported. Command 'switch' is currently not supported. Command 'test' is currently not supported. Command 'white' is currently not supported. Copyright (C) %s Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Could not create logfile, all slots occupied. Error reading file '%s' Failed to open %s for writing: %s File name is too long (max = %d) Fischer increment of %d seconds Graphic mode is disabled. Graphic mode is enabled. Hashing is off. Hashing is on. Help for command %s not found Incorrect book option Incorrect epd file Initial position reached. There are no earlier moves. Invalid filename. Invalid move: %s List of commands: (help COMMAND to get more help) Memory out of Range or Invalid My rating = %d New TimeLimit = %g No more moves. Game reached the end. No moves to undo! No. of moves generated = %ld Null-move heuristic is off. Null-move heuristic is on. Old TimeLimit = %g Opponent rating = %d Option Processing Failed Options: Play the game of chess Report bugs to . Save to %s Search to a depth of %d The syntax to add a new book is: book add file.pgn Thinking... Time Control: %d moves in %.2f secs Usage: %s [OPTION]... WhiteYou may consider deleting or renaming your existing logfiles. book is now best book is now off book is now on book is now random book is now worst movesmy rating = %d, opponent rating = %d name - list known players alphabetically reverse - list by GNU worst result first score - list by GNU best result first timeProject-Id-Version: gnuchess 6.2.2-rc1 Report-Msgid-Bugs-To: bug-gnu-chess@gnu.org POT-Creation-Date: 2015-10-17 14:05+0200 PO-Revision-Date: 2015-09-15 15:56+0300 Last-Translator: Yuri Chornoivan Language-Team: Ukrainian Language: uk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2); X-Generator: Lokalize 1.5 Мій хід: %s --silent те Ñаме, що Ñ– -q -M розмір, --memory=розмір вказати об’єм пам’Ñті у МБ, Ñкий можна викориÑтовувати Ð´Ð»Ñ Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ– хешів -a файл, --addbook=файл Ñтворити book.bin на оÑнові вказаного файла збірника pgn -e, --easy вимкнути Ð¾Ð±Ð¼Ñ–Ñ€ÐºÐ¾Ð²ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ð¾Ð·Ð¸Ñ†Ñ–Ñ— під Ñ‡Ð°Ñ Ñ…Ð¾Ð´Ñƒ Ñуперника -g, --graphic увімкнути графічний режим -h, --help вивеÑти довідку та завершити роботу -m, --manual увімкнути ручний режим -p, --post запуÑк з показом Ð¾Ð±Ð¼Ñ–Ñ€ÐºÐ¾Ð²ÑƒÐ²Ð°Ð½Ð½Ñ Ñ…Ð¾Ð´Ñ–Ð² -q, --quiet не виводити повідомлень піÑÐ»Ñ Ð·Ð°Ð¿ÑƒÑку програми -u, --uci увімкнути протокол UCI (виводити дані до інтерфейÑу у форматі Ñ€ÑƒÑˆÑ–Ñ UCI) -v, --version показати дані щодо верÑÑ–Ñ— Ñ– завершити роботу -x, --xboard запуÑтити у режимі Ñ€ÑƒÑˆÑ–Ñ ÐŸÐµÑ€ÐµÑ…Ð¾Ð´Ð¸Ñ‚ÑŒ до наÑтупного ходу у завантаженій з файла pgn грі. Переводить програму у режим показу даних щодо аналізу: варіанти, оцінки, чаÑ, глибина Ð¾Ð¿Ñ€Ð°Ñ†ÑŽÐ²Ð°Ð½Ð½Ñ Ð¿Ð¾Ð·Ð¸Ñ†Ñ–Ñ— тощо. Повертає позиції на один хід назад у журналі гри. Переходить до попереднього ходу у завантаженій з файла pgn грі. Повертає позиції на два ходи назад у журналі гри. Комп’ютер переходить на бік гравцÑ, Ñкий має право ходу Ñ– починає негайно обмірковувати хід цього гравцÑ. Вимикає графічний режим Ñ– перемикає програму на клаÑичний режим переглÑду. Показує довідку щодо ÑинтакÑиÑу Ñ€Ñдка команди. Вмикає показ дошки у графічному режимі. Переходить до початкової позиції завантаженої з файла pgn гри. Переходить до кінцевої позиції завантаженої з файла pgn гри. У режимі аналізу припинÑÑ” аналіз, у інших режимах завершує роботу програми. Ð’Ð²ÐµÐ´ÐµÐ½Ð½Ñ Ð¾Ñ†Ñ–Ð½ÐºÐ¸ рейтингу комп’ютера та його Ñуперника. Ð’Ð²ÐµÐ´ÐµÐ½Ð½Ñ Ñ‡Ð°Ñу на залишок гри Ð´Ð»Ñ ÐºÐ¾Ð¼Ð¿â€™ÑŽÑ‚ÐµÑ€Ð° у Ñотих чаÑтинах Ñекунди. Здебільшого викориÑтовуєтьÑÑ Ð´Ð»Ñ Ñ€Ð¾Ð±Ð¾Ñ‚Ð¸ з Internet Chess Server. Ðадає вам змогу ввеÑти позицію. Виконує Ð·Ð°Ð¿Ð¸Ñ Ð´Ð°Ð½Ð¸Ñ… до файлів log.nnn та game.nnn. Докладніший Ð¾Ð¿Ð¸Ñ Ð¼Ð¾Ð¶Ð½Ð° знайти у розділах щодо формату допоміжного файла. Завантажує позицію у форматі EPD з диÑка до оперативної пам’Ñті. Завантажує гру з файла до пам’Ñті Ñ– вмикає команди «first», «last», «next», «previous». Завантажує гру з файла до пам’Ñті. ЗаборонÑÑ” програмі виконувати ходи. ПіÑÐ»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ ви можете вводити ходи, аж до доÑÑÐ³Ð½ÐµÐ½Ð½Ñ Ð¿ÐµÐ²Ð½Ð¾Ñ— позиції. Здебільшого викориÑтовуєтьÑÑ Ð´Ð»Ñ Ñ€Ð¾Ð±Ð¾Ñ‚Ð¸ з Internet Chess Server. Ходи можна вказувати або у Ñтандартних алгебраїчних позначеннÑÑ… (SAN), або у координатних алгебраїчних позначеннÑÑ…. Параметри xboard та post можна вказувати без похилих риÑок на початку Ð´Ð»Ñ Ð·Ð²Ð¾Ñ€Ð¾Ñ‚Ð½Ð¾Ñ— ÑуміÑноÑті. Виводить дані щодо верÑÑ–Ñ— програми. Виводить довідкове Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ñ‰Ð¾Ð´Ð¾ цього ÑпиÑку команд. Програма грає чорними. Програма грає білими. Завершує роботу програми. Зберігає позицію у форматі EPD з оперативної пам’Ñті на диÑк. Зберігає дані поточної гри у пам’Ñті до файла. Ð’Ñтановлює граничний розмір таблиці хешів у МБ. Ð’Ñтановлює глибину пошуку Ð´Ð»Ñ Ð¿Ñ€Ð¾Ð³Ñ€Ð°Ð¼Ð¸ у вказану кількіÑть напівходів. Якщо Ñ–Ñнує мат або інша гранична позиціÑ, Ñка не дозволÑÑ” подібний пошук, Ð¾Ð±Ð¼ÐµÐ¶ÐµÐ½Ð½Ñ Ð½Ðµ буде заÑтоÑовано. Ð’Ñтановлює контроль чаÑу у вказаній кількоÑті ходів на вказану кількіÑть Ñекунд з кожним ходом (тобто годинник Фішера). Ðалаштовує нову гру (розташовує фігури у початкових позиціÑÑ…). Показує ходи Ð´Ð»Ñ Ð·Ð±Ñ–Ñ€Ð½Ð¸ÐºÐ° дебютів. Розв’Ñзує позиції у файлі з вказаною назвою. Перемикає гравцÑ, Ñкий ходитиме. За допомогою файла «gnuchess.ini» можна визначати параметри налаштуваннÑ. Докладніший Ð¾Ð¿Ð¸Ñ Ð¼Ð¾Ð¶Ð½Ð° отримати за допомогою команди «info gnuchess». Програма шукатиме файл або у поточному каталозі, або, Ñкщо його там не буде знайдено, у каталозі, на Ñкий вказує змінна Ñередовища GNUCHESS_PKGDATADIR. За допомогою цієї команди можна активувати гру, Ñку було автоматично перервано через мат або Ð²Ð¸Ñ‡ÐµÑ€Ð¿Ð°Ð½Ð½Ñ Ð¾Ð±Ð¼ÐµÐ¶ÐµÐ½Ð½Ñ Ð·Ð° чаÑом. Втім, команда не знімає обмежень. Отже, вам доведетьÑÑ ÑкаÑувати один чи два ходи або додати чаÑу за допомогою команди «level» або «time». Вимикає режим докладного виведеннÑ. add - збирає book.bin на оÑнові файла збірника pgn best - виконує найкращий хід зі збірника board - показує поточну позицію на дошці capture - виконує Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ð° epd Ñ– показує можливі взÑÑ‚Ñ‚Ñ Ð½Ð° оÑнові його запиÑів capture - показує ходи зі взÑттÑм capturespeed - теÑтує швидкіÑть генератора ходів зі взÑттÑм escape - показує ходи, Ñкі не пройшли перевірки за допомогою одного виклику підпрограми eval - виконує Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ð° epd Ñ– показує оцінку запиÑів у ньому eval [або score] - показує оцінку за фігурами та загальну оцінку evalspeed - теÑтує швидкіÑть заÑобу Ð¾Ñ†Ñ–Ð½ÑŽÐ²Ð°Ð½Ð½Ñ Ñ…Ð¾Ð´Ñ–Ð² game - показує ходи у журналі гри movegenspeed - теÑтує швидкіÑть генератора ходів movelist - виконує Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ð° epd Ñ– показує коректні ходи на оÑнові його запиÑів moves - показує уÑÑ– ходи за допомогою одного виклику підпрограми noncapture - показує ходи без взÑÑ‚Ñ‚Ñ off - вимикає викориÑÑ‚Ð°Ð½Ð½Ñ Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ– хешів у пам’Ñті off - вимикає викориÑÑ‚Ð°Ð½Ð½Ñ Ð·Ð±Ñ–Ñ€Ð½Ð¸ÐºÐ° дебютів off - вимикає викориÑÑ‚Ð°Ð½Ð½Ñ xboard/winboard off - вимикає викориÑÑ‚Ð°Ð½Ð½Ñ ÐµÐ²Ñ€Ð¸Ñтики нульового ходу on - вмикає викориÑÑ‚Ð°Ð½Ð½Ñ Ð·Ð±Ñ–Ñ€Ð½Ð¸ÐºÐ° дебютів (типово) on - вмикає викориÑÑ‚Ð°Ð½Ð½Ñ xboard/winboard on - вмикає викориÑÑ‚Ð°Ð½Ð½Ñ Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ– хешів у пам’Ñті Ð´Ð»Ñ Ð¿Ñ€Ð¸ÑˆÐ²Ð¸Ð´ÑˆÐµÐ½Ð½Ñ Ð¿Ð¾ÑˆÑƒÐºÑƒ on - вмикає викориÑÑ‚Ð°Ð½Ð½Ñ ÐµÐ²Ñ€Ð¸Ñтики нульового ходу Ð´Ð»Ñ Ð¿Ñ€Ð¸ÑˆÐ²Ð¸Ð´ÑˆÐµÐ½Ð½Ñ Ð¿Ð¾ÑˆÑƒÐºÑƒ pin - показує зв’Ñзані фігури prefer - те Ñаме, що Ñ– «book on» (типово) random - виконує випадковий хід зі збірника time - показує параметри чаÑу worst - виконує найгірший хід зі збірникаЧорніПомилкова Ð¿Ð¾Ð·Ð¸Ñ†Ñ–Ñ Ð½Ð° дошці! У поточному режимі роботи програми команди «activate» не передбачено. У поточному режимі роботи програми команди «black» не передбачено. У поточному режимі роботи програми команди «random» не передбачено. У поточному режимі роботи програми команди «show eval/score» не передбачено. У поточному режимі роботи програми команди «show pin» не передбачено. У поточному режимі роботи програми команди «switch» не передбачено. У поточному режимі роботи програми команди «test» не передбачено. У поточному режимі роботи програми команди «white» не передбачено. ÐвторÑькі права належать Free Software Foundation, Inc., %s Умови Ð»Ñ–Ñ†ÐµÐ½Ð·ÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ð¸ÐºÐ»Ð°Ð´ÐµÐ½Ð¾ у GPLv3+: GNU GPL верÑÑ–Ñ— 3 або новішій, Це вільне програмне забезпеченнÑ: ви можете вільно змінювати Ñ– поширювати його. Вам не надаєтьÑÑ Ð–ÐžÐ”ÐИХ ГÐРÐÐТІЙ, окрім гарантій передбачених законодавÑтвом. Ðе вдалоÑÑ Ñтворити файл журналу, уÑÑ– можливі запиÑи вже заповнено. Помилка під Ñ‡Ð°Ñ Ñпроби прочитати файл «%s» Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ %s Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸ÑÑƒÐ²Ð°Ð½Ð½Ñ Ð´Ð°Ð½Ð¸Ñ…: %s Файл Ñ” надто довгим (макÑимум = %d) ПриріÑÑ‚ Фішера у %d Ñекунд Графічний режим вимкнено. Графічний режим увімкнено. Ð¥ÐµÑˆÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ð¸Ð¼ÐºÐ½ÐµÐ½Ð¾. Ð¥ÐµÑˆÑƒÐ²Ð°Ð½Ð½Ñ ÑƒÐ²Ñ–Ð¼ÐºÐ½ÐµÐ½Ð¾. Довідки щодо команди %s не знайдено Ðекоректний параметр збірника Помилковий файл epd Початкова позиціÑ. Попередніх ходів більше немає. Ðекоректна назва файла. Ðекоректний хід: %s СпиÑок команд: (help КОМÐÐДÐ, щоб отримати додаткову довідку) Пам’Ñть поза припуÑтимими межами або некоректна Ваш рейтинг = %d Ðове Ð¾Ð±Ð¼ÐµÐ¶ÐµÐ½Ð½Ñ Ð·Ð° чаÑом = %g Більше ходів немає. Гру завершено. Ðемає ходів, Ñкі можна ÑкаÑувати! К-ть згенерованих ходів = %ld ЕвриÑтику нульового ходу вимкнено. ЕвриÑтику нульового ходу увімкнено. Попереднє Ð¾Ð±Ð¼ÐµÐ¶ÐµÐ½Ð½Ñ Ð·Ð° чаÑом = %g Рейтинг Ñуперника = %d Помилка під Ñ‡Ð°Ñ Ñпроби обробити параметри Параметри: Гра у шахи Про вади повідомлÑйте за адреÑою . Зберегти до %s Пошук з глибиною %d СинтакÑÐ¸Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð¸ Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ Ð½Ð¾Ð²Ð¾Ð³Ð¾ збірника: book add файл.pgn Обдумуємо... ÐšÐµÑ€ÑƒÐ²Ð°Ð½Ð½Ñ Ñ‡Ð°Ñом: %d ходів за %.2f Ñекунд КориÑтуваннÑ: %s [ПÐРÐМЕТР]... БіліВам варто вилучити або перейменувати наÑвні файли журналу. тепер зі збірника вибиратиметьÑÑ Ð½Ð°Ð¹ÐºÑ€Ð°Ñ‰Ð¸Ð¹ хід викориÑÑ‚Ð°Ð½Ð½Ñ Ð·Ð±Ñ–Ñ€Ð½Ð¸ÐºÐ° вимкнено викориÑÑ‚Ð°Ð½Ð½Ñ Ð·Ð±Ñ–Ñ€Ð½Ð¸ÐºÐ° увімкнено тепер зі збірника вибиратиметьÑÑ Ð²Ð¸Ð¿Ð°Ð´ÐºÐ¾Ð²Ð¸Ð¹ хід тепер зі збірника вибиратиметьÑÑ Ð½Ð°Ð¹Ð³Ñ–Ñ€ÑˆÐ¸Ð¹ хід ходиваш рейтинг = %d, рейтинг Ñуперника = %d name - показати відомих гравців за абеткою reverse - вивеÑти за найгіршими результатами GNU score - Ð²Ð¸Ð²ÐµÐ´ÐµÐ½Ð½Ñ Ð·Ð° найкращими результатами GNU чаÑgnuchess-6.2.2/po/uk.po000644 000766 000024 00000071633 12610434564 015567 0ustar00antoniostaff000000 000000 # Ukrainian translation to gnuchess. # Copyright (C) 2013 Free Software Foundation, Inc. # This file is distributed under the same license as the gnuchess package. # # Yuri Chornoivan , 2013, 2015. msgid "" msgstr "" "Project-Id-Version: gnuchess 6.2.2-rc1\n" "Report-Msgid-Bugs-To: bug-gnu-chess@gnu.org\n" "POT-Creation-Date: 2015-10-17 14:05+0200\n" "PO-Revision-Date: 2015-09-15 15:56+0300\n" "Last-Translator: Yuri Chornoivan \n" "Language-Team: Ukrainian \n" "Language: uk\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "X-Generator: Lokalize 1.5\n" #: src/main.cc:317 #, c-format msgid "Memory out of Range or Invalid\n" msgstr "Пам’Ñть поза припуÑтимими межами або некоректна\n" #: src/main.cc:334 #, c-format msgid "File name is too long (max = %d)\n" msgstr "Файл Ñ” надто довгим (макÑимум = %d)\n" #: src/main.cc:340 msgid "Option Processing Failed\n" msgstr "Помилка під Ñ‡Ð°Ñ Ñпроби обробити параметри\n" #: src/main.cc:381 #, c-format msgid "" "Copyright (C) %s Free Software Foundation, Inc.\n" "License GPLv3+: GNU GPL version 3 or later \n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" msgstr "" "ÐвторÑькі права належать Free Software Foundation, Inc., %s\n" "Умови Ð»Ñ–Ñ†ÐµÐ½Ð·ÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ð¸ÐºÐ»Ð°Ð´ÐµÐ½Ð¾ у GPLv3+: GNU GPL верÑÑ–Ñ— 3 або новішій, \n" "Це вільне програмне забезпеченнÑ: ви можете вільно змінювати Ñ– поширювати " "його.\n" "Вам не надаєтьÑÑ Ð–ÐžÐ”ÐИХ ГÐРÐÐТІЙ, окрім гарантій передбачених " "законодавÑтвом.\n" #: src/main.cc:494 #, c-format msgid "Thinking...\n" msgstr "Обдумуємо...\n" #: src/frontend/cmd.cc:101 #, c-format msgid "Command 'activate' is currently not supported.\n" msgstr "" "У поточному режимі роботи програми команди «activate» не передбачено.\n" #: src/frontend/cmd.cc:131 #, c-format msgid "Command 'black' is currently not supported.\n" msgstr "У поточному режимі роботи програми команди «black» не передбачено.\n" #: src/frontend/cmd.cc:140 #, c-format msgid "" "The syntax to add a new book is:\n" "\n" "\tbook add file.pgn\n" msgstr "" "СинтакÑÐ¸Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð¸ Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ Ð½Ð¾Ð²Ð¾Ð³Ð¾ збірника:\n" "\n" "\tbook add файл.pgn\n" #: src/frontend/cmd.cc:147 #, c-format msgid "book is now on\n" msgstr "викориÑÑ‚Ð°Ð½Ð½Ñ Ð·Ð±Ñ–Ñ€Ð½Ð¸ÐºÐ° увімкнено\n" #: src/frontend/cmd.cc:150 #, c-format msgid "book is now off\n" msgstr "викориÑÑ‚Ð°Ð½Ð½Ñ Ð·Ð±Ñ–Ñ€Ð½Ð¸ÐºÐ° вимкнено\n" #: src/frontend/cmd.cc:153 #, c-format msgid "book is now best\n" msgstr "тепер зі збірника вибиратиметьÑÑ Ð½Ð°Ð¹ÐºÑ€Ð°Ñ‰Ð¸Ð¹ хід\n" #: src/frontend/cmd.cc:156 #, c-format msgid "book is now worst\n" msgstr "тепер зі збірника вибиратиметьÑÑ Ð½Ð°Ð¹Ð³Ñ–Ñ€ÑˆÐ¸Ð¹ хід\n" #: src/frontend/cmd.cc:159 #, c-format msgid "book is now random\n" msgstr "тепер зі збірника вибиратиметьÑÑ Ð²Ð¸Ð¿Ð°Ð´ÐºÐ¾Ð²Ð¸Ð¹ хід\n" #: src/frontend/cmd.cc:161 #, c-format msgid "Incorrect book option\n" msgstr "Ðекоректний параметр збірника\n" #: src/frontend/cmd.cc:174 #, c-format msgid "Search to a depth of %d\n" msgstr "Пошук з глибиною %d\n" #: src/frontend/cmd.cc:240 #, c-format msgid "Hashing is on.\n" msgstr "Ð¥ÐµÑˆÑƒÐ²Ð°Ð½Ð½Ñ ÑƒÐ²Ñ–Ð¼ÐºÐ½ÐµÐ½Ð¾.\n" #: src/frontend/cmd.cc:242 #, c-format msgid "Hashing is off.\n" msgstr "Ð¥ÐµÑˆÑƒÐ²Ð°Ð½Ð½Ñ Ð²Ð¸Ð¼ÐºÐ½ÐµÐ½Ð¾.\n" #: src/frontend/cmd.cc:268 src/frontend/cmd.cc:278 #, c-format msgid "Fischer increment of %d seconds\n" msgstr "ПриріÑÑ‚ Фішера у %d Ñекунд\n" #. TRANSLATORS: Please be aware that the word 'move' is sometimes #. used as a synonym of 'ply', and sometimes in the sense of a #. full 2-ply move. #: src/frontend/cmd.cc:276 #, c-format msgid "Time Control: %d moves in %.2f secs\n" msgstr "ÐšÐµÑ€ÑƒÐ²Ð°Ð½Ð½Ñ Ñ‡Ð°Ñом: %d ходів за %.2f Ñекунд\n" #: src/frontend/cmd.cc:286 #, c-format msgid "name - list known players alphabetically\n" msgstr "name - показати відомих гравців за абеткою\n" #: src/frontend/cmd.cc:287 #, c-format msgid "score - list by GNU best result first \n" msgstr "score - Ð²Ð¸Ð²ÐµÐ´ÐµÐ½Ð½Ñ Ð·Ð° найкращими результатами GNU\n" #: src/frontend/cmd.cc:288 #, c-format msgid "reverse - list by GNU worst result first\n" msgstr "reverse - вивеÑти за найгіршими результатами GNU\n" #: src/frontend/cmd.cc:303 src/frontend/cmd.cc:1301 #, c-format msgid "Board is wrong!\n" msgstr "Помилкова Ð¿Ð¾Ð·Ð¸Ñ†Ñ–Ñ Ð½Ð° дошці!\n" #: src/frontend/cmd.cc:309 src/frontend/cmd.cc:312 #, c-format msgid "Error reading file '%s'\n" msgstr "Помилка під Ñ‡Ð°Ñ Ñпроби прочитати файл «%s»\n" #: src/frontend/cmd.cc:378 #, c-format msgid "Failed to open %s for writing: %s\n" msgstr "Ðе вдалоÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ %s Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸ÑÑƒÐ²Ð°Ð½Ð½Ñ Ð´Ð°Ð½Ð¸Ñ…: %s\n" #: src/frontend/cmd.cc:384 #, c-format msgid "Could not create logfile, all slots occupied.\n" msgstr "Ðе вдалоÑÑ Ñтворити файл журналу, уÑÑ– можливі запиÑи вже заповнено.\n" #: src/frontend/cmd.cc:385 #, c-format msgid "You may consider deleting or renaming your existing logfiles.\n" msgstr "Вам варто вилучити або перейменувати наÑвні файли журналу.\n" #: src/frontend/cmd.cc:417 #, c-format msgid "Null-move heuristic is on.\n" msgstr "ЕвриÑтику нульового ходу увімкнено.\n" #: src/frontend/cmd.cc:419 #, c-format msgid "Null-move heuristic is off.\n" msgstr "ЕвриÑтику нульового ходу вимкнено.\n" #: src/frontend/cmd.cc:439 src/frontend/cmd.cc:466 #, c-format msgid "Incorrect epd file\n" msgstr "Помилковий файл epd\n" #: src/frontend/cmd.cc:510 #, c-format msgid "No more moves. Game reached the end.\n" msgstr "Більше ходів немає. Гру завершено.\n" #: src/frontend/cmd.cc:530 #, c-format msgid "Initial position reached. There are no earlier moves.\n" msgstr "Початкова позиціÑ. Попередніх ходів більше немає.\n" #: src/frontend/cmd.cc:586 src/frontend/cmd.cc:692 #, c-format msgid "Invalid filename.\n" msgstr "Ðекоректна назва файла.\n" #: src/frontend/cmd.cc:592 #, c-format msgid "Graphic mode is enabled.\n" msgstr "Графічний режим увімкнено.\n" #: src/frontend/cmd.cc:598 #, c-format msgid "Graphic mode is disabled.\n" msgstr "Графічний режим вимкнено.\n" #: src/frontend/cmd.cc:639 #, c-format msgid "Command 'random' is currently not supported.\n" msgstr "У поточному режимі роботи програми команди «random» не передбачено.\n" #: src/frontend/cmd.cc:647 #, c-format msgid "my rating = %d, opponent rating = %d\n" msgstr "ваш рейтинг = %d, рейтинг Ñуперника = %d\n" #: src/frontend/cmd.cc:671 src/frontend/cmd.cc:741 #, c-format msgid "No moves to undo!\n" msgstr "Ðемає ходів, Ñкі можна ÑкаÑувати!\n" #: src/frontend/cmd.cc:681 #, c-format msgid "Save to %s\n" msgstr "Зберегти до %s\n" #: src/frontend/cmd.cc:722 #, c-format msgid "Command 'switch' is currently not supported.\n" msgstr "У поточному режимі роботи програми команди «switch» не передбачено.\n" #: src/frontend/cmd.cc:728 #, c-format msgid "Old TimeLimit = %g\n" msgstr "Попереднє Ð¾Ð±Ð¼ÐµÐ¶ÐµÐ½Ð½Ñ Ð·Ð° чаÑом = %g\n" #: src/frontend/cmd.cc:730 #, c-format msgid "New TimeLimit = %g\n" msgstr "Ðове Ð¾Ð±Ð¼ÐµÐ¶ÐµÐ½Ð½Ñ Ð·Ð° чаÑом = %g\n" #: src/frontend/cmd.cc:750 #, c-format msgid "" "Usage: %s [OPTION]...\n" "\n" msgstr "" "КориÑтуваннÑ: %s [ПÐРÐМЕТР]...\n" "\n" #: src/frontend/cmd.cc:752 msgid "" "Play the game of chess\n" "\n" msgstr "" "Гра у шахи\n" "\n" #: src/frontend/cmd.cc:754 msgid "Options:\n" msgstr "Параметри:\n" #: src/frontend/cmd.cc:755 msgid " -h, --help display this help and exit\n" msgstr " -h, --help вивеÑти довідку та завершити роботу\n" #: src/frontend/cmd.cc:757 msgid " -v, --version display version information and exit\n" msgstr " -v, --version показати дані щодо верÑÑ–Ñ— Ñ– завершити роботу\n" #: src/frontend/cmd.cc:759 msgid " -q, --quiet make the program silent on startup\n" msgstr " -q, --quiet не виводити повідомлень піÑÐ»Ñ Ð·Ð°Ð¿ÑƒÑку програми\n" #: src/frontend/cmd.cc:761 msgid " --silent same as -q\n" msgstr " --silent те Ñаме, що Ñ– -q\n" #: src/frontend/cmd.cc:763 src/frontend/cmd.cc:781 msgid "\n" msgstr "\n" #: src/frontend/cmd.cc:765 msgid " -x, --xboard start in engine mode\n" msgstr " -x, --xboard запуÑтити у режимі рушіÑ\n" #: src/frontend/cmd.cc:767 msgid " -p, --post start up showing thinking\n" msgstr " -p, --post запуÑк з показом Ð¾Ð±Ð¼Ñ–Ñ€ÐºÐ¾Ð²ÑƒÐ²Ð°Ð½Ð½Ñ Ñ…Ð¾Ð´Ñ–Ð²\n" #: src/frontend/cmd.cc:769 msgid " -e, --easy disable thinking in opponents time\n" msgstr "" " -e, --easy вимкнути Ð¾Ð±Ð¼Ñ–Ñ€ÐºÐ¾Ð²ÑƒÐ²Ð°Ð½Ð½Ñ Ð¿Ð¾Ð·Ð¸Ñ†Ñ–Ñ— під Ñ‡Ð°Ñ Ñ…Ð¾Ð´Ñƒ Ñуперника\n" #: src/frontend/cmd.cc:771 msgid " -m, --manual enable manual mode\n" msgstr " -m, --manual увімкнути ручний режим\n" #: src/frontend/cmd.cc:773 msgid "" " -u, --uci enable UCI protocol (externally behave as UCI engine)\n" msgstr "" " -u, --uci увімкнути протокол UCI (виводити дані до інтерфейÑу у " "форматі Ñ€ÑƒÑˆÑ–Ñ UCI)\n" #: src/frontend/cmd.cc:775 msgid " -M size, --memory=size specify memory usage in MB for hashtable\n" msgstr "" " -M розмір, --memory=розмір вказати об’єм пам’Ñті у МБ, Ñкий можна " "викориÑтовувати Ð´Ð»Ñ Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ– хешів\n" #: src/frontend/cmd.cc:777 msgid "" " -a filename, --addbook=filename compile book.bin from pgn book " "'filename'\n" msgstr "" " -a файл, --addbook=файл Ñтворити book.bin на оÑнові вказаного " "файла збірника pgn\n" #: src/frontend/cmd.cc:779 msgid " -g, --graphic enable graphic mode\n" msgstr " -g, --graphic увімкнути графічний режим\n" #: src/frontend/cmd.cc:783 msgid "" " Options xboard and post are accepted without leading dashes\n" " for backward compatibility.\n" "\n" msgstr "" " Параметри xboard та post можна вказувати без похилих риÑок на початку\n" " Ð´Ð»Ñ Ð·Ð²Ð¾Ñ€Ð¾Ñ‚Ð½Ð¾Ñ— ÑуміÑноÑті.\n" "\n" #: src/frontend/cmd.cc:787 msgid "" " Moves are accepted either in standard algebraic notation (SAN) or\n" " in coordinate algebraic notation.\n" "\n" msgstr "" " Ходи можна вказувати або у Ñтандартних алгебраїчних позначеннÑÑ… (SAN), або\n" " у координатних алгебраїчних позначеннÑÑ….\n" "\n" #: src/frontend/cmd.cc:791 msgid "" " The file 'gnuchess.ini' allows setting config options. See\n" " 'info gnuchess' for details. The file will be looked up in the current\n" " directory or, if not found there, in the directory pointed to by\n" " environment variable GNUCHESS_PKGDATADIR.\n" "\n" msgstr "" " За допомогою файла «gnuchess.ini» можна визначати параметри налаштуваннÑ.\n" " Докладніший Ð¾Ð¿Ð¸Ñ Ð¼Ð¾Ð¶Ð½Ð° отримати за допомогою команди «info gnuchess».\n" " Програма шукатиме файл або у поточному каталозі, або, Ñкщо його там не " "буде\n" " знайдено, у каталозі, на Ñкий вказує змінна Ñередовища " "GNUCHESS_PKGDATADIR.\n" "\n" #: src/frontend/cmd.cc:797 msgid "" "Report bugs to .\n" "\n" msgstr "" "Про вади повідомлÑйте за адреÑою .\n" "\n" #: src/frontend/cmd.cc:844 src/frontend/cmd.cc:1280 #, c-format msgid "Invalid move: %s\n" msgstr "Ðекоректний хід: %s\n" #: src/frontend/cmd.cc:862 #, c-format msgid "Command 'white' is currently not supported.\n" msgstr "У поточному режимі роботи програми команди «white» не передбачено.\n" #: src/frontend/cmd.cc:893 #, c-format msgid "My rating = %d\n" msgstr "Ваш рейтинг = %d\n" #: src/frontend/cmd.cc:894 #, c-format msgid "Opponent rating = %d\n" msgstr "Рейтинг Ñуперника = %d\n" #: src/frontend/cmd.cc:896 msgid "time" msgstr "чаÑ" #: src/frontend/cmd.cc:898 msgid "moves" msgstr "ходи" #: src/frontend/cmd.cc:903 src/frontend/cmd.cc:910 src/frontend/cmd.cc:919 #: src/frontend/cmd.cc:928 #, c-format msgid "No. of moves generated = %ld\n" msgstr "К-ть згенерованих ходів = %ld\n" #: src/frontend/cmd.cc:932 #, c-format msgid "Command 'show eval/score' is currently not supported.\n" msgstr "" "У поточному режимі роботи програми команди «show eval/score» не " "передбачено.\n" #: src/frontend/cmd.cc:939 #, c-format msgid "Command 'show pin' is currently not supported.\n" msgstr "" "У поточному режимі роботи програми команди «show pin» не передбачено.\n" #: src/frontend/cmd.cc:951 #, c-format msgid "Command 'test' is currently not supported.\n" msgstr "У поточному режимі роботи програми команди «test» не передбачено.\n" #: src/frontend/cmd.cc:969 msgid " Quits the program." msgstr " Завершує роботу програми." #: src/frontend/cmd.cc:971 msgid " In analysis mode this stops analysis, otherwise it quits the program." msgstr "" " У режимі аналізу припинÑÑ” аналіз, у інших режимах завершує роботу програми." #: src/frontend/cmd.cc:973 msgid " Produces a help blurb corresponding to this list of commands." msgstr " Виводить довідкове Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ñ‰Ð¾Ð´Ð¾ цього ÑпиÑку команд." #: src/frontend/cmd.cc:975 msgid " add - compiles book.bin from a pgn book file" msgstr " add - збирає book.bin на оÑнові файла збірника pgn" #: src/frontend/cmd.cc:976 msgid " on - enables use of book (default)" msgstr " on - вмикає викориÑÑ‚Ð°Ð½Ð½Ñ Ð·Ð±Ñ–Ñ€Ð½Ð¸ÐºÐ° дебютів (типово)" #: src/frontend/cmd.cc:977 msgid " off - disables use of book" msgstr " off - вимикає викориÑÑ‚Ð°Ð½Ð½Ñ Ð·Ð±Ñ–Ñ€Ð½Ð¸ÐºÐ° дебютів" #: src/frontend/cmd.cc:978 msgid " worst - plays worst move from book" msgstr " worst - виконує найгірший хід зі збірника" #: src/frontend/cmd.cc:979 msgid " best - plays best move from book" msgstr " best - виконує найкращий хід зі збірника" #: src/frontend/cmd.cc:980 msgid " prefer - same as 'book on' (default)" msgstr " prefer - те Ñаме, що Ñ– «book on» (типово)" #: src/frontend/cmd.cc:981 msgid " random - plays any move from book" msgstr " random - виконує випадковий хід зі збірника" #: src/frontend/cmd.cc:983 msgid " Prints out the version of this program." msgstr " Виводить дані щодо верÑÑ–Ñ— програми." #: src/frontend/cmd.cc:986 msgid " Backs up one move in pgn loaded game." msgstr " Переходить до попереднього ходу у завантаженій з файла pgn грі." #: src/frontend/cmd.cc:988 msgid " Saves the game so far from memory to the file." msgstr " Зберігає дані поточної гри у пам’Ñті до файла." #: src/frontend/cmd.cc:990 msgid " Loads the game in the file into memory." msgstr " Завантажує гру з файла до пам’Ñті." #: src/frontend/cmd.cc:992 msgid "" " Loads the game in the file into memory, and enables\n" " the commands 'first', 'last', 'next', 'previous'." msgstr "" " Завантажує гру з файла до пам’Ñті Ñ– вмикає команди\n" " «first», «last», «next», «previous»." #: src/frontend/cmd.cc:996 msgid " Advances one move in pgn loaded game." msgstr " Переходить до наÑтупного ходу у завантаженій з файла pgn грі." #: src/frontend/cmd.cc:998 msgid " Goes to begin position of pgn loaded game." msgstr " Переходить до початкової позиції завантаженої з файла pgn гри." #: src/frontend/cmd.cc:1000 msgid " Goes to end position of pgn loaded game." msgstr " Переходить до кінцевої позиції завантаженої з файла pgn гри." #: src/frontend/cmd.cc:1003 msgid "" " Makes the program stop moving. You may now enter moves\n" " to reach some position in the future." msgstr "" " ЗаборонÑÑ” програмі виконувати ходи. ПіÑÐ»Ñ Ñ†ÑŒÐ¾Ð³Ð¾ ви можете\n" " вводити ходи, аж до доÑÑÐ³Ð½ÐµÐ½Ð½Ñ Ð¿ÐµÐ²Ð½Ð¾Ñ— позиції." #: src/frontend/cmd.cc:1007 msgid " Program plays white." msgstr " Програма грає білими." #: src/frontend/cmd.cc:1009 msgid " Program plays black." msgstr " Програма грає чорними." #: src/frontend/cmd.cc:1011 msgid "" " Computer takes whichever side is on move and begins its\n" " thinking immediately." msgstr "" " Комп’ютер переходить на бік гравцÑ, Ñкий має право ходу Ñ– починає\n" " негайно обмірковувати хід цього гравцÑ." #: src/frontend/cmd.cc:1014 msgid "" " Arranges for verbose thinking output showing variation, score,\n" " time, depth, etc." msgstr "" " Переводить програму у режим показу даних щодо аналізу: варіанти, оцінки,\n" " чаÑ, глибина Ð¾Ð¿Ñ€Ð°Ñ†ÑŽÐ²Ð°Ð½Ð½Ñ Ð¿Ð¾Ð·Ð¸Ñ†Ñ–Ñ— тощо." #: src/frontend/cmd.cc:1017 msgid " Turns off verbose thinking output." msgstr " Вимикає режим докладного виведеннÑ." #: src/frontend/cmd.cc:1019 msgid "" " Lets you input your name. Also writes the log.nnn and\n" " corresponding game.nnn files. For details please see\n" " the auxiliary file format sections." msgstr "" " Ðадає вам змогу ввеÑти позицію. Виконує Ð·Ð°Ð¿Ð¸Ñ Ð´Ð°Ð½Ð¸Ñ… до\n" " файлів log.nnn та game.nnn. Докладніший Ð¾Ð¿Ð¸Ñ Ð¼Ð¾Ð¶Ð½Ð° знайти\n" " у розділах щодо формату допоміжного файла." #: src/frontend/cmd.cc:1023 msgid " Mostly used by Internet Chess Server." msgstr " Здебільшого викориÑтовуєтьÑÑ Ð´Ð»Ñ Ñ€Ð¾Ð±Ð¾Ñ‚Ð¸ з Internet Chess Server." #: src/frontend/cmd.cc:1025 msgid "" " This command reactivates a game that has been terminated automatically\n" " due to checkmate or no more time on the clock. However, it does not\n" " alter those conditions. So you would have to undo a move or two, or\n" " add time to the clock with 'level' or 'time'." msgstr "" " За допомогою цієї команди можна активувати гру, Ñку було автоматично\n" " перервано через мат або Ð²Ð¸Ñ‡ÐµÑ€Ð¿Ð°Ð½Ð½Ñ Ð¾Ð±Ð¼ÐµÐ¶ÐµÐ½Ð½Ñ Ð·Ð° чаÑом. Втім, команда\n" " не знімає обмежень. Отже, вам доведетьÑÑ ÑкаÑувати один чи два ходи\n" " або додати чаÑу за допомогою команди «level» або «time»." #: src/frontend/cmd.cc:1030 msgid " Inputs the estimated rating for computer and for its opponent." msgstr " Ð’Ð²ÐµÐ´ÐµÐ½Ð½Ñ Ð¾Ñ†Ñ–Ð½ÐºÐ¸ рейтингу комп’ютера та його Ñуперника." #: src/frontend/cmd.cc:1032 msgid " Sets up a new game (i.e. pieces in original positions)." msgstr " Ðалаштовує нову гру (розташовує фігури у початкових позиціÑÑ…)." #: src/frontend/cmd.cc:1034 msgid "" " Inputs time left in game for computer in hundredths of a second.\n" " Mostly used by Internet Chess Server." msgstr "" " Ð’Ð²ÐµÐ´ÐµÐ½Ð½Ñ Ñ‡Ð°Ñу на залишок гри Ð´Ð»Ñ ÐºÐ¾Ð¼Ð¿â€™ÑŽÑ‚ÐµÑ€Ð° у Ñотих чаÑтинах Ñекунди.\n" " Здебільшого викориÑтовуєтьÑÑ Ð´Ð»Ñ Ñ€Ð¾Ð±Ð¾Ñ‚Ð¸ з Internet Chess Server." #: src/frontend/cmd.cc:1037 msgid " on - enables using the memory hash table to speed up search" msgstr "" " on - вмикає викориÑÑ‚Ð°Ð½Ð½Ñ Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ– хешів у пам’Ñті Ð´Ð»Ñ Ð¿Ñ€Ð¸ÑˆÐ²Ð¸Ð´ÑˆÐµÐ½Ð½Ñ Ð¿Ð¾ÑˆÑƒÐºÑƒ" #: src/frontend/cmd.cc:1038 msgid " off - disables the memory hash table" msgstr " off - вимикає викориÑÑ‚Ð°Ð½Ð½Ñ Ñ‚Ð°Ð±Ð»Ð¸Ñ†Ñ– хешів у пам’Ñті" #: src/frontend/cmd.cc:1040 msgid " Sets the hash table to permit storage of N MB." msgstr " Ð’Ñтановлює граничний розмір таблиці хешів у МБ." #: src/frontend/cmd.cc:1042 msgid " on - enables using the null-move heuristic to speed up search" msgstr "" " on - вмикає викориÑÑ‚Ð°Ð½Ð½Ñ ÐµÐ²Ñ€Ð¸Ñтики нульового ходу Ð´Ð»Ñ Ð¿Ñ€Ð¸ÑˆÐ²Ð¸Ð´ÑˆÐµÐ½Ð½Ñ Ð¿Ð¾ÑˆÑƒÐºÑƒ" #: src/frontend/cmd.cc:1043 msgid " off - disables using the null-move heuristic" msgstr " off - вимикає викориÑÑ‚Ð°Ð½Ð½Ñ ÐµÐ²Ñ€Ð¸Ñтики нульового ходу" #: src/frontend/cmd.cc:1045 msgid " on - enables use of xboard/winboard" msgstr " on - вмикає викориÑÑ‚Ð°Ð½Ð½Ñ xboard/winboard" #: src/frontend/cmd.cc:1046 msgid " off - disables use of xboard/winboard" msgstr " off - вимикає викориÑÑ‚Ð°Ð½Ð½Ñ xboard/winboard" #: src/frontend/cmd.cc:1048 msgid "" " Sets the program to look N ply (half-moves) deep for every\n" " search it performs. If there is a checkmate or other condition\n" " that does not allow that depth, then it will not be." msgstr "" " Ð’Ñтановлює глибину пошуку Ð´Ð»Ñ Ð¿Ñ€Ð¾Ð³Ñ€Ð°Ð¼Ð¸ у вказану кількіÑть\n" " напівходів. Якщо Ñ–Ñнує мат або інша гранична позиціÑ, Ñка\n" " не дозволÑÑ” подібний пошук, Ð¾Ð±Ð¼ÐµÐ¶ÐµÐ½Ð½Ñ Ð½Ðµ буде заÑтоÑовано." #: src/frontend/cmd.cc:1052 msgid "" " Sets time control to be MOVES in MINUTES, with each move giving\n" " an INCREMENT (in seconds, i.e. a Fischer-style clock)." msgstr "" " Ð’Ñтановлює контроль чаÑу у вказаній кількоÑті ходів на вказану\n" " кількіÑть Ñекунд з кожним ходом (тобто годинник Фішера)." #: src/frontend/cmd.cc:1056 msgid " Loads a position in EPD format from disk into memory." msgstr " Завантажує позицію у форматі EPD з диÑка до оперативної пам’Ñті." #: src/frontend/cmd.cc:1059 msgid " Saves game position into EPD format from memory to disk." msgstr " Зберігає позицію у форматі EPD з оперативної пам’Ñті на диÑк." #: src/frontend/cmd.cc:1061 msgid " Switches side to move." msgstr " Перемикає гравцÑ, Ñкий ходитиме." #: src/frontend/cmd.cc:1064 msgid " Solves the positions in FILENAME." msgstr " Розв’Ñзує позиції у файлі з вказаною назвою." #: src/frontend/cmd.cc:1066 msgid " Backs up two moves in game history." msgstr " Повертає позиції на два ходи назад у журналі гри." #: src/frontend/cmd.cc:1068 msgid " Backs up one move in game history." msgstr " Повертає позиції на один хід назад у журналі гри." #: src/frontend/cmd.cc:1070 msgid " Displays command line syntax." msgstr " Показує довідку щодо ÑинтакÑиÑу Ñ€Ñдка команди." #: src/frontend/cmd.cc:1072 msgid " board - displays the current board" msgstr " board - показує поточну позицію на дошці" #: src/frontend/cmd.cc:1073 msgid " time - displays the time settings" msgstr " time - показує параметри чаÑу" #: src/frontend/cmd.cc:1074 msgid " moves - shows all moves using one call to routine" msgstr " moves - показує уÑÑ– ходи за допомогою одного виклику підпрограми" #: src/frontend/cmd.cc:1075 msgid " escape - shows moves that escape from check using one call to routine" msgstr "" " escape - показує ходи, Ñкі не пройшли перевірки за допомогою одного виклику " "підпрограми" #: src/frontend/cmd.cc:1076 msgid " noncapture - shows non-capture moves" msgstr " noncapture - показує ходи без взÑттÑ" #: src/frontend/cmd.cc:1077 msgid " capture - shows capture moves" msgstr " capture - показує ходи зі взÑттÑм" #: src/frontend/cmd.cc:1078 msgid " eval [or score] - shows the evaluation per piece and overall" msgstr " eval [або score] - показує оцінку за фігурами та загальну оцінку" #: src/frontend/cmd.cc:1079 msgid " game - shows moves in game history" msgstr " game - показує ходи у журналі гри" #: src/frontend/cmd.cc:1080 msgid " pin - shows pinned pieces" msgstr " pin - показує зв’Ñзані фігури" #: src/frontend/cmd.cc:1082 msgid " movelist - reads in an epd file and shows legal moves for its entries" msgstr "" " movelist - виконує Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ð° epd Ñ– показує коректні ходи на оÑнові його " "запиÑів" #: src/frontend/cmd.cc:1083 msgid "" " capture - reads in an epd file and shows legal captures for its entries" msgstr "" " capture - виконує Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ð° epd Ñ– показує можливі взÑÑ‚Ñ‚Ñ Ð½Ð° оÑнові його " "запиÑів" #: src/frontend/cmd.cc:1084 msgid " movegenspeed - tests speed of move generator" msgstr " movegenspeed - теÑтує швидкіÑть генератора ходів" #: src/frontend/cmd.cc:1085 msgid " capturespeed - tests speed of capture move generator" msgstr " capturespeed - теÑтує швидкіÑть генератора ходів зі взÑттÑм" #: src/frontend/cmd.cc:1086 msgid " eval - reads in an epd file and shows evaluation for its entries" msgstr " eval - виконує Ñ‡Ð¸Ñ‚Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ð° epd Ñ– показує оцінку запиÑів у ньому" #: src/frontend/cmd.cc:1087 msgid " evalspeed - tests speed of the evaluator" msgstr " evalspeed - теÑтує швидкіÑть заÑобу Ð¾Ñ†Ñ–Ð½ÑŽÐ²Ð°Ð½Ð½Ñ Ñ…Ð¾Ð´Ñ–Ð²" #: src/frontend/cmd.cc:1089 msgid " Shows moves from opening book." msgstr " Показує ходи Ð´Ð»Ñ Ð·Ð±Ñ–Ñ€Ð½Ð¸ÐºÐ° дебютів." #: src/frontend/cmd.cc:1091 msgid " Enables display board in graphic mode." msgstr " Вмикає показ дошки у графічному режимі." #: src/frontend/cmd.cc:1093 msgid " Disables graphic mode and display classical view." msgstr "" " Вимикає графічний режим Ñ– перемикає програму на клаÑичний режим переглÑду." #: src/frontend/cmd.cc:1119 #, c-format msgid "" "Help for command %s not found\n" "\n" msgstr "" "Довідки щодо команди %s не знайдено\n" "\n" #: src/frontend/cmd.cc:1121 #, c-format msgid "List of commands: (help COMMAND to get more help)\n" msgstr "СпиÑок команд: (help КОМÐÐДÐ, щоб отримати додаткову довідку)\n" #: src/frontend/engine.cc:247 msgid "Black" msgstr "Чорні" #: src/frontend/engine.cc:247 msgid "White" msgstr "Білі" #: src/frontend/engine.cc:333 #, c-format msgid "" "\n" "My move is : %s\n" msgstr "" "\n" "Мій хід: %s\n" #~ msgid " an INCREMENT (in seconds, i.e. Fischer-style clock)." #~ msgstr "" #~ " Ð·Ð±Ñ–Ð»ÑŒÑˆÐµÐ½Ð½Ñ Ñ‡Ð°Ñу на хід (у Ñекундах, тобто годинник у Ñтилі Фішера)." gnuchess-6.2.2/po/vi.gmo000644 000766 000024 00000046547 12610434565 015741 0ustar00antoniostaff000000 000000 Þ•ŽŒ¿üø ù û  C- Mq 7¿ (÷ / 'P .x 7§ Jß 9*)d&ŽRµ#&,$SOx2Èû'+B)nF˜?ßh‘ˆ6gQ(¹^â&Agh[Ð(,>U”ªÀ9Ô//>±nx 8™Ò"òò- #!-E!s#•H¹5!FWAž=à)#H-lFš2á%%:`&|-£#Ñ$õ<>W–%±"×"ú#AG/X,ˆ-µ6ã/-J+x,¤÷Ñ.É ø "!!4! V!w!’!¬!½!Í!í!"6"O"b"2t"§"Ç"×"%ë"#$#B#_#{##¥# ¿#É#)â# $$51$ g$$t$™$±$>·$ö$%%)%=%P%%V%,|%)©%)Ó%ý%Ð&Ó' Õ'%ö'„(Z¡(Cü(2@)?s)2³)6æ)=*N[*Fª*?ñ*T1+s†+@ú+C;,>,¾,P@-%‘-<·-Oô-OD.€”.V/Ìl/´90Dî0z313®1zâ1`]2†¾2…E3/Ë3jû3f4‚4 4EÀ4454;5ýp5¹n6X(7>7(À7é7=8^C9C¢:5æ:9;,V;fƒ;(ê;Q<\e<]Â<V =:w=I²=Cü=o@>H°>8ù>/2?b?#|?O ?%ð?@L6@Nƒ@/Ò@5A48A6mA:¤AßAäA<ùA96B:pBC«B<ïB:,C8gC9 CDÚC@E*`E&‹E*²EÝE$ùE(FGFYF.oF$žF ÃFWäF"ÜL?M [MKŽ PH->+„!'Y/(.Z xN†‚^‹5a|fer@cB~bvn?pRS&)zD\*m, ;1$`s_ƒ%‡A4Tq9dW€Q=jˆ<Љwh]U3V8o kEIL6g…GtF{":XJŒ C0O7M#}uy2l[i My move is : %s --silent same as -q -M size, --memory=size specify memory usage in MB for hashtable -a filename, --addbook=filename compile book.bin from pgn book 'filename' -e, --easy disable thinking in opponents time -g, --graphic enable graphic mode -h, --help display this help and exit -m, --manual enable manual mode -p, --post start up showing thinking -q, --quiet make the program silent on startup -u, --uci enable UCI protocol (externally behave as UCI engine) -v, --version display version information and exit -x, --xboard start in engine mode Advances one move in pgn loaded game. Arranges for verbose thinking output showing variation, score, time, depth, etc. Backs up one move in game history. Backs up one move in pgn loaded game. Backs up two moves in game history. Computer takes whichever side is on move and begins its thinking immediately. Disables graphic mode and display classical view. Displays command line syntax. Enables display board in graphic mode. Goes to begin position of pgn loaded game. Goes to end position of pgn loaded game. In analysis mode this stops analysis, otherwise it quits the program. Inputs the estimated rating for computer and for its opponent. Inputs time left in game for computer in hundredths of a second. Mostly used by Internet Chess Server. Lets you input your name. Also writes the log.nnn and corresponding game.nnn files. For details please see the auxiliary file format sections. Loads a position in EPD format from disk into memory. Loads the game in the file into memory, and enables the commands 'first', 'last', 'next', 'previous'. Loads the game in the file into memory. Makes the program stop moving. You may now enter moves to reach some position in the future. Mostly used by Internet Chess Server. Moves are accepted either in standard algebraic notation (SAN) or in coordinate algebraic notation. Options xboard and post are accepted without leading dashes for backward compatibility. Prints out the version of this program. Produces a help blurb corresponding to this list of commands. Program plays black. Program plays white. Quits the program. Saves game position into EPD format from memory to disk. Saves the game so far from memory to the file. Sets the hash table to permit storage of N MB. Sets the program to look N ply (half-moves) deep for every search it performs. If there is a checkmate or other condition that does not allow that depth, then it will not be. Sets time control to be MOVES in MINUTES, with each move giving an INCREMENT (in seconds, i.e. a Fischer-style clock). Sets up a new game (i.e. pieces in original positions). Shows moves from opening book. Solves the positions in FILENAME. Switches side to move. The file 'gnuchess.ini' allows setting config options. See 'info gnuchess' for details. The file will be looked up in the current directory or, if not found there, in the directory pointed to by environment variable GNUCHESS_PKGDATADIR. This command reactivates a game that has been terminated automatically due to checkmate or no more time on the clock. However, it does not alter those conditions. So you would have to undo a move or two, or add time to the clock with 'level' or 'time'. Turns off verbose thinking output. add - compiles book.bin from a pgn book file best - plays best move from book board - displays the current board capture - reads in an epd file and shows legal captures for its entries capture - shows capture moves capturespeed - tests speed of capture move generator escape - shows moves that escape from check using one call to routine eval - reads in an epd file and shows evaluation for its entries eval [or score] - shows the evaluation per piece and overall evalspeed - tests speed of the evaluator game - shows moves in game history movegenspeed - tests speed of move generator movelist - reads in an epd file and shows legal moves for its entries moves - shows all moves using one call to routine noncapture - shows non-capture moves off - disables the memory hash table off - disables use of book off - disables use of xboard/winboard off - disables using the null-move heuristic on - enables use of book (default) on - enables use of xboard/winboard on - enables using the memory hash table to speed up search on - enables using the null-move heuristic to speed up search pin - shows pinned pieces prefer - same as 'book on' (default) random - plays any move from book time - displays the time settings worst - plays worst move from bookBlackBoard is wrong! Command 'activate' is currently not supported. Command 'black' is currently not supported. Command 'random' is currently not supported. Command 'show eval/score' is currently not supported. Command 'show pin' is currently not supported. Command 'switch' is currently not supported. Command 'test' is currently not supported. Command 'white' is currently not supported. Copyright (C) %s Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Could not create logfile, all slots occupied. Error reading file '%s' Failed to open %s for writing: %s File name is too long (max = %d) Fischer increment of %d seconds Graphic mode is disabled. Graphic mode is enabled. Hashing is off. Hashing is on. Help for command %s not found Incorrect book option Incorrect epd file Initial position reached. There are no earlier moves. Invalid filename. Invalid move: %s List of commands: (help COMMAND to get more help) Memory out of Range or Invalid My rating = %d New TimeLimit = %g No more moves. Game reached the end. No moves to undo! No. of moves generated = %ld Null-move heuristic is off. Null-move heuristic is on. Old TimeLimit = %g Opponent rating = %d Option Processing Failed Options: Play the game of chess Report bugs to . Save to %s Search to a depth of %d The syntax to add a new book is: book add file.pgn Thinking... Time Control: %d moves in %.2f secs Usage: %s [OPTION]... WhiteYou may consider deleting or renaming your existing logfiles. book is now best book is now off book is now on book is now random book is now worst movesmy rating = %d, opponent rating = %d name - list known players alphabetically reverse - list by GNU worst result first score - list by GNU best result first timeProject-Id-Version: gnuchess 6.2.2-rc1 Report-Msgid-Bugs-To: bug-gnu-chess@gnu.org POT-Creation-Date: 2015-10-17 14:05+0200 PO-Revision-Date: 2015-09-16 07:38+0700 Last-Translator: Trần Ngá»c Quân Language-Team: Vietnamese Language: vi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; X-Generator: Gtranslator 2.91.7 Nước Ä‘i cá»§a tôi là: %s --silent giống vá»›i -q -M cỡ, --memory=cỡ chỉ định dung lượng bá»™ nhá»› dành cho bảng băm tính theo MB -a filename, --addbook=tập-tin biên dịch sách.bin từ sách pgn “filename†-e, --easy tắt suy nghÄ© trong lúc đối thá»§ đánh -g, --graphic bật chế độ đồ há»a -h, --help hiển thị trợ giúp này rồi thoát -m, --manual bật chế độ thá»§ công -p, --post hiển thị máy Ä‘ang tính gì -q, --quiet khởi động chương trình im lặng -u, --uci bật giao thức UCI (ứng xá»­ như là bá»™ máy UCI) -v, --version hiển thị thông tin phiên bản rồi thoát -x, --xboard khởi động trong chế độ bá»™ máy Hiển thị nước Ä‘i sẽ Ä‘i tiếp trong ván đấu pgn đã được tải. Sắp đặt cho kết xuất tính toán chi tiết để biến thiên, Ä‘iểm số, giá»i, độ sâu, v.v.. Sao lưu lại má»™t nước Ä‘i trong lịch sá»­ ván đấu. Sao lưu lại má»™t nước Ä‘i trong ván đấu pgn đã tải. Sao lưu lại hai nước Ä‘i trong lịch sá»­ ván đấu. Máy tính cầm bất cứ bên nào mà nó được Ä‘i và bắt đầu tính toán nước Ä‘i cá»§a nó ngay lập tức. Tắt chế độ đồ há»a và hiển thị trình bày kiểu cổ Ä‘iển. Hiển thị cú pháp dòng lệnh. Bật hiển thị bàn cá» trong chế độ đồ há»a. Äi đến nước Ä‘i đầu cá»§a ván đấu từ tập tin pgn đã tải. Äi đến nước Ä‘i cuối cá»§a ván đấu từ tập tin pgn đã tải. Trong chế độ phân tích cái này phân tích những cái tốt nhất, nếu không thì thoát khá»i chương trình. Nhập vào Ä‘iểm số ước tính cho máy tính và các đối thá»§ cá»§a nó. Nhập vào thá»i gian còn lại trong ván đấu cho máy tính, tính theo phần trăm giây. Phần lá»›n được dùng bởi “Internet Chess Server†(Dịch vụ chÆ¡i cá» trên Internet). Hãy đặt tên bạn. Äồng thá»i ghi tập tin log.nnn và game.nnn tương ứng. Äể biết thêm chi tiết hãy xem phần phụ trợ vỠđịnh dạng tập tin. Tải vị trí từ định dạng EPD từ đĩa vào bá»™ nhá»›. Tải ván đâú trong tập tin vào bá»™ nhá»›, và bật lệnh “firstâ€, “lastâ€, “nextâ€, “previousâ€. Tải ván đâú trong tập tin vào bá»™ nhá»›. Làm chương trình ngừng chÆ¡i. Bạn có thể nhập vào nước Ä‘i cho đến vài vị trí trong tương lai. ÄÆ°á»£c dùng phổ biến bởi Dịch vụ chÆ¡i cá» trên Internet (Internet Chess Server) Nước Ä‘i được chấp nhận hoặc là gi chú đại số tiêu chuẩn (SAN) hoặc là ghi chú đại số tá»a độ. Các tùy chá»n xboard và post được chấp nhận mà không có gạch nối ở đầu để mà tương thích ngược. In ra phiên bản cá»§a chương trình này. Sản sinh ra lá»i hướng dẫn ngắn gá»n tương ứng vá»›i những lệnh trong danh sách này. Máy tính Ä‘i quân Ä‘en. Máy tính Ä‘i quân trắng Thoát khá»i chương trình. Lưu ván đấu vào định dạng EPD từ bá»™ nhá»› vào đĩa. Ghi lại ván đấu từ bá»™ nhá»› ra tập tin. Äặt bảng băm để cho phép lưu trữ N MB. Äặt chương trình tìm kiếm ở mức sâu N lá»›p (ná»­a bước Ä‘i) má»—i khi tìm nước Ä‘i. Nếu đây là má»™t nước chiếu hết hay Ä‘iá»u kiện khác mà nó không cho phép mức sâu này, thế thì nó sẽ không thế. Äặt thá»i gian Ä‘iá»u khiển NƯỚC ÄI trong PHÚT, vá»›i từng nước Ä‘i đưa ra má»™t Sá» GIA (tính bằng giây, ví dụ như là má»™t đồng hồ kiểu-Fischer). Cài đặt má»™t ván má»›i (vd: đặt các quân cá» vào vị trí nguyên gốc). Hiển thị các nước Ä‘i từ sách Ä‘ang được mở. Phân giải vị trí trong TẬP-TIN. Chuyển cạnh để Ä‘i. Tập tin “gnuchess.ini†cho phép đặt các tùy chá»n để cấu hình. Xem “info gnuchess†để biết thêm chi tiết. Tập tin sẽ được tìm trong thư mục hiện tại hoặc nếu không tìm thấy, thư mục sẽ được chỉ ra bởi biến môi trưá»ng GNUCHESS_PKGDATADIR. Lệnh này sẽ kích hoạt lại ván đấu mà nó đã bị chấm dứt má»™t cách tá»± động do chiếu hết hoặc do hết giá». Tuy nhiên, nó không thay đổi những Ä‘iá»u kiện này. Do vậy bạn cần phải há»§y má»™t, hai nước Ä‘i, hoặc thêm giá» vào đồng hồ vá»›i lệnh “level†hoặc “timeâ€. Tắt các kết xuất chi tiết vá» suy nghÄ© cá»§a máy tính add - biên dịch book.bin từ tập tin sách pgn best - trình diá»…n nước Ä‘i tốt nhất từ sách board - hiển thị bàn cá» hiện tại capture - Ä‘á»c trong tập tin epd và hiển thị các nước bắt quân cho những mục này capture - hiện các nước ăn quân capturespeed - kiểm tra tốc độ cá»§a bá»™ tạo nước bắt mục tiêu escape - hiển thị các nước Ä‘i mà thoát chiếu dùng má»™t cú gá»i thá»§ tục eval - Ä‘á»c trong tập tin epd và hiển thị đánh giá vá» những mục trong đó eval [hay score] - hiển thị lượng giá trên má»—i quân cá» và tổng thể evalspeed - kiểm tra tốc độ cá»§a bá»™ đánh giá game - hiển thị các nước Ä‘i trong lịch sá»­ cá»§a ván đấu movegenspeed - kiểm tra tốc độ cá»§a bá»™ tạo nước Ä‘i movelist - Ä‘á»c trong tập tin epd và hiển thị những nước Ä‘i hợp lệ cho các mục cá»§a nó moves - hiển thị các nước Ä‘i dùng má»™t cú gá»i thá»§ tục noncapture - hiển thị các nước không ăn quân on - không sá»­ dụng bảng băm bá»™ nhá»› off - không dùng sách off - không dùng xboard/winboard off - tắt dùng phá»ng Ä‘oán null-move để tăng tốc độ tìm kiếm on - cho dùng sách (mặc định) on - cho dùng xboard/winboard on - bật sá»­ dụng bảng băm bá»™ nhá»› để tăng tốc tìm kiếm on - bật dùng phá»ng Ä‘oán null-move để tăng tốc độ tìm kiếm pin - hiển thị các quân cỠđã đóng prefer - giống vá»›i “book on†(mặc định) random - trình diá»…n má»i nước Ä‘i từ sách time - hiển thị các cài đặt vá» thá»i gian worst - trình diá»…n nước Ä‘i tồi nhất từ sáchÄenBàn cá» bị sai! Lệnh “activate†hiện nay chưa được há»— trợ. Lệnh “black†hiện nay chưa được há»— trợ. Lệnh “random†hiện nay chưa được há»— trợ. Lệnh “show eval/score†hiện nay chưa được há»— trợ. Lệnh “show pin†hiện nay chưa được há»— trợ. Lệnh “switch†hiện nay chưa được há»— trợ. Lệnh “test†hiện nay chưa được há»— trợ. Lệnh “white†hiện nay chưa được há»— trợ. Tác quyá»n © %s Tổ chức Phần má»m Tá»± do. Giấy Phép Công Cá»™ng GNU (GPL), phiên bản 3 hay sau Äây là phần má»m tá»± do: bạn có quyá»n thay đổi và phát hành lại nó. KHÔNG CÓ BẢO HÀNH GÃŒ CẢ, vá»›i Ä‘iá»u kiện được pháp luật cho phép. Không thể tạo tập tin nhật ký, má»i khe đã há»ng. Gặp lá»—i khi Ä‘á»c tập tin “%s†Gặp lá»—i khi mở %s để ghi: %s Tên tập tin quá dài (tối Ä‘a = %d) Fischer gia tăng %d giây Chế độ đồ há»a bị tắt. Chế độ đồ há»a được bật. Băm bị tắt. Băm được bật. Không tìm thấy trợ giúp cho lệnh %s Tùy chá»n sách không hợp lệ Tập tin epd không hợp lệ Äã đến Ä‘iểm khởi đầu. Không còn nước Ä‘i nào trước nước này. Tên tập tin không hợp lệ. Nước Ä‘i không hợp lệ: %s Danh sách các câu lệnh: (help LỆNH để có thêm thông tin) Bá»™ nhá»› nằm ngoài phạm vi hoặc không hợp lệ Äiểm cá»§a tôi = %d Giá»›i-hạn-giá» má»›i = %g Không còn nước Ä‘i nào nữa. Ván đấu đã đến Ä‘iểm kết. Không có nước Ä‘i nào để mà há»§y bước cả! Số lượng nước Ä‘i đã tạo = %ld Phá»ng Ä‘oán “Null-move†đã tắt. Phá»ng Ä‘oán “Null-move†được bật. Giá»›i-hạn-giá» cÅ© = %g Äiểm cá»§a đối thá»§ = %d Gặp lá»—i khi xá»­ lý tùy chá»n Các tùy chá»n: Trình diá»…n các ván cá» Báo cáo lá»—i cho . Báo cáo lá»—i dịch cho . Ghi vào %s Tìm đến mức sâu %d Cú pháp để thêm má»™t sách má»›i là: book add tập-tin.pgn Äang nghĩ… Äiá»u khiển thá»i gian: %d nước Ä‘i trong %.2f giây Cách dùng: %s [TÙY-CHỌN]… TrăÌngBạn có thể cân nhắc xóa hay đổi tên tập tin nhật ký có trước cá»§a mình. sách giá» là tốt nhất sách bây giỠđược tắt sách bây giỠđược bật sách giá» là ngẫu nhiên sách giá» là tệ nhất Nước Ä‘iÄ‘iểm cá»§a tôi = %d, Ä‘iểm cá»§a đối thá»§ = %d name - liệt kê toàn bá»™ các tay cỠđược biết theo bảng chữ cái reverse - liệt kê theo kết quả GNU kém xếp trước score - liệt kê theo kết quả GNU tốt xếp trước thá»i giangnuchess-6.2.2/po/vi.po000644 000766 000024 00000061011 12610434564 015553 0ustar00antoniostaff000000 000000 # Vietnamese translations for gnuchess package # Bản dịch tiếng Việt cho gói gnuchess. # Copyright (C) 2015 Free Software Foundation, Inc. # This file is distributed under the same license as the gnuchess package. # Trần Ngá»c Quân , 2013-2014, 2015. # msgid "" msgstr "" "Project-Id-Version: gnuchess 6.2.2-rc1\n" "Report-Msgid-Bugs-To: bug-gnu-chess@gnu.org\n" "POT-Creation-Date: 2015-10-17 14:05+0200\n" "PO-Revision-Date: 2015-09-16 07:38+0700\n" "Last-Translator: Trần Ngá»c Quân \n" "Language-Team: Vietnamese \n" "Language: vi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Gtranslator 2.91.7\n" #: src/main.cc:317 #, c-format msgid "Memory out of Range or Invalid\n" msgstr "Bá»™ nhá»› nằm ngoài phạm vi hoặc không hợp lệ\n" #: src/main.cc:334 #, c-format msgid "File name is too long (max = %d)\n" msgstr "Tên tập tin quá dài (tối Ä‘a = %d)\n" #: src/main.cc:340 msgid "Option Processing Failed\n" msgstr "Gặp lá»—i khi xá»­ lý tùy chá»n\n" #: src/main.cc:381 #, c-format msgid "" "Copyright (C) %s Free Software Foundation, Inc.\n" "License GPLv3+: GNU GPL version 3 or later \n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" msgstr "" "Tác quyá»n © %s Tổ chức Phần má»m Tá»± do.\n" "Giấy Phép Công Cá»™ng GNU (GPL), phiên bản 3 hay sau \n" "Äây là phần má»m tá»± do: bạn có quyá»n thay đổi và phát hành lại nó.\n" "KHÔNG CÓ BẢO HÀNH GÃŒ CẢ, vá»›i Ä‘iá»u kiện được pháp luật cho phép.\n" #: src/main.cc:494 #, c-format msgid "Thinking...\n" msgstr "Äang nghĩ…\n" #: src/frontend/cmd.cc:101 #, c-format msgid "Command 'activate' is currently not supported.\n" msgstr "Lệnh “activate†hiện nay chưa được há»— trợ.\n" #: src/frontend/cmd.cc:131 #, c-format msgid "Command 'black' is currently not supported.\n" msgstr "Lệnh “black†hiện nay chưa được há»— trợ.\n" #: src/frontend/cmd.cc:140 #, c-format msgid "" "The syntax to add a new book is:\n" "\n" "\tbook add file.pgn\n" msgstr "" "Cú pháp để thêm má»™t sách má»›i là:\n" "\n" "\tbook add tập-tin.pgn\n" #: src/frontend/cmd.cc:147 #, c-format msgid "book is now on\n" msgstr "sách bây giỠđược bật\n" #: src/frontend/cmd.cc:150 #, c-format msgid "book is now off\n" msgstr "sách bây giỠđược tắt\n" #: src/frontend/cmd.cc:153 #, c-format msgid "book is now best\n" msgstr "sách giá» là tốt nhất\n" #: src/frontend/cmd.cc:156 #, c-format msgid "book is now worst\n" msgstr "sách giá» là tệ nhất\n" #: src/frontend/cmd.cc:159 #, c-format msgid "book is now random\n" msgstr "sách giá» là ngẫu nhiên\n" #: src/frontend/cmd.cc:161 #, c-format msgid "Incorrect book option\n" msgstr "Tùy chá»n sách không hợp lệ\n" #: src/frontend/cmd.cc:174 #, c-format msgid "Search to a depth of %d\n" msgstr "Tìm đến mức sâu %d\n" #: src/frontend/cmd.cc:240 #, c-format msgid "Hashing is on.\n" msgstr "Băm được bật.\n" #: src/frontend/cmd.cc:242 #, c-format msgid "Hashing is off.\n" msgstr "Băm bị tắt.\n" #: src/frontend/cmd.cc:268 src/frontend/cmd.cc:278 #, c-format msgid "Fischer increment of %d seconds\n" msgstr "Fischer gia tăng %d giây\n" #. TRANSLATORS: Please be aware that the word 'move' is sometimes #. used as a synonym of 'ply', and sometimes in the sense of a #. full 2-ply move. #: src/frontend/cmd.cc:276 #, c-format msgid "Time Control: %d moves in %.2f secs\n" msgstr "Äiá»u khiển thá»i gian: %d nước Ä‘i trong %.2f giây\n" #: src/frontend/cmd.cc:286 #, c-format msgid "name - list known players alphabetically\n" msgstr "name - liệt kê toàn bá»™ các tay cỠđược biết theo bảng chữ cái\n" #: src/frontend/cmd.cc:287 #, c-format msgid "score - list by GNU best result first \n" msgstr "score - liệt kê theo kết quả GNU tốt xếp trước\n" #: src/frontend/cmd.cc:288 #, c-format msgid "reverse - list by GNU worst result first\n" msgstr "reverse - liệt kê theo kết quả GNU kém xếp trước\n" #: src/frontend/cmd.cc:303 src/frontend/cmd.cc:1301 #, c-format msgid "Board is wrong!\n" msgstr "Bàn cá» bị sai!\n" #: src/frontend/cmd.cc:309 src/frontend/cmd.cc:312 #, c-format msgid "Error reading file '%s'\n" msgstr "Gặp lá»—i khi Ä‘á»c tập tin “%sâ€\n" #: src/frontend/cmd.cc:378 #, c-format msgid "Failed to open %s for writing: %s\n" msgstr "Gặp lá»—i khi mở %s để ghi: %s\n" #: src/frontend/cmd.cc:384 #, c-format msgid "Could not create logfile, all slots occupied.\n" msgstr "Không thể tạo tập tin nhật ký, má»i khe đã há»ng.\n" #: src/frontend/cmd.cc:385 #, c-format msgid "You may consider deleting or renaming your existing logfiles.\n" msgstr "" "Bạn có thể cân nhắc xóa hay đổi tên tập tin nhật ký có trước cá»§a mình.\n" #: src/frontend/cmd.cc:417 #, c-format msgid "Null-move heuristic is on.\n" msgstr "Phá»ng Ä‘oán “Null-move†được bật.\n" #: src/frontend/cmd.cc:419 #, c-format msgid "Null-move heuristic is off.\n" msgstr "Phá»ng Ä‘oán “Null-move†đã tắt.\n" #: src/frontend/cmd.cc:439 src/frontend/cmd.cc:466 #, c-format msgid "Incorrect epd file\n" msgstr "Tập tin epd không hợp lệ\n" #: src/frontend/cmd.cc:510 #, c-format msgid "No more moves. Game reached the end.\n" msgstr "Không còn nước Ä‘i nào nữa. Ván đấu đã đến Ä‘iểm kết.\n" #: src/frontend/cmd.cc:530 #, c-format msgid "Initial position reached. There are no earlier moves.\n" msgstr "Äã đến Ä‘iểm khởi đầu. Không còn nước Ä‘i nào trước nước này.\n" #: src/frontend/cmd.cc:586 src/frontend/cmd.cc:692 #, c-format msgid "Invalid filename.\n" msgstr "Tên tập tin không hợp lệ.\n" #: src/frontend/cmd.cc:592 #, c-format msgid "Graphic mode is enabled.\n" msgstr "Chế độ đồ há»a được bật.\n" #: src/frontend/cmd.cc:598 #, c-format msgid "Graphic mode is disabled.\n" msgstr "Chế độ đồ há»a bị tắt.\n" #: src/frontend/cmd.cc:639 #, c-format msgid "Command 'random' is currently not supported.\n" msgstr "Lệnh “random†hiện nay chưa được há»— trợ.\n" #: src/frontend/cmd.cc:647 #, c-format msgid "my rating = %d, opponent rating = %d\n" msgstr "Ä‘iểm cá»§a tôi = %d, Ä‘iểm cá»§a đối thá»§ = %d\n" #: src/frontend/cmd.cc:671 src/frontend/cmd.cc:741 #, c-format msgid "No moves to undo!\n" msgstr "Không có nước Ä‘i nào để mà há»§y bước cả!\n" #: src/frontend/cmd.cc:681 #, c-format msgid "Save to %s\n" msgstr "Ghi vào %s\n" #: src/frontend/cmd.cc:722 #, c-format msgid "Command 'switch' is currently not supported.\n" msgstr "Lệnh “switch†hiện nay chưa được há»— trợ.\n" #: src/frontend/cmd.cc:728 #, c-format msgid "Old TimeLimit = %g\n" msgstr "Giá»›i-hạn-giá» cÅ© = %g\n" #: src/frontend/cmd.cc:730 #, c-format msgid "New TimeLimit = %g\n" msgstr "Giá»›i-hạn-giá» má»›i = %g\n" #: src/frontend/cmd.cc:750 #, c-format msgid "" "Usage: %s [OPTION]...\n" "\n" msgstr "Cách dùng: %s [TÙY-CHỌN]…\n" #: src/frontend/cmd.cc:752 msgid "" "Play the game of chess\n" "\n" msgstr "" "Trình diá»…n các ván cá»\n" "\n" #: src/frontend/cmd.cc:754 msgid "Options:\n" msgstr "Các tùy chá»n:\n" #: src/frontend/cmd.cc:755 msgid " -h, --help display this help and exit\n" msgstr " -h, --help hiển thị trợ giúp này rồi thoát\n" #: src/frontend/cmd.cc:757 msgid " -v, --version display version information and exit\n" msgstr " -v, --version hiển thị thông tin phiên bản rồi thoát\n" #: src/frontend/cmd.cc:759 msgid " -q, --quiet make the program silent on startup\n" msgstr " -q, --quiet khởi động chương trình im lặng\n" #: src/frontend/cmd.cc:761 msgid " --silent same as -q\n" msgstr " --silent giống vá»›i -q\n" #: src/frontend/cmd.cc:763 src/frontend/cmd.cc:781 msgid "\n" msgstr "\n" #: src/frontend/cmd.cc:765 msgid " -x, --xboard start in engine mode\n" msgstr " -x, --xboard khởi động trong chế độ bá»™ máy\n" #: src/frontend/cmd.cc:767 msgid " -p, --post start up showing thinking\n" msgstr " -p, --post hiển thị máy Ä‘ang tính gì\n" #: src/frontend/cmd.cc:769 msgid " -e, --easy disable thinking in opponents time\n" msgstr " -e, --easy tắt suy nghÄ© trong lúc đối thá»§ đánh\n" #: src/frontend/cmd.cc:771 msgid " -m, --manual enable manual mode\n" msgstr " -m, --manual bật chế độ thá»§ công\n" #: src/frontend/cmd.cc:773 msgid "" " -u, --uci enable UCI protocol (externally behave as UCI engine)\n" msgstr " -u, --uci bật giao thức UCI (ứng xá»­ như là bá»™ máy UCI)\n" #: src/frontend/cmd.cc:775 msgid " -M size, --memory=size specify memory usage in MB for hashtable\n" msgstr "" " -M cỡ, --memory=cỡ chỉ định dung lượng bá»™ nhá»› dành cho bảng\n" " băm tính theo MB\n" #: src/frontend/cmd.cc:777 msgid "" " -a filename, --addbook=filename compile book.bin from pgn book " "'filename'\n" msgstr "" " -a filename, --addbook=tập-tin biên dịch sách.bin từ sách pgn " "“filenameâ€\n" #: src/frontend/cmd.cc:779 msgid " -g, --graphic enable graphic mode\n" msgstr " -g, --graphic bật chế độ đồ há»a\n" #: src/frontend/cmd.cc:783 msgid "" " Options xboard and post are accepted without leading dashes\n" " for backward compatibility.\n" "\n" msgstr "" " Các tùy chá»n xboard và post được chấp nhận mà không có gạch\n" " nối ở đầu để mà tương thích ngược.\n" "\n" #: src/frontend/cmd.cc:787 msgid "" " Moves are accepted either in standard algebraic notation (SAN) or\n" " in coordinate algebraic notation.\n" "\n" msgstr "" " Nước Ä‘i được chấp nhận hoặc là gi chú đại số tiêu chuẩn (SAN) hoặc là\n" " ghi chú đại số tá»a độ.\n" "\n" #: src/frontend/cmd.cc:791 msgid "" " The file 'gnuchess.ini' allows setting config options. See\n" " 'info gnuchess' for details. The file will be looked up in the current\n" " directory or, if not found there, in the directory pointed to by\n" " environment variable GNUCHESS_PKGDATADIR.\n" "\n" msgstr "" " Tập tin “gnuchess.ini†cho phép đặt các tùy chá»n để cấu hình. Xem\n" " “info gnuchess†để biết thêm chi tiết. Tập tin sẽ được tìm trong thư mục\n" " hiện tại hoặc nếu không tìm thấy, thư mục sẽ được chỉ ra bởi\n" " biến môi trưá»ng GNUCHESS_PKGDATADIR.\n" "\n" #: src/frontend/cmd.cc:797 msgid "" "Report bugs to .\n" "\n" msgstr "" "Báo cáo lá»—i cho .\n" "Báo cáo lá»—i dịch cho .\n" "\n" #: src/frontend/cmd.cc:844 src/frontend/cmd.cc:1280 #, c-format msgid "Invalid move: %s\n" msgstr "Nước Ä‘i không hợp lệ: %s\n" #: src/frontend/cmd.cc:862 #, c-format msgid "Command 'white' is currently not supported.\n" msgstr "Lệnh “white†hiện nay chưa được há»— trợ.\n" #: src/frontend/cmd.cc:893 #, c-format msgid "My rating = %d\n" msgstr "Äiểm cá»§a tôi = %d\n" #: src/frontend/cmd.cc:894 #, c-format msgid "Opponent rating = %d\n" msgstr "Äiểm cá»§a đối thá»§ = %d\n" #: src/frontend/cmd.cc:896 msgid "time" msgstr "thá»i gian" #: src/frontend/cmd.cc:898 msgid "moves" msgstr "Nước Ä‘i" #: src/frontend/cmd.cc:903 src/frontend/cmd.cc:910 src/frontend/cmd.cc:919 #: src/frontend/cmd.cc:928 #, c-format msgid "No. of moves generated = %ld\n" msgstr "Số lượng nước Ä‘i đã tạo = %ld\n" #: src/frontend/cmd.cc:932 #, c-format msgid "Command 'show eval/score' is currently not supported.\n" msgstr "Lệnh “show eval/score†hiện nay chưa được há»— trợ.\n" #: src/frontend/cmd.cc:939 #, c-format msgid "Command 'show pin' is currently not supported.\n" msgstr "Lệnh “show pin†hiện nay chưa được há»— trợ.\n" #: src/frontend/cmd.cc:951 #, c-format msgid "Command 'test' is currently not supported.\n" msgstr "Lệnh “test†hiện nay chưa được há»— trợ.\n" #: src/frontend/cmd.cc:969 msgid " Quits the program." msgstr " Thoát khá»i chương trình." #: src/frontend/cmd.cc:971 msgid " In analysis mode this stops analysis, otherwise it quits the program." msgstr "" " Trong chế độ phân tích cái này phân tích những cái tốt nhất, nếu không thì " "thoát khá»i chương trình." #: src/frontend/cmd.cc:973 msgid " Produces a help blurb corresponding to this list of commands." msgstr "" " Sản sinh ra lá»i hướng dẫn ngắn gá»n tương ứng vá»›i những lệnh trong danh sách " "này." #: src/frontend/cmd.cc:975 msgid " add - compiles book.bin from a pgn book file" msgstr " add - biên dịch book.bin từ tập tin sách pgn" #: src/frontend/cmd.cc:976 msgid " on - enables use of book (default)" msgstr " on - cho dùng sách (mặc định)" #: src/frontend/cmd.cc:977 msgid " off - disables use of book" msgstr " off - không dùng sách" #: src/frontend/cmd.cc:978 msgid " worst - plays worst move from book" msgstr " worst - trình diá»…n nước Ä‘i tồi nhất từ sách" #: src/frontend/cmd.cc:979 msgid " best - plays best move from book" msgstr " best - trình diá»…n nước Ä‘i tốt nhất từ sách" #: src/frontend/cmd.cc:980 msgid " prefer - same as 'book on' (default)" msgstr " prefer - giống vá»›i “book on†(mặc định)" #: src/frontend/cmd.cc:981 msgid " random - plays any move from book" msgstr " random - trình diá»…n má»i nước Ä‘i từ sách" #: src/frontend/cmd.cc:983 msgid " Prints out the version of this program." msgstr " In ra phiên bản cá»§a chương trình này." #: src/frontend/cmd.cc:986 msgid " Backs up one move in pgn loaded game." msgstr " Sao lưu lại má»™t nước Ä‘i trong ván đấu pgn đã tải." #: src/frontend/cmd.cc:988 msgid " Saves the game so far from memory to the file." msgstr " Ghi lại ván đấu từ bá»™ nhá»› ra tập tin." #: src/frontend/cmd.cc:990 msgid " Loads the game in the file into memory." msgstr " Tải ván đâú trong tập tin vào bá»™ nhá»›." #: src/frontend/cmd.cc:992 msgid "" " Loads the game in the file into memory, and enables\n" " the commands 'first', 'last', 'next', 'previous'." msgstr "" " Tải ván đâú trong tập tin vào bá»™ nhá»›, và bật\n" " lệnh “firstâ€, “lastâ€, “nextâ€, “previousâ€." #: src/frontend/cmd.cc:996 msgid " Advances one move in pgn loaded game." msgstr " Hiển thị nước Ä‘i sẽ Ä‘i tiếp trong ván đấu pgn đã được tải." #: src/frontend/cmd.cc:998 msgid " Goes to begin position of pgn loaded game." msgstr " Äi đến nước Ä‘i đầu cá»§a ván đấu từ tập tin pgn đã tải." #: src/frontend/cmd.cc:1000 msgid " Goes to end position of pgn loaded game." msgstr " Äi đến nước Ä‘i cuối cá»§a ván đấu từ tập tin pgn đã tải." #: src/frontend/cmd.cc:1003 msgid "" " Makes the program stop moving. You may now enter moves\n" " to reach some position in the future." msgstr "" " Làm chương trình ngừng chÆ¡i. Bạn có thể nhập vào nước Ä‘i\n" " cho đến vài vị trí trong tương lai." #: src/frontend/cmd.cc:1007 msgid " Program plays white." msgstr " Máy tính Ä‘i quân trắng" #: src/frontend/cmd.cc:1009 msgid " Program plays black." msgstr " Máy tính Ä‘i quân Ä‘en." #: src/frontend/cmd.cc:1011 msgid "" " Computer takes whichever side is on move and begins its\n" " thinking immediately." msgstr "" " Máy tính cầm bất cứ bên nào mà nó được Ä‘i và bắt đầu\n" " tính toán nước Ä‘i cá»§a nó ngay lập tức." #: src/frontend/cmd.cc:1014 msgid "" " Arranges for verbose thinking output showing variation, score,\n" " time, depth, etc." msgstr "" " Sắp đặt cho kết xuất tính toán chi tiết để biến thiên, Ä‘iểm số,\n" " giá»i, độ sâu, v.v.." #: src/frontend/cmd.cc:1017 msgid " Turns off verbose thinking output." msgstr " Tắt các kết xuất chi tiết vá» suy nghÄ© cá»§a máy tính" #: src/frontend/cmd.cc:1019 msgid "" " Lets you input your name. Also writes the log.nnn and\n" " corresponding game.nnn files. For details please see\n" " the auxiliary file format sections." msgstr "" " Hãy đặt tên bạn. Äồng thá»i ghi tập tin log.nnn và\n" " game.nnn tương ứng. Äể biết thêm chi tiết hãy xem\n" " phần phụ trợ vỠđịnh dạng tập tin." #: src/frontend/cmd.cc:1023 msgid " Mostly used by Internet Chess Server." msgstr "" " ÄÆ°á»£c dùng phổ biến bởi Dịch vụ chÆ¡i cá» trên Internet (Internet Chess Server)" #: src/frontend/cmd.cc:1025 msgid "" " This command reactivates a game that has been terminated automatically\n" " due to checkmate or no more time on the clock. However, it does not\n" " alter those conditions. So you would have to undo a move or two, or\n" " add time to the clock with 'level' or 'time'." msgstr "" " Lệnh này sẽ kích hoạt lại ván đấu mà nó đã bị chấm dứt má»™t cách tá»±\n" " động do chiếu hết hoặc do hết giá». Tuy nhiên, nó không thay đổi\n" " những Ä‘iá»u kiện này. Do vậy bạn cần phải há»§y má»™t, hai nước Ä‘i, hoặc\n" " thêm giá» vào đồng hồ vá»›i lệnh “level†hoặc “timeâ€." #: src/frontend/cmd.cc:1030 msgid " Inputs the estimated rating for computer and for its opponent." msgstr " Nhập vào Ä‘iểm số ước tính cho máy tính và các đối thá»§ cá»§a nó." #: src/frontend/cmd.cc:1032 msgid " Sets up a new game (i.e. pieces in original positions)." msgstr " Cài đặt má»™t ván má»›i (vd: đặt các quân cá» vào vị trí nguyên gốc)." #: src/frontend/cmd.cc:1034 msgid "" " Inputs time left in game for computer in hundredths of a second.\n" " Mostly used by Internet Chess Server." msgstr "" " Nhập vào thá»i gian còn lại trong ván đấu cho máy tính, tính theo phần trăm " "giây.\n" " Phần lá»›n được dùng bởi “Internet Chess Server†(Dịch vụ chÆ¡i cá» trên " "Internet)." #: src/frontend/cmd.cc:1037 msgid " on - enables using the memory hash table to speed up search" msgstr " on - bật sá»­ dụng bảng băm bá»™ nhá»› để tăng tốc tìm kiếm" #: src/frontend/cmd.cc:1038 msgid " off - disables the memory hash table" msgstr " on - không sá»­ dụng bảng băm bá»™ nhá»›" #: src/frontend/cmd.cc:1040 msgid " Sets the hash table to permit storage of N MB." msgstr " Äặt bảng băm để cho phép lưu trữ N MB." #: src/frontend/cmd.cc:1042 msgid " on - enables using the null-move heuristic to speed up search" msgstr " on - bật dùng phá»ng Ä‘oán null-move để tăng tốc độ tìm kiếm" #: src/frontend/cmd.cc:1043 msgid " off - disables using the null-move heuristic" msgstr " off - tắt dùng phá»ng Ä‘oán null-move để tăng tốc độ tìm kiếm" #: src/frontend/cmd.cc:1045 msgid " on - enables use of xboard/winboard" msgstr " on - cho dùng xboard/winboard" #: src/frontend/cmd.cc:1046 msgid " off - disables use of xboard/winboard" msgstr " off - không dùng xboard/winboard" #: src/frontend/cmd.cc:1048 msgid "" " Sets the program to look N ply (half-moves) deep for every\n" " search it performs. If there is a checkmate or other condition\n" " that does not allow that depth, then it will not be." msgstr "" " Äặt chương trình tìm kiếm ở mức sâu N lá»›p (ná»­a bước Ä‘i) má»—i khi\n" " tìm nước Ä‘i. Nếu đây là má»™t nước chiếu hết hay Ä‘iá»u kiện khác\n" " mà nó không cho phép mức sâu này, thế thì nó sẽ không thế." #: src/frontend/cmd.cc:1052 msgid "" " Sets time control to be MOVES in MINUTES, with each move giving\n" " an INCREMENT (in seconds, i.e. a Fischer-style clock)." msgstr "" " Äặt thá»i gian Ä‘iá»u khiển NƯỚC ÄI trong PHÚT, vá»›i từng nước Ä‘i đưa ra\n" " má»™t Sá» GIA (tính bằng giây, ví dụ như là má»™t đồng hồ kiểu-Fischer)." #: src/frontend/cmd.cc:1056 msgid " Loads a position in EPD format from disk into memory." msgstr " Tải vị trí từ định dạng EPD từ đĩa vào bá»™ nhá»›." #: src/frontend/cmd.cc:1059 msgid " Saves game position into EPD format from memory to disk." msgstr " Lưu ván đấu vào định dạng EPD từ bá»™ nhá»› vào đĩa." #: src/frontend/cmd.cc:1061 msgid " Switches side to move." msgstr " Chuyển cạnh để Ä‘i." #: src/frontend/cmd.cc:1064 msgid " Solves the positions in FILENAME." msgstr " Phân giải vị trí trong TẬP-TIN." #: src/frontend/cmd.cc:1066 msgid " Backs up two moves in game history." msgstr " Sao lưu lại hai nước Ä‘i trong lịch sá»­ ván đấu." #: src/frontend/cmd.cc:1068 msgid " Backs up one move in game history." msgstr " Sao lưu lại má»™t nước Ä‘i trong lịch sá»­ ván đấu." #: src/frontend/cmd.cc:1070 msgid " Displays command line syntax." msgstr " Hiển thị cú pháp dòng lệnh." #: src/frontend/cmd.cc:1072 msgid " board - displays the current board" msgstr " board - hiển thị bàn cá» hiện tại" #: src/frontend/cmd.cc:1073 msgid " time - displays the time settings" msgstr " time - hiển thị các cài đặt vá» thá»i gian" #: src/frontend/cmd.cc:1074 msgid " moves - shows all moves using one call to routine" msgstr " moves - hiển thị các nước Ä‘i dùng má»™t cú gá»i thá»§ tục" #: src/frontend/cmd.cc:1075 msgid " escape - shows moves that escape from check using one call to routine" msgstr " escape - hiển thị các nước Ä‘i mà thoát chiếu dùng má»™t cú gá»i thá»§ tục" #: src/frontend/cmd.cc:1076 msgid " noncapture - shows non-capture moves" msgstr " noncapture - hiển thị các nước không ăn quân" #: src/frontend/cmd.cc:1077 msgid " capture - shows capture moves" msgstr " capture - hiện các nước ăn quân" #: src/frontend/cmd.cc:1078 msgid " eval [or score] - shows the evaluation per piece and overall" msgstr " eval [hay score] - hiển thị lượng giá trên má»—i quân cá» và tổng thể" #: src/frontend/cmd.cc:1079 msgid " game - shows moves in game history" msgstr " game - hiển thị các nước Ä‘i trong lịch sá»­ cá»§a ván đấu" #: src/frontend/cmd.cc:1080 msgid " pin - shows pinned pieces" msgstr " pin - hiển thị các quân cỠđã đóng" #: src/frontend/cmd.cc:1082 msgid " movelist - reads in an epd file and shows legal moves for its entries" msgstr "" " movelist - Ä‘á»c trong tập tin epd và hiển thị những nước Ä‘i hợp lệ cho các " "mục cá»§a nó" #: src/frontend/cmd.cc:1083 msgid "" " capture - reads in an epd file and shows legal captures for its entries" msgstr "" " capture - Ä‘á»c trong tập tin epd và hiển thị các nước bắt quân cho những mục " "này" #: src/frontend/cmd.cc:1084 msgid " movegenspeed - tests speed of move generator" msgstr " movegenspeed - kiểm tra tốc độ cá»§a bá»™ tạo nước Ä‘i" #: src/frontend/cmd.cc:1085 msgid " capturespeed - tests speed of capture move generator" msgstr " capturespeed - kiểm tra tốc độ cá»§a bá»™ tạo nước bắt mục tiêu" #: src/frontend/cmd.cc:1086 msgid " eval - reads in an epd file and shows evaluation for its entries" msgstr "" " eval - Ä‘á»c trong tập tin epd và hiển thị đánh giá vá» những mục trong đó" #: src/frontend/cmd.cc:1087 msgid " evalspeed - tests speed of the evaluator" msgstr " evalspeed - kiểm tra tốc độ cá»§a bá»™ đánh giá" #: src/frontend/cmd.cc:1089 msgid " Shows moves from opening book." msgstr " Hiển thị các nước Ä‘i từ sách Ä‘ang được mở." #: src/frontend/cmd.cc:1091 msgid " Enables display board in graphic mode." msgstr " Bật hiển thị bàn cá» trong chế độ đồ há»a." #: src/frontend/cmd.cc:1093 msgid " Disables graphic mode and display classical view." msgstr " Tắt chế độ đồ há»a và hiển thị trình bày kiểu cổ Ä‘iển." #: src/frontend/cmd.cc:1119 #, c-format msgid "" "Help for command %s not found\n" "\n" msgstr "" "Không tìm thấy trợ giúp cho lệnh %s\n" "\n" #: src/frontend/cmd.cc:1121 #, c-format msgid "List of commands: (help COMMAND to get more help)\n" msgstr "Danh sách các câu lệnh: (help LỆNH để có thêm thông tin)\n" #: src/frontend/engine.cc:247 msgid "Black" msgstr "Äen" #: src/frontend/engine.cc:247 msgid "White" msgstr "TrăÌng" #: src/frontend/engine.cc:333 #, c-format msgid "" "\n" "My move is : %s\n" msgstr "" "\n" "Nước Ä‘i cá»§a tôi là: %s\n" gnuchess-6.2.2/misc/gnuchess.eng000644 000766 000024 00000000042 12451624122 017413 0ustar00antoniostaff000000 000000 plugin spec 0.0 gnuchess -x chess gnuchess-6.2.2/misc/gnuchess.png000644 000766 000024 00000004620 12451623627 017445 0ustar00antoniostaff000000 000000 ‰PNG  IHDR‚A*¡ŒÕPLTE€€€€€€€€€ÀÀÀÀÜÀ¦Êð@ ` €   À à @ @@@`@€@ @À@à@` `@```€` `À`à`€ €@€`€€€ €À€à€   @ ` €   À à À À@À`À€À ÀÀÀàÀà à@à`à€à àÀààà@ @@@`@€@ @À@à@ @ @@ @` @€ @  @À @à @@@ @@@@@`@@€@@ @@À@@à@@`@ `@@`@``@€`@ `@À`@à`@€@ €@@€@`€@€€@ €@À€@à€@ @  @@ @` @€ @  @À @à @À@ À@@À@`À@€À@ À@ÀÀ@àÀ@à@ à@@à@`à@€à@ à@Àà@àà@€ €@€`€€€ €À€à€ € €@ €` €€ €  €À €à €@€ @€@@€`@€€@€ @€À@€à@€`€ `€@`€``€€`€ `€À`€à`€€€ €€@€€`€€€€€ €€À€€à€€ €  €@ €` €€ €  €À €à €À€ À€@À€`À€€À€ À€ÀÀ€àÀ€à€ à€@à€`à€€à€ à€Àà€àà€À À@À`À€À ÀÀÀàÀ À À@ À` À€ À  ÀÀ Àà À@À @À@@À`@À€@À @ÀÀ@Àà@À`À `À@`À``À€`À `ÀÀ`Àà`À€À €À@€À`€À€€À €ÀÀ€Àà€À À  À@ À` À€ À  ÀÀ Àà ÀÀÀ ÀÀ@ÀÀ`ÀÀ€ÀÀ ÀÀÿûð  ¤€€€ÿÿÿÿÿÿÿÿÿÿÿÿXÒ4D pHYs Ø Ø4æ5b vpAg‚A¯Èvž¿IDAThÞ홽nÜ8€Ù ýh*î ¶c™Î/“2€ÙEÓØÂ{Õ½‹Ë+\0g€ìÄ›þˆÒJ>ÅЕͧù§¬†OõÙ__«> ‹ÿ4´ÁG–`ÂÒæ`1@@»/âˆà#*Û)e"L·Ò%$õ´-Òòšu*¥XF ‘\2±"À2"D»CAÐÖƒQÉNx€>J¤èA¿CA°Ñ¥NÚ†Õ­„‰”“µ0𫀏8‘_é×Ãd™o¿¥ g'W&ä¥ ùx 6ÄÃlo(éç¿¿ '€!`ˆe§æV@ÕÅ01ØÙ5R~mF ?wd„†@;IO¬ÇdꨒܠBlDã?3…}V´Á°ÈÇÍ{’v ŽÀ2£H¥+å¶sO¦l‚ÉŽaTFìQLÁƒüíJ…fAàNá冧£ý¯õ¾GÎBJGƒmq–’q×H¼F°¤šç'*Jf m:i|cÑ¥yKˆV:åØ1?n‹àhH9̪Œ}Ñ\#ã¶"íªº!då¥>™Ý V‚« ηq±Fðt ù. øþp¸ÛaûeеoÚåt¼üqHòº‚8Û`}ù¾±‚·qé!ÇC‘»=RÖ®æ%´Ä¢î“n&ù‘¾ ¯^ê.¾?].!ä+4™T¼i`[,LÇÃñ¥ This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .PP Play the game of chess .SH OPTIONS .TP \fB\-h\fR, \fB\-\-help\fR display this help and exit .TP \fB\-v\fR, \fB\-\-version\fR display version information and exit .TP \fB\-q\fR, \fB\-\-quiet\fR make the program silent on startup .TP \fB\-\-silent\fR same as \fB\-q\fR .TP \fB\-x\fR, \fB\-\-xboard\fR start in engine mode .TP \fB\-p\fR, \fB\-\-post\fR start up showing thinking .TP \fB\-e\fR, \fB\-\-easy\fR disable thinking in opponents time .TP \fB\-m\fR, \fB\-\-manual\fR enable manual mode .TP \fB\-u\fR, \fB\-\-uci\fR enable UCI protocol (externally behave as UCI engine) .TP \fB\-M\fR size, \fB\-\-memory\fR=\fI\,size\/\fR specify memory usage in MB for hashtable .TP \fB\-a\fR filename, \fB\-\-addbook\fR=\fI\,filename\/\fR compile book.bin from pgn book 'filename' .TP \fB\-g\fR, \fB\-\-graphic\fR enable graphic mode .IP Options xboard and post are accepted without leading dashes for backward compatibility. .IP Moves are accepted either in standard algebraic notation (SAN) or in coordinate algebraic notation. .IP The file 'gnuchess.ini' allows setting config options. See \&'info gnuchess' for details. The file will be looked up in the current directory or, if not found there, in the directory pointed to by environment variable GNUCHESS_PKGDATADIR. .SH "REPORTING BUGS" Report bugs to . .SH "SEE ALSO" The full documentation for .B Chess is maintained as a Texinfo manual. If the .B info and .B Chess programs are properly installed at your site, the command .IP .B info gnuchess .PP should give you access to the complete manual. gnuchess-6.2.2/man/Makefile.am000644 000766 000024 00000002451 12452303712 016763 0ustar00antoniostaff000000 000000 # Makefile for gnuchess/man # # Copyright (C) 2015 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . man_MANS = gnuchess.1 EXTRA_DIST = $(man_MANS) MAINTAINERCLEANFILES = $(man_MANS) # The man pages depend on the --help strings and the version number. common_mandeps = $(top_srcdir)/configure.ac # Depend on the source, not the binary; we don't need to regenerate the # binary when any source file changes, only the main one. # Use -o so that the `missing' program can infer the output file. gnuchess.1: $(top_srcdir)/src/main.cc $(top_srcdir)/src/frontend/cmd.cc $(common_mandeps) $(HELP2MAN) --name='GNU Chess' --info-page='gnuchess' ../src/gnuchess -o $@ CLEANFILES = ${man_MANS} DISTCLEANFILES = ${CLEANFILES} gnuchess-6.2.2/man/Makefile.in000644 000766 000024 00000040466 12606706417 017016 0ustar00antoniostaff000000 000000 # Makefile.in generated by automake 1.14 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile for gnuchess/man # # Copyright (C) 2015 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = man DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HELP2MAN = @HELP2MAN@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGINSDIR = @PLUGINSDIR@ POSUB = @POSUB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXXFLAGS = @PTHREAD_CXXFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ man_MANS = gnuchess.1 EXTRA_DIST = $(man_MANS) MAINTAINERCLEANFILES = $(man_MANS) # The man pages depend on the --help strings and the version number. common_mandeps = $(top_srcdir)/configure.ac CLEANFILES = ${man_MANS} DISTCLEANFILES = ${CLEANFILES} all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu man/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-man1 install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am uninstall-man \ uninstall-man1 # Depend on the source, not the binary; we don't need to regenerate the # binary when any source file changes, only the main one. # Use -o so that the `missing' program can infer the output file. gnuchess.1: $(top_srcdir)/src/main.cc $(top_srcdir)/src/frontend/cmd.cc $(common_mandeps) $(HELP2MAN) --name='GNU Chess' --info-page='gnuchess' ../src/gnuchess -o $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: gnuchess-6.2.2/m4/ChangeLog000644 000766 000024 00000000635 12205361270 016247 0ustar00antoniostaff000000 000000 2013-08-22 gettextize * gettext.m4: New file, from gettext-0.18.3. * iconv.m4: New file, from gettext-0.18.3. * lib-ld.m4: New file, from gettext-0.18.3. * lib-link.m4: New file, from gettext-0.18.3. * lib-prefix.m4: New file, from gettext-0.18.3. * nls.m4: New file, from gettext-0.18.3. * po.m4: New file, from gettext-0.18.3. * progtest.m4: New file, from gettext-0.18.3. gnuchess-6.2.2/m4/gettext.m4000644 000766 000024 00000035615 12205361270 016431 0ustar00antoniostaff000000 000000 # gettext.m4 serial 66 (gettext-0.18.2) dnl Copyright (C) 1995-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2006, 2008-2010. dnl Macro to add for using GNU gettext. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The dnl default (if it is not specified or empty) is 'no-libtool'. dnl INTLSYMBOL should be 'external' for packages with no intl directory, dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. dnl If INTLSYMBOL is 'use-libtool', then a libtool library dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library dnl $(top_builddir)/intl/libintl.a will be created. dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext dnl implementations (in libc or libintl) without the ngettext() function dnl will be ignored. If NEEDSYMBOL is specified and is dnl 'need-formatstring-macros', then GNU gettext implementations that don't dnl support the ISO C 99 formatstring macros will be ignored. dnl INTLDIR is used to find the intl libraries. If empty, dnl the value '$(top_builddir)/intl/' is used. dnl dnl The result of the configuration is one of three cases: dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled dnl and used. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 2) GNU gettext has been found in the system's C library. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 3) No internationalization, always use English msgid. dnl Catalog format: none dnl Catalog extension: none dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. dnl The use of .gmo is historical (it was needed to avoid overwriting the dnl GNU format catalogs when building on a platform with an X/Open gettext), dnl but we keep it in order not to force irrelevant filename changes on the dnl maintainers. dnl AC_DEFUN([AM_GNU_GETTEXT], [ dnl Argument checking. ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT ])])])])]) ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old], [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])]) ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) define([gt_included_intl], ifelse([$1], [external], ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]), [yes])) define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) gt_NEEDS_INIT AM_GNU_GETTEXT_NEED([$2]) AC_REQUIRE([AM_PO_SUBDIRS])dnl ifelse(gt_included_intl, yes, [ AC_REQUIRE([AM_INTL_SUBDIR])dnl ]) dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Sometimes libintl requires libiconv, so first search for libiconv. dnl Ideally we would do this search only after the dnl if test "$USE_NLS" = "yes"; then dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT dnl the configure script would need to contain the same shell code dnl again, outside any 'if'. There are two solutions: dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not dnl documented, we avoid it. ifelse(gt_included_intl, yes, , [ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation. gt_INTL_MACOSX dnl Set USE_NLS. AC_REQUIRE([AM_NLS]) ifelse(gt_included_intl, yes, [ BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no ]) LIBINTL= LTLIBINTL= POSUB= dnl Add a version number to the cache macros. case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH([included-gettext], [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext]) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then ]) dnl User does not insist on using GNU NLS library. Figure out what dnl to use. If GNU gettext is available we use this. Else we have dnl to fall back to GNU NLS library. if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; ]], [[ bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings ]])], [eval "$gt_func_gnugettext_libc=yes"], [eval "$gt_func_gnugettext_libc=no"])]) if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl Sometimes libintl requires libiconv, so first search for libiconv. ifelse(gt_included_intl, yes, , [ AM_ICONV_LINK ]) dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) dnl because that would add "-liconv" to LIBINTL and LTLIBINTL dnl even if libiconv doesn't exist. AC_LIB_LINKFLAGS_BODY([intl]) AC_CACHE_CHECK([for GNU gettext in libintl], [$gt_func_gnugettext_libintl], [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" dnl Now see whether libintl exists and does not depend on libiconv. AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); ]], [[ bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ]])], [eval "$gt_func_gnugettext_libintl=yes"], [eval "$gt_func_gnugettext_libintl=no"]) dnl Now see whether libintl exists and depends on libiconv. if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); ]], [[ bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ]])], [LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" ]) fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) fi dnl If an already present or preinstalled GNU gettext() is found, dnl use it. But if this macro is used in GNU gettext, and GNU dnl gettext is already preinstalled in libintl, we update this dnl libintl. (Cf. the install rule in intl/Makefile.in.) if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else dnl Reset the values set by searching for libintl. LIBINTL= LTLIBINTL= INCINTL= fi ifelse(gt_included_intl, yes, [ if test "$gt_use_preinstalled_gnugettext" != "yes"; then dnl GNU gettext is not found in the C library. dnl Fall back on included GNU gettext library. nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD" LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi CATOBJEXT= if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions to use GNU gettext tools. CATOBJEXT=.gmo fi ]) if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Some extra flags are needed during linking. LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then AC_DEFINE([ENABLE_NLS], [1], [Define to 1 if translation of program messages to the user's native language is requested.]) else USE_NLS=no fi fi AC_MSG_CHECKING([whether to use NLS]) AC_MSG_RESULT([$USE_NLS]) if test "$USE_NLS" = "yes"; then AC_MSG_CHECKING([where the gettext function comes from]) if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi AC_MSG_RESULT([$gt_source]) fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then AC_MSG_CHECKING([how to link with libintl]) AC_MSG_RESULT([$LIBINTL]) AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) fi dnl For backward compatibility. Some packages may be using this. AC_DEFINE([HAVE_GETTEXT], [1], [Define if the GNU gettext() function is already present or preinstalled.]) AC_DEFINE([HAVE_DCGETTEXT], [1], [Define if the GNU dcgettext() function is already present or preinstalled.]) fi dnl We need to process the po/ directory. POSUB=po fi ifelse(gt_included_intl, yes, [ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL dnl to 'yes' because some of the testsuite requires it. if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then BUILD_INCLUDED_LIBINTL=yes fi dnl Make all variables we use known to autoconf. AC_SUBST([BUILD_INCLUDED_LIBINTL]) AC_SUBST([USE_INCLUDED_LIBINTL]) AC_SUBST([CATOBJEXT]) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= nls_cv_header_libgt= dnl For backward compatibility. Some Makefiles may be using this. DATADIRNAME=share AC_SUBST([DATADIRNAME]) dnl For backward compatibility. Some Makefiles may be using this. INSTOBJEXT=.mo AC_SUBST([INSTOBJEXT]) dnl For backward compatibility. Some Makefiles may be using this. GENCAT=gencat AC_SUBST([GENCAT]) dnl For backward compatibility. Some Makefiles may be using this. INTLOBJS= if test "$USE_INCLUDED_LIBINTL" = yes; then INTLOBJS="\$(GETTOBJS)" fi AC_SUBST([INTLOBJS]) dnl Enable libtool support if the surrounding package wishes it. INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX]) ]) dnl For backward compatibility. Some Makefiles may be using this. INTLLIBS="$LIBINTL" AC_SUBST([INTLLIBS]) dnl Make all documented variables known to autoconf. AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) AC_SUBST([POSUB]) ]) dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized. m4_define([gt_NEEDS_INIT], [ m4_divert_text([DEFAULTS], [gt_needs=]) m4_define([gt_NEEDS_INIT], []) ]) dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL]) AC_DEFUN([AM_GNU_GETTEXT_NEED], [ m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"]) ]) dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) gnuchess-6.2.2/m4/iconv.m4000644 000766 000024 00000021620 12205361270 016052 0ustar00antoniostaff000000 000000 # iconv.m4 serial 18 (gettext-0.18.2) dnl Copyright (C) 2000-2002, 2007-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_LIB_LINKFLAGS_BODY([iconv]) ]) AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_func_iconv=yes]) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_lib_iconv=yes] [am_cv_func_iconv=yes]) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11, dnl Solaris 10. am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include int main () { int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static const char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static const char input[] = "\263"; char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; const char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) result |= 16; return result; }]])], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no], [ changequote(,)dnl case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac changequote([,])dnl ]) LIBS="$am_save_LIBS" ]) case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then AC_DEFINE([HAVE_ICONV], [1], [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST([LIBICONV]) AC_SUBST([LTLIBICONV]) ]) dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to dnl avoid warnings like dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". dnl This is tricky because of the way 'aclocal' is implemented: dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. dnl Otherwise aclocal's initial scan pass would miss the macro definition. dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. dnl Otherwise aclocal would emit many "Use of uninitialized value $1" dnl warnings. m4_define([gl_iconv_AC_DEFUN], m4_version_prereq([2.64], [[AC_DEFUN_ONCE( [$1], [$2])]], [m4_ifdef([gl_00GNULIB], [[AC_DEFUN_ONCE( [$1], [$2])]], [[AC_DEFUN( [$1], [$2])]])])) gl_iconv_AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL([am_cv_proto_iconv], [ AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ]], [[]])], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([ $am_cv_proto_iconv]) AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], [Define as const if the declaration of iconv() needs const.]) dnl Also substitute ICONV_CONST in the gnulib generated . m4_ifdef([gl_ICONV_H_DEFAULTS], [AC_REQUIRE([gl_ICONV_H_DEFAULTS]) if test -n "$am_cv_proto_iconv_arg1"; then ICONV_CONST="const" fi ]) fi ]) gnuchess-6.2.2/m4/intlmacosx.m4000644 000766 000024 00000004753 12205367045 017133 0ustar00antoniostaff000000 000000 # intlmacosx.m4 serial 5 (gettext-0.18.2) dnl Copyright (C) 2004-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Checks for special options needed on Mac OS X. dnl Defines INTL_MACOSX_LIBS. AC_DEFUN([gt_INTL_MACOSX], [ dnl Check for API introduced in Mac OS X 10.2. AC_CACHE_CHECK([for CFPreferencesCopyAppValue], [gt_cv_func_CFPreferencesCopyAppValue], [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[CFPreferencesCopyAppValue(NULL, NULL)]])], [gt_cv_func_CFPreferencesCopyAppValue=yes], [gt_cv_func_CFPreferencesCopyAppValue=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1], [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) fi dnl Check for API introduced in Mac OS X 10.3. AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent], [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[CFLocaleCopyCurrent();]])], [gt_cv_func_CFLocaleCopyCurrent=yes], [gt_cv_func_CFLocaleCopyCurrent=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFLocaleCopyCurrent = yes; then AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1], [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi AC_SUBST([INTL_MACOSX_LIBS]) ]) gnuchess-6.2.2/m4/lib-ld.m4000644 000766 000024 00000007143 12205361270 016103 0ustar00antoniostaff000000 000000 # lib-ld.m4 serial 6 dnl Copyright (C) 1996-2003, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid dnl collision with libtool.m4. dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], [# I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 /dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL([acl_cv_path_LD], [if test -z "$LD"; then acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 = 1.10 to complain if config.rpath is missing. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE([rpath], [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_FROMPACKAGE(name, package) dnl declares that libname comes from the given package. The configure file dnl will then not have a --with-libname-prefix option but a dnl --with-package-prefix option. Several libraries can come from the same dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar dnl macro call that searches for libname. AC_DEFUN([AC_LIB_FROMPACKAGE], [ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_frompackage_]NAME, [$2]) popdef([NAME]) pushdef([PACK],[$2]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_libsinpackage_]PACKUP, m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1]) popdef([PACKUP]) popdef([PACK]) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) dnl Autoconf >= 2.61 supports dots in --with options. pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_ARG_WITH(P_A_C_K[-prefix], [[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi ]) dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= LIB[]NAME[]_PREFIX= dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been dnl computed. So it has to be reset here. HAVE_LIB[]NAME= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" dnl The same code as in the loop below: dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$acl_hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi popdef([P_A_C_K]) popdef([PACKLIBS]) popdef([PACKUP]) popdef([PACK]) popdef([NAME]) ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) dnl For those cases where a variable contains several -L and -l options dnl referring to unknown libraries and directories, this macro determines the dnl necessary additional linker options for the runtime path. dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) dnl sets LDADDVAR to linker options needed together with LIBSVALUE. dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, dnl otherwise linking without libtool is assumed. AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], [ AC_REQUIRE([AC_LIB_RPATH]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) $1= if test "$enable_rpath" != no; then if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode directories into the resulting dnl binary. rpathdirs= next= for opt in $2; do if test -n "$next"; then dir="$next" dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= else case $opt in -L) next=yes ;; -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= ;; *) next= ;; esac fi done if test "X$rpathdirs" != "X"; then if test -n ""$3""; then dnl libtool is used for linking. Use -R options. for dir in $rpathdirs; do $1="${$1}${$1:+ }-R$dir" done else dnl The linker is used for linking directly. if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user dnl must pass all path elements in one option. alldirs= for dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="$flag" else dnl The -rpath options are cumulative. for dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="${$1}${$1:+ }$flag" done fi fi fi fi fi AC_SUBST([$1]) ]) gnuchess-6.2.2/m4/lib-prefix.m4000644 000766 000024 00000020422 12205361270 016774 0ustar00antoniostaff000000 000000 # lib-prefix.m4 serial 7 (gettext-0.18) dnl Copyright (C) 2001-2005, 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't dnl require excessive bracketing. ifdef([AC_HELP_STRING], [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib-prefix], [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" ]) dnl AC_LIB_PREPARE_MULTILIB creates dnl - a variable acl_libdirstem, containing the basename of the libdir, either dnl "lib" or "lib64" or "lib/64", dnl - a variable acl_libdirstem2, as a secondary possible value for dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or dnl "lib/amd64". AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ dnl There is no formal standard regarding lib and lib64. dnl On glibc systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine dnl the compiler's default mode by looking at the compiler's library search dnl path. If at least one of its elements ends in /lib64 or points to a dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI. dnl Otherwise we use the default, namely "lib". dnl On Solaris systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. AC_REQUIRE([AC_CANONICAL_HOST]) acl_libdirstem=lib acl_libdirstem2= case "$host_os" in solaris*) dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment dnl . dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the dnl symlink is missing, so we set acl_libdirstem2 too. AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], [AC_EGREP_CPP([sixtyfour bits], [ #ifdef _LP64 sixtyfour bits #endif ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) ]) if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" ]) gnuchess-6.2.2/m4/nls.m4000644 000766 000024 00000002315 12205361270 015530 0ustar00antoniostaff000000 000000 # nls.m4 serial 5 (gettext-0.18) dnl Copyright (C) 1995-2003, 2005-2006, 2008-2013 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ([2.50]) AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE([nls], [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT([$USE_NLS]) AC_SUBST([USE_NLS]) ]) gnuchess-6.2.2/m4/po.m4000644 000766 000024 00000045041 12205361270 015355 0ustar00antoniostaff000000 000000 # po.m4 serial 21 (gettext-0.18.3) dnl Copyright (C) 1995-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ([2.60]) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl AC_REQUIRE([AC_PROG_SED])dnl AC_REQUIRE([AM_NLS])dnl dnl Release version of the gettext macros. This is used to ensure that dnl the gettext macros and po/Makefile.in.in are in sync. AC_SUBST([GETTEXT_MACRO_VERSION], [0.18]) dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. dnl Search for GNU msgfmt in the PATH. dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. dnl The second test excludes FreeBSD msgfmt. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT]) dnl Test whether it is GNU msgfmt >= 0.15. changequote(,)dnl case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac changequote([,])dnl AC_SUBST([MSGFMT_015]) changequote(,)dnl case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac changequote([,])dnl AC_SUBST([GMSGFMT_015]) dnl Search for GNU xgettext 0.12 or newer in the PATH. dnl The first test excludes Solaris xgettext and early GNU xgettext versions. dnl The second test excludes FreeBSD xgettext. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po dnl Test whether it is GNU xgettext >= 0.15. changequote(,)dnl case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac changequote([,])dnl AC_SUBST([XGETTEXT_015]) dnl Search for GNU msgmerge 0.11 or newer in the PATH. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) dnl Installation directories. dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we dnl have to define it here, so that it can be used in po/Makefile. test -n "$localedir" || localedir='${datadir}/locale' AC_SUBST([localedir]) dnl Support for AM_XGETTEXT_OPTION. test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) AC_CONFIG_COMMANDS([po-directories], [[ for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" gt_tab=`printf '\t'` cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done]], [# Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" ]) ]) dnl Postprocesses a Makefile in a directory containing PO files. AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], [ # When this code is run, in config.status, two variables have already been # set: # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, # - LINGUAS is the value of the environment variable LINGUAS at configure # time. changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Find a way to echo strings without interpreting backslash. if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then gt_echo='echo' else if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then gt_echo='printf %s\n' else echo_func () { cat < "$ac_file.tmp" tab=`printf '\t'` if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` cat >> "$ac_file.tmp" < /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` cat >> "$ac_file.tmp" <> "$ac_file.tmp" <, 1996. AC_PREREQ([2.50]) # Search path for a program which passes the given test. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN([AM_PATH_PROG_WITH_TEST], [ # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL([ac_cv_path_$1], [case "[$]$1" in [[\\/]]* | ?:[[\\/]]*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in ifelse([$5], , $PATH, [$5]); do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$][$1]) else AC_MSG_RESULT([no]) fi AC_SUBST([$1])dnl ]) gnuchess-6.2.2/lib/gettext.h000644 000766 000024 00000023433 12205643704 016566 0ustar00antoniostaff000000 000000 /* Convenience header for conditional use of GNU . Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef _LIBGETTEXT_H #define _LIBGETTEXT_H 1 /* NLS can be disabled through the configure --disable-nls option. */ #if ENABLE_NLS /* Get declarations of GNU message catalog functions. */ # include /* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by the gettext() and ngettext() macros. This is an alternative to calling textdomain(), and is useful for libraries. */ # ifdef DEFAULT_TEXT_DOMAIN # undef gettext # define gettext(Msgid) \ dgettext (DEFAULT_TEXT_DOMAIN, Msgid) # undef ngettext # define ngettext(Msgid1, Msgid2, N) \ dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N) # endif #else /* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. We don't include as well because people using "gettext.h" will not include , and also including would fail on SunOS 4, whereas is OK. */ #if defined(__sun) # include #endif /* Many header files from the libstdc++ coming with g++ 3.3 or newer include , which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. */ #if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) # include # if (__GLIBC__ >= 2 && !defined __UCLIBC__) || _GLIBCXX_HAVE_LIBINTL_H # include # endif #endif /* Disabled NLS. The casts to 'const char *' serve the purpose of producing warnings for invalid uses of the value returned from these functions. On pre-ANSI systems without 'const', the config.h file is supposed to contain "#define const". */ # undef gettext # define gettext(Msgid) ((const char *) (Msgid)) # undef dgettext # define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid)) # undef dcgettext # define dcgettext(Domainname, Msgid, Category) \ ((void) (Category), dgettext (Domainname, Msgid)) # undef ngettext # define ngettext(Msgid1, Msgid2, N) \ ((N) == 1 \ ? ((void) (Msgid2), (const char *) (Msgid1)) \ : ((void) (Msgid1), (const char *) (Msgid2))) # undef dngettext # define dngettext(Domainname, Msgid1, Msgid2, N) \ ((void) (Domainname), ngettext (Msgid1, Msgid2, N)) # undef dcngettext # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ ((void) (Category), dngettext (Domainname, Msgid1, Msgid2, N)) # undef textdomain # define textdomain(Domainname) ((const char *) (Domainname)) # undef bindtextdomain # define bindtextdomain(Domainname, Dirname) \ ((void) (Domainname), (const char *) (Dirname)) # undef bind_textdomain_codeset # define bind_textdomain_codeset(Domainname, Codeset) \ ((void) (Domainname), (const char *) (Codeset)) #endif /* Prefer gnulib's setlocale override over libintl's setlocale override. */ #ifdef GNULIB_defined_setlocale # undef setlocale # define setlocale rpl_setlocale #endif /* A pseudo function call that serves as a marker for the automated extraction of messages, but does not call gettext(). The run-time translation is done at a different place in the code. The argument, String, should be a literal string. Concatenated strings and other string expressions won't work. The macro's expansion is not parenthesized, so that it is suitable as initializer for static 'char[]' or 'const char[]' variables. */ #define gettext_noop(String) String /* The separator between msgctxt and msgid in a .mo file. */ #define GETTEXT_CONTEXT_GLUE "\004" /* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be short and rarely need to change. The letter 'p' stands for 'particular' or 'special'. */ #ifdef DEFAULT_TEXT_DOMAIN # define pgettext(Msgctxt, Msgid) \ pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #else # define pgettext(Msgctxt, Msgid) \ pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #endif #define dpgettext(Domainname, Msgctxt, Msgid) \ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #define dcpgettext(Domainname, Msgctxt, Msgid, Category) \ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category) #ifdef DEFAULT_TEXT_DOMAIN # define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #else # define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #endif #define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category) #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * pgettext_aux (const char *domain, const char *msg_ctxt_id, const char *msgid, int category) { const char *translation = dcgettext (domain, msg_ctxt_id, category); if (translation == msg_ctxt_id) return msgid; else return translation; } #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * npgettext_aux (const char *domain, const char *msg_ctxt_id, const char *msgid, const char *msgid_plural, unsigned long int n, int category) { const char *translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); if (translation == msg_ctxt_id || translation == msgid_plural) return (n == 1 ? msgid : msgid_plural); else return translation; } /* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID can be arbitrary expressions. But for string literals these macros are less efficient than those above. */ #include #if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \ /* || __STDC_VERSION__ >= 199901L */ ) # define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1 #else # define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0 #endif #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS #include #endif #define pgettext_expr(Msgctxt, Msgid) \ dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES) #define dpgettext_expr(Domainname, Msgctxt, Msgid) \ dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES) #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * dcpgettext_expr (const char *domain, const char *msgctxt, const char *msgid, int category) { size_t msgctxt_len = strlen (msgctxt) + 1; size_t msgid_len = strlen (msgid) + 1; const char *translation; #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS char msg_ctxt_id[msgctxt_len + msgid_len]; #else char buf[1024]; char *msg_ctxt_id = (msgctxt_len + msgid_len <= sizeof (buf) ? buf : (char *) malloc (msgctxt_len + msgid_len)); if (msg_ctxt_id != NULL) #endif { memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); msg_ctxt_id[msgctxt_len - 1] = '\004'; memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); translation = dcgettext (domain, msg_ctxt_id, category); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS if (msg_ctxt_id != buf) free (msg_ctxt_id); #endif if (translation != msg_ctxt_id) return translation; } return msgid; } #define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \ dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) #define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * dcnpgettext_expr (const char *domain, const char *msgctxt, const char *msgid, const char *msgid_plural, unsigned long int n, int category) { size_t msgctxt_len = strlen (msgctxt) + 1; size_t msgid_len = strlen (msgid) + 1; const char *translation; #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS char msg_ctxt_id[msgctxt_len + msgid_len]; #else char buf[1024]; char *msg_ctxt_id = (msgctxt_len + msgid_len <= sizeof (buf) ? buf : (char *) malloc (msgctxt_len + msgid_len)); if (msg_ctxt_id != NULL) #endif { memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); msg_ctxt_id[msgctxt_len - 1] = '\004'; memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS if (msg_ctxt_id != buf) free (msg_ctxt_id); #endif if (!(translation == msg_ctxt_id || translation == msgid_plural)) return translation; } return (n == 1 ? msgid : msgid_plural); } #endif /* _LIBGETTEXT_H */ gnuchess-6.2.2/doc/fdl.texi000644 000766 000024 00000056015 11546721544 016400 0ustar00antoniostaff000000 000000 @c The GNU Free Documentation License. @center Version 1.3, 3 November 2008 @c This file is intended to be included within another document, @c hence no sectioning command or @node. @display Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. @uref{http://fsf.org/} Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @end display @enumerate 0 @item PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document @dfn{free} in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of ``copyleft'', which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. @item APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The ``Document'', below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as ``you''. You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A ``Modified Version'' of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A ``Secondary Section'' is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The ``Invariant Sections'' are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. The ``Cover Texts'' are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. A ``Transparent'' copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not ``Transparent'' is called ``Opaque''. Examples of suitable formats for Transparent copies include plain @sc{ascii} without markup, Texinfo input format, La@TeX{} input format, @acronym{SGML} or @acronym{XML} using a publicly available @acronym{DTD}, and standard-conforming simple @acronym{HTML}, PostScript or @acronym{PDF} designed for human modification. Examples of transparent image formats include @acronym{PNG}, @acronym{XCF} and @acronym{JPG}. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, @acronym{SGML} or @acronym{XML} for which the @acronym{DTD} and/or processing tools are not generally available, and the machine-generated @acronym{HTML}, PostScript or @acronym{PDF} produced by some word processors for output purposes only. The ``Title Page'' means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, ``Title Page'' means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. The ``publisher'' means any person or entity that distributes copies of the Document to the public. A section ``Entitled XYZ'' means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as ``Acknowledgements'', ``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title'' of such a section when you modify the Document means that it remains a section ``Entitled XYZ'' according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. @item VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. @item COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. @item MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: @enumerate A @item Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. @item List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. @item State on the Title page the name of the publisher of the Modified Version, as the publisher. @item Preserve all the copyright notices of the Document. @item Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. @item Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. @item Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. @item Include an unaltered copy of this License. @item Preserve the section Entitled ``History'', Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled ``History'' in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. @item Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the ``History'' section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. @item For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. @item Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. @item Delete any section Entitled ``Endorsements''. Such a section may not be included in the Modified Version. @item Do not retitle any existing section to be Entitled ``Endorsements'' or to conflict in title with any Invariant Section. @item Preserve any Warranty Disclaimers. @end enumerate If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section Entitled ``Endorsements'', provided it contains nothing but endorsements of your Modified Version by various parties---for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. @item COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections Entitled ``History'' in the various original documents, forming one section Entitled ``History''; likewise combine any sections Entitled ``Acknowledgements'', and any sections Entitled ``Dedications''. You must delete all sections Entitled ``Endorsements.'' @item COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. @item AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an ``aggregate'' if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. @item TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled ``Acknowledgements'', ``Dedications'', or ``History'', the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. @item TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, or distribute it is void, and will automatically terminate your rights under this License. However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, receipt of a copy of some or all of the same material does not give you any rights to use it. @item FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See @uref{http://www.gnu.org/copyleft/}. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License ``or any later version'' applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. If the Document specifies that a proxy can decide which future versions of this License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Document. @item RELICENSING ``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any World Wide Web server that publishes copyrightable works and also provides prominent facilities for anybody to edit those works. A public wiki that anybody can edit is an example of such a server. A ``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the site means any set of copyrightable works thus published on the MMC site. ``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0 license published by Creative Commons Corporation, a not-for-profit corporation with a principal place of business in San Francisco, California, as well as future copyleft versions of that license published by that same organization. ``Incorporate'' means to publish or republish a Document, in whole or in part, as part of another Document. An MMC is ``eligible for relicensing'' if it is licensed under this License, and if all works that were first published under this License somewhere other than this MMC, and subsequently incorporated in whole or in part into the MMC, (1) had no cover texts or invariant sections, and (2) were thus incorporated prior to November 1, 2008. The operator of an MMC Site may republish an MMC contained in the site under CC-BY-SA on the same site at any time before August 1, 2009, provided the MMC is eligible for relicensing. @end enumerate @page @heading ADDENDUM: How to use this License for your documents To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page: @smallexample @group Copyright (C) @var{year} @var{your name}. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. @end group @end smallexample If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the ``with@dots{}Texts.'' line with this: @smallexample @group with the Invariant Sections being @var{list their titles}, with the Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}. @end group @end smallexample If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software. @c Local Variables: @c ispell-local-pdict: "ispell-dict" @c End: gnuchess-6.2.2/doc/gnuchess.info000644 000766 000024 00000241456 12606707212 017433 0ustar00antoniostaff000000 000000 This is gnuchess.info, produced by makeinfo version 5.0 from gnuchess.texi. This manual is for GNU Chess (version 6.2.2, 4 January 2015), which is a complete chess program, frequently used as a chess engine. Copyright (C) 2001-2015 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". INFO-DIR-SECTION Basics START-INFO-DIR-ENTRY * GNU Chess: (gnuchess). Playing chess and related games. END-INFO-DIR-ENTRY  File: gnuchess.info, Node: Top, Next: Overview, Up: (dir) GNU Chess ********* This manual is for GNU Chess (version 6.2.2, 4 January 2015). This manual is for GNU Chess (version 6.2.2, 4 January 2015), which is a complete chess program, frequently used as a chess engine. Copyright (C) 2001-2015 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". * Menu: * Overview:: General information. * Contact info:: How to find help and to report bugs. * Invocation:: Running 'gnuchess'. * Book:: Where and how to obtain a chess book usable by GNU Chess. * Tests:: Some execution results. * Chess notation:: Auxillary file formats (PGN, EPD). * History:: A brief review of the long history of GNU Chess. * Known problems:: Known problems * Developers:: Notes for developers. * Translations:: GNU Chess in other languages. * GNU Free Documentation License:: Copying and sharing this documentation. * Concept index:: Index of concepts.  File: gnuchess.info, Node: Overview, Next: Contact info, Prev: Top, Up: Top 1 Overview ********** GNU Chess () is a computer program for playing chess. It can be used to interactively play chess on a text terminal, but it is more often used in conjunction with a GUI program such as GNU XBoard. Because it is protected by the GNU General Public License, users are free (in perpetuity) to share and change it. The main author of GNU Chess version 6 is Fabien Letouzey, The original author is Stuart Cracraft.  File: gnuchess.info, Node: Contact info, Next: Invocation, Prev: Overview, Up: Top 2 Contact info ************** We are the GNU Chess developers and you may reach us at: Our official web page is: We are indebted to our sponsor, the Free Software Foundation whose web page is: and which also serves as our software depository for new versions of GNU and GNU Chess. You can download the latest version from GNU's FTP site at: The code is provided for the purpose of encouraging you to do the programming. If you lack the programming skills to do so, try dabbling in it. You might surprise yourself. If you want to report a possible bug in GNU Chess, please send a message to the e-mail address indicated above, providing precise information about the conditions that led to the possible bug. As a general guideline, you can kindly include the follow information: * Version of the program. The following command will print it: gnuchess --version * How you started the program. Whether running standalone or in combination with other programs such as XBoard. * The actions you performed and the output or behaviour you observed. * Output files if any. In order to enable the writing to adapter.log, set the following option in config file gnuchess.ini: 'Log = true' * Whether the problem is systematic (it always happens) or occasional. * Any other information you may deem relevant.  File: gnuchess.info, Node: Invocation, Next: Book, Prev: Contact info, Up: Top 3 Running 'gnuchess' ******************** * Menu: * Invoking gnuchess:: * Interactive game:: * Command list:: * Environment variables:: * Configuration file:: * Output files:: * XBoard chess engine:: * UCI chess engine:: * Internet::  File: gnuchess.info, Node: Invoking gnuchess, Next: Interactive game, Up: Invocation 3.1 Invoking gnuchess ===================== The format for running the 'gnuchess' program is: gnuchess OPTION ... With no options, 'gnuchess' starts in interactive mode and it is ready to start a chess game. 'gnuchess' supports the following options: '--help' '-h' Print an informative help message on standard output and exit successfully. '--version' '-v' Print the version number and licensing information of Hello on standard output and then exit successfully. '--quiet' '--silent' '-q' Make the program silent on startup. '--xboard' '-x' Start the program in xboard mode, i.e. as an xboard engine. This is typically used for using the program as backend of other chess GUI such as XBoard. Option 'xboard'Âcompatibility. '--post' '-p' Start up showing thinking. Option 'post'Âcompatibility. '--easy' '-e' Disable thinking in opponent's time. By default, the program runs in hard mode, i.e. it uses opponent's time to think too. '--manual' '-m' Enable manual mode. '--uci' '-u' Enable UCI protocol (externally behave as UCI engine). '--memory size' '-M size' Specify memory usage in MB for hashtable. '--addbook filename' '-a filename' Compile book.bin from pgn book 'filename' and quits. '--graphic' '-g' Enable graphic mode based on Unicode chess symbols.  File: gnuchess.info, Node: Interactive game, Next: Command list, Prev: Invoking gnuchess, Up: Invocation 3.2 Interactive game ==================== Moves are accepted either in standard algebraic notation (SAN) or in coordinate algebraic notation. Examples: Nf3 g1f3 O-O e1g1  File: gnuchess.info, Node: Command list, Next: Environment variables, Prev: Interactive game, Up: Invocation 3.3 Command list ================ 'gnuchess' supports the following commands: '^C' Quit the program. 'quit' Quit the program. 'exit' In analysis mode this stops analysis, otherwise it quits the program. 'help' Produces a help blurb corresponding to this list of commands. 'usage' Produce blurb on command line options. (Same as 'gnuchess --help') 'book' Handle the book. Requires a subcommand: add - compiles book.bin from book.pgn on - enables use of book off - disables use of book best - play best move from book worst - play worst move from book random - play any move from book prefer (default) - choose a good move from book (Method subject to variation) 'version' Prints out the version of this program (Same as 'gnuchess --version') 'pgnsave FILENAME' Saves the game so far to the file from memory 'pgnload FILENAME' Loads the game in the file into memory (cf. pgnreplay) 'pgnreplay FILENAME' Loads the game in the file into memory, and enables commands first, last, next, previous. This allows replaying a saved game step by step. (cf. pgnload) 'first' Go to start position of pgn loaded game with pgnreplay. 'last' Go to last position of pgn loaded game with pgnreplay. 'next' Advances one move in pgn loaded game with pgnreplay. 'n' Advances one move in pgn loaded game with pgnreplay. 'previous' Back one move in pgn loaded game with pgnreplay. 'p' Back one move in pgn loaded game with pgnreplay. 'force' 'manual' Makes the program stop moving. You may now enter moves to reach some position in the future. (Same as 'gnuchess --manual') 'white' Program plays black, set white to move. Note: not implemented in this version. 'black' Program plays white, set black to move. (White and black commands are mainly for icsDrone and will cause the current en-passant capture square to be forgotten). Note: not implemented in this version. 'go' Computer takes whichever side is on move and begins its thinking immediately 'easy' Disables thinking on opponent's time (Same as 'gnuchess --easy') 'hard' Enables thinking on opponent's time 'post' Arranges for verbose thinking output showing variation, score, time, depth, etc. If pondering (see hard) is on, the program will output it's thinking whilst the opponent is thinking. (Same as 'gnuchess --post') 'nopost' Turns off verbose thinking output 'name NAME' Lets you input your name. Also writes the log.nnn and a corresponding game.nnn file. For details please see auxillary file format sections. 'result' Mostly used by Internet Chess server. 'activate' This command reactivates a game that has been terminated automatically due to checkmate or no more time on the clock. However, it does not alter those conditions. You would have to undo a move or two or add time to the clock with level or time in that case. Note: not implemented in this version. 'rating COMPUTERRATING OPPONENTRATING' Inputs the estimated rating for computer and for its opponent 'new' Sets up new game (i.e. positions in original positions) 'time' Inputs time left in game for computer in hundredths of a second. Mostly used by Internet Chess server. 'otim' Inputs time left in game for opponent in hundredths of a second. Mostly used by Internet Chess server. 'random' Randomizes play by perturbing the evaluation score slightly. The degree of perturbation is adjustable. Note: not implemented in this version. Neither in v5 'hash' on - enables using the memory hash table to speed search off - disables the memory hash table 'memory N' Sets the hash table to permit storage of N MB. 'null' on - enables using the null move heuristic to speed search off - disables using the null move heuristic 'xboard' on - enables use of xboard/winboard off - disables use of xboard/winboard (Same as 'gnuchess --xboard') 'depth N' Sets the program to look N ply (half-moves) deep for every search it performs. If there is a checkmate or other condition that does not allow that depth, then it will not be 'level MOVES MINUTES INCREMENT' Sets time control to be MOVES in MINUTES with each move giving an INCREMENT (in seconds, i.e. Fischer-style clock). 'load' 'epdload' Loads a position in EPD format from disk into memory. 'save' 'epdsave' Saves game position into EPD format from memory to disk. 'switch' Switches side to move Note: not implemented in this version. 'solve FILENAME' 'solveepd FILENAME' Solves the positions in FILENAME 'remove' Backs up two moves in game history 'undo' Backs up one move in game history 'show' Requires a subcommand: board - displays the current board time - displays the time settings moves - shows all moves using one call to routine escape - shows moves that escape from check using one call to routine noncapture - shows non-capture moves capture - shows capture moves eval [or score] - shows the evaluation per piece and overall game - shows moves in game history pin - shows pinned pieces Note: 'show eval' and 'show pin' not implemented in this version. 'test' Requires a subcommand: movelist - reads in an epd file and shows legal moves for its entries capture - reads in an epd file and shows legal captures for its entries movegenspeed - tests speed of move generator capturespeed - tests speed of capture move generator eval - reads in an epd file and shows evaluation for its entries evalspeed tests speed of the evaluator Note: not implemented in this version. 'analyze' Switches program into analysis mode, this is primarily intended for communicating analysis to an external interface using the Xboard chess engine protocol. It enables "force", "post", and "hard", at the same time, whilst altering the output format of post to conform with the engine protocol. 'graphic' Enables graphic mode. In this mode, the board is displayed using the Unicode chess symbols (Codepoints from U+2654 to U+265F). The graphic mode requires a terminal with Unicode support. (Same as 'gnuchess --graphic') 'nographic' Disables graphic mode. The board is displayed using the good-old classic view based on plain ASCII.  File: gnuchess.info, Node: Environment variables, Next: Configuration file, Prev: Command list, Up: Invocation 3.4 Environment variables ========================= If 'GNUCHESS_PKGDATADIR' is defined, it will be taken as the path for the config file and for the book, in case the files are not found in the current directory. If it is not defined, they will be taken from the package data directory, in case the files are not found in the current directory.  File: gnuchess.info, Node: Configuration file, Next: Output files, Prev: Environment variables, Up: Invocation 3.5 Configuration file ====================== * Menu: * Structure:: * Options:: * Workarounds::  File: gnuchess.info, Node: Structure, Next: Options, Up: Configuration file 3.5.1 Structure --------------- A file called 'gnuchess.ini' is used to define configuration options. The file is applicable provided '--uci' is not used. The file is looked in three places according to the following precedence: 1. The directory where the program was started 2. Environment variable'GNUCHESS_PKGDATADIR' 3. The package data directory stated at configure time Sections are composed of 'variable = value' lines. Note: There can be spaces in variable names or values. Do not use quotes. '[Adapter]' section This section is used by the adapter only. The engine is unaware of these options. The list of available options is detailed below in this document. '[Engine]' section This section contains engine UCI options. The PolyGlot-based adapter does not understand them, but sends the information to the engine at startup (converted to 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 correct. It will be replaced by the adapter with 'setoption name OwnBook value true' at engine startup. Standard UCI options are 'Hash', 'NalimovPath', 'NalimovCache' and 'OwnBook'. Hidden options like 'Ponder' or 'UCI_xxx' are automatic and should not be put in the INI file.  File: gnuchess.info, Node: Options, Next: Workarounds, Prev: Structure, Up: Configuration file 3.5.2 Options ------------- These should be put in the '[Adapter]' section. 'Log' Default: false Whether the adapter should log all transactions with the interface and the engine. This should be necessary only to locate problems. 'LogFile' Default: 'adapter.log' The name of the log file. Note that it is put where the program was launched from, not into the engine directory. WARNING: Log files are not cleared between sessions, and can become very large. It is safe to remove them though. 'Resign' Default: false Set this to "true" if you want the adapter to resign on behalf of the engine. NOTE: Some engines display buggy scores from time to time although the best move is correct. Use this option only if you know what you are doing (e.g. you always check the final position of games). 'ResignMoves' Default: 3 Number of consecutive moves with "resign" score (see below) before the adapter resigns for the engine. Positions with only one legal move are ignored. 'ResignScore' Default: 600 This is the score in centipawns that will trigger resign "counting". 'ShowPonder' Default: true Show search information during engine pondering. Turning this off might be better for interactive use in some interfaces. 'KibitzMove' Default: false Whether to kibitz when playing a move. 'KibitzPV' Default: false Whether to kibitz when the PV is changed (new iteration or new best move). 'KibitzCommand' Default: tellall 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 affect only if "KibitzPV" is selected, move kibitzes are always sent regardless of the delay. 'Book' Default: false Indicates whether the adapter should use a book. This has no effect on the engine own book (which can be controlled with the UCI option 'OwnBook' in the '[Engine]' section). In particular, it is possible to use both a PolyGlot book and an engine book. In that case, the engine book will be used whenever PolyGlot is out of book. Remember that PolyGlot is unaware of whether the engine is itself using a book or not. '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 current directory does not matter. If the file is not found in the current directory, it will be looked for in GNUCHESS_PKGDATADIR if the variable is defined, or in the package data directory otherwise. Note that there is no option to control book usage. All parameters are fixed when compiling a PGN file into a binary book (see below). This is purposeful and is not likely to change. Using a book does not require any additional memory, this can be important for memory-limited tournaments. These are UCI options for the '[Engine]' section: 'NullMove Pruning' (Always/Fail High/Never) Default: Fail High "Always" actually means the usual conditions (not in check, etc ...). "Fail High" adds the condition that the static evaluation fails high. Never use "Never" (ever)! OK you can use "Never" to test a Zugzwang problem. I expect that this option has little effect (assuming the first two choices only). It was only added because most engines do not use the fail-high condition. 'NullMove Reduction' (1-3 plies) Default: 3 3 is rather aggressive, especially in the endgame. It seems better than always using 2 though. 'Verification Search' (Always/Endgame/Never) Default: Endgame This tries to solve some Zugzwang-related problems. It is expected to hardly have any effect in games. The default value should be sufficient for most-common Zugzwang situations. 'Verification Reduction' (1-6 plies) Default: 5 5 guarantees that the cost of verification search is negligible in most cases. Of course it means Zugzwang problems need a lot of depth to get solved, if ever! With such a reduction, verification search is similar to Vincent Diepeveen's "double null move". 'History Pruning' (true/false) Default: true A bit dodgy, but fun to experiment with. It should help in blitz, but it's possible it actually hurts play in longer games. 'History Threshold' (percentage) Default: 60% This is the thing, as it affects the search tree! Lower values are safer, and higher values more aggressive. THIS VALUE HAS NOT BEEN TUNED! There is a good chance Fruit's strength can be improved by changing this option. 'Futility Pruning' (true/false) Default: false Very common but controversial. Makes the engine a tiny bit better at tactics but slightly weaker positionally. It might be beneficial by a very small amount, but has not been tested in conjunction with history pruning yet. 'Futility Margin' (centipawns) Default: 100 This value is somewhat aggressive. It could lead to problems in the endgame. Larger values prune less but will lead to fewer positional errors. 'Delta Pruning' (true/false) Default: false Similar to futility pruning. Probably safer because it is used mainly during the middlegame. Has not been tested with history pruning either. 'Delta Margin' (centipawns) Default: 50 Same behaviour as futility margin. This one is probably safe. 'Quiescence Check Plies' (0-2 plies) Default: 1 Fruit tries safe (SEE >= 0) checks at the first plies of the quiescence search. 0 means no checks at all (as in most older engines). 1 is the same as previous versions of Fruit. 2 is probably not worth the extra cost. It could be interesting when solving mate problems though. 'Evaluation options' (percentage) Default: 100% These options are evaluation-feature multipliers. You can modify Fruit's playing style to an extent or make Fruit weaker for instance by setting "Material" to a low value. "Material" is obvious. It also includes the bishop-pair bonus. "Piece Activity": piece placement and mobility. "King Safety": mixed features related to the king during early phases "Pawn Structure": all pawn-only features (not passed pawns). "Passed Pawns": ... can you guess? The following options were used in PolyGlot v1.4, but are deprecated in GNU Chess: 'EngineName' Default: GNU Chess This is the name that will appear in the xboard interface. It is cosmetic only. You can use different names for tweaked versions of the same engine. If no "Engine Name" is given, the UCI name will be used. 'EngineDir' Default: . Full path of the directory where the engine is installed. You can use "." (without the quotes) if you know that PolyGlot will be launched in the engine directory or the engine is in the "path" and does not need any data file. 'EngineCommand' Put here the name of the engine executable file. You can also add command-line arguments. Path searching is used and the current directory will be "EngineDir". NOTE: Unix users are recommended to prepend "./"; this is required on some secure systems.  File: gnuchess.info, Node: Workarounds, Prev: Options, Up: Configuration file 3.5.3 Workarounds ----------------- 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). The default value is always correct for bug-free software. These workarounds are unlikely to be used or meaningful for GNU Chess. 'UCIVersion' Default: 2 The default value of 2 corresponds to UCI+. Use 1 to select plain UCI for engines that have problems with UCI+. 'CanPonder' Default: false The adapter 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 ponder do not declare the option. This work around lets The adapter know that they can ponder. 'SyncStop' Default: false When a ponder miss occurs, the adapter 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 the adapter 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 "e7e8" instead of the correct "e7e8q". This work around enables the incorrect form (and of course promotes into a queen).  File: gnuchess.info, Node: Output files, Next: XBoard chess engine, Prev: Configuration file, Up: Invocation 3.6 Output files ================ GNU Chess produces several output files: 'Adapter log file' This file is written by the adapter. The name of the file is specified by the following option in 'gnuchess.ini': 'LogFile = FILENAME' The file is produced if option '--uci' is not specified and if the following variable is set in 'gnuchess.ini': Typically, this file is named 'adapter.log', but any other name will do the job. 'Log = true' 'log.nnn' This file is written if command 'name' was requested. The contents are the opponent's name and the game in coordinate algebraic notation. 'game.nnn' This file is written if command 'name' was requested. The contents are the opponent's name and the game in portable game notation (PGN). 'players.dat' This file is written if command 'name' was requested. The contents are the statistics of games. This is the format of each line: 'opponent-name wins loses draws' 'gnuchess.debug' This file contains internal information that is useful for debugging purposes. For this file to be written, it is necessary to define preprocessor directive 'DEBUG'. Hence, when installing the program, instead of ./configure make make install Use the following commands: ./configure CPPFLAGS=-DDEBUG make make install When analysing a bug, this file could be very helpful. Users are encouraged to provide it.  File: gnuchess.info, Node: XBoard chess engine, Next: UCI chess engine, Prev: Output files, Up: Invocation 3.7 XBoard chess engine ======================= Running the program with the "-xboard" command line parameter sets it to produce output acceptable to and accept input suitable for XBoard and WinBoard, the graphical display front-ends with mouse interface. For historical reasons the option "xboard" does not need to be preceeded by "-", however we would encourage the new syntax. How to run XBoard with GNU Chess as chess backend: xboard -fcp 'gnuchess --xboard' xboard -fd . -fcp './gnuchess --xboard'  File: gnuchess.info, Node: UCI chess engine, Next: Internet, Prev: XBoard chess engine, Up: Invocation 3.8 UCI chess engine ==================== For GNU Chess to behave as a pure UCI chess engine, execute the following command: gnuchess --uci In this mode, configuration file 'gnuchess.ini' is ignored.  File: gnuchess.info, Node: Internet, Prev: UCI chess engine, Up: Invocation 3.9 Internet ============ For GNU Chess to run in Internet, Zippy is required. See Zippy documentation in the XBoard/WinrBoard distribution: this is an example of how to run GNU Chess on FICS using XBoard as frontend and Zippy as connector: xboard -zp -ics -icshost freechess.org -icshelper timeseal -fcp 'gnuchess --xboard'  File: gnuchess.info, Node: Book, Next: Tests, Prev: Invocation, Up: Top 4 Book ****** See options 'Book' and 'Bookfile' in Running GNU Chess - Configuration file - Options  File: gnuchess.info, Node: Tests, Next: Chess notation, Prev: Book, Up: Top 5 Tests ******* GNU Chess 6 has been tested on the Free Internet Chess Server () with XBoard.  File: gnuchess.info, Node: Chess notation, Next: History, Prev: Tests, Up: Top 6 Auxiliary file formats ************************ '.bin' binary book format '.pgn' game listing like '1. e4 e5 2. Nf3' etc. '.epd' epd-style format using FEN notation. See tests subdirectory for example. 'log.nnn' record of an entire game from computer's viewpoint (thinking, etc.) 'game.nnn' record of an entire game, similar to .pgn but auto-generated The '.bin' file format is a simple binary format for the compiled book which is read by the program when it is using book. See the book section for more detail. EPD and PGN require little introduction. These are the uniformly accepted standards for position recording and game recording. Note that 'log.nnn' and 'game.nnn' files are written at the end of a game when you use the 'name' command to give the computer your name. It is highly recommended to do this since the resulting two files that match in a monotonically-increasing extension numbered suffix may be used for reporting bugs and keeping track of your games.  File: gnuchess.info, Node: History, Next: Known problems, Prev: Chess notation, Up: Top 7 History ********* The first version of GNU Chess was written by Stuart Cracraft back in 1984. Versions from 2 to 4 were written by John Stanback. Version 5 was written by Chua Kong-Sian. Version 6 was written by Fabien Letouzey.  File: gnuchess.info, Node: Known problems, Next: Developers, Prev: History, Up: Top 8 Known problems **************** * Menu: * Adapter::  File: gnuchess.info, Node: Adapter, Up: Known problems 8.1 Adapter =========== These are known problems of PolyGlot v1.4 as described by Fabien Letouzey. The addition of Chess960 support lead to a change in internal-move representation for castling. This slightly affected the opening-book format. We recommend that you recompile books with this version. Several users reported engines losing on time. The playing conditions always mixed playing on an Internet server with pondering. It is not yet clear what the source of the problem is, but there seems to be a forever incompatibility between the xboard and UCI protocol regarding a complex pondering/remaining-time relation.  File: gnuchess.info, Node: Developers, Next: Translations, Prev: Known problems, Up: Top 9 Developers ************ * Menu: * Background of v6:: * Guidelines followed to develop GNU Chess v6:: * Chess engine protocol adapter:: * Structure of the source code:: * C/C++ coexistence:: * Chess engine::  File: gnuchess.info, Node: Background of v6, Next: Guidelines followed to develop GNU Chess v6, Up: Developers 9.1 Background of v6 ==================== Since version 5.07 of the program was released in 2003, GNU Chess has basically remained unchanged. Then Fabien Letouzey developped Fruit, which proved to be a stronger chess engine and shaked the computer chess world. At some point in time, he kindly assigned copyright to FSF, which allowed us to make Fruit 2.1 (the latest free version) the base for GNU Chess v6. Therefore, it can be fairly said that Fabien Letouzey is remarkably the main contributor to GNU Chess v6.  File: gnuchess.info, Node: Guidelines followed to develop GNU Chess v6, Next: Chess engine protocol adapter, Prev: Background of v6, Up: Developers 9.2 Guidelines followed to develop GNU Chess v6 =============================================== The idea was to use Fruit 2.1 as the base for GNU Chess v6, keeping external interfaces backwards compatible. This is particularly important since GNU Chess has been world-wide used for long. GNU Chess can be used in two modes: interactively using the command-line interface on a text console, and used as backend engine from a graphical frontend. Both cases rely on almost identical grammar. The former is described in GNU Chess help. When GNU Chess is used as a pure chess engine, for instance, as backend for XBoard, it uses the Chess Engine Communication Protocol (aka XBoard protocol), which is described here: Since Fruit uses the Universal Chess Interface (UCI), keeping the former interface was the main challenge of GNU Chess v6. UCI is described here: GNU Chess can also run as a UCI chess engine, if the '--uci' command-line option is specified.  File: gnuchess.info, Node: Chess engine protocol adapter, Next: Structure of the source code, Prev: Guidelines followed to develop GNU Chess v6, Up: Developers 9.3 Chess engine protocol adapter ================================= UCI is very different from the Chess Engine Communication Protocol. PolyGlot is a UCI-to-xboard adapter developed by Fabien. It connects a UCI chess engine to an xboard interface such as WinBoard. UCI2WB is another such adapter (for Windows). Standalone PolyGlot can be used, along with Fruit, as chess engine for chess frontends, suchs as XBoard. In that case, PolyGlot and Fruit run as two independent single-threaded processes. PolyGlot starts first, and it forks Fruit. Both processes get communicated by by means of pipes: PolyGlot captures Fruit's standrad input and output. PolyGlot tries to solve known problems with other adapters. For instance, it detects and reports draws by fifty-move rule, repetition, etc. PolyGlot 1.4 has been adapted and incorporated to GNU Chess v6 as chess engine protocol adapter. It connects Fruit-based GNU Chess engine to the good old GNU Chess frontend.  File: gnuchess.info, Node: Structure of the source code, Next: C/C++ coexistence, Prev: Chess engine protocol adapter, Up: Developers 9.4 Structure of the source code ================================ We want to keep three loosely-coupled modules in GNU Chess v6: * frontend * adapter * engine The main program contains the frontend and starts two addtional threads, one for the adapter, and another one for the engine. The three components comprise a chain, thus there are two links: * frontend <-> adapter * adapter <-> engine The links are based on pipes. There is no need for additional synchronization mechanisms such as mutex. The changes in PolyGlot and Fruit are minimal, since they were already using the same mechanism to communicate with each other. Another technical problem was the fact that GNU Chess v5 was written in C, whereas PolyGlot and Fruit are written in C++. In GNU Chess v6 the main program, the adapter and the engine are in C++, but the frontend remains in C. Source code was placed under a single 'src' in GNU Chess v5, as usual. Three additional directories have been created for GNU Chess v6, so the code is organized in four directories: 'src' Contains the 'main' and a source file used to create the pipes that communicate the three modules: frontend, adapter and engine. 'src/frontend' Contains the frontend. The code here is inherited from GNU Chess v5, with some modifications mainly in 'cmd.c' and a new file 'engine.c' which addresses the message passing through modules. 'src/adapter' Contains the chess protocol adapter, based on PolyGlot 1.4. Minor changes, wrt the baseline. 'src/engine' Contains the chess engine, based on Fruit 2.1. Minor changes wrt the baseline. The sources in each 'src' subdirectory are compiled as a static library. When link with the sources in top 'src', they result into the binary 'gnuchess'. The module libraries are named after their respective directory name: libfrontend.a libadapter.a libengine.a  File: gnuchess.info, Node: C/C++ coexistence, Next: Chess engine, Prev: Structure of the source code, Up: Developers 9.5 C/C++ coexistence ===================== The source code of the frontend comes mainly from version 5.07, which was written in C. There is no problem in having both C and C++ in the same program, and so have they lived together in all versions from 6.0.0 to 6.1.0. However, in version 6.1.1 and subsequent versions the frontend is compiled in C++. This change has been introduced to avoid compilation warnings in output.cc (former output.c) as a result of the introduction of Unicode literals. PolyGlot and Fruit have a common origin, which means that there is a lot of shared code. The point is that the shared code is very similar but not identical, which would make hard an eventual unification. In order to avoid massive name clash, all the code has been wrapped in namespaces, one for the adapter, one for the engine. The frontend remains in the default namespace.  File: gnuchess.info, Node: Chess engine, Prev: C/C++ coexistence, Up: Developers 9.6 Chess engine ================ * Menu: * Fruit overview:: * Board data structure:: * Search algorithm:: * Transposition table:: * Null move:: * Move ordering:: * Evaluation function:: * Speed::  File: gnuchess.info, Node: Fruit overview, Next: Board data structure, Up: Chess engine 9.6.1 Fruit overview -------------------- Fruit was designed to help with the study of game-tree search algorithms, when applied to chess. It is now released as a chess engine, which is a somewhat different category of programs. Therefore the source code contains entire files and also functions that are either not used by the engine, or could be replaced with a much simpler (although somewhat less efficient) equivalent. As a chess engine, Fruit combines a "robust" search algorithm with a "minimalist" evaluation function. The latter is not a design choice, and will hopefully change in the future. The following description is only a very incomplete description. Please consult the source code for an absolute definition. The search algorithm was designed to accommodate with heavy forward-pruning eccentricities (such as search inconsistencies).  File: gnuchess.info, Node: Board data structure, Next: Search algorithm, Prev: Fruit overview, Up: Chess engine 9.6.2 Board data structure -------------------------- Fruit uses the 16x12 board. Although this structure is not very popular, it can be seen as simply combining 10x12 (mailbox) with 16x8 (0x88). 0x88 was picked in Fruit because of the small memory requirements of vector calculations (much smaller tables). It is possible that Fruit uses bitboards for pawns in the future.  File: gnuchess.info, Node: Search algorithm, Next: Transposition table, Prev: Board data structure, Up: Chess engine 9.6.3 Search algorithm ---------------------- The main search algorithm is a classical PVS with iterative deepening. Search enhancements such as a transposition table and null-move pruning are also used (see below). A few details in the PVS implementation are not-so-standard and are there to supposedly enhance the stability of the search (like reducing the consequences of search inconsistencies). For example the re-search window after a scout fail high of score "value" (with value > alpha) is [alpha,beta], not [value,beta]. As another example, I only allow null move when the static evaluation fails high (i.e. eval() >= beta). Whether these features improve the strength of the engine is an open question. The main search function is full_search() in search_full.cpp  File: gnuchess.info, Node: Transposition table, Next: Null move, Prev: Search algorithm, Up: Chess engine 9.6.4 Transposition table ------------------------- Fruit uses 4 probes and replaces the shallowest entry. Time stamping is used so that entries from previous searches are considered available for overwriting. Enhanced Transposition Cutoff (ETC) is also used 4 plies (and more) away from the horizon.  File: gnuchess.info, Node: Null move, Next: Move ordering, Prev: Transposition table, Up: Chess engine 9.6.5 Null move --------------- Fruit uses R=3 recursive null move, even in the endgame. In Fruit, a precondition to using null move is that the static eval fails high. One of the consequences of this is that no two null moves can be played in a row (this is because the evaluation is symmetrical). This is a usual condition but notice that in Fruit the null-move condition is "pure" (independent of move paths). The fail-high condition was selected for other reasons however. Also, a verification search is launched in the endgame.  File: gnuchess.info, Node: Move ordering, Next: Evaluation function, Prev: Null move, Up: Chess engine 9.6.6 Move ordering ------------------- The move ordering is rather basic: * transposition-table move * captures sorted by MVV/LVA * promotions * killer moves (two per level, no counters) * history moves (piece-type/to-square table, with "aging").  File: gnuchess.info, Node: Evaluation function, Next: Speed, Prev: Move ordering, Up: Chess engine 9.6.7 Evaluation function ------------------------- The evaluation function includes: * Material * Mobility * Drawish-material heuristics * Separated passed-pawn evaluation from the pawn hash table. Interaction with pieces can be taken into account * Pawn-shelter penalty; with king placement this forms some sort of a simplistic king-safety feature * Incremental move generation * Futility and delta pruning (not tested in conjunction with history pruning and hence not activated by default) * Move ordering (bad captures are postponed) * History pruning (not tested seriously yet enabled by default)  File: gnuchess.info, Node: Speed, Prev: Evaluation function, Up: Chess engine 9.6.8 Speed ----------- Fruit is not fast (in nodes per second) given the little it is calculating. Some "optimisations" could be undone in order to make the code shorter and more flexible.  File: gnuchess.info, Node: Translations, Next: GNU Free Documentation License, Prev: Developers, Up: Top 10 Translations *************** English is the native language of GNU Chess, as usual in the GNU Project. Starting on version 6.1.0, GNU Chess features internationalization support based on GNU 'gettext'. The Translation Project contributes message strings translated into other languages. See the Translation Project page for GNU Chess (http://translationproject.org/domain/gnuchess.html) for the currently available translations. During the installation of the operating system, the language to be used is selected. This selection is made system-wide. An individual user can select his or her own language by setting the 'locale' through environment variables. Typically, a command like this (in 'bash') will set German as the language to be used: export LANGUAGE=de_DE See details on this at  File: gnuchess.info, Node: GNU Free Documentation License, Next: Concept index, Prev: Translations, Up: Top Appendix A GNU Free Documentation License ***************************************** Version 1.3, 3 November 2008 Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. 0. PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. 1. APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not "Transparent" is called "Opaque". Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only. The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. The "publisher" means any person or entity that distributes copies of the Document to the public. A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as "Acknowledgements", "Dedications", "Endorsements", or "History".) To "Preserve the Title" of such a section when you modify the Document means that it remains a section "Entitled XYZ" according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. 2. VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. 3. COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. 4. MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. C. State on the Title page the name of the publisher of the Modified Version, as the publisher. D. Preserve all the copyright notices of the Document. E. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. F. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. H. Include an unaltered copy of this License. I. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. J. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. K. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. M. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version. N. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any Invariant Section. O. Preserve any Warranty Disclaimers. If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. 5. COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections Entitled "History" in the various original documents, forming one section Entitled "History"; likewise combine any sections Entitled "Acknowledgements", and any sections Entitled "Dedications". You must delete all sections Entitled "Endorsements." 6. COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. 7. AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. 8. TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. 9. TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, or distribute it is void, and will automatically terminate your rights under this License. However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, receipt of a copy of some or all of the same material does not give you any rights to use it. 10. FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See . Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. If the Document specifies that a proxy can decide which future versions of this License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Document. 11. RELICENSING "Massive Multiauthor Collaboration Site" (or "MMC Site") means any World Wide Web server that publishes copyrightable works and also provides prominent facilities for anybody to edit those works. A public wiki that anybody can edit is an example of such a server. A "Massive Multiauthor Collaboration" (or "MMC") contained in the site means any set of copyrightable works thus published on the MMC site. "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 license published by Creative Commons Corporation, a not-for-profit corporation with a principal place of business in San Francisco, California, as well as future copyleft versions of that license published by that same organization. "Incorporate" means to publish or republish a Document, in whole or in part, as part of another Document. An MMC is "eligible for relicensing" if it is licensed under this License, and if all works that were first published under this License somewhere other than this MMC, and subsequently incorporated in whole or in part into the MMC, (1) had no cover texts or invariant sections, and (2) were thus incorporated prior to November 1, 2008. The operator of an MMC Site may republish an MMC contained in the site under CC-BY-SA on the same site at any time before August 1, 2009, provided the MMC is eligible for relicensing. ADDENDUM: How to use this License for your documents ==================================================== To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page: Copyright (C) YEAR YOUR NAME. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the "with...Texts." line with this: with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software.  File: gnuchess.info, Node: Concept index, Prev: GNU Free Documentation License, Up: Top Concept index ************* [index] * Menu: * --addbook: Invoking gnuchess. (line 63) * --easy: Invoking gnuchess. (line 46) * --graphic: Invoking gnuchess. (line 67) * --help: Invoking gnuchess. (line 17) * --manual: Invoking gnuchess. (line 51) * --memory: Invoking gnuchess. (line 59) * --post: Invoking gnuchess. (line 40) * --quiet: Invoking gnuchess. (line 28) * --silent: Invoking gnuchess. (line 28) * --uci: Invoking gnuchess. (line 55) * --version: Invoking gnuchess. (line 22) * --xboard: Invoking gnuchess. (line 32) * -a: Invoking gnuchess. (line 63) * -e: Invoking gnuchess. (line 46) * -g: Invoking gnuchess. (line 67) * -h: Invoking gnuchess. (line 17) * -m: Invoking gnuchess. (line 51) * -M: Invoking gnuchess. (line 59) * -p: Invoking gnuchess. (line 40) * -q: Invoking gnuchess. (line 28) * -u: Invoking gnuchess. (line 55) * -v: Invoking gnuchess. (line 22) * -x: Invoking gnuchess. (line 32) * ^C: Command list. (line 9) * activate: Command list. (line 131) * adapter: Chess engine protocol adapter. (line 6) * adapter <1>: Structure of the source code. (line 6) * Adapter log file: Output files. (line 9) * analyze: Command list. (line 256) * author: Overview. (line 14) * authors: History. (line 6) * binary: Structure of the source code. (line 53) * black: Command list. (line 91) * book: Command list. (line 27) * Book: Options. (line 77) * book <1>: Book. (line 6) * BookFile: Options. (line 88) * C: C/C++ coexistence. (line 6) * C++: C/C++ coexistence. (line 6) * CanPonder: Workarounds. (line 21) * chess engine: Chess engine. (line 6) * Chess Engine Communication Protocol: Guidelines followed to develop GNU Chess v6. (line 15) * configuration file: Configuration file. (line 6) * contact: Contact info. (line 6) * Cracraft, Stuart: History. (line 6) * Delta Margin: Options. (line 196) * Delta Pruning: Options. (line 187) * depth: Command list. (line 181) * easy: Command list. (line 103) * engine: Structure of the source code. (line 6) * EngineCommand: Options. (line 249) * EngineDir: Options. (line 241) * EngineName: Options. (line 232) * environment variable: Environment variables. (line 6) * epdload: Command list. (line 191) * epdsave: Command list. (line 195) * Evaluation options: Options. (line 214) * exit: Command list. (line 15) * first: Command list. (line 61) * force: Command list. (line 80) * frontend: Structure of the source code. (line 6) * Fruit: Background of v6. (line 6) * Fruit <1>: Guidelines followed to develop GNU Chess v6. (line 6) * Futility Margin: Options. (line 178) * Futility Pruning: Options. (line 168) * go: Command list. (line 99) * graphic: Command list. (line 263) * hard: Command list. (line 108) * hash: Command list. (line 161) * help: Invoking gnuchess. (line 6) * help <1>: Invoking gnuchess. (line 17) * help <2>: Command list. (line 19) * history: History. (line 6) * History Pruning: Options. (line 150) * History Threshold: Options. (line 158) * invoking: Invoking gnuchess. (line 6) * KibitzCommand: Options. (line 64) * KibitzDelay: Options. (line 70) * KibitzMove: Options. (line 53) * KibitzPV: Options. (line 58) * Kong-Sian, Chua: History. (line 6) * last: Command list. (line 64) * Letouzey, Fabien: Overview. (line 14) * Letouzey, Fabien <1>: History. (line 6) * Letouzey, Fabien <2>: Background of v6. (line 6) * level: Command list. (line 186) * library: Structure of the source code. (line 53) * load: Command list. (line 191) * Log: Options. (line 9) * LogFile: Options. (line 15) * 'main': Structure of the source code. (line 34) * manual: Command list. (line 80) * memory: Command list. (line 166) * modules: Structure of the source code. (line 6) * n: Command list. (line 70) * name: Command list. (line 123) * namespaces: C/C++ coexistence. (line 14) * new: Command list. (line 144) * next: Command list. (line 67) * nographic: Command list. (line 270) * nopost: Command list. (line 120) * null: Command list. (line 169) * NullMove Pruning: Options. (line 109) * NullMove Reduction: Options. (line 123) * options: Invoking gnuchess. (line 6) * otim: Command list. (line 151) * output: Output files. (line 6) * overview: Overview. (line 6) * p: Command list. (line 76) * pgnload: Command list. (line 53) * pgnreplay: Command list. (line 56) * pgnsave: Command list. (line 50) * pipes: Structure of the source code. (line 19) * PolyGlot: Chess engine protocol adapter. (line 6) * post: Command list. (line 111) * previous: Command list. (line 73) * PromoteWorkAround: Workarounds. (line 39) * protocol: Chess engine protocol adapter. (line 6) * Quiescence Check Plies: Options. (line 203) * quit: Command list. (line 12) * random: Command list. (line 155) * rating: Command list. (line 141) * remove: Command list. (line 207) * Resign: Options. (line 24) * ResignMoves: Options. (line 34) * ResignScore: Options. (line 41) * result: Command list. (line 128) * save: Command list. (line 195) * show: Command list. (line 213) * ShowPonder: Options. (line 47) * solve: Command list. (line 204) * solveepd: Command list. (line 204) * src: Structure of the source code. (line 34) * src/adapter: Structure of the source code. (line 44) * src/engine: Structure of the source code. (line 49) * src/frontend: Structure of the source code. (line 38) * Stanback, John: History. (line 6) * Stuart, Cracraft: Overview. (line 14) * switch: Command list. (line 198) * SyncStop: Workarounds. (line 30) * test: Command list. (line 237) * time: Command list. (line 147) * uci: UCI chess engine. (line 6) * UCI: Guidelines followed to develop GNU Chess v6. (line 21) * UCIVersion: Workarounds. (line 15) * undo: Command list. (line 210) * Universal Chess Interface: Guidelines followed to develop GNU Chess v6. (line 21) * usage: Invoking gnuchess. (line 6) * usage <1>: Command list. (line 22) * Verification Reduction: Options. (line 140) * Verification Search: Options. (line 131) * version: Invoking gnuchess. (line 22) * version <1>: Command list. (line 45) * version 5: Adapter. (line 6) * version 5 <1>: Background of v6. (line 6) * white: Command list. (line 86) * winboard: XBoard chess engine. (line 6) * XBoard: Overview. (line 6) * xboard: Invoking gnuchess. (line 32) * xboard <1>: Command list. (line 174) * xboard <2>: XBoard chess engine. (line 6)  Tag Table: Node: Top815 Node: Overview2153 Node: Contact info2715 Node: Invocation4318 Node: Invoking gnuchess4641 Node: Interactive game6116 Node: Command list6454 Node: Environment variables13257 Node: Configuration file13724 Node: Structure13941 Node: Options15397 Node: Workarounds23208 Node: Output files24766 Node: XBoard chess engine26419 Node: UCI chess engine27058 Node: Internet27380 Node: Book27831 Node: Tests28012 Node: Chess notation28217 Node: History29332 Node: Known problems29663 Node: Adapter29811 Node: Developers30511 Node: Background of v630819 Node: Guidelines followed to develop GNU Chess v631459 Node: Chess engine protocol adapter32698 Node: Structure of the source code33849 Node: C/C++ coexistence35943 Node: Chess engine36950 Node: Fruit overview37237 Node: Board data structure38200 Node: Search algorithm38701 Node: Transposition table39612 Node: Null move40033 Node: Move ordering40688 Node: Evaluation function41064 Node: Speed41817 Node: Translations42094 Node: GNU Free Documentation License43086 Node: Concept index68242  End Tag Table gnuchess-6.2.2/doc/gnuchess.texi000644 000766 000024 00000122333 12452207421 017435 0ustar00antoniostaff000000 000000 \input texinfo @c -*-texinfo-*- @c %**start of header @setfilename gnuchess.info @include version.texi @settitle GNU Chess @value{VERSION} @c Define a new index for options. @defcodeindex op @c Combine everything into one index (arbitrarily chosen to be the @c concept index). @syncodeindex op cp @c %**end of header @copying This manual is for GNU Chess (version @value{VERSION}, @value{UPDATED}), which is a complete chess program, frequently used as a chess engine. Copyright @copyright{} 2001--2015 Free Software Foundation, Inc. @quotation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. @end quotation @end copying @c If your manual is published on paper by the FSF, it should include @c the standard FSF Front-Cover and Back-Cover Texts, as given in @c maintain.texi. @dircategory Basics @direntry * GNU Chess: (gnuchess). Playing chess and related games. @end direntry @titlepage @title GNU Chess @subtitle for version @value{VERSION}, @value{UPDATED} @author @url{http://www.gnu.org/software/chess} @page @vskip 0pt plus 1filll @insertcopying @end titlepage @contents @ifnottex @node Top @top GNU Chess This manual is for GNU Chess (version @value{VERSION}, @value{UPDATED}). @insertcopying @end ifnottex @menu * Overview:: General information. * Contact info:: How to find help and to report bugs. * Invocation:: Running @command{gnuchess}. * Book:: Where and how to obtain a chess book usable by GNU Chess. * Tests:: Some execution results. * Chess notation:: Auxillary file formats (PGN, EPD). * History:: A brief review of the long history of GNU Chess. * Known problems:: Known problems * Developers:: Notes for developers. * Translations:: GNU Chess in other languages. * GNU Free Documentation License:: Copying and sharing this documentation. * Concept index:: Index of concepts. @end menu @node Overview @chapter Overview @cindex XBoard @cindex overview GNU Chess (@url{http://www.gnu.org/software/chess/}) is a computer program for playing chess. It can be used to interactively play chess on a text terminal, but it is more often used in conjunction with a GUI program such as GNU XBoard. Because it is protected by the GNU General Public License, users are free (in perpetuity) to share and change it. @cindex author @cindex Letouzey, Fabien @cindex Stuart, Cracraft The main author of GNU Chess version 6 is Fabien Letouzey, The original author is Stuart Cracraft. @node Contact info @chapter Contact info @cindex contact We are the GNU Chess developers and you may reach us at: @email{bug-gnu-chess@@gnu.org} Our official web page is: @uref{http://www.gnu.org/software/chess} We are indebted to our sponsor, the Free Software Foundation whose web page is: @uref{http://www.fsf.org} and which also serves as our software depository for new versions of GNU and GNU Chess. You can download the latest version from GNU's FTP site at: @uref{ftp://ftp.gnu.org/gnu/chess/} The code is provided for the purpose of encouraging you to do the programming. If you lack the programming skills to do so, try dabbling in it. You might surprise yourself. If you want to report a possible bug in GNU Chess, please send a message to the e-mail address indicated above, providing precise information about the conditions that led to the possible bug. As a general guideline, you can kindly include the follow information: @itemize @item Version of the program. The following command will print it: @example gnuchess --version @end example @item How you started the program. Whether running standalone or in combination with other programs such as XBoard. @item The actions you performed and the output or behaviour you observed. @item Output files if any. In order to enable the writing to adapter.log, set the following option in config file gnuchess.ini: @option{Log = true} @item Whether the problem is systematic (it always happens) or occasional. @item Any other information you may deem relevant. @end itemize @node Invocation @chapter Running @command{gnuchess} @menu * Invoking gnuchess:: * Interactive game:: * Command list:: * Environment variables:: * Configuration file:: * Output files:: * XBoard chess engine:: * UCI chess engine:: * Internet:: @end menu @node Invoking gnuchess @section Invoking gnuchess @cindex invoking @cindex options @cindex usage @cindex help The format for running the @command{gnuchess} program is: @example gnuchess @var{option} @dots{} @end example With no options, @command{gnuchess} starts in interactive mode and it is ready to start a chess game. @command{gnuchess} supports the following options: @table @option @item --help @itemx -h @opindex --help @opindex -h @cindex help Print an informative help message on standard output and exit successfully. @item --version @itemx -v @opindex --version @opindex -v @cindex version Print the version number and licensing information of Hello on standard output and then exit successfully. @item --quiet @item --silent @itemx -q @opindex --quiet @opindex --silent @opindex -q Make the program silent on startup. @item --xboard @itemx -x @opindex --xboard @opindex -x @cindex xboard Start the program in xboard mode, i.e. as an xboard engine. This is typically used for using the program as backend of other chess GUI such as XBoard. Option @option{xboard} is accepted without leading dashes for backward compatibility. @item --post @itemx -p @opindex --post @opindex -p Start up showing thinking. Option @option{post} is accepted without leading dashes for backward compatibility. @item --easy @itemx -e @opindex --easy @opindex -e Disable thinking in opponent's time. By default, the program runs in hard mode, i.e. it uses opponent's time to think too. @item --manual @itemx -m @opindex --manual @opindex -m Enable manual mode. @item --uci @itemx -u @opindex --uci @opindex -u Enable UCI protocol (externally behave as UCI engine). @item --memory size @itemx -M size @opindex --memory @opindex -M Specify memory usage in MB for hashtable. @item --addbook filename @itemx -a filename @opindex --addbook @opindex -a Compile book.bin from pgn book 'filename' and quits. @item --graphic @itemx -g @opindex --graphic @opindex -g Enable graphic mode based on Unicode chess symbols. @end table @node Interactive game @section Interactive game Moves are accepted either in standard algebraic notation (SAN) or in coordinate algebraic notation. Examples: @example Nf3 g1f3 O-O e1g1 @end example @node Command list @section Command list @command{gnuchess} supports the following commands: @table @command @item ^C @cindex ^C Quit the program. @item quit @cindex quit Quit the program. @item exit @cindex exit In analysis mode this stops analysis, otherwise it quits the program. @item help @cindex help Produces a help blurb corresponding to this list of commands. @item usage @cindex usage Produce blurb on command line options. (Same as @command{gnuchess --help}) @item book @cindex book Handle the book. Requires a subcommand: add - compiles book.bin from book.pgn on - enables use of book off - disables use of book best - play best move from book worst - play worst move from book random - play any move from book prefer (default) - choose a good move from book (Method subject to variation) @item version @cindex version Prints out the version of this program (Same as @command{gnuchess --version}) @item pgnsave FILENAME @cindex pgnsave Saves the game so far to the file from memory @item pgnload FILENAME @cindex pgnload Loads the game in the file into memory (cf. pgnreplay) @item pgnreplay FILENAME @cindex pgnreplay Loads the game in the file into memory, and enables commands first, last, next, previous. This allows replaying a saved game step by step. (cf. pgnload) @item first @cindex first Go to start position of pgn loaded game with pgnreplay. @item last @cindex last Go to last position of pgn loaded game with pgnreplay. @item next @cindex next Advances one move in pgn loaded game with pgnreplay. @item n @cindex n Advances one move in pgn loaded game with pgnreplay. @item previous @cindex previous Back one move in pgn loaded game with pgnreplay. @item p @cindex p Back one move in pgn loaded game with pgnreplay. @item force @itemx manual @cindex force @cindex manual Makes the program stop moving. You may now enter moves to reach some position in the future. (Same as @command{gnuchess --manual}) @item white @cindex white Program plays black, set white to move. Note: not implemented in this version. @item black @cindex black Program plays white, set black to move. (White and black commands are mainly for icsDrone and will cause the current en-passant capture square to be forgotten). Note: not implemented in this version. @item go @cindex go Computer takes whichever side is on move and begins its thinking immediately @item easy @cindex easy Disables thinking on opponent's time (Same as @command{gnuchess --easy}) @item hard @cindex hard Enables thinking on opponent's time @item post @cindex post Arranges for verbose thinking output showing variation, score, time, depth, etc. If pondering (see hard) is on, the program will output it's thinking whilst the opponent is thinking. (Same as @command{gnuchess --post}) @item nopost @cindex nopost Turns off verbose thinking output @item name NAME @cindex name Lets you input your name. Also writes the log.nnn and a corresponding game.nnn file. For details please see auxillary file format sections. @item result @cindex result Mostly used by Internet Chess server. @item activate @cindex activate This command reactivates a game that has been terminated automatically due to checkmate or no more time on the clock. However, it does not alter those conditions. You would have to undo a move or two or add time to the clock with level or time in that case. Note: not implemented in this version. @item rating COMPUTERRATING OPPONENTRATING @cindex rating Inputs the estimated rating for computer and for its opponent @item new @cindex new Sets up new game (i.e. positions in original positions) @item time @cindex time Inputs time left in game for computer in hundredths of a second. Mostly used by Internet Chess server. @item otim @cindex otim Inputs time left in game for opponent in hundredths of a second. Mostly used by Internet Chess server. @item random @cindex random Randomizes play by perturbing the evaluation score slightly. The degree of perturbation is adjustable. Note: not implemented in this version. Neither in v5 @item hash @cindex hash on - enables using the memory hash table to speed search off - disables the memory hash table @item memory N @cindex memory Sets the hash table to permit storage of N MB. @item null @cindex null on - enables using the null move heuristic to speed search off - disables using the null move heuristic @item xboard @cindex xboard on - enables use of xboard/winboard off - disables use of xboard/winboard (Same as @command{gnuchess --xboard}) @item depth N @cindex depth Sets the program to look N ply (half-moves) deep for every search it performs. If there is a checkmate or other condition that does not allow that depth, then it will not be @item level MOVES MINUTES INCREMENT @cindex level Sets time control to be MOVES in MINUTES with each move giving an INCREMENT (in seconds, i.e. Fischer-style clock). @item load @itemx epdload @cindex load @cindex epdload Loads a position in EPD format from disk into memory. @item save @itemx epdsave @cindex save @cindex epdsave Saves game position into EPD format from memory to disk. @item switch @cindex switch Switches side to move Note: not implemented in this version. @item solve FILENAME @itemx solveepd FILENAME @cindex solve @cindex solveepd Solves the positions in FILENAME @item remove @cindex remove Backs up two moves in game history @item undo @cindex undo Backs up one move in game history @item show @cindex show Requires a subcommand: board - displays the current board time - displays the time settings moves - shows all moves using one call to routine escape - shows moves that escape from check using one call to routine noncapture - shows non-capture moves capture - shows capture moves eval [or score] - shows the evaluation per piece and overall game - shows moves in game history pin - shows pinned pieces Note: 'show eval' and 'show pin' not implemented in this version. @item test @cindex test Requires a subcommand: movelist - reads in an epd file and shows legal moves for its entries capture - reads in an epd file and shows legal captures for its entries movegenspeed - tests speed of move generator capturespeed - tests speed of capture move generator eval - reads in an epd file and shows evaluation for its entries evalspeed tests speed of the evaluator Note: not implemented in this version. @item analyze @cindex analyze Switches program into analysis mode, this is primarily intended for communicating analysis to an external interface using the Xboard chess engine protocol. It enables "force", "post", and "hard", at the same time, whilst altering the output format of post to conform with the engine protocol. @item graphic @cindex graphic Enables graphic mode. In this mode, the board is displayed using the Unicode chess symbols (Codepoints from U+2654 to U+265F). The graphic mode requires a terminal with Unicode support. (Same as @command{gnuchess --graphic}) @item nographic @cindex nographic Disables graphic mode. The board is displayed using the good-old classic view based on plain ASCII. @end table @node Environment variables @section Environment variables @cindex environment variable If @env{GNUCHESS_PKGDATADIR} is defined, it will be taken as the path for the config file and for the book, in case the files are not found in the current directory. If it is not defined, they will be taken from the package data directory, in case the files are not found in the current directory. @node Configuration file @section Configuration file @cindex configuration file @menu * Structure:: * Options:: * Workarounds:: @end menu @node Structure @subsection Structure A file called @file{gnuchess.ini} is used to define configuration options. The file is applicable provided @option{--uci} is not used. The file is looked in three places according to the following precedence: @enumerate @item The directory where the program was started @item Environment variable@env{GNUCHESS_PKGDATADIR} @item The package data directory stated at configure time @end enumerate Sections are composed of @option{variable = value} lines. Note: There can be spaces in variable names or values. Do not use quotes. @option{[Adapter]} section This section is used by the adapter only. The engine is unaware of these options. The list of available options is detailed below in this document. @option{[Engine]} section This section contains engine UCI options. The PolyGlot-based adapter does not understand them, but sends the information to the engine at startup (converted to 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 @option{OwnBook = true} is correct. It will be replaced by the adapter with @option{setoption name OwnBook value true} at engine startup. Standard UCI options are @option{Hash}, @option{NalimovPath}, @option{NalimovCache} and @option{OwnBook}. Hidden options like @option{Ponder} or @option{UCI_xxx} are automatic and should not be put in the INI file. @node Options @subsection Options These should be put in the @option{[Adapter]} section. @table @code @item Log @cindex Log Default: false Whether the adapter should log all transactions with the interface and the engine. This should be necessary only to locate problems. @item LogFile @cindex LogFile Default: @file{adapter.log} The name of the log file. Note that it is put where the program was launched from, not into the engine directory. WARNING: Log files are not cleared between sessions, and can become very large. It is safe to remove them though. @item Resign @cindex Resign Default: false Set this to "true" if you want the adapter to resign on behalf of the engine. NOTE: Some engines display buggy scores from time to time although the best move is correct. Use this option only if you know what you are doing (e.g. you always check the final position of games). @item ResignMoves @cindex ResignMoves Default: 3 Number of consecutive moves with "resign" score (see below) before the adapter resigns for the engine. Positions with only one legal move are ignored. @item ResignScore @cindex ResignScore Default: 600 This is the score in centipawns that will trigger resign "counting". @item ShowPonder @cindex ShowPonder Default: true Show search information during engine pondering. Turning this off might be better for interactive use in some interfaces. @item KibitzMove @cindex KibitzMove Default: false Whether to kibitz when playing a move. @item KibitzPV @cindex KibitzPV Default: false Whether to kibitz when the PV is changed (new iteration or new best move). @item KibitzCommand @cindex KibitzCommand Default: tellall xboard command to use for kibitzing, normally "tellall" for kibitzing or "tellothers" for whispering. @item KibitzDelay @cindex KibitzDelay Default: 5 How many seconds to wait before starting kibitzing. This has an affect only if "KibitzPV" is selected, move kibitzes are always sent regardless of the delay. @item Book @cindex Book Default: false Indicates whether the adapter should use a book. This has no effect on the engine own book (which can be controlled with the UCI option @code{OwnBook} in the @option{[Engine]} section). In particular, it is possible to use both a PolyGlot book and an engine book. In that case, the engine book will be used whenever PolyGlot is out of book. Remember that PolyGlot is unaware of whether the engine is itself using a book or not. @item BookFile @cindex BookFile Default: @file{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 current directory does not matter. If the file is not found in the current directory, it will be looked for in @var{GNUCHESS_PKGDATADIR} if the variable is defined, or in the package data directory otherwise. Note that there is no option to control book usage. All parameters are fixed when compiling a PGN file into a binary book (see below). This is purposeful and is not likely to change. Using a book does not require any additional memory, this can be important for memory-limited tournaments. @end table These are UCI options for the @option{[Engine]} section: @table @code @item NullMove Pruning @cindex NullMove Pruning (Always/Fail High/Never) Default: Fail High "Always" actually means the usual conditions (not in check, etc ...). "Fail High" adds the condition that the static evaluation fails high. Never use "Never" (ever)! OK you can use "Never" to test a Zugzwang problem. I expect that this option has little effect (assuming the first two choices only). It was only added because most engines do not use the fail-high condition. @item NullMove Reduction @cindex NullMove Reduction (1-3 plies) Default: 3 3 is rather aggressive, especially in the endgame. It seems better than always using 2 though. @item Verification Search @cindex Verification Search (Always/Endgame/Never) Default: Endgame This tries to solve some Zugzwang-related problems. It is expected to hardly have any effect in games. The default value should be sufficient for most-common Zugzwang situations. @item Verification Reduction @cindex Verification Reduction (1-6 plies) Default: 5 5 guarantees that the cost of verification search is negligible in most cases. Of course it means Zugzwang problems need a lot of depth to get solved, if ever! With such a reduction, verification search is similar to Vincent Diepeveen's "double null move". @item History Pruning @cindex History Pruning (true/false) Default: true A bit dodgy, but fun to experiment with. It should help in blitz, but it's possible it actually hurts play in longer games. @item History Threshold @cindex History Threshold (percentage) Default: 60% This is the thing, as it affects the search tree! Lower values are safer, and higher values more aggressive. THIS VALUE HAS NOT BEEN TUNED! There is a good chance Fruit's strength can be improved by changing this option. @item Futility Pruning @cindex Futility Pruning (true/false) Default: false Very common but controversial. Makes the engine a tiny bit better at tactics but slightly weaker positionally. It might be beneficial by a very small amount, but has not been tested in conjunction with history pruning yet. @item Futility Margin @cindex Futility Margin (centipawns) Default: 100 This value is somewhat aggressive. It could lead to problems in the endgame. Larger values prune less but will lead to fewer positional errors. @item Delta Pruning @cindex Delta Pruning (true/false) Default: false Similar to futility pruning. Probably safer because it is used mainly during the middlegame. Has not been tested with history pruning either. @item Delta Margin @cindex Delta Margin (centipawns) Default: 50 Same behaviour as futility margin. This one is probably safe. @item Quiescence Check Plies @cindex Quiescence Check Plies (0-2 plies) Default: 1 Fruit tries safe (SEE >= 0) checks at the first plies of the quiescence search. 0 means no checks at all (as in most older engines). 1 is the same as previous versions of Fruit. 2 is probably not worth the extra cost. It could be interesting when solving mate problems though. @item Evaluation options @cindex Evaluation options (percentage) Default: 100% These options are evaluation-feature multipliers. You can modify Fruit's playing style to an extent or make Fruit weaker for instance by setting "Material" to a low value. "Material" is obvious. It also includes the bishop-pair bonus. "Piece Activity": piece placement and mobility. "King Safety": mixed features related to the king during early phases "Pawn Structure": all pawn-only features (not passed pawns). "Passed Pawns": ... can you guess? @end table The following options were used in PolyGlot v1.4, but are deprecated in GNU Chess: @table @code @item EngineName @cindex EngineName Default: GNU Chess This is the name that will appear in the xboard interface. It is cosmetic only. You can use different names for tweaked versions of the same engine. If no "Engine Name" is given, the UCI name will be used. @item EngineDir @cindex EngineDir Default: . Full path of the directory where the engine is installed. You can use "." (without the quotes) if you know that PolyGlot will be launched in the engine directory or the engine is in the "path" and does not need any data file. @item EngineCommand @cindex EngineCommand Put here the name of the engine executable file. You can also add command-line arguments. Path searching is used and the current directory will be "EngineDir". NOTE: Unix users are recommended to prepend "./"; this is required on some secure systems. @end table @node Workarounds @subsection Workarounds 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). The default value is always correct for bug-free software. These workarounds are unlikely to be used or meaningful for GNU Chess. @table @code @item UCIVersion @cindex UCIVersion Default: 2 The default value of 2 corresponds to UCI+. Use 1 to select plain UCI for engines that have problems with UCI+. @item CanPonder @cindex CanPonder Default: false The adapter now conforms to the documented UCI behaviour: the engine will be allowed to ponder only if it (the engine) declares the @option{Ponder} UCI option. However some engines which can actually ponder do not declare the option. This work around lets The adapter know that they can ponder. @item SyncStop @cindex SyncStop Default: false When a ponder miss occurs, the adapter 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. @option{SyncStop} forces the adapter to wait for the (now useless) ponder search to finish before launching the new search. @item PromoteWorkAround @cindex PromoteWorkAround Default: false Some engines do not specify a promotion piece, e.g. they send "e7e8" instead of the correct "e7e8q". This work around enables the incorrect form (and of course promotes into a queen). @end table @node Output files @section Output files @cindex output GNU Chess produces several output files: @table @file @item Adapter log file @cindex Adapter log file This file is written by the adapter. The name of the file is specified by the following option in @file{gnuchess.ini}: @option{LogFile = FILENAME} The file is produced if option @option{--uci} is not specified and if the following variable is set in @file{gnuchess.ini}: Typically, this file is named @file{adapter.log}, but any other name will do the job. @option{Log = true} @item @file{log.nnn} This file is written if command @command{name} was requested. The contents are the opponent's name and the game in coordinate algebraic notation. @item @file{game.nnn} This file is written if command @command{name} was requested. The contents are the opponent's name and the game in portable game notation (PGN). @item @file{players.dat} This file is written if command @command{name} was requested. The contents are the statistics of games. This is the format of each line: @command{opponent-name wins loses draws} @item @file{gnuchess.debug} This file contains internal information that is useful for debugging purposes. For this file to be written, it is necessary to define preprocessor directive @command{DEBUG}. Hence, when installing the program, instead of @example ./configure make make install @end example Use the following commands: @example ./configure CPPFLAGS=-DDEBUG make make install @end example When analysing a bug, this file could be very helpful. Users are encouraged to provide it. @end table @node XBoard chess engine @section XBoard chess engine @cindex xboard @cindex winboard Running the program with the "--xboard" command line parameter sets it to produce output acceptable to and accept input suitable for XBoard and WinBoard, the graphical display front-ends with mouse interface. For historical reasons the option "xboard" does not need to be preceeded by "--", however we would encourage the new syntax. How to run XBoard with GNU Chess as chess backend: @example xboard -fcp 'gnuchess --xboard' xboard -fd . -fcp './gnuchess --xboard' @end example @node UCI chess engine @section UCI chess engine @cindex uci For GNU Chess to behave as a pure UCI chess engine, execute the following command: @example gnuchess --uci @end example In this mode, configuration file @file{gnuchess.ini} is ignored. @node Internet @section Internet For GNU Chess to run in Internet, Zippy is required. See Zippy documentation in the XBoard/WinrBoard distribution: @uref{http://www.tim-mann.org/} this is an example of how to run GNU Chess on FICS using XBoard as frontend and Zippy as connector: @example xboard -zp -ics -icshost freechess.org -icshelper timeseal -fcp 'gnuchess --xboard' @end example @node Book @chapter Book @cindex book See options @option{Book} and @option{Bookfile} in Running GNU Chess - Configuration file - Options @node Tests @chapter Tests GNU Chess 6 has been tested on the Free Internet Chess Server (@uref{http://www.freechess.org}) with XBoard. @node Chess notation @chapter Auxiliary file formats @table @file @item .bin binary book format @item .pgn game listing like @command{1. e4 e5 2. Nf3} etc. @item .epd epd-style format using FEN notation. See tests subdirectory for example. @item log.nnn record of an entire game from computer's viewpoint (thinking, etc.) @item game.nnn record of an entire game, similar to .pgn but auto-generated @end table The @file{.bin} file format is a simple binary format for the compiled book which is read by the program when it is using book. See the book section for more detail. EPD and PGN require little introduction. These are the uniformly accepted standards for position recording and game recording. Note that @file{log.nnn} and @file{game.nnn} files are written at the end of a game when you use the @command{name} command to give the computer your name. It is highly recommended to do this since the resulting two files that match in a monotonically-increasing extension numbered suffix may be used for reporting bugs and keeping track of your games. @node History @chapter History @cindex history @cindex authors @cindex Cracraft, Stuart @cindex Stanback, John @cindex Kong-Sian, Chua @cindex Letouzey, Fabien The first version of GNU Chess was written by Stuart Cracraft back in 1984. Versions from 2 to 4 were written by John Stanback. Version 5 was written by Chua Kong-Sian. Version 6 was written by Fabien Letouzey. @node Known problems @chapter Known problems @menu * Adapter:: @end menu @node Adapter @section Adapter @cindex version 5 These are known problems of PolyGlot v1.4 as described by Fabien Letouzey. The addition of Chess960 support lead to a change in internal-move representation for castling. This slightly affected the opening-book format. We recommend that you recompile books with this version. Several users reported engines losing on time. The playing conditions always mixed playing on an Internet server with pondering. It is not yet clear what the source of the problem is, but there seems to be a forever incompatibility between the xboard and UCI protocol regarding a complex pondering/remaining-time relation. @node Developers @chapter Developers @menu * Background of v6:: * Guidelines followed to develop GNU Chess v6:: * Chess engine protocol adapter:: * Structure of the source code:: * C/C++ coexistence:: * Chess engine:: @end menu @node Background of v6 @section Background of v6 @cindex version 5 @cindex Fruit @cindex Letouzey, Fabien Since version 5.07 of the program was released in 2003, GNU Chess has basically remained unchanged. Then Fabien Letouzey developped Fruit, which proved to be a stronger chess engine and shaked the computer chess world. At some point in time, he kindly assigned copyright to FSF, which allowed us to make Fruit 2.1 (the latest free version) the base for GNU Chess v6. Therefore, it can be fairly said that Fabien Letouzey is remarkably the main contributor to GNU Chess v6. @node Guidelines followed to develop GNU Chess v6 @section Guidelines followed to develop GNU Chess v6 @cindex Fruit The idea was to use Fruit 2.1 as the base for GNU Chess v6, keeping external interfaces backwards compatible. This is particularly important since GNU Chess has been world-wide used for long. GNU Chess can be used in two modes: interactively using the command-line interface on a text console, and used as backend engine from a graphical frontend. Both cases rely on almost identical grammar. The former is described in GNU Chess help. @cindex Chess Engine Communication Protocol When GNU Chess is used as a pure chess engine, for instance, as backend for XBoard, it uses the Chess Engine Communication Protocol (aka XBoard protocol), which is described here: @uref{http://home.hccnet.nl/h.g.muller/engine-intf.html} @cindex Universal Chess Interface @cindex UCI Since Fruit uses the Universal Chess Interface (UCI), keeping the former interface was the main challenge of GNU Chess v6. UCI is described here: @uref{http://wbec-ridderkerk.nl/html/UCIProtocol.html} GNU Chess can also run as a UCI chess engine, if the @option{--uci} command-line option is specified. @node Chess engine protocol adapter @section Chess engine protocol adapter @cindex PolyGlot @cindex adapter @cindex protocol UCI is very different from the Chess Engine Communication Protocol. PolyGlot is a UCI-to-xboard adapter developed by Fabien. It connects a UCI chess engine to an xboard interface such as WinBoard. UCI2WB is another such adapter (for Windows). Standalone PolyGlot can be used, along with Fruit, as chess engine for chess frontends, suchs as XBoard. In that case, PolyGlot and Fruit run as two independent single-threaded processes. PolyGlot starts first, and it forks Fruit. Both processes get communicated by by means of pipes: PolyGlot captures Fruit's standrad input and output. PolyGlot tries to solve known problems with other adapters. For instance, it detects and reports draws by fifty-move rule, repetition, etc. PolyGlot 1.4 has been adapted and incorporated to GNU Chess v6 as chess engine protocol adapter. It connects Fruit-based GNU Chess engine to the good old GNU Chess frontend. @node Structure of the source code @section Structure of the source code @cindex modules @cindex frontend @cindex adapter @cindex engine We want to keep three loosely-coupled modules in GNU Chess v6: @itemize @item frontend @item adapter @item engine @end itemize The main program contains the frontend and starts two addtional threads, one for the adapter, and another one for the engine. The three components comprise a chain, thus there are two links: @itemize @item frontend <--> adapter @item adapter <--> engine @end itemize @cindex pipes The links are based on pipes. There is no need for additional synchronization mechanisms such as mutex. The changes in PolyGlot and Fruit are minimal, since they were already using the same mechanism to communicate with each other. Another technical problem was the fact that GNU Chess v5 was written in C, whereas PolyGlot and Fruit are written in C++. In GNU Chess v6 the main program, the adapter and the engine are in C++, but the frontend remains in C. Source code was placed under a single @file{src} in GNU Chess v5, as usual. Three additional directories have been created for GNU Chess v6, so the code is organized in four directories: @table @file @item src @cindex src @cindex @command{main} Contains the @command{main} and a source file used to create the pipes that communicate the three modules: frontend, adapter and engine. @item src/frontend @cindex src/frontend Contains the frontend. The code here is inherited from GNU Chess v5, with some modifications mainly in @file{cmd.c} and a new file @file{engine.c} which addresses the message passing through modules. @item src/adapter @cindex src/adapter Contains the chess protocol adapter, based on PolyGlot 1.4. Minor changes, wrt the baseline. @item src/engine @cindex src/engine Contains the chess engine, based on Fruit 2.1. Minor changes wrt the baseline. @end table @cindex binary @cindex library The sources in each @file{src} subdirectory are compiled as a static library. When link with the sources in top @file{src}, they result into the binary @command{gnuchess}. The module libraries are named after their respective directory name: @example libfrontend.a libadapter.a libengine.a @end example @node C/C++ coexistence @section C/C++ coexistence @cindex C @cindex C++ The source code of the frontend comes mainly from version 5.07, which was written in C. There is no problem in having both C and C++ in the same program, and so have they lived together in all versions from 6.0.0 to 6.1.0. However, in version 6.1.1 and subsequent versions the frontend is compiled in C++. This change has been introduced to avoid compilation warnings in output.cc (former output.c) as a result of the introduction of Unicode literals. @cindex namespaces PolyGlot and Fruit have a common origin, which means that there is a lot of shared code. The point is that the shared code is very similar but not identical, which would make hard an eventual unification. In order to avoid massive name clash, all the code has been wrapped in namespaces, one for the adapter, one for the engine. The frontend remains in the default namespace. @node Chess engine @section Chess engine @cindex chess engine @menu * Fruit overview:: * Board data structure:: * Search algorithm:: * Transposition table:: * Null move:: * Move ordering:: * Evaluation function:: * Speed:: @end menu @node Fruit overview @subsection Fruit overview Fruit was designed to help with the study of game-tree search algorithms, when applied to chess. It is now released as a chess engine, which is a somewhat different category of programs. Therefore the source code contains entire files and also functions that are either not used by the engine, or could be replaced with a much simpler (although somewhat less efficient) equivalent. As a chess engine, Fruit combines a "robust" search algorithm with a "minimalist" evaluation function. The latter is not a design choice, and will hopefully change in the future. The following description is only a very incomplete description. Please consult the source code for an absolute definition. The search algorithm was designed to accommodate with heavy forward-pruning eccentricities (such as search inconsistencies). @node Board data structure @subsection Board data structure Fruit uses the 16x12 board. Although this structure is not very popular, it can be seen as simply combining 10x12 (mailbox) with 16x8 (0x88). 0x88 was picked in Fruit because of the small memory requirements of vector calculations (much smaller tables). It is possible that Fruit uses bitboards for pawns in the future. @node Search algorithm @subsection Search algorithm The main search algorithm is a classical PVS with iterative deepening. Search enhancements such as a transposition table and null-move pruning are also used (see below). A few details in the PVS implementation are not-so-standard and are there to supposedly enhance the stability of the search (like reducing the consequences of search inconsistencies). For example the re-search window after a scout fail high of score "value" (with value > alpha) is [alpha,beta], not [value,beta]. As another example, I only allow null move when the static evaluation fails high (i.e. eval() >= beta). Whether these features improve the strength of the engine is an open question. The main search function is full_search() in search_full.cpp @node Transposition table @subsection Transposition table Fruit uses 4 probes and replaces the shallowest entry. Time stamping is used so that entries from previous searches are considered available for overwriting. Enhanced Transposition Cutoff (ETC) is also used 4 plies (and more) away from the horizon. @node Null move @subsection Null move Fruit uses R=3 recursive null move, even in the endgame. In Fruit, a precondition to using null move is that the static eval fails high. One of the consequences of this is that no two null moves can be played in a row (this is because the evaluation is symmetrical). This is a usual condition but notice that in Fruit the null-move condition is "pure" (independent of move paths). The fail-high condition was selected for other reasons however. Also, a verification search is launched in the endgame. @node Move ordering @subsection Move ordering The move ordering is rather basic: @itemize @item transposition-table move @item captures sorted by MVV/LVA @item promotions @item killer moves (two per level, no counters) @item history moves (piece-type/to-square table, with "aging"). @end itemize @node Evaluation function @subsection Evaluation function The evaluation function includes: @itemize @item Material @item Mobility @item Drawish-material heuristics @item Separated passed-pawn evaluation from the pawn hash table. Interaction with pieces can be taken into account @item Pawn-shelter penalty; with king placement this forms some sort of a simplistic king-safety feature @item Incremental move generation @item Futility and delta pruning (not tested in conjunction with history pruning and hence not activated by default) @item Move ordering (bad captures are postponed) @item History pruning (not tested seriously yet enabled by default) @end itemize @node Speed @subsection Speed Fruit is not fast (in nodes per second) given the little it is calculating. Some "optimisations" could be undone in order to make the code shorter and more flexible. @node Translations @chapter Translations English is the native language of GNU Chess, as usual in the GNU Project. Starting on version 6.1.0, GNU Chess features internationalization support based on GNU @command{gettext}. The Translation Project contributes message strings translated into other languages. See the @uref{http://translationproject.org/domain/gnuchess.html, Translation Project page for GNU Chess} for the currently available translations. During the installation of the operating system, the language to be used is selected. This selection is made system-wide. An individual user can select his or her own language by setting the `locale' through environment variables. Typically, a command like this (in @command{bash}) will set German as the language to be used: @example export LANGUAGE=de_DE @end example See details on this at @uref{http://www.gnu.org/software/gettext/manual/gettext.html#Users} @node GNU Free Documentation License @appendix GNU Free Documentation License @include fdl.texi @node Concept index @unnumbered Concept index @printindex cp @bye gnuchess-6.2.2/doc/Makefile.am000644 000766 000024 00000001550 12452303677 016766 0ustar00antoniostaff000000 000000 # Makefile for gnuchess/doc # # Copyright (C) 2001-2015 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . info_TEXINFOS = gnuchess.texi gnuchess_TEXINFOS = fdl.texi CLEANFILES = *.aux *.cp *.cps *.fn *.ky *.log *.op *.pg *.toc *.tp *.vr DISTCLEANFILES = ${CLEANFILES} gnuchess-6.2.2/doc/Makefile.in000644 000766 000024 00000062307 12606706417 017006 0ustar00antoniostaff000000 000000 # Makefile.in generated by automake 1.14 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile for gnuchess/doc # # Copyright (C) 2001-2015 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(gnuchess_TEXINFOS) mdate-sh $(srcdir)/version.texi \ $(srcdir)/stamp-vti texinfo.tex README ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = AM_V_DVIPS = $(am__v_DVIPS_@AM_V@) am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@) am__v_DVIPS_0 = @echo " DVIPS " $@; am__v_DVIPS_1 = AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@) am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@) am__v_MAKEINFO_0 = @echo " MAKEINFO" $@; am__v_MAKEINFO_1 = AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@) am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@) am__v_INFOHTML_0 = @echo " INFOHTML" $@; am__v_INFOHTML_1 = AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@) am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@) am__v_TEXI2DVI_0 = @echo " TEXI2DVI" $@; am__v_TEXI2DVI_1 = AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@) am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@) am__v_TEXI2PDF_0 = @echo " TEXI2PDF" $@; am__v_TEXI2PDF_1 = AM_V_texinfo = $(am__v_texinfo_@AM_V@) am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@) am__v_texinfo_0 = -q am__v_texinfo_1 = AM_V_texidevnull = $(am__v_texidevnull_@AM_V@) am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@) am__v_texidevnull_0 = > /dev/null am__v_texidevnull_1 = INFO_DEPS = $(srcdir)/gnuchess.info am__TEXINFO_TEX_DIR = $(srcdir) DVIS = gnuchess.dvi PDFS = gnuchess.pdf PSS = gnuchess.ps HTMLS = gnuchess.html TEXINFOS = gnuchess.texi TEXI2DVI = texi2dvi TEXI2PDF = $(TEXI2DVI) --pdf --batch MAKEINFOHTML = $(MAKEINFO) --html AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) DVIPS = dvips am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__installdirs = "$(DESTDIR)$(infodir)" am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HELP2MAN = @HELP2MAN@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGINSDIR = @PLUGINSDIR@ POSUB = @POSUB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_CXXFLAGS = @PTHREAD_CXXFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ info_TEXINFOS = gnuchess.texi gnuchess_TEXINFOS = fdl.texi CLEANFILES = *.aux *.cp *.cps *.fn *.ky *.log *.op *.pg *.toc *.tp *.vr DISTCLEANFILES = ${CLEANFILES} all: all-am .SUFFIXES: .SUFFIXES: .dvi .html .info .pdf .ps .texi $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): .texi.info: $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \ am__cwd=`pwd` && $(am__cd) $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ done; \ else :; fi && \ cd "$$am__cwd"; \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $@ $<; \ then \ rc=0; \ $(am__cd) $(srcdir); \ else \ rc=$$?; \ $(am__cd) $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc .texi.dvi: $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ $(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \ $< .texi.pdf: $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ $(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \ $< .texi.html: $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp) $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $(@:.html=.htp) $<; \ then \ rm -rf $@ && mv $(@:.html=.htp) $@; \ else \ rm -rf $(@:.html=.htp); exit 1; \ fi $(srcdir)/gnuchess.info: gnuchess.texi $(srcdir)/version.texi $(gnuchess_TEXINFOS) gnuchess.dvi: gnuchess.texi $(srcdir)/version.texi $(gnuchess_TEXINFOS) gnuchess.pdf: gnuchess.texi $(srcdir)/version.texi $(gnuchess_TEXINFOS) gnuchess.html: gnuchess.texi $(srcdir)/version.texi $(gnuchess_TEXINFOS) $(srcdir)/version.texi: $(srcdir)/stamp-vti $(srcdir)/stamp-vti: gnuchess.texi $(top_srcdir)/configure @(dir=.; test -f ./gnuchess.texi || dir=$(srcdir); \ set `$(SHELL) $(srcdir)/mdate-sh $$dir/gnuchess.texi`; \ echo "@set UPDATED $$1 $$2 $$3"; \ echo "@set UPDATED-MONTH $$2 $$3"; \ echo "@set EDITION $(VERSION)"; \ echo "@set VERSION $(VERSION)") > vti.tmp @cmp -s vti.tmp $(srcdir)/version.texi \ || (echo "Updating $(srcdir)/version.texi"; \ cp vti.tmp $(srcdir)/version.texi) -@rm -f vti.tmp @cp $(srcdir)/version.texi $@ mostlyclean-vti: -rm -f vti.tmp maintainer-clean-vti: -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi .dvi.ps: $(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ $(DVIPS) $(AM_V_texinfo) -o $@ $< uninstall-dvi-am: @$(NORMAL_UNINSTALL) @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \ rm -f "$(DESTDIR)$(dvidir)/$$f"; \ done uninstall-html-am: @$(NORMAL_UNINSTALL) @list='$(HTMLS)'; test -n "$(htmldir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \ rm -rf "$(DESTDIR)$(htmldir)/$$f"; \ done uninstall-info-am: @$(PRE_UNINSTALL) @if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \ done; \ else :; fi @$(NORMAL_UNINSTALL) @list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \ echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ else :; fi); \ done uninstall-pdf-am: @$(NORMAL_UNINSTALL) @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \ rm -f "$(DESTDIR)$(pdfdir)/$$f"; \ done uninstall-ps-am: @$(NORMAL_UNINSTALL) @list='$(PSS)'; test -n "$(psdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \ rm -f "$(DESTDIR)$(psdir)/$$f"; \ done dist-info: $(INFO_DEPS) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; \ for base in $$list; do \ case $$base in \ $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$base; then d=.; else d=$(srcdir); fi; \ base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \ for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \ if test -f $$file; then \ relfile=`expr "$$file" : "$$d/\(.*\)"`; \ test -f "$(distdir)/$$relfile" || \ cp -p $$file "$(distdir)/$$relfile"; \ else :; fi; \ done; \ done mostlyclean-aminfo: -rm -rf gnuchess.t2d gnuchess.t2p clean-aminfo: -test -z "gnuchess.dvi gnuchess.pdf gnuchess.ps gnuchess.html" \ || rm -rf gnuchess.dvi gnuchess.pdf gnuchess.ps gnuchess.html maintainer-clean-aminfo: @list='$(INFO_DEPS)'; for i in $$list; do \ i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ done tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-info check-am: all-am check: check-am all-am: Makefile $(INFO_DEPS) installdirs: for dir in "$(DESTDIR)$(infodir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-aminfo clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: $(DVIS) html: html-am html-am: $(HTMLS) info: info-am info-am: $(INFO_DEPS) install-data-am: install-info-am install-dvi: install-dvi-am install-dvi-am: $(DVIS) @$(NORMAL_INSTALL) @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \ $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \ done install-exec-am: install-html: install-html-am install-html-am: $(HTMLS) @$(NORMAL_INSTALL) @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \ $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \ $(am__strip_dir) \ d2=$$d$$p; \ if test -d "$$d2"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \ $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \ $(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \ else \ list2="$$list2 $$d2"; \ fi; \ done; \ test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \ done; } install-info: install-info-am install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \ $(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \ fi; \ for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ if test -f $$ifile; then \ echo "$$ifile"; \ else : ; fi; \ done; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done @$(POST_INSTALL) @if $(am__can_run_installinfo); then \ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ done; \ else : ; fi install-man: install-pdf: install-pdf-am install-pdf-am: $(PDFS) @$(NORMAL_INSTALL) @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done install-ps: install-ps-am install-ps-am: $(PSS) @$(NORMAL_INSTALL) @list='$(PSS)'; test -n "$(psdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-aminfo \ maintainer-clean-generic maintainer-clean-vti mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-aminfo mostlyclean-generic mostlyclean-vti pdf: pdf-am pdf-am: $(PDFS) ps: ps-am ps-am: $(PSS) uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \ uninstall-pdf-am uninstall-ps-am .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-aminfo clean-generic \ cscopelist-am ctags-am dist-info distclean distclean-generic \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-aminfo \ maintainer-clean-generic maintainer-clean-vti mostlyclean \ mostlyclean-aminfo mostlyclean-generic mostlyclean-vti pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am \ uninstall-dvi-am uninstall-html-am uninstall-info-am \ uninstall-pdf-am uninstall-ps-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: gnuchess-6.2.2/doc/mdate-sh000755 000766 000024 00000013637 12244054564 016370 0ustar00antoniostaff000000 000000 #!/bin/sh # Get modification time of a file or directory and pretty-print it. scriptversion=2010-08-21.06; # UTC # Copyright (C) 1995-2013 Free Software Foundation, Inc. # written by Ulrich Drepper , June 1995 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST fi case $1 in '') echo "$0: No file. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: mdate-sh [--help] [--version] FILE Pretty-print the modification day of FILE, in the format: 1 January 1970 Report bugs to . EOF exit $? ;; -v | --v*) echo "mdate-sh $scriptversion" exit $? ;; esac error () { echo "$0: $1" >&2 exit 1 } # Prevent date giving response in another language. LANG=C export LANG LC_ALL=C export LC_ALL LC_TIME=C export LC_TIME # GNU ls changes its time format in response to the TIME_STYLE # variable. Since we cannot assume 'unset' works, revert this # variable to its documented default. if test "${TIME_STYLE+set}" = set; then TIME_STYLE=posix-long-iso export TIME_STYLE fi save_arg1=$1 # Find out how to get the extended ls output of a file or directory. if ls -L /dev/null 1>/dev/null 2>&1; then ls_command='ls -L -l -d' else ls_command='ls -l -d' fi # Avoid user/group names that might have spaces, when possible. if ls -n /dev/null 1>/dev/null 2>&1; then ls_command="$ls_command -n" fi # A 'ls -l' line looks as follows on OS/2. # drwxrwx--- 0 Aug 11 2001 foo # This differs from Unix, which adds ownership information. # drwxrwx--- 2 root root 4096 Aug 11 2001 foo # # To find the date, we split the line on spaces and iterate on words # until we find a month. This cannot work with files whose owner is a # user named "Jan", or "Feb", etc. However, it's unlikely that '/' # will be owned by a user whose name is a month. So we first look at # the extended ls output of the root directory to decide how many # words should be skipped to get the date. # On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below. set x`$ls_command /` # Find which argument is the month. month= command= until test $month do test $# -gt 0 || error "failed parsing '$ls_command /' output" shift # Add another shift to the command. command="$command shift;" case $1 in Jan) month=January; nummonth=1;; Feb) month=February; nummonth=2;; Mar) month=March; nummonth=3;; Apr) month=April; nummonth=4;; May) month=May; nummonth=5;; Jun) month=June; nummonth=6;; Jul) month=July; nummonth=7;; Aug) month=August; nummonth=8;; Sep) month=September; nummonth=9;; Oct) month=October; nummonth=10;; Nov) month=November; nummonth=11;; Dec) month=December; nummonth=12;; esac done test -n "$month" || error "failed parsing '$ls_command /' output" # Get the extended ls output of the file or directory. set dummy x`eval "$ls_command \"\\\$save_arg1\""` # Remove all preceding arguments eval $command # Because of the dummy argument above, month is in $2. # # On a POSIX system, we should have # # $# = 5 # $1 = file size # $2 = month # $3 = day # $4 = year or time # $5 = filename # # On Darwin 7.7.0 and 7.6.0, we have # # $# = 4 # $1 = day # $2 = month # $3 = year or time # $4 = filename # Get the month. case $2 in Jan) month=January; nummonth=1;; Feb) month=February; nummonth=2;; Mar) month=March; nummonth=3;; Apr) month=April; nummonth=4;; May) month=May; nummonth=5;; Jun) month=June; nummonth=6;; Jul) month=July; nummonth=7;; Aug) month=August; nummonth=8;; Sep) month=September; nummonth=9;; Oct) month=October; nummonth=10;; Nov) month=November; nummonth=11;; Dec) month=December; nummonth=12;; esac case $3 in ???*) day=$1;; *) day=$3; shift;; esac # Here we have to deal with the problem that the ls output gives either # the time of day or the year. case $3 in *:*) set `date`; eval year=\$$# case $2 in Jan) nummonthtod=1;; Feb) nummonthtod=2;; Mar) nummonthtod=3;; Apr) nummonthtod=4;; May) nummonthtod=5;; Jun) nummonthtod=6;; Jul) nummonthtod=7;; Aug) nummonthtod=8;; Sep) nummonthtod=9;; Oct) nummonthtod=10;; Nov) nummonthtod=11;; Dec) nummonthtod=12;; esac # For the first six month of the year the time notation can also # be used for files modified in the last year. if (expr $nummonth \> $nummonthtod) > /dev/null; then year=`expr $year - 1` fi;; *) year=$3;; esac # The result. echo $day $month $year # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: gnuchess-6.2.2/doc/quotes.rb000755 000766 000024 00000007371 11517377072 016612 0ustar00antoniostaff000000 000000 #!/usr/bin/ruby # quotes.rb # # Copyright (C) 2001-2011 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. # # Contact: bug-gnu-chess@gnu.org # This script replaces inner double quotes in fi by single quotes and writes # the result on fo. This is necessary because command 'book add' does not # accept more than two matching double quotes in PGN files. # The program expects exactly two arguments in the command-line. # The first argument is the name of the input file, i.e. the file that is # going to be processed. # The second argument is the name of the output file, i.e. the file that will # be written as a result of processing the input file. # Check the number of command-line arguments: if other than two, display the # usage message and exit. if ARGV.size != 2 then puts "Usage: ./quotes " exit end # 'fiName' takes the first command-line argument, i.e. the input file name fiName = ARGV[0] # 'foName' takes the second command-line argument, i.e. the output file name foName = ARGV[1] # If the input does not exists, print an error message and exit. if not File.exists? fiName then puts "File #{fiName} does not exist." exit end # If the input and output file names are identical, print an error message # and exit. if foName == fiName then puts "Provide different input and output file names" exit end # If the output file already exists, ask the user if she or he wants to # replace it. Repeat the question in an infinite loop until the user enters # a valid answer: # if the user answers 'y' or 'Y', the program will continue; # if the user answers 'n' or 'N', the program will exit. if File.exists? foName then answer = "" while answer != "y" and answer != "n" puts "File #{foName} already exists. Replace it (y/n)?" answer = STDIN.gets.chop answer.downcase! end if answer == "n" then exit end end # Open the input file in read-only mode fi = File.new( fiName, 'r' ) # Open the output file in read-write mode fo = File.new( foName, 'w' ) # Loop over each line of the input file fi.each {|line| nQuotes = line.count( '\"' ) # Get the number of double quotes that are # present in the line. oLine = '' # Initialise the output line oLine << line # By default, the output line is equal to the input line # If the number of double quotes in the line is greater than 2, the output # line requires special processing. if nQuotes > 2 then # The line will be scanned character by character... nq = 0 # Initialize the count of double quotes in the line. oLine = '' # Overrides previous value of the output line # Loop over each character of the line line.each_char {|c| # If the character is a double quote, do special processing; # otherwise, append it to the output line. if c == "\"" then # Two special cases are considered (enough to cover book_1.01.pgn): # a) 3 double quotes => replace the 2nd double quote by a single quote # b) 4 double quotes => replace the 2nd and 3rd double quotes by a # single quote # Otherwise, append the character to the output line. if ( nQuotes == 3 and nq == 1 ) or ( nQuotes == 4 and ( nq == 1 or nq == 2 ) ) then oLine << '\'' else oLine << c end nq += 1 else oLine << c end } # End of looping over the characters of a line end fo.puts oLine # Write output line to the output file } # End of looping over the lines of the input file # Close the output file fo.close # Close the input file fi.close gnuchess-6.2.2/doc/README000644 000766 000024 00000000107 12236026751 015602 0ustar00antoniostaff000000 000000 ./gendocs.sh --email bug-gnu-chess@gnu.org gnuchess "GNU Chess manual" gnuchess-6.2.2/doc/stamp-vti000644 000766 000024 00000000142 12606706442 016573 0ustar00antoniostaff000000 000000 @set UPDATED 4 January 2015 @set UPDATED-MONTH January 2015 @set EDITION 6.2.2 @set VERSION 6.2.2 gnuchess-6.2.2/doc/texinfo.tex000644 000766 000024 00001167036 12244054564 017142 0ustar00antoniostaff000000 000000 % texinfo.tex -- TeX macros to handle Texinfo files. % % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % \def\texinfoversion{2013-02-01.11} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, % 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. % % This texinfo.tex file is free software: you can redistribute it and/or % modify it under the terms of the GNU General Public License as % published by the Free Software Foundation, either version 3 of the % License, or (at your option) any later version. % % This texinfo.tex file is distributed in the hope that it will be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU % General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program. If not, see . % % As a special exception, when this file is read by TeX when processing % a Texinfo source document, you may use the result without % restriction. This Exception is an additional permission under section 7 % of the GNU General Public License, version 3 ("GPLv3"). % % Please try the latest version of texinfo.tex before submitting bug % reports; you can get the latest version from: % http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or % http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or % http://www.gnu.org/software/texinfo/ (the Texinfo home page) % The texinfo.tex in any given distribution could well be out % of date, so if that's what you're using, please check. % % Send bug reports to bug-texinfo@gnu.org. Please include including a % complete document in each bug report with which we can reproduce the % problem. Patches are, of course, greatly appreciated. % % To process a Texinfo manual with TeX, it's most reliable to use the % texi2dvi shell script that comes with the distribution. For a simple % manual foo.texi, however, you can get away with this: % tex foo.texi % texindex foo.?? % tex foo.texi % tex foo.texi % dvips foo.dvi -o # or whatever; this makes foo.ps. % The extra TeX runs get the cross-reference information correct. % Sometimes one run after texindex suffices, and sometimes you need more % than two; texi2dvi does it as many times as necessary. % % It is possible to adapt texinfo.tex for other languages, to some % extent. You can get the existing language-specific files from the % full Texinfo distribution. % % The GNU Texinfo home page is http://www.gnu.org/software/texinfo. \message{Loading texinfo [version \texinfoversion]:} % If in a .fmt file, print the version number % and turn on active characters that we couldn't do earlier because % they might have appeared in the input file name. \everyjob{\message{[Texinfo version \texinfoversion]}% \catcode`+=\active \catcode`\_=\active} \chardef\other=12 % We never want plain's \outer definition of \+ in Texinfo. % For @tex, we can use \tabalign. \let\+ = \relax % Save some plain tex macros whose names we will redefine. \let\ptexb=\b \let\ptexbullet=\bullet \let\ptexc=\c \let\ptexcomma=\, \let\ptexdot=\. \let\ptexdots=\dots \let\ptexend=\end \let\ptexequiv=\equiv \let\ptexexclam=\! \let\ptexfootnote=\footnote \let\ptexgtr=> \let\ptexhat=^ \let\ptexi=\i \let\ptexindent=\indent \let\ptexinsert=\insert \let\ptexlbrace=\{ \let\ptexless=< \let\ptexnewwrite\newwrite \let\ptexnoindent=\noindent \let\ptexplus=+ \let\ptexraggedright=\raggedright \let\ptexrbrace=\} \let\ptexslash=\/ \let\ptexstar=\* \let\ptext=\t \let\ptextop=\top {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode % If this character appears in an error message or help string, it % starts a new line in the output. \newlinechar = `^^J % Use TeX 3.0's \inputlineno to get the line number, for better error % messages, but if we're using an old version of TeX, don't do anything. % \ifx\inputlineno\thisisundefined \let\linenumber = \empty % Pre-3.0. \else \def\linenumber{l.\the\inputlineno:\space} \fi % Set up fixed words for English if not already set. \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi \ifx\putworderror\undefined \gdef\putworderror{error}\fi \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi \ifx\putwordin\undefined \gdef\putwordin{in}\fi \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi \ifx\putwordof\undefined \gdef\putwordof{of}\fi \ifx\putwordon\undefined \gdef\putwordon{on}\fi \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi % \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi % \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi % Since the category of space is not known, we have to be careful. \chardef\spacecat = 10 \def\spaceisspace{\catcode`\ =\spacecat} % sometimes characters are active, so we need control sequences. \chardef\ampChar = `\& \chardef\colonChar = `\: \chardef\commaChar = `\, \chardef\dashChar = `\- \chardef\dotChar = `\. \chardef\exclamChar= `\! \chardef\hashChar = `\# \chardef\lquoteChar= `\` \chardef\questChar = `\? \chardef\rquoteChar= `\' \chardef\semiChar = `\; \chardef\slashChar = `\/ \chardef\underChar = `\_ % Ignore a token. % \def\gobble#1{} % The following is used inside several \edef's. \def\makecsname#1{\expandafter\noexpand\csname#1\endcsname} % Hyphenation fixes. \hyphenation{ Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script ap-pen-dix bit-map bit-maps data-base data-bases eshell fall-ing half-way long-est man-u-script man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces spell-ing spell-ings stand-alone strong-est time-stamp time-stamps which-ever white-space wide-spread wrap-around } % Margin to add to right of even pages, to left of odd pages. \newdimen\bindingoffset \newdimen\normaloffset \newdimen\pagewidth \newdimen\pageheight % For a final copy, take out the rectangles % that mark overfull boxes (in case you have decided % that the text looks ok even though it passes the margin). % \def\finalout{\overfullrule=0pt } % Sometimes it is convenient to have everything in the transcript file % and nothing on the terminal. We don't just call \tracingall here, % since that produces some useless output on the terminal. We also make % some effort to order the tracing commands to reduce output in the log % file; cf. trace.sty in LaTeX. % \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% \def\loggingall{% \tracingstats2 \tracingpages1 \tracinglostchars2 % 2 gives us more in etex \tracingparagraphs1 \tracingoutput1 \tracingmacros2 \tracingrestores1 \showboxbreadth\maxdimen \showboxdepth\maxdimen \ifx\eTeXversion\thisisundefined\else % etex gives us more logging \tracingscantokens1 \tracingifs1 \tracinggroups1 \tracingnesting2 \tracingassigns1 \fi \tracingcommands3 % 3 gives us more in etex \errorcontextlines16 }% % @errormsg{MSG}. Do the index-like expansions on MSG, but if things % aren't perfect, it's not the end of the world, being an error message, % after all. % \def\errormsg{\begingroup \indexnofonts \doerrormsg} \def\doerrormsg#1{\errmessage{#1}} % add check for \lastpenalty to plain's definitions. If the last thing % we did was a \nobreak, we don't want to insert more space. % \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount \removelastskip\penalty-50\smallskip\fi\fi} \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount \removelastskip\penalty-100\medskip\fi\fi} \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount \removelastskip\penalty-200\bigskip\fi\fi} % Do @cropmarks to get crop marks. % \newif\ifcropmarks \let\cropmarks = \cropmarkstrue % % Dimensions to add cropmarks at corners. % Added by P. A. MacKay, 12 Nov. 1986 % \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines \newdimen\cornerlong \cornerlong=1pc \newdimen\cornerthick \cornerthick=.3pt \newdimen\topandbottommargin \topandbottommargin=.75in % Output a mark which sets \thischapter, \thissection and \thiscolor. % We dump everything together because we only have one kind of mark. % This works because we only use \botmark / \topmark, not \firstmark. % % A mark contains a subexpression of the \ifcase ... \fi construct. % \get*marks macros below extract the needed part using \ifcase. % % Another complication is to let the user choose whether \thischapter % (\thissection) refers to the chapter (section) in effect at the top % of a page, or that at the bottom of a page. The solution is % described on page 260 of The TeXbook. It involves outputting two % marks for the sectioning macros, one before the section break, and % one after. I won't pretend I can describe this better than DEK... \def\domark{% \toks0=\expandafter{\lastchapterdefs}% \toks2=\expandafter{\lastsectiondefs}% \toks4=\expandafter{\prevchapterdefs}% \toks6=\expandafter{\prevsectiondefs}% \toks8=\expandafter{\lastcolordefs}% \mark{% \the\toks0 \the\toks2 \noexpand\or \the\toks4 \the\toks6 \noexpand\else \the\toks8 }% } % \topmark doesn't work for the very first chapter (after the title % page or the contents), so we use \firstmark there -- this gets us % the mark with the chapter defs, unless the user sneaks in, e.g., % @setcolor (or @url, or @link, etc.) between @contents and the very % first @chapter. \def\gettopheadingmarks{% \ifcase0\topmark\fi \ifx\thischapter\empty \ifcase0\firstmark\fi \fi } \def\getbottomheadingmarks{\ifcase1\botmark\fi} \def\getcolormarks{\ifcase2\topmark\fi} % Avoid "undefined control sequence" errors. \def\lastchapterdefs{} \def\lastsectiondefs{} \def\prevchapterdefs{} \def\prevsectiondefs{} \def\lastcolordefs{} % Main output routine. \chardef\PAGE = 255 \output = {\onepageout{\pagecontents\PAGE}} \newbox\headlinebox \newbox\footlinebox % \onepageout takes a vbox as an argument. Note that \pagecontents % does insertions, but you have to call it yourself. \def\onepageout#1{% \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi % \ifodd\pageno \advance\hoffset by \bindingoffset \else \advance\hoffset by -\bindingoffset\fi % % Do this outside of the \shipout so @code etc. will be expanded in % the headline as they should be, not taken literally (outputting ''code). \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% % {% % Have to do this stuff outside the \shipout because we want it to % take effect in \write's, yet the group defined by the \vbox ends % before the \shipout runs. % \indexdummies % don't expand commands in the output. \normalturnoffactive % \ in index entries must not stay \, e.g., if % the page break happens to be in the middle of an example. % We don't want .vr (or whatever) entries like this: % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}} % "\acronym" won't work when it's read back in; % it needs to be % {\code {{\tt \backslashcurfont }acronym} \shipout\vbox{% % Do this early so pdf references go to the beginning of the page. \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi % \ifcropmarks \vbox to \outervsize\bgroup \hsize = \outerhsize \vskip-\topandbottommargin \vtop to0pt{% \line{\ewtop\hfil\ewtop}% \nointerlineskip \line{% \vbox{\moveleft\cornerthick\nstop}% \hfill \vbox{\moveright\cornerthick\nstop}% }% \vss}% \vskip\topandbottommargin \line\bgroup \hfil % center the page within the outer (page) hsize. \ifodd\pageno\hskip\bindingoffset\fi \vbox\bgroup \fi % \unvbox\headlinebox \pagebody{#1}% \ifdim\ht\footlinebox > 0pt % Only leave this space if the footline is nonempty. % (We lessened \vsize for it in \oddfootingyyy.) % The \baselineskip=24pt in plain's \makefootline has no effect. \vskip 24pt \unvbox\footlinebox \fi % \ifcropmarks \egroup % end of \vbox\bgroup \hfil\egroup % end of (centering) \line\bgroup \vskip\topandbottommargin plus1fill minus1fill \boxmaxdepth = \cornerthick \vbox to0pt{\vss \line{% \vbox{\moveleft\cornerthick\nsbot}% \hfill \vbox{\moveright\cornerthick\nsbot}% }% \nointerlineskip \line{\ewbot\hfil\ewbot}% }% \egroup % \vbox from first cropmarks clause \fi }% end of \shipout\vbox }% end of group with \indexdummies \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi } \newinsert\margin \dimen\margin=\maxdimen \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} {\catcode`\@ =11 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi % marginal hacks, juha@viisa.uucp (Juha Takala) \ifvoid\margin\else % marginal info is present \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi \dimen@=\dp#1\relax \unvbox#1\relax \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi \ifr@ggedbottom \kern-\dimen@ \vfil \fi} } % Here are the rules for the cropmarks. Note that they are % offset so that the space between them is truly \outerhsize or \outervsize % (P. A. MacKay, 12 November, 1986) % \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} \def\nstop{\vbox {\hrule height\cornerthick depth\cornerlong width\cornerthick}} \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} \def\nsbot{\vbox {\hrule height\cornerlong depth\cornerthick width\cornerthick}} % Parse an argument, then pass it to #1. The argument is the rest of % the input line (except we remove a trailing comment). #1 should be a % macro which expects an ordinary undelimited TeX argument. % \def\parsearg{\parseargusing{}} \def\parseargusing#1#2{% \def\argtorun{#2}% \begingroup \obeylines \spaceisspace #1% \parseargline\empty% Insert the \empty token, see \finishparsearg below. } {\obeylines % \gdef\parseargline#1^^M{% \endgroup % End of the group started in \parsearg. \argremovecomment #1\comment\ArgTerm% }% } % First remove any @comment, then any @c comment. \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} % Each occurrence of `\^^M' or `\^^M' is replaced by a single space. % % \argremovec might leave us with trailing space, e.g., % @end itemize @c foo % This space token undergoes the same procedure and is eventually removed % by \finishparsearg. % \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% \def\temp{#3}% \ifx\temp\empty % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp: \let\temp\finishparsearg \else \let\temp\argcheckspaces \fi % Put the space token in: \temp#1 #3\ArgTerm } % If a _delimited_ argument is enclosed in braces, they get stripped; so % to get _exactly_ the rest of the line, we had to prevent such situation. % We prepended an \empty token at the very beginning and we expand it now, % just before passing the control to \argtorun. % (Similarly, we have to think about #3 of \argcheckspacesY above: it is % either the null string, or it ends with \^^M---thus there is no danger % that a pair of braces would be stripped. % % But first, we have to remove the trailing space token. % \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} % \parseargdef\foo{...} % is roughly equivalent to % \def\foo{\parsearg\Xfoo} % \def\Xfoo#1{...} % % Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my % favourite TeX trick. --kasal, 16nov03 \def\parseargdef#1{% \expandafter \doparseargdef \csname\string#1\endcsname #1% } \def\doparseargdef#1#2{% \def#2{\parsearg#1}% \def#1##1% } % Several utility definitions with active space: { \obeyspaces \gdef\obeyedspace{ } % Make each space character in the input produce a normal interword % space in the output. Don't allow a line break at this space, as this % is used only in environments like @example, where each line of input % should produce a line of output anyway. % \gdef\sepspaces{\obeyspaces\let =\tie} % If an index command is used in an @example environment, any spaces % therein should become regular spaces in the raw index file, not the % expansion of \tie (\leavevmode \penalty \@M \ ). \gdef\unsepspaces{\let =\space} } \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} % Define the framework for environments in texinfo.tex. It's used like this: % % \envdef\foo{...} % \def\Efoo{...} % % It's the responsibility of \envdef to insert \begingroup before the % actual body; @end closes the group after calling \Efoo. \envdef also % defines \thisenv, so the current environment is known; @end checks % whether the environment name matches. The \checkenv macro can also be % used to check whether the current environment is the one expected. % % Non-false conditionals (@iftex, @ifset) don't fit into this, so they % are not treated as environments; they don't open a group. (The % implementation of @end takes care not to call \endgroup in this % special case.) % At run-time, environments start with this: \def\startenvironment#1{\begingroup\def\thisenv{#1}} % initialize \let\thisenv\empty % ... but they get defined via ``\envdef\foo{...}'': \long\def\envdef#1#2{\def#1{\startenvironment#1#2}} \def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}} % Check whether we're in the right environment: \def\checkenv#1{% \def\temp{#1}% \ifx\thisenv\temp \else \badenverr \fi } % Environment mismatch, #1 expected: \def\badenverr{% \errhelp = \EMsimple \errmessage{This command can appear only \inenvironment\temp, not \inenvironment\thisenv}% } \def\inenvironment#1{% \ifx#1\empty outside of any environment% \else in environment \expandafter\string#1% \fi } % @end foo executes the definition of \Efoo. % But first, it executes a specialized version of \checkenv % \parseargdef\end{% \if 1\csname iscond.#1\endcsname \else % The general wording of \badenverr may not be ideal. \expandafter\checkenv\csname#1\endcsname \csname E#1\endcsname \endgroup \fi } \newhelp\EMsimple{Press RETURN to continue.} % Be sure we're in horizontal mode when doing a tie, since we make space % equivalent to this in @example-like environments. Otherwise, a space % at the beginning of a line will start with \penalty -- and % since \penalty is valid in vertical mode, we'd end up putting the % penalty on the vertical list instead of in the new paragraph. {\catcode`@ = 11 % Avoid using \@M directly, because that causes trouble % if the definition is written into an index file. \global\let\tiepenalty = \@M \gdef\tie{\leavevmode\penalty\tiepenalty\ } } % @: forces normal size whitespace following. \def\:{\spacefactor=1000 } % @* forces a line break. \def\*{\unskip\hfil\break\hbox{}\ignorespaces} % @/ allows a line break. \let\/=\allowbreak % @. is an end-of-sentence period. \def\.{.\spacefactor=\endofsentencespacefactor\space} % @! is an end-of-sentence bang. \def\!{!\spacefactor=\endofsentencespacefactor\space} % @? is an end-of-sentence query. \def\?{?\spacefactor=\endofsentencespacefactor\space} % @frenchspacing on|off says whether to put extra space after punctuation. % \def\onword{on} \def\offword{off} % \parseargdef\frenchspacing{% \def\temp{#1}% \ifx\temp\onword \plainfrenchspacing \else\ifx\temp\offword \plainnonfrenchspacing \else \errhelp = \EMsimple \errmessage{Unknown @frenchspacing option `\temp', must be on|off}% \fi\fi } % @w prevents a word break. Without the \leavevmode, @w at the % beginning of a paragraph, when TeX is still in vertical mode, would % produce a whole line of output instead of starting the paragraph. \def\w#1{\leavevmode\hbox{#1}} % @group ... @end group forces ... to be all on one page, by enclosing % it in a TeX vbox. We use \vtop instead of \vbox to construct the box % to keep its height that of a normal line. According to the rules for % \topskip (p.114 of the TeXbook), the glue inserted is % max (\topskip - \ht (first item), 0). If that height is large, % therefore, no glue is inserted, and the space between the headline and % the text is small, which looks bad. % % Another complication is that the group might be very large. This can % cause the glue on the previous page to be unduly stretched, because it % does not have much material. In this case, it's better to add an % explicit \vfill so that the extra space is at the bottom. The % threshold for doing this is if the group is more than \vfilllimit % percent of a page (\vfilllimit can be changed inside of @tex). % \newbox\groupbox \def\vfilllimit{0.7} % \envdef\group{% \ifnum\catcode`\^^M=\active \else \errhelp = \groupinvalidhelp \errmessage{@group invalid in context where filling is enabled}% \fi \startsavinginserts % \setbox\groupbox = \vtop\bgroup % Do @comment since we are called inside an environment such as % @example, where each end-of-line in the input causes an % end-of-line in the output. We don't want the end-of-line after % the `@group' to put extra space in the output. Since @group % should appear on a line by itself (according to the Texinfo % manual), we don't worry about eating any user text. \comment } % % The \vtop produces a box with normal height and large depth; thus, TeX puts % \baselineskip glue before it, and (when the next line of text is done) % \lineskip glue after it. Thus, space below is not quite equal to space % above. But it's pretty close. \def\Egroup{% % To get correct interline space between the last line of the group % and the first line afterwards, we have to propagate \prevdepth. \endgraf % Not \par, as it may have been set to \lisppar. \global\dimen1 = \prevdepth \egroup % End the \vtop. % \dimen0 is the vertical size of the group's box. \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox % \dimen2 is how much space is left on the page (more or less). \dimen2 = \pageheight \advance\dimen2 by -\pagetotal % if the group doesn't fit on the current page, and it's a big big % group, force a page break. \ifdim \dimen0 > \dimen2 \ifdim \pagetotal < \vfilllimit\pageheight \page \fi \fi \box\groupbox \prevdepth = \dimen1 \checkinserts } % % TeX puts in an \escapechar (i.e., `@') at the beginning of the help % message, so this ends up printing `@group can only ...'. % \newhelp\groupinvalidhelp{% group can only be used in environments such as @example,^^J% where each line of input produces a line of output.} % @need space-in-mils % forces a page break if there is not space-in-mils remaining. \newdimen\mil \mil=0.001in \parseargdef\need{% % Ensure vertical mode, so we don't make a big box in the middle of a % paragraph. \par % % If the @need value is less than one line space, it's useless. \dimen0 = #1\mil \dimen2 = \ht\strutbox \advance\dimen2 by \dp\strutbox \ifdim\dimen0 > \dimen2 % % Do a \strut just to make the height of this box be normal, so the % normal leading is inserted relative to the preceding line. % And a page break here is fine. \vtop to #1\mil{\strut\vfil}% % % TeX does not even consider page breaks if a penalty added to the % main vertical list is 10000 or more. But in order to see if the % empty box we just added fits on the page, we must make it consider % page breaks. On the other hand, we don't want to actually break the % page after the empty box. So we use a penalty of 9999. % % There is an extremely small chance that TeX will actually break the % page at this \penalty, if there are no other feasible breakpoints in % sight. (If the user is using lots of big @group commands, which % almost-but-not-quite fill up a page, TeX will have a hard time doing % good page breaking, for example.) However, I could not construct an % example where a page broke at this \penalty; if it happens in a real % document, then we can reconsider our strategy. \penalty9999 % % Back up by the size of the box, whether we did a page break or not. \kern -#1\mil % % Do not allow a page break right after this kern. \nobreak \fi } % @br forces paragraph break (and is undocumented). \let\br = \par % @page forces the start of a new page. % \def\page{\par\vfill\supereject} % @exdent text.... % outputs text on separate line in roman font, starting at standard page margin % This records the amount of indent in the innermost environment. % That's how much \exdent should take out. \newskip\exdentamount % This defn is used inside fill environments such as @defun. \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break} % This defn is used inside nofill environments such as @example. \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount \leftline{\hskip\leftskip{\rm#1}}}} % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current % paragraph. For more general purposes, use the \margin insertion % class. WHICH is `l' or `r'. Not documented, written for gawk manual. % \newskip\inmarginspacing \inmarginspacing=1cm \def\strutdepth{\dp\strutbox} % \def\doinmargin#1#2{\strut\vadjust{% \nobreak \kern-\strutdepth \vtop to \strutdepth{% \baselineskip=\strutdepth \vss % if you have multiple lines of stuff to put here, you'll need to % make the vbox yourself of the appropriate size. \ifx#1l% \llap{\ignorespaces #2\hskip\inmarginspacing}% \else \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% \fi \null }% }} \def\inleftmargin{\doinmargin l} \def\inrightmargin{\doinmargin r} % % @inmargin{TEXT [, RIGHT-TEXT]} % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; % else use TEXT for both). % \def\inmargin#1{\parseinmargin #1,,\finish} \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \def\lefttext{#1}% have both texts \def\righttext{#2}% \else \def\lefttext{#1}% have only one text \def\righttext{#1}% \fi % \ifodd\pageno \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin \else \def\temp{\inleftmargin\lefttext}% \fi \temp } % @| inserts a changebar to the left of the current line. It should % surround any changed text. This approach does *not* work if the % change spans more than two lines of output. To handle that, we would % have adopt a much more difficult approach (putting marks into the main % vertical list for the beginning and end of each change). This command % is not documented, not supported, and doesn't work. % \def\|{% % \vadjust can only be used in horizontal mode. \leavevmode % % Append this vertical mode material after the current line in the output. \vadjust{% % We want to insert a rule with the height and depth of the current % leading; that is exactly what \strutbox is supposed to record. \vskip-\baselineskip % % \vadjust-items are inserted at the left edge of the type. So % the \llap here moves out into the left-hand margin. \llap{% % % For a thicker or thinner bar, change the `1pt'. \vrule height\baselineskip width1pt % % This is the space between the bar and the text. \hskip 12pt }% }% } % @include FILE -- \input text of FILE. % \def\include{\parseargusing\filenamecatcodes\includezzz} \def\includezzz#1{% \pushthisfilestack \def\thisfile{#1}% {% \makevalueexpandable % we want to expand any @value in FILE. \turnoffactive % and allow special characters in the expansion \indexnofonts % Allow `@@' and other weird things in file names. \wlog{texinfo.tex: doing @include of #1^^J}% \edef\temp{\noexpand\input #1 }% % % This trickery is to read FILE outside of a group, in case it makes % definitions, etc. \expandafter }\temp \popthisfilestack } \def\filenamecatcodes{% \catcode`\\=\other \catcode`~=\other \catcode`^=\other \catcode`_=\other \catcode`|=\other \catcode`<=\other \catcode`>=\other \catcode`+=\other \catcode`-=\other \catcode`\`=\other \catcode`\'=\other } \def\pushthisfilestack{% \expandafter\pushthisfilestackX\popthisfilestack\StackTerm } \def\pushthisfilestackX{% \expandafter\pushthisfilestackY\thisfile\StackTerm } \def\pushthisfilestackY #1\StackTerm #2\StackTerm {% \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}% } \def\popthisfilestack{\errthisfilestackempty} \def\errthisfilestackempty{\errmessage{Internal error: the stack of filenames is empty.}} % \def\thisfile{} % @center line % outputs that line, centered. % \parseargdef\center{% \ifhmode \let\centersub\centerH \else \let\centersub\centerV \fi \centersub{\hfil \ignorespaces#1\unskip \hfil}% \let\centersub\relax % don't let the definition persist, just in case } \def\centerH#1{{% \hfil\break \advance\hsize by -\leftskip \advance\hsize by -\rightskip \line{#1}% \break }} % \newcount\centerpenalty \def\centerV#1{% % The idea here is the same as in \startdefun, \cartouche, etc.: if % @center is the first thing after a section heading, we need to wipe % out the negative parskip inserted by \sectionheading, but still % prevent a page break here. \centerpenalty = \lastpenalty \ifnum\centerpenalty>10000 \vskip\parskip \fi \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi \line{\kern\leftskip #1\kern\rightskip}% } % @sp n outputs n lines of vertical space % \parseargdef\sp{\vskip #1\baselineskip} % @comment ...line which is ignored... % @c is the same as @comment % @ignore ... @end ignore is another way to write a comment % \def\comment{\begingroup \catcode`\^^M=\other% \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% \commentxxx} {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} % \let\c=\comment % @paragraphindent NCHARS % We'll use ems for NCHARS, close enough. % NCHARS can also be the word `asis' or `none'. % We cannot feasibly implement @paragraphindent asis, though. % \def\asisword{asis} % no translation, these are keywords \def\noneword{none} % \parseargdef\paragraphindent{% \def\temp{#1}% \ifx\temp\asisword \else \ifx\temp\noneword \defaultparindent = 0pt \else \defaultparindent = #1em \fi \fi \parindent = \defaultparindent } % @exampleindent NCHARS % We'll use ems for NCHARS like @paragraphindent. % It seems @exampleindent asis isn't necessary, but % I preserve it to make it similar to @paragraphindent. \parseargdef\exampleindent{% \def\temp{#1}% \ifx\temp\asisword \else \ifx\temp\noneword \lispnarrowing = 0pt \else \lispnarrowing = #1em \fi \fi } % @firstparagraphindent WORD % If WORD is `none', then suppress indentation of the first paragraph % after a section heading. If WORD is `insert', then do indent at such % paragraphs. % % The paragraph indentation is suppressed or not by calling % \suppressfirstparagraphindent, which the sectioning commands do. % We switch the definition of this back and forth according to WORD. % By default, we suppress indentation. % \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} \def\insertword{insert} % \parseargdef\firstparagraphindent{% \def\temp{#1}% \ifx\temp\noneword \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent \else\ifx\temp\insertword \let\suppressfirstparagraphindent = \relax \else \errhelp = \EMsimple \errmessage{Unknown @firstparagraphindent option `\temp'}% \fi\fi } % Here is how we actually suppress indentation. Redefine \everypar to % \kern backwards by \parindent, and then reset itself to empty. % % We also make \indent itself not actually do anything until the next % paragraph. % \gdef\dosuppressfirstparagraphindent{% \gdef\indent{% \restorefirstparagraphindent \indent }% \gdef\noindent{% \restorefirstparagraphindent \noindent }% \global\everypar = {% \kern -\parindent \restorefirstparagraphindent }% } \gdef\restorefirstparagraphindent{% \global \let \indent = \ptexindent \global \let \noindent = \ptexnoindent \global \everypar = {}% } % @refill is a no-op. \let\refill=\relax % If working on a large document in chapters, it is convenient to % be able to disable indexing, cross-referencing, and contents, for test runs. % This is done with @novalidate (before @setfilename). % \newif\iflinks \linkstrue % by default we want the aux files. \let\novalidate = \linksfalse % @setfilename is done at the beginning of every texinfo file. % So open here the files we need to have open while reading the input. % This makes it possible to make a .fmt file for texinfo. \def\setfilename{% \fixbackslash % Turn off hack to swallow `\input texinfo'. \iflinks \tryauxfile % Open the new aux file. TeX will close it automatically at exit. \immediate\openout\auxfile=\jobname.aux \fi % \openindices needs to do some work in any case. \openindices \let\setfilename=\comment % Ignore extra @setfilename cmds. % % If texinfo.cnf is present on the system, read it. % Useful for site-wide @afourpaper, etc. \openin 1 texinfo.cnf \ifeof 1 \else \input texinfo.cnf \fi \closein 1 % \comment % Ignore the actual filename. } % Called from \setfilename. % \def\openindices{% \newindex{cp}% \newcodeindex{fn}% \newcodeindex{vr}% \newcodeindex{tp}% \newcodeindex{ky}% \newcodeindex{pg}% } % @bye. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} \message{pdf,} % adobe `portable' document format \newcount\tempnum \newcount\lnkcount \newtoks\filename \newcount\filenamelength \newcount\pgn \newtoks\toksA \newtoks\toksB \newtoks\toksC \newtoks\toksD \newbox\boxA \newcount\countA \newif\ifpdf \newif\ifpdfmakepagedest % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 % can be set). So we test for \relax and 0 as well as being undefined. \ifx\pdfoutput\thisisundefined \else \ifx\pdfoutput\relax \else \ifcase\pdfoutput \else \pdftrue \fi \fi \fi % PDF uses PostScript string constants for the names of xref targets, % for display in the outlines, and in other places. Thus, we have to % double any backslashes. Otherwise, a name like "\node" will be % interpreted as a newline (\n), followed by o, d, e. Not good. % % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and % related messages. The final outcome is that it is up to the TeX user % to double the backslashes and otherwise make the string valid, so % that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to % do this reliably, so we use it. % #1 is a control sequence in which to do the replacements, % which we \xdef. \def\txiescapepdf#1{% \ifx\pdfescapestring\thisisundefined % No primitive available; should we give a warning or log? % Many times it won't matter. \else % The expandable \pdfescapestring primitive escapes parentheses, % backslashes, and other special chars. \xdef#1{\pdfescapestring{#1}}% \fi } \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images with PDF output, and none of those formats could be found. (.eps cannot be supported due to the design of the PDF format; use regular TeX (DVI output) for that.)} \ifpdf % % Color manipulation macros based on pdfcolor.tex, % except using rgb instead of cmyk; the latter is said to render as a % very dark gray on-screen and a very dark halftone in print, instead % of actual black. \def\rgbDarkRed{0.50 0.09 0.12} \def\rgbBlack{0 0 0} % % k sets the color for filling (usual text, etc.); % K sets the color for stroking (thin rules, e.g., normal _'s). \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}} % % Set color, and create a mark which defines \thiscolor accordingly, % so that \makeheadline knows which color to restore. \def\setcolor#1{% \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% \domark \pdfsetcolor{#1}% } % \def\maincolor{\rgbBlack} \pdfsetcolor{\maincolor} \edef\thiscolor{\maincolor} \def\lastcolordefs{} % \def\makefootline{% \baselineskip24pt \line{\pdfsetcolor{\maincolor}\the\footline}% } % \def\makeheadline{% \vbox to 0pt{% \vskip-22.5pt \line{% \vbox to8.5pt{}% % Extract \thiscolor definition from the marks. \getcolormarks % Typeset the headline with \maincolor, then restore the color. \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% }% \vss }% \nointerlineskip } % % \pdfcatalog{/PageMode /UseOutlines} % % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). \def\dopdfimage#1#2#3{% \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% % % pdftex (and the PDF format) support .pdf, .png, .jpg (among % others). Let's try in that order, PDF first since if % someone has a scalable image, presumably better to use that than a % bitmap. \let\pdfimgext=\empty \begingroup \openin 1 #1.pdf \ifeof 1 \openin 1 #1.PDF \ifeof 1 \openin 1 #1.png \ifeof 1 \openin 1 #1.jpg \ifeof 1 \openin 1 #1.jpeg \ifeof 1 \openin 1 #1.JPG \ifeof 1 \errhelp = \nopdfimagehelp \errmessage{Could not find image file #1 for pdf}% \else \gdef\pdfimgext{JPG}% \fi \else \gdef\pdfimgext{jpeg}% \fi \else \gdef\pdfimgext{jpg}% \fi \else \gdef\pdfimgext{png}% \fi \else \gdef\pdfimgext{PDF}% \fi \else \gdef\pdfimgext{pdf}% \fi \closein 1 \endgroup % % without \immediate, ancient pdftex seg faults when the same image is % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) \ifnum\pdftexversion < 14 \immediate\pdfimage \else \immediate\pdfximage \fi \ifdim \wd0 >0pt width \pdfimagewidth \fi \ifdim \wd2 >0pt height \pdfimageheight \fi \ifnum\pdftexversion<13 #1.\pdfimgext \else {#1.\pdfimgext}% \fi \ifnum\pdftexversion < 14 \else \pdfrefximage \pdflastximage \fi} % \def\pdfmkdest#1{{% % We have to set dummies so commands such as @code, and characters % such as \, aren't expanded when present in a section title. \indexnofonts \turnoffactive \makevalueexpandable \def\pdfdestname{#1}% \txiescapepdf\pdfdestname \safewhatsit{\pdfdest name{\pdfdestname} xyz}% }} % % used to mark target names; must be expandable. \def\pdfmkpgn#1{#1} % % by default, use a color that is dark enough to print on paper as % nearly black, but still distinguishable for online viewing. \def\urlcolor{\rgbDarkRed} \def\linkcolor{\rgbDarkRed} \def\endlink{\setcolor{\maincolor}\pdfendlink} % % Adding outlines to PDF; macros for calculating structure of outlines % come from Petr Olsak \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% \else \csname#1\endcsname \fi} \def\advancenumber#1{\tempnum=\expnumber{#1}\relax \advance\tempnum by 1 \expandafter\xdef\csname#1\endcsname{\the\tempnum}} % % #1 is the section text, which is what will be displayed in the % outline by the pdf viewer. #2 is the pdf expression for the number % of subentries (or empty, for subsubsections). #3 is the node text, % which might be empty if this toc entry had no corresponding node. % #4 is the page number % \def\dopdfoutline#1#2#3#4{% % Generate a link to the node text if that exists; else, use the % page number. We could generate a destination for the section % text in the case where a section has no node, but it doesn't % seem worth the trouble, since most documents are normally structured. \edef\pdfoutlinedest{#3}% \ifx\pdfoutlinedest\empty \def\pdfoutlinedest{#4}% \else \txiescapepdf\pdfoutlinedest \fi % % Also escape PDF chars in the display string. \edef\pdfoutlinetext{#1}% \txiescapepdf\pdfoutlinetext % \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}% } % \def\pdfmakeoutlines{% \begingroup % Read toc silently, to get counts of subentries for \pdfoutline. \def\partentry##1##2##3##4{}% ignore parts in the outlines \def\numchapentry##1##2##3##4{% \def\thischapnum{##2}% \def\thissecnum{0}% \def\thissubsecnum{0}% }% \def\numsecentry##1##2##3##4{% \advancenumber{chap\thischapnum}% \def\thissecnum{##2}% \def\thissubsecnum{0}% }% \def\numsubsecentry##1##2##3##4{% \advancenumber{sec\thissecnum}% \def\thissubsecnum{##2}% }% \def\numsubsubsecentry##1##2##3##4{% \advancenumber{subsec\thissubsecnum}% }% \def\thischapnum{0}% \def\thissecnum{0}% \def\thissubsecnum{0}% % % use \def rather than \let here because we redefine \chapentry et % al. a second time, below. \def\appentry{\numchapentry}% \def\appsecentry{\numsecentry}% \def\appsubsecentry{\numsubsecentry}% \def\appsubsubsecentry{\numsubsubsecentry}% \def\unnchapentry{\numchapentry}% \def\unnsecentry{\numsecentry}% \def\unnsubsecentry{\numsubsecentry}% \def\unnsubsubsecentry{\numsubsubsecentry}% \readdatafile{toc}% % % Read toc second time, this time actually producing the outlines. % The `-' means take the \expnumber as the absolute number of % subentries, which we calculated on our first read of the .toc above. % % We use the node names as the destinations. \def\numchapentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% \def\numsecentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% \def\numsubsecentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% \def\numsubsubsecentry##1##2##3##4{% count is always zero \dopdfoutline{##1}{}{##3}{##4}}% % % PDF outlines are displayed using system fonts, instead of % document fonts. Therefore we cannot use special characters, % since the encoding is unknown. For example, the eogonek from % Latin 2 (0xea) gets translated to a | character. Info from % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. % % TODO this right, we have to translate 8-bit characters to % their "best" equivalent, based on the @documentencoding. Too % much work for too little return. Just use the ASCII equivalents % we use for the index sort strings. % \indexnofonts \setupdatafile % We can have normal brace characters in the PDF outlines, unlike % Texinfo index files. So set that up. \def\{{\lbracecharliteral}% \def\}{\rbracecharliteral}% \catcode`\\=\active \otherbackslash \input \tocreadfilename \endgroup } {\catcode`[=1 \catcode`]=2 \catcode`{=\other \catcode`}=\other \gdef\lbracecharliteral[{]% \gdef\rbracecharliteral[}]% ] % \def\skipspaces#1{\def\PP{#1}\def\D{|}% \ifx\PP\D\let\nextsp\relax \else\let\nextsp\skipspaces \addtokens{\filename}{\PP}% \advance\filenamelength by 1 \fi \nextsp} \def\getfilename#1{% \filenamelength=0 % If we don't expand the argument now, \skipspaces will get % snagged on things like "@value{foo}". \edef\temp{#1}% \expandafter\skipspaces\temp|\relax } \ifnum\pdftexversion < 14 \let \startlink \pdfannotlink \else \let \startlink \pdfstartlink \fi % make a live url in pdf output. \def\pdfurl#1{% \begingroup % it seems we really need yet another set of dummies; have not % tried to figure out what each command should do in the context % of @url. for now, just make @/ a no-op, that's the only one % people have actually reported a problem with. % \normalturnoffactive \def\@{@}% \let\/=\empty \makevalueexpandable % do we want to go so far as to use \indexnofonts instead of just % special-casing \var here? \def\var##1{##1}% % \leavevmode\setcolor{\urlcolor}% \startlink attr{/Border [0 0 0]}% user{/Subtype /Link /A << /S /URI /URI (#1) >>}% \endgroup} \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} \def\maketoks{% \expandafter\poptoks\the\toksA|ENDTOKS|\relax \ifx\first0\adn0 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 \else \ifnum0=\countA\else\makelink\fi \ifx\first.\let\next=\done\else \let\next=\maketoks \addtokens{\toksB}{\the\toksD} \ifx\first,\addtokens{\toksB}{\space}\fi \fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \next} \def\makelink{\addtokens{\toksB}% {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} \def\pdflink#1{% \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} \setcolor{\linkcolor}#1\endlink} \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} \else % non-pdf mode \let\pdfmkdest = \gobble \let\pdfurl = \gobble \let\endlink = \relax \let\setcolor = \gobble \let\pdfsetcolor = \gobble \let\pdfmakeoutlines = \relax \fi % \ifx\pdfoutput \message{fonts,} % Change the current font style to #1, remembering it in \curfontstyle. % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in % italics, not bold italics. % \def\setfontstyle#1{% \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. \csname ten#1\endcsname % change the current font } % Select #1 fonts with the current style. % \def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} \def\rm{\fam=0 \setfontstyle{rm}} \def\it{\fam=\itfam \setfontstyle{it}} \def\sl{\fam=\slfam \setfontstyle{sl}} \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} \def\tt{\fam=\ttfam \setfontstyle{tt}} % Unfortunately, we have to override this for titles and the like, since % in those cases "rm" is bold. Sigh. \def\rmisbold{\rm\def\curfontstyle{bf}} % Texinfo sort of supports the sans serif font style, which plain TeX does not. % So we set up a \sf. \newfam\sffam \def\sf{\fam=\sffam \setfontstyle{sf}} \let\li = \sf % Sometimes we call it \li, not \sf. % We don't need math for this font style. \def\ttsl{\setfontstyle{ttsl}} % Set the baselineskip to #1, and the lineskip and strut size % correspondingly. There is no deep meaning behind these magic numbers % used as factors; they just match (closely enough) what Knuth defined. % \def\lineskipfactor{.08333} \def\strutheightpercent{.70833} \def\strutdepthpercent {.29167} % % can get a sort of poor man's double spacing by redefining this. \def\baselinefactor{1} % \newdimen\textleading \def\setleading#1{% \dimen0 = #1\relax \normalbaselineskip = \baselinefactor\dimen0 \normallineskip = \lineskipfactor\normalbaselineskip \normalbaselines \setbox\strutbox =\hbox{% \vrule width0pt height\strutheightpercent\baselineskip depth \strutdepthpercent \baselineskip }% } % PDF CMaps. See also LaTeX's t1.cmap. % % do nothing with this by default. \expandafter\let\csname cmapOT1\endcsname\gobble \expandafter\let\csname cmapOT1IT\endcsname\gobble \expandafter\let\csname cmapOT1TT\endcsname\gobble % if we are producing pdf, and we have \pdffontattr, then define cmaps. % (\pdffontattr was introduced many years ago, but people still run % older pdftex's; it's easy to conditionalize, so we do.) \ifpdf \ifx\pdffontattr\thisisundefined \else \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1-0) %%Title: (TeX-OT1-0 TeX OT1 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1) /Supplement 0 >> def /CMapName /TeX-OT1-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 8 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <23> <26> <0023> <28> <3B> <0028> <3F> <5B> <003F> <5D> <5E> <005D> <61> <7A> <0061> <7B> <7C> <2013> endbfrange 40 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <00660066> <0C> <00660069> <0D> <0066006C> <0E> <006600660069> <0F> <00660066006C> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <21> <0021> <22> <201D> <27> <2019> <3C> <00A1> <3D> <003D> <3E> <00BF> <5C> <201C> <5F> <02D9> <60> <2018> <7D> <02DD> <7E> <007E> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% % % \cmapOT1IT \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1IT-0) %%Title: (TeX-OT1IT-0 TeX OT1IT 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1IT) /Supplement 0 >> def /CMapName /TeX-OT1IT-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 8 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <25> <26> <0025> <28> <3B> <0028> <3F> <5B> <003F> <5D> <5E> <005D> <61> <7A> <0061> <7B> <7C> <2013> endbfrange 42 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <00660066> <0C> <00660069> <0D> <0066006C> <0E> <006600660069> <0F> <00660066006C> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <21> <0021> <22> <201D> <23> <0023> <24> <00A3> <27> <2019> <3C> <00A1> <3D> <003D> <3E> <00BF> <5C> <201C> <5F> <02D9> <60> <2018> <7D> <02DD> <7E> <007E> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1IT\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% % % \cmapOT1TT \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1TT-0) %%Title: (TeX-OT1TT-0 TeX OT1TT 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1TT) /Supplement 0 >> def /CMapName /TeX-OT1TT-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 5 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <21> <26> <0021> <28> <5F> <0028> <61> <7E> <0061> endbfrange 32 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <2191> <0C> <2193> <0D> <0027> <0E> <00A1> <0F> <00BF> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <20> <2423> <27> <2019> <60> <2018> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1TT\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% \fi\fi % Set the font macro #1 to the font named \fontprefix#2. % #3 is the font's design size, #4 is a scale factor, #5 is the CMap % encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit). % Example: % #1 = \textrm % #2 = \rmshape % #3 = 10 % #4 = \mainmagstep % #5 = OT1 % \def\setfont#1#2#3#4#5{% \font#1=\fontprefix#2#3 scaled #4 \csname cmap#5\endcsname#1% } % This is what gets called when #5 of \setfont is empty. \let\cmap\gobble % % (end of cmaps) % Use cm as the default font prefix. % To specify the font prefix, you must define \fontprefix % before you read in texinfo.tex. \ifx\fontprefix\thisisundefined \def\fontprefix{cm} \fi % Support font families that don't use the same naming scheme as CM. \def\rmshape{r} \def\rmbshape{bx} % where the normal face is bold \def\bfshape{b} \def\bxshape{bx} \def\ttshape{tt} \def\ttbshape{tt} \def\ttslshape{sltt} \def\itshape{ti} \def\itbshape{bxti} \def\slshape{sl} \def\slbshape{bxsl} \def\sfshape{ss} \def\sfbshape{ss} \def\scshape{csc} \def\scbshape{csc} % Definitions for a main text size of 11pt. (The default in Texinfo.) % \def\definetextfontsizexi{% % Text fonts (11.2pt, magstep1). \def\textnominalsize{11pt} \edef\mainmagstep{\magstephalf} \setfont\textrm\rmshape{10}{\mainmagstep}{OT1} \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} \setfont\textbf\bfshape{10}{\mainmagstep}{OT1} \setfont\textit\itshape{10}{\mainmagstep}{OT1IT} \setfont\textsl\slshape{10}{\mainmagstep}{OT1} \setfont\textsf\sfshape{10}{\mainmagstep}{OT1} \setfont\textsc\scshape{10}{\mainmagstep}{OT1} \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep \def\textecsize{1095} % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstep1}{OT1} \setfont\deftt\ttshape{10}{\magstep1}{OT1TT} \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} % Fonts for indices, footnotes, small examples (9pt). \def\smallnominalsize{9pt} \setfont\smallrm\rmshape{9}{1000}{OT1} \setfont\smalltt\ttshape{9}{1000}{OT1TT} \setfont\smallbf\bfshape{10}{900}{OT1} \setfont\smallit\itshape{9}{1000}{OT1IT} \setfont\smallsl\slshape{9}{1000}{OT1} \setfont\smallsf\sfshape{9}{1000}{OT1} \setfont\smallsc\scshape{10}{900}{OT1} \setfont\smallttsl\ttslshape{10}{900}{OT1TT} \font\smalli=cmmi9 \font\smallsy=cmsy9 \def\smallecsize{0900} % Fonts for small examples (8pt). \def\smallernominalsize{8pt} \setfont\smallerrm\rmshape{8}{1000}{OT1} \setfont\smallertt\ttshape{8}{1000}{OT1TT} \setfont\smallerbf\bfshape{10}{800}{OT1} \setfont\smallerit\itshape{8}{1000}{OT1IT} \setfont\smallersl\slshape{8}{1000}{OT1} \setfont\smallersf\sfshape{8}{1000}{OT1} \setfont\smallersc\scshape{10}{800}{OT1} \setfont\smallerttsl\ttslshape{10}{800}{OT1TT} \font\smalleri=cmmi8 \font\smallersy=cmsy8 \def\smallerecsize{0800} % Fonts for title page (20.4pt): \def\titlenominalsize{20pt} \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} \setfont\titleit\itbshape{10}{\magstep4}{OT1IT} \setfont\titlesl\slbshape{10}{\magstep4}{OT1} \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} \setfont\titlesf\sfbshape{17}{\magstep1}{OT1} \let\titlebf=\titlerm \setfont\titlesc\scbshape{10}{\magstep4}{OT1} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 \def\titleecsize{2074} % Chapter (and unnumbered) fonts (17.28pt). \def\chapnominalsize{17pt} \setfont\chaprm\rmbshape{12}{\magstep2}{OT1} \setfont\chapit\itbshape{10}{\magstep3}{OT1IT} \setfont\chapsl\slbshape{10}{\magstep3}{OT1} \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT} \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT} \setfont\chapsf\sfbshape{17}{1000}{OT1} \let\chapbf=\chaprm \setfont\chapsc\scbshape{10}{\magstep3}{OT1} \font\chapi=cmmi12 scaled \magstep2 \font\chapsy=cmsy10 scaled \magstep3 \def\chapecsize{1728} % Section fonts (14.4pt). \def\secnominalsize{14pt} \setfont\secrm\rmbshape{12}{\magstep1}{OT1} \setfont\secit\itbshape{10}{\magstep2}{OT1IT} \setfont\secsl\slbshape{10}{\magstep2}{OT1} \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT} \setfont\secsf\sfbshape{12}{\magstep1}{OT1} \let\secbf\secrm \setfont\secsc\scbshape{10}{\magstep2}{OT1} \font\seci=cmmi12 scaled \magstep1 \font\secsy=cmsy10 scaled \magstep2 \def\sececsize{1440} % Subsection fonts (13.15pt). \def\ssecnominalsize{13pt} \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1} \setfont\ssecit\itbshape{10}{1315}{OT1IT} \setfont\ssecsl\slbshape{10}{1315}{OT1} \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT} \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT} \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1} \let\ssecbf\ssecrm \setfont\ssecsc\scbshape{10}{1315}{OT1} \font\sseci=cmmi12 scaled \magstephalf \font\ssecsy=cmsy10 scaled 1315 \def\ssececsize{1200} % Reduced fonts for @acro in text (10pt). \def\reducednominalsize{10pt} \setfont\reducedrm\rmshape{10}{1000}{OT1} \setfont\reducedtt\ttshape{10}{1000}{OT1TT} \setfont\reducedbf\bfshape{10}{1000}{OT1} \setfont\reducedit\itshape{10}{1000}{OT1IT} \setfont\reducedsl\slshape{10}{1000}{OT1} \setfont\reducedsf\sfshape{10}{1000}{OT1} \setfont\reducedsc\scshape{10}{1000}{OT1} \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT} \font\reducedi=cmmi10 \font\reducedsy=cmsy10 \def\reducedecsize{1000} \textleading = 13.2pt % line spacing for 11pt CM \textfonts % reset the current fonts \rm } % end of 11pt text font size definitions, \definetextfontsizexi % Definitions to make the main text be 10pt Computer Modern, with % section, chapter, etc., sizes following suit. This is for the GNU % Press printing of the Emacs 22 manual. Maybe other manuals in the % future. Used with @smallbook, which sets the leading to 12pt. % \def\definetextfontsizex{% % Text fonts (10pt). \def\textnominalsize{10pt} \edef\mainmagstep{1000} \setfont\textrm\rmshape{10}{\mainmagstep}{OT1} \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} \setfont\textbf\bfshape{10}{\mainmagstep}{OT1} \setfont\textit\itshape{10}{\mainmagstep}{OT1IT} \setfont\textsl\slshape{10}{\mainmagstep}{OT1} \setfont\textsf\sfshape{10}{\mainmagstep}{OT1} \setfont\textsc\scshape{10}{\mainmagstep}{OT1} \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep \def\textecsize{1000} % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstephalf}{OT1} \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} % Fonts for indices, footnotes, small examples (9pt). \def\smallnominalsize{9pt} \setfont\smallrm\rmshape{9}{1000}{OT1} \setfont\smalltt\ttshape{9}{1000}{OT1TT} \setfont\smallbf\bfshape{10}{900}{OT1} \setfont\smallit\itshape{9}{1000}{OT1IT} \setfont\smallsl\slshape{9}{1000}{OT1} \setfont\smallsf\sfshape{9}{1000}{OT1} \setfont\smallsc\scshape{10}{900}{OT1} \setfont\smallttsl\ttslshape{10}{900}{OT1TT} \font\smalli=cmmi9 \font\smallsy=cmsy9 \def\smallecsize{0900} % Fonts for small examples (8pt). \def\smallernominalsize{8pt} \setfont\smallerrm\rmshape{8}{1000}{OT1} \setfont\smallertt\ttshape{8}{1000}{OT1TT} \setfont\smallerbf\bfshape{10}{800}{OT1} \setfont\smallerit\itshape{8}{1000}{OT1IT} \setfont\smallersl\slshape{8}{1000}{OT1} \setfont\smallersf\sfshape{8}{1000}{OT1} \setfont\smallersc\scshape{10}{800}{OT1} \setfont\smallerttsl\ttslshape{10}{800}{OT1TT} \font\smalleri=cmmi8 \font\smallersy=cmsy8 \def\smallerecsize{0800} % Fonts for title page (20.4pt): \def\titlenominalsize{20pt} \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} \setfont\titleit\itbshape{10}{\magstep4}{OT1IT} \setfont\titlesl\slbshape{10}{\magstep4}{OT1} \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} \setfont\titlesf\sfbshape{17}{\magstep1}{OT1} \let\titlebf=\titlerm \setfont\titlesc\scbshape{10}{\magstep4}{OT1} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 \def\titleecsize{2074} % Chapter fonts (14.4pt). \def\chapnominalsize{14pt} \setfont\chaprm\rmbshape{12}{\magstep1}{OT1} \setfont\chapit\itbshape{10}{\magstep2}{OT1IT} \setfont\chapsl\slbshape{10}{\magstep2}{OT1} \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT} \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT} \setfont\chapsf\sfbshape{12}{\magstep1}{OT1} \let\chapbf\chaprm \setfont\chapsc\scbshape{10}{\magstep2}{OT1} \font\chapi=cmmi12 scaled \magstep1 \font\chapsy=cmsy10 scaled \magstep2 \def\chapecsize{1440} % Section fonts (12pt). \def\secnominalsize{12pt} \setfont\secrm\rmbshape{12}{1000}{OT1} \setfont\secit\itbshape{10}{\magstep1}{OT1IT} \setfont\secsl\slbshape{10}{\magstep1}{OT1} \setfont\sectt\ttbshape{12}{1000}{OT1TT} \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT} \setfont\secsf\sfbshape{12}{1000}{OT1} \let\secbf\secrm \setfont\secsc\scbshape{10}{\magstep1}{OT1} \font\seci=cmmi12 \font\secsy=cmsy10 scaled \magstep1 \def\sececsize{1200} % Subsection fonts (10pt). \def\ssecnominalsize{10pt} \setfont\ssecrm\rmbshape{10}{1000}{OT1} \setfont\ssecit\itbshape{10}{1000}{OT1IT} \setfont\ssecsl\slbshape{10}{1000}{OT1} \setfont\ssectt\ttbshape{10}{1000}{OT1TT} \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT} \setfont\ssecsf\sfbshape{10}{1000}{OT1} \let\ssecbf\ssecrm \setfont\ssecsc\scbshape{10}{1000}{OT1} \font\sseci=cmmi10 \font\ssecsy=cmsy10 \def\ssececsize{1000} % Reduced fonts for @acro in text (9pt). \def\reducednominalsize{9pt} \setfont\reducedrm\rmshape{9}{1000}{OT1} \setfont\reducedtt\ttshape{9}{1000}{OT1TT} \setfont\reducedbf\bfshape{10}{900}{OT1} \setfont\reducedit\itshape{9}{1000}{OT1IT} \setfont\reducedsl\slshape{9}{1000}{OT1} \setfont\reducedsf\sfshape{9}{1000}{OT1} \setfont\reducedsc\scshape{10}{900}{OT1} \setfont\reducedttsl\ttslshape{10}{900}{OT1TT} \font\reducedi=cmmi9 \font\reducedsy=cmsy9 \def\reducedecsize{0900} \divide\parskip by 2 % reduce space between paragraphs \textleading = 12pt % line spacing for 10pt CM \textfonts % reset the current fonts \rm } % end of 10pt text font size definitions, \definetextfontsizex % We provide the user-level command % @fonttextsize 10 % (or 11) to redefine the text font size. pt is assumed. % \def\xiword{11} \def\xword{10} \def\xwordpt{10pt} % \parseargdef\fonttextsize{% \def\textsizearg{#1}% %\wlog{doing @fonttextsize \textsizearg}% % % Set \globaldefs so that documents can use this inside @tex, since % makeinfo 4.8 does not support it, but we need it nonetheless. % \begingroup \globaldefs=1 \ifx\textsizearg\xword \definetextfontsizex \else \ifx\textsizearg\xiword \definetextfontsizexi \else \errhelp=\EMsimple \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'} \fi\fi \endgroup } % In order for the font changes to affect most math symbols and letters, % we have to define the \textfont of the standard families. Since % texinfo doesn't allow for producing subscripts and superscripts except % in the main text, we don't bother to reset \scriptfont and % \scriptscriptfont (which would also require loading a lot more fonts). % \def\resetmathfonts{% \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf \textfont\ttfam=\tentt \textfont\sffam=\tensf } % The font-changing commands redefine the meanings of \tenSTYLE, instead % of just \STYLE. We do this because \STYLE needs to also set the % current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire % \tenSTYLE to set the current font. % % Each font-changing command also sets the names \lsize (one size lower) % and \lllsize (three sizes lower). These relative commands are used in % the LaTeX logo and acronyms. % % This all needs generalizing, badly. % \def\textfonts{% \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl \def\curfontsize{text}% \def\lsize{reduced}\def\lllsize{smaller}% \resetmathfonts \setleading{\textleading}} \def\titlefonts{% \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy \let\tenttsl=\titlettsl \def\curfontsize{title}% \def\lsize{chap}\def\lllsize{subsec}% \resetmathfonts \setleading{27pt}} \def\titlefont#1{{\titlefonts\rmisbold #1}} \def\chapfonts{% \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl \def\curfontsize{chap}% \def\lsize{sec}\def\lllsize{text}% \resetmathfonts \setleading{19pt}} \def\secfonts{% \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl \def\curfontsize{sec}% \def\lsize{subsec}\def\lllsize{reduced}% \resetmathfonts \setleading{16pt}} \def\subsecfonts{% \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl \def\curfontsize{ssec}% \def\lsize{text}\def\lllsize{small}% \resetmathfonts \setleading{15pt}} \let\subsubsecfonts = \subsecfonts \def\reducedfonts{% \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy \let\tenttsl=\reducedttsl \def\curfontsize{reduced}% \def\lsize{small}\def\lllsize{smaller}% \resetmathfonts \setleading{10.5pt}} \def\smallfonts{% \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy \let\tenttsl=\smallttsl \def\curfontsize{small}% \def\lsize{smaller}\def\lllsize{smaller}% \resetmathfonts \setleading{10.5pt}} \def\smallerfonts{% \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy \let\tenttsl=\smallerttsl \def\curfontsize{smaller}% \def\lsize{smaller}\def\lllsize{smaller}% \resetmathfonts \setleading{9.5pt}} % Fonts for short table of contents. \setfont\shortcontrm\rmshape{12}{1000}{OT1} \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 \setfont\shortcontsl\slshape{12}{1000}{OT1} \setfont\shortconttt\ttshape{12}{1000}{OT1TT} % Define these just so they can be easily changed for other fonts. \def\angleleft{$\langle$} \def\angleright{$\rangle$} % Set the fonts to use with the @small... environments. \let\smallexamplefonts = \smallfonts % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample % can fit this many characters: % 8.5x11=86 smallbook=72 a4=90 a5=69 % If we use \scriptfonts (8pt), then we can fit this many characters: % 8.5x11=90+ smallbook=80 a4=90+ a5=77 % For me, subjectively, the few extra characters that fit aren't worth % the additional smallness of 8pt. So I'm making the default 9pt. % % By the way, for comparison, here's what fits with @example (10pt): % 8.5x11=71 smallbook=60 a4=75 a5=58 % --karl, 24jan03. % Set up the default fonts, so we can use them for creating boxes. % \definetextfontsizexi \message{markup,} % Check if we are currently using a typewriter font. Since all the % Computer Modern typewriter fonts have zero interword stretch (and % shrink), and it is reasonable to expect all typewriter fonts to have % this property, we can check that font parameter. % \def\ifmonospace{\ifdim\fontdimen3\font=0pt } % Markup style infrastructure. \defmarkupstylesetup\INITMACRO will % define and register \INITMACRO to be called on markup style changes. % \INITMACRO can check \currentmarkupstyle for the innermost % style and the set of \ifmarkupSTYLE switches for all styles % currently in effect. \newif\ifmarkupvar \newif\ifmarkupsamp \newif\ifmarkupkey %\newif\ifmarkupfile % @file == @samp. %\newif\ifmarkupoption % @option == @samp. \newif\ifmarkupcode \newif\ifmarkupkbd %\newif\ifmarkupenv % @env == @code. %\newif\ifmarkupcommand % @command == @code. \newif\ifmarkuptex % @tex (and part of @math, for now). \newif\ifmarkupexample \newif\ifmarkupverb \newif\ifmarkupverbatim \let\currentmarkupstyle\empty \def\setupmarkupstyle#1{% \csname markup#1true\endcsname \def\currentmarkupstyle{#1}% \markupstylesetup } \let\markupstylesetup\empty \def\defmarkupstylesetup#1{% \expandafter\def\expandafter\markupstylesetup \expandafter{\markupstylesetup #1}% \def#1% } % Markup style setup for left and right quotes. \defmarkupstylesetup\markupsetuplq{% \expandafter\let\expandafter \temp \csname markupsetuplq\currentmarkupstyle\endcsname \ifx\temp\relax \markupsetuplqdefault \else \temp \fi } \defmarkupstylesetup\markupsetuprq{% \expandafter\let\expandafter \temp \csname markupsetuprq\currentmarkupstyle\endcsname \ifx\temp\relax \markupsetuprqdefault \else \temp \fi } { \catcode`\'=\active \catcode`\`=\active \gdef\markupsetuplqdefault{\let`\lq} \gdef\markupsetuprqdefault{\let'\rq} \gdef\markupsetcodequoteleft{\let`\codequoteleft} \gdef\markupsetcodequoteright{\let'\codequoteright} } \let\markupsetuplqcode \markupsetcodequoteleft \let\markupsetuprqcode \markupsetcodequoteright % \let\markupsetuplqexample \markupsetcodequoteleft \let\markupsetuprqexample \markupsetcodequoteright % \let\markupsetuplqkbd \markupsetcodequoteleft \let\markupsetuprqkbd \markupsetcodequoteright % \let\markupsetuplqsamp \markupsetcodequoteleft \let\markupsetuprqsamp \markupsetcodequoteright % \let\markupsetuplqverb \markupsetcodequoteleft \let\markupsetuprqverb \markupsetcodequoteright % \let\markupsetuplqverbatim \markupsetcodequoteleft \let\markupsetuprqverbatim \markupsetcodequoteright % Allow an option to not use regular directed right quote/apostrophe % (char 0x27), but instead the undirected quote from cmtt (char 0x0d). % The undirected quote is ugly, so don't make it the default, but it % works for pasting with more pdf viewers (at least evince), the % lilypond developers report. xpdf does work with the regular 0x27. % \def\codequoteright{% \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax '% \else \char'15 \fi \else \char'15 \fi } % % and a similar option for the left quote char vs. a grave accent. % Modern fonts display ASCII 0x60 as a grave accent, so some people like % the code environments to do likewise. % \def\codequoteleft{% \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax % [Knuth] pp. 380,381,391 % \relax disables Spanish ligatures ?` and !` of \tt font. \relax`% \else \char'22 \fi \else \char'22 \fi } % Commands to set the quote options. % \parseargdef\codequoteundirected{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETtxicodequoteundirected\endcsname = t% \else\ifx\temp\offword \expandafter\let\csname SETtxicodequoteundirected\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}% \fi\fi } % \parseargdef\codequotebacktick{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETtxicodequotebacktick\endcsname = t% \else\ifx\temp\offword \expandafter\let\csname SETtxicodequotebacktick\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}% \fi\fi } % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font. \def\noligaturesquoteleft{\relax\lq} % Count depth in font-changes, for error checks \newcount\fontdepth \fontdepth=0 % Font commands. % #1 is the font command (\sl or \it), #2 is the text to slant. % If we are in a monospaced environment, however, 1) always use \ttsl, % and 2) do not add an italic correction. \def\dosmartslant#1#2{% \ifusingtt {{\ttsl #2}\let\next=\relax}% {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}% \next } \def\smartslanted{\dosmartslant\sl} \def\smartitalic{\dosmartslant\it} % Output an italic correction unless \next (presumed to be the following % character) is such as not to need one. \def\smartitaliccorrection{% \ifx\next,% \else\ifx\next-% \else\ifx\next.% \else\ptexslash \fi\fi\fi \aftersmartic } % Unconditional use \ttsl, and no ic. @var is set to this for defuns. \def\ttslanted#1{{\ttsl #1}} % @cite is like \smartslanted except unconditionally use \sl. We never want % ttsl for book titles, do we? \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection} \def\aftersmartic{} \def\var#1{% \let\saveaftersmartic = \aftersmartic \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}% \smartslanted{#1}% } \let\i=\smartitalic \let\slanted=\smartslanted \let\dfn=\smartslanted \let\emph=\smartitalic % Explicit font changes: @r, @sc, undocumented @ii. \def\r#1{{\rm #1}} % roman font \def\sc#1{{\smallcaps#1}} % smallcaps font \def\ii#1{{\it #1}} % italic font % @b, explicit bold. Also @strong. \def\b#1{{\bf #1}} \let\strong=\b % @sansserif, explicit sans. \def\sansserif#1{{\sf #1}} % We can't just use \exhyphenpenalty, because that only has effect at % the end of a paragraph. Restore normal hyphenation at the end of the % group within which \nohyphenation is presumably called. % \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} \def\restorehyphenation{\hyphenchar\font = `- } % Set sfcode to normal for the chars that usually have another value. % Can't use plain's \frenchspacing because it uses the `\x notation, and % sometimes \x has an active definition that messes things up. % \catcode`@=11 \def\plainfrenchspacing{% \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m \def\endofsentencespacefactor{1000}% for @. and friends } \def\plainnonfrenchspacing{% \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000 \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 \def\endofsentencespacefactor{3000}% for @. and friends } \catcode`@=\other \def\endofsentencespacefactor{3000}% default % @t, explicit typewriter. \def\t#1{% {\tt \rawbackslash \plainfrenchspacing #1}% \null } % @samp. \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}} % @indicateurl is \samp, that is, with quotes. \let\indicateurl=\samp % @code (and similar) prints in typewriter, but with spaces the same % size as normal in the surrounding text, without hyphenation, etc. % This is a subroutine for that. \def\tclose#1{% {% % Change normal interword space to be same as for the current font. \spaceskip = \fontdimen2\font % % Switch to typewriter. \tt % % But `\ ' produces the large typewriter interword space. \def\ {{\spaceskip = 0pt{} }}% % % Turn off hyphenation. \nohyphenation % \rawbackslash \plainfrenchspacing #1% }% \null % reset spacefactor to 1000 } % We *must* turn on hyphenation at `-' and `_' in @code. % Otherwise, it is too hard to avoid overfull hboxes % in the Emacs manual, the Library manual, etc. % % Unfortunately, TeX uses one parameter (\hyphenchar) to control % both hyphenation at - and hyphenation within words. % We must therefore turn them both off (\tclose does that) % and arrange explicitly to hyphenate at a dash. % -- rms. { \catcode`\-=\active \catcode`\_=\active \catcode`\'=\active \catcode`\`=\active \global\let'=\rq \global\let`=\lq % default definitions % \global\def\code{\begingroup \setupmarkupstyle{code}% % The following should really be moved into \setupmarkupstyle handlers. \catcode\dashChar=\active \catcode\underChar=\active \ifallowcodebreaks \let-\codedash \let_\codeunder \else \let-\normaldash \let_\realunder \fi \codex } } \def\codex #1{\tclose{#1}\endgroup} \def\normaldash{-} \def\codedash{-\discretionary{}{}{}} \def\codeunder{% % this is all so @math{@code{var_name}+1} can work. In math mode, _ % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) % will therefore expand the active definition of _, which is us % (inside @code that is), therefore an endless loop. \ifusingtt{\ifmmode \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. \else\normalunderscore \fi \discretionary{}{}{}}% {\_}% } % An additional complication: the above will allow breaks after, e.g., % each of the four underscores in __typeof__. This is bad. % @allowcodebreaks provides a document-level way to turn breaking at - % and _ on and off. % \newif\ifallowcodebreaks \allowcodebreakstrue \def\keywordtrue{true} \def\keywordfalse{false} \parseargdef\allowcodebreaks{% \def\txiarg{#1}% \ifx\txiarg\keywordtrue \allowcodebreakstrue \else\ifx\txiarg\keywordfalse \allowcodebreaksfalse \else \errhelp = \EMsimple \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}% \fi\fi } % For @command, @env, @file, @option quotes seem unnecessary, % so use \code rather than \samp. \let\command=\code \let\env=\code \let\file=\code \let\option=\code % @uref (abbreviation for `urlref') takes an optional (comma-separated) % second argument specifying the text to display and an optional third % arg as text to display instead of (rather than in addition to) the url % itself. First (mandatory) arg is the url. % (This \urefnobreak definition isn't used now, leaving it for a while % for comparison.) \def\urefnobreak#1{\dourefnobreak #1,,,\finish} \def\dourefnobreak#1,#2,#3,#4\finish{\begingroup \unsepspaces \pdfurl{#1}% \setbox0 = \hbox{\ignorespaces #3}% \ifdim\wd0 > 0pt \unhbox0 % third arg given, show only that \else \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \ifpdf \unhbox0 % PDF: 2nd arg given, show only it \else \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url \fi \else \code{#1}% only url given, so show it \fi \fi \endlink \endgroup} % This \urefbreak definition is the active one. \def\urefbreak{\begingroup \urefcatcodes \dourefbreak} \let\uref=\urefbreak \def\dourefbreak#1{\urefbreakfinish #1,,,\finish} \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example \unsepspaces \pdfurl{#1}% \setbox0 = \hbox{\ignorespaces #3}% \ifdim\wd0 > 0pt \unhbox0 % third arg given, show only that \else \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \ifpdf \unhbox0 % PDF: 2nd arg given, show only it \else \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url \fi \else \urefcode{#1}% only url given, so show it \fi \fi \endlink \endgroup} % Allow line breaks around only a few characters (only). \def\urefcatcodes{% \catcode\ampChar=\active \catcode\dotChar=\active \catcode\hashChar=\active \catcode\questChar=\active \catcode\slashChar=\active } { \urefcatcodes % \global\def\urefcode{\begingroup \setupmarkupstyle{code}% \urefcatcodes \let&\urefcodeamp \let.\urefcodedot \let#\urefcodehash \let?\urefcodequest \let/\urefcodeslash \codex } % % By default, they are just regular characters. \global\def&{\normalamp} \global\def.{\normaldot} \global\def#{\normalhash} \global\def?{\normalquest} \global\def/{\normalslash} } % we put a little stretch before and after the breakable chars, to help % line breaking of long url's. The unequal skips make look better in % cmtt at least, especially for dots. \def\urefprestretch{\urefprebreak \hskip0pt plus.13em } \def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em } % \def\urefcodeamp{\urefprestretch \&\urefpoststretch} \def\urefcodedot{\urefprestretch .\urefpoststretch} \def\urefcodehash{\urefprestretch \#\urefpoststretch} \def\urefcodequest{\urefprestretch ?\urefpoststretch} \def\urefcodeslash{\futurelet\next\urefcodeslashfinish} { \catcode`\/=\active \global\def\urefcodeslashfinish{% \urefprestretch \slashChar % Allow line break only after the final / in a sequence of % slashes, to avoid line break between the slashes in http://. \ifx\next/\else \urefpoststretch \fi } } % One more complication: by default we'll break after the special % characters, but some people like to break before the special chars, so % allow that. Also allow no breaking at all, for manual control. % \parseargdef\urefbreakstyle{% \def\txiarg{#1}% \ifx\txiarg\wordnone \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak} \else\ifx\txiarg\wordbefore \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak} \else\ifx\txiarg\wordafter \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak} \else \errhelp = \EMsimple \errmessage{Unknown @urefbreakstyle setting `\txiarg'}% \fi\fi\fi } \def\wordafter{after} \def\wordbefore{before} \def\wordnone{none} \urefbreakstyle after % @url synonym for @uref, since that's how everyone uses it. % \let\url=\uref % rms does not like angle brackets --karl, 17may97. % So now @email is just like @uref, unless we are pdf. % %\def\email#1{\angleleft{\tt #1}\angleright} \ifpdf \def\email#1{\doemail#1,,\finish} \def\doemail#1,#2,#3\finish{\begingroup \unsepspaces \pdfurl{mailto:#1}% \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi \endlink \endgroup} \else \let\email=\uref \fi % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), % `example' (@kbd uses ttsl only inside of @example and friends), % or `code' (@kbd uses normal tty font always). \parseargdef\kbdinputstyle{% \def\txiarg{#1}% \ifx\txiarg\worddistinct \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% \else\ifx\txiarg\wordexample \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% \else\ifx\txiarg\wordcode \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% \else \errhelp = \EMsimple \errmessage{Unknown @kbdinputstyle setting `\txiarg'}% \fi\fi\fi } \def\worddistinct{distinct} \def\wordexample{example} \def\wordcode{code} % Default is `distinct'. \kbdinputstyle distinct % @kbd is like @code, except that if the argument is just one @key command, % then @kbd has no effect. \def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}} \def\xkey{\key} \def\kbdsub#1#2#3\par{% \def\one{#1}\def\three{#3}\def\threex{??}% \ifx\one\xkey\ifx\threex\three \key{#2}% \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi } % definition of @key that produces a lozenge. Doesn't adjust to text size. %\setfont\keyrm\rmshape{8}{1000}{OT1} %\font\keysy=cmsy9 %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% % \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% % \vbox{\hrule\kern-0.4pt % \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% % \kern-0.4pt\hrule}% % \kern-.06em\raise0.4pt\hbox{\angleright}}}} % definition of @key with no lozenge. If the current font is already % monospace, don't change it; that way, we respect @kbdinputstyle. But % if it isn't monospace, then use \tt. % \def\key#1{{\setupmarkupstyle{key}% \nohyphenation \ifmonospace\else\tt\fi #1}\null} % @clicksequence{File @click{} Open ...} \def\clicksequence#1{\begingroup #1\endgroup} % @clickstyle @arrow (by default) \parseargdef\clickstyle{\def\click{#1}} \def\click{\arrow} % Typeset a dimension, e.g., `in' or `pt'. The only reason for the % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. % \def\dmn#1{\thinspace #1} % @l was never documented to mean ``switch to the Lisp font'', % and it is not used as such in any manual I can find. We need it for % Polish suppressed-l. --karl, 22sep96. %\def\l#1{{\li #1}\null} % @acronym for "FBI", "NATO", and the like. % We print this one point size smaller, since it's intended for % all-uppercase. % \def\acronym#1{\doacronym #1,,\finish} \def\doacronym#1,#2,#3\finish{% {\selectfonts\lsize #1}% \def\temp{#2}% \ifx\temp\empty \else \space ({\unsepspaces \ignorespaces \temp \unskip})% \fi \null % reset \spacefactor=1000 } % @abbr for "Comput. J." and the like. % No font change, but don't do end-of-sentence spacing. % \def\abbr#1{\doabbr #1,,\finish} \def\doabbr#1,#2,#3\finish{% {\plainfrenchspacing #1}% \def\temp{#2}% \ifx\temp\empty \else \space ({\unsepspaces \ignorespaces \temp \unskip})% \fi \null % reset \spacefactor=1000 } % @asis just yields its argument. Used with @table, for example. % \def\asis#1{#1} % @math outputs its argument in math mode. % % One complication: _ usually means subscripts, but it could also mean % an actual _ character, as in @math{@var{some_variable} + 1}. So make % _ active, and distinguish by seeing if the current family is \slfam, % which is what @var uses. { \catcode`\_ = \active \gdef\mathunderscore{% \catcode`\_=\active \def_{\ifnum\fam=\slfam \_\else\sb\fi}% } } % Another complication: we want \\ (and @\) to output a math (or tt) \. % FYI, plain.tex uses \\ as a temporary control sequence (for no % particular reason), but this is not advertised and we don't care. % % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} % \def\math{% \tex \mathunderscore \let\\ = \mathbackslash \mathactive % make the texinfo accent commands work in math mode \let\"=\ddot \let\'=\acute \let\==\bar \let\^=\hat \let\`=\grave \let\u=\breve \let\v=\check \let\~=\tilde \let\dotaccent=\dot $\finishmath } \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. % Some active characters (such as <) are spaced differently in math. % We have to reset their definitions in case the @math was an argument % to a command which sets the catcodes (such as @item or @section). % { \catcode`^ = \active \catcode`< = \active \catcode`> = \active \catcode`+ = \active \catcode`' = \active \gdef\mathactive{% \let^ = \ptexhat \let< = \ptexless \let> = \ptexgtr \let+ = \ptexplus \let' = \ptexquoteright } } % ctrl is no longer a Texinfo command, but leave this definition for fun. \def\ctrl #1{{\tt \rawbackslash \hat}#1} % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. % Ignore unless FMTNAME == tex; then it is like @iftex and @tex, % except specified as a normal braced arg, so no newlines to worry about. % \def\outfmtnametex{tex} % \long\def\inlinefmt#1{\doinlinefmt #1,\finish} \long\def\doinlinefmt#1,#2,\finish{% \def\inlinefmtname{#1}% \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi } % For raw, must switch into @tex before parsing the argument, to avoid % setting catcodes prematurely. Doing it this way means that, for % example, @inlineraw{html, foo{bar} gets a parse error instead of being % ignored. But this isn't important because if people want a literal % *right* brace they would have to use a command anyway, so they may as % well use a command to get a left brace too. We could re-use the % delimiter character idea from \verb, but it seems like overkill. % \long\def\inlineraw{\tex \doinlineraw} \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish} \def\doinlinerawtwo#1,#2,\finish{% \def\inlinerawname{#1}% \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi \endgroup % close group opened by \tex. } \message{glyphs,} % and logos. % @@ prints an @, as does @atchar{}. \def\@{\char64 } \let\atchar=\@ % @{ @} @lbracechar{} @rbracechar{} all generate brace characters. % Unless we're in typewriter, use \ecfont because the CM text fonts do % not have braces, and we don't want to switch into math. \def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}} \def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}} \let\{=\mylbrace \let\lbracechar=\{ \let\}=\myrbrace \let\rbracechar=\} \begingroup % Definitions to produce \{ and \} commands for indices, % and @{ and @} for the aux/toc files. \catcode`\{ = \other \catcode`\} = \other \catcode`\[ = 1 \catcode`\] = 2 \catcode`\! = 0 \catcode`\\ = \other !gdef!lbracecmd[\{]% !gdef!rbracecmd[\}]% !gdef!lbraceatcmd[@{]% !gdef!rbraceatcmd[@}]% !endgroup % @comma{} to avoid , parsing problems. \let\comma = , % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. \let\, = \ptexc \let\dotaccent = \ptexdot \def\ringaccent#1{{\accent23 #1}} \let\tieaccent = \ptext \let\ubaraccent = \ptexb \let\udotaccent = \d % Other special characters: @questiondown @exclamdown @ordf @ordm % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. \def\questiondown{?`} \def\exclamdown{!`} \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} % Dotless i and dotless j, used for accents. \def\imacro{i} \def\jmacro{j} \def\dotless#1{% \def\temp{#1}% \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi \else \errmessage{@dotless can be used only with i or j}% \fi\fi } % The \TeX{} logo, as in plain, but resetting the spacing so that a % period following counts as ending a sentence. (Idea found in latex.) % \edef\TeX{\TeX \spacefactor=1000 } % @LaTeX{} logo. Not quite the same results as the definition in % latex.ltx, since we use a different font for the raised A; it's most % convenient for us to use an explicitly smaller font, rather than using % the \scriptstyle font (since we don't reset \scriptstyle and % \scriptscriptstyle). % \def\LaTeX{% L\kern-.36em {\setbox0=\hbox{T}% \vbox to \ht0{\hbox{% \ifx\textnominalsize\xwordpt % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX. % Revert to plain's \scriptsize, which is 7pt. \count255=\the\fam $\fam\count255 \scriptstyle A$% \else % For 11pt, we can use our lllsize. \selectfonts\lllsize A% \fi }% \vss }}% \kern-.15em \TeX } % Some math mode symbols. \def\bullet{$\ptexbullet$} \def\geq{\ifmmode \ge\else $\ge$\fi} \def\leq{\ifmmode \le\else $\le$\fi} \def\minus{\ifmmode -\else $-$\fi} % @dots{} outputs an ellipsis using the current font. % We do .5em per period so that it has the same spacing in the cm % typewriter fonts as three actual period characters; on the other hand, % in other typewriter fonts three periods are wider than 1.5em. So do % whichever is larger. % \def\dots{% \leavevmode \setbox0=\hbox{...}% get width of three periods \ifdim\wd0 > 1.5em \dimen0 = \wd0 \else \dimen0 = 1.5em \fi \hbox to \dimen0{% \hskip 0pt plus.25fil .\hskip 0pt plus1fil .\hskip 0pt plus1fil .\hskip 0pt plus.5fil }% } % @enddots{} is an end-of-sentence ellipsis. % \def\enddots{% \dots \spacefactor=\endofsentencespacefactor } % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. % % Since these characters are used in examples, they should be an even number of % \tt widths. Each \tt character is 1en, so two makes it 1em. % \def\point{$\star$} \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}} \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}} \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}} % The @error{} command. % Adapted from the TeXbook's \boxit. % \newbox\errorbox % {\tentt \global\dimen0 = 3em}% Width of the box. \dimen2 = .55pt % Thickness of rules % The text. (`r' is open on the right, `e' somewhat less so on the left.) \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt} % \setbox\errorbox=\hbox to \dimen0{\hfil \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. \advance\hsize by -2\dimen2 % Rules. \vbox{% \hrule height\dimen2 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. \kern3pt\vrule width\dimen2}% Space to right. \hrule height\dimen2} \hfil} % \def\error{\leavevmode\lower.7ex\copy\errorbox} % @pounds{} is a sterling sign, which Knuth put in the CM italic font. % \def\pounds{{\it\$}} % @euro{} comes from a separate font, depending on the current style. % We use the free feym* fonts from the eurosym package by Henrik % Theiling, which support regular, slanted, bold and bold slanted (and % "outlined" (blackboard board, sort of) versions, which we don't need). % It is available from http://www.ctan.org/tex-archive/fonts/eurosym. % % Although only regular is the truly official Euro symbol, we ignore % that. The Euro is designed to be slightly taller than the regular % font height. % % feymr - regular % feymo - slanted % feybr - bold % feybo - bold slanted % % There is no good (free) typewriter version, to my knowledge. % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide. % Hmm. % % Also doesn't work in math. Do we need to do math with euro symbols? % Hope not. % % \def\euro{{\eurofont e}} \def\eurofont{% % We set the font at each command, rather than predefining it in % \textfonts and the other font-switching commands, so that % installations which never need the symbol don't have to have the % font installed. % % There is only one designed size (nominal 10pt), so we always scale % that to the current nominal size. % % By the way, simply using "at 1em" works for cmr10 and the like, but % does not work for cmbx10 and other extended/shrunken fonts. % \def\eurosize{\csname\curfontsize nominalsize\endcsname}% % \ifx\curfontstyle\bfstylename % bold: \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize \else % regular: \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize \fi \thiseurofont } % Glyphs from the EC fonts. We don't use \let for the aliases, because % sometimes we redefine the original macro, and the alias should reflect % the redefinition. % % Use LaTeX names for the Icelandic letters. \def\DH{{\ecfont \char"D0}} % Eth \def\dh{{\ecfont \char"F0}} % eth \def\TH{{\ecfont \char"DE}} % Thorn \def\th{{\ecfont \char"FE}} % thorn % \def\guillemetleft{{\ecfont \char"13}} \def\guillemotleft{\guillemetleft} \def\guillemetright{{\ecfont \char"14}} \def\guillemotright{\guillemetright} \def\guilsinglleft{{\ecfont \char"0E}} \def\guilsinglright{{\ecfont \char"0F}} \def\quotedblbase{{\ecfont \char"12}} \def\quotesinglbase{{\ecfont \char"0D}} % % This positioning is not perfect (see the ogonek LaTeX package), but % we have the precomposed glyphs for the most common cases. We put the % tests to use those glyphs in the single \ogonek macro so we have fewer % dummy definitions to worry about for index entries, etc. % % ogonek is also used with other letters in Lithuanian (IOU), but using % the precomposed glyphs for those is not so easy since they aren't in % the same EC font. \def\ogonek#1{{% \def\temp{#1}% \ifx\temp\macrocharA\Aogonek \else\ifx\temp\macrochara\aogonek \else\ifx\temp\macrocharE\Eogonek \else\ifx\temp\macrochare\eogonek \else \ecfont \setbox0=\hbox{#1}% \ifdim\ht0=1ex\accent"0C #1% \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}% \fi \fi\fi\fi\fi }% } \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A} \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a} \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E} \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e} % % Use the ec* fonts (cm-super in outline format) for non-CM glyphs. \def\ecfont{% % We can't distinguish serif/sans and italic/slanted, but this % is used for crude hacks anyway (like adding French and German % quotes to documents typeset with CM, where we lose kerning), so % hopefully nobody will notice/care. \edef\ecsize{\csname\curfontsize ecsize\endcsname}% \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% \ifmonospace % typewriter: \font\thisecfont = ectt\ecsize \space at \nominalsize \else \ifx\curfontstyle\bfstylename % bold: \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize \else % regular: \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize \fi \fi \thisecfont } % @registeredsymbol - R in a circle. The font for the R should really % be smaller yet, but lllsize is the best we can do for now. % Adapted from the plain.tex definition of \copyright. % \def\registeredsymbol{% $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}% \hfil\crcr\Orb}}% }$% } % @textdegree - the normal degrees sign. % \def\textdegree{$^\circ$} % Laurent Siebenmann reports \Orb undefined with: % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 % so we'll define it if necessary. % \ifx\Orb\thisisundefined \def\Orb{\mathhexbox20D} \fi % Quotes. \chardef\quotedblleft="5C \chardef\quotedblright=`\" \chardef\quoteleft=`\` \chardef\quoteright=`\' \message{page headings,} \newskip\titlepagetopglue \titlepagetopglue = 1.5in \newskip\titlepagebottomglue \titlepagebottomglue = 2pc % First the title page. Must do @settitle before @titlepage. \newif\ifseenauthor \newif\iffinishedtitlepage % Do an implicit @contents or @shortcontents after @end titlepage if the % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. % \newif\ifsetcontentsaftertitlepage \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue \newif\ifsetshortcontentsaftertitlepage \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue \parseargdef\shorttitlepage{% \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}% \endgroup\page\hbox{}\page} \envdef\titlepage{% % Open one extra group, as we want to close it in the middle of \Etitlepage. \begingroup \parindent=0pt \textfonts % Leave some space at the very top of the page. \vglue\titlepagetopglue % No rule at page bottom unless we print one at the top with @title. \finishedtitlepagetrue % % Most title ``pages'' are actually two pages long, with space % at the top of the second. We don't want the ragged left on the second. \let\oldpage = \page \def\page{% \iffinishedtitlepage\else \finishtitlepage \fi \let\page = \oldpage \page \null }% } \def\Etitlepage{% \iffinishedtitlepage\else \finishtitlepage \fi % It is important to do the page break before ending the group, % because the headline and footline are only empty inside the group. % If we use the new definition of \page, we always get a blank page % after the title page, which we certainly don't want. \oldpage \endgroup % % Need this before the \...aftertitlepage checks so that if they are % in effect the toc pages will come out with page numbers. \HEADINGSon % % If they want short, they certainly want long too. \ifsetshortcontentsaftertitlepage \shortcontents \contents \global\let\shortcontents = \relax \global\let\contents = \relax \fi % \ifsetcontentsaftertitlepage \contents \global\let\contents = \relax \global\let\shortcontents = \relax \fi } \def\finishtitlepage{% \vskip4pt \hrule height 2pt width \hsize \vskip\titlepagebottomglue \finishedtitlepagetrue } % Settings used for typesetting titles: no hyphenation, no indentation, % don't worry much about spacing, ragged right. This should be used % inside a \vbox, and fonts need to be set appropriately first. Because % it is always used for titles, nothing else, we call \rmisbold. \par % should be specified before the end of the \vbox, since a vbox is a group. % \def\raggedtitlesettings{% \rmisbold \hyphenpenalty=10000 \parindent=0pt \tolerance=5000 \ptexraggedright } % Macros to be used within @titlepage: \let\subtitlerm=\tenrm \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} \parseargdef\title{% \checkenv\titlepage \vbox{\titlefonts \raggedtitlesettings #1\par}% % print a rule at the page bottom also. \finishedtitlepagefalse \vskip4pt \hrule height 4pt width \hsize \vskip4pt } \parseargdef\subtitle{% \checkenv\titlepage {\subtitlefont \rightline{#1}}% } % @author should come last, but may come many times. % It can also be used inside @quotation. % \parseargdef\author{% \def\temp{\quotation}% \ifx\thisenv\temp \def\quotationauthor{#1}% printed in \Equotation. \else \checkenv\titlepage \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi {\secfonts\rmisbold \leftline{#1}}% \fi } % Set up page headings and footings. \let\thispage=\folio \newtoks\evenheadline % headline on even pages \newtoks\oddheadline % headline on odd pages \newtoks\evenfootline % footline on even pages \newtoks\oddfootline % footline on odd pages % Now make TeX use those variables \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline \else \the\evenheadline \fi}} \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline \else \the\evenfootline \fi}\HEADINGShook} \let\HEADINGShook=\relax % Commands to set those variables. % For example, this is what @headings on does % @evenheading @thistitle|@thispage|@thischapter % @oddheading @thischapter|@thispage|@thistitle % @evenfooting @thisfile|| % @oddfooting ||@thisfile \def\evenheading{\parsearg\evenheadingxxx} \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} \def\evenheadingyyy #1\|#2\|#3\|#4\finish{% \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \def\oddheading{\parsearg\oddheadingxxx} \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} \def\oddheadingyyy #1\|#2\|#3\|#4\finish{% \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% \def\evenfooting{\parsearg\evenfootingxxx} \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} \def\evenfootingyyy #1\|#2\|#3\|#4\finish{% \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \def\oddfooting{\parsearg\oddfootingxxx} \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} \def\oddfootingyyy #1\|#2\|#3\|#4\finish{% \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% % % Leave some space for the footline. Hopefully ok to assume % @evenfooting will not be used by itself. \global\advance\pageheight by -12pt \global\advance\vsize by -12pt } \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} % @evenheadingmarks top \thischapter <- chapter at the top of a page % @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page % % The same set of arguments for: % % @oddheadingmarks % @evenfootingmarks % @oddfootingmarks % @everyheadingmarks % @everyfootingmarks \def\evenheadingmarks{\headingmarks{even}{heading}} \def\oddheadingmarks{\headingmarks{odd}{heading}} \def\evenfootingmarks{\headingmarks{even}{footing}} \def\oddfootingmarks{\headingmarks{odd}{footing}} \def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1} \headingmarks{odd}{heading}{#1} } \def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1} \headingmarks{odd}{footing}{#1} } % #1 = even/odd, #2 = heading/footing, #3 = top/bottom. \def\headingmarks#1#2#3 {% \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname \global\expandafter\let\csname get#1#2marks\endcsname \temp } \everyheadingmarks bottom \everyfootingmarks bottom % @headings double turns headings on for double-sided printing. % @headings single turns headings on for single-sided printing. % @headings off turns them off. % @headings on same as @headings double, retained for compatibility. % @headings after turns on double-sided headings after this page. % @headings doubleafter turns on double-sided headings after this page. % @headings singleafter turns on single-sided headings after this page. % By default, they are off at the start of a document, % and turned `on' after @end titlepage. \def\headings #1 {\csname HEADINGS#1\endcsname} \def\headingsoff{% non-global headings elimination \evenheadline={\hfil}\evenfootline={\hfil}% \oddheadline={\hfil}\oddfootline={\hfil}% } \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting \HEADINGSoff % it's the default % When we turn headings on, set the page number to 1. % For double-sided printing, put current file name in lower left corner, % chapter name on inside top of right hand pages, document % title on inside top of left hand pages, and page numbers on outside top % edge of all pages. \def\HEADINGSdouble{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \let\contentsalignmacro = \chappager % For single-sided printing, chapter title goes across top left of page, % page number on top right. \def\HEADINGSsingle{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } \def\HEADINGSon{\HEADINGSdouble} \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} \let\HEADINGSdoubleafter=\HEADINGSafter \def\HEADINGSdoublex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} \def\HEADINGSsinglex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } % Subroutines used in generating headings % This produces Day Month Year style of output. % Only define if not already defined, in case a txi-??.tex file has set % up a different format (e.g., txi-cs.tex does this). \ifx\today\thisisundefined \def\today{% \number\day\space \ifcase\month \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec \fi \space\number\year} \fi % @settitle line... specifies the title of the document, for headings. % It generates no output of its own. \def\thistitle{\putwordNoTitle} \def\settitle{\parsearg{\gdef\thistitle}} \message{tables,} % Tables -- @table, @ftable, @vtable, @item(x). % default indentation of table text \newdimen\tableindent \tableindent=.8in % default indentation of @itemize and @enumerate text \newdimen\itemindent \itemindent=.3in % margin between end of table item and start of table text. \newdimen\itemmargin \itemmargin=.1in % used internally for \itemindent minus \itemmargin \newdimen\itemmax % Note @table, @ftable, and @vtable define @item, @itemx, etc., with % these defs. % They also define \itemindex % to index the item name in whatever manner is desired (perhaps none). \newif\ifitemxneedsnegativevskip \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} \def\internalBitem{\smallbreak \parsearg\itemzzz} \def\internalBitemx{\itemxpar \parsearg\itemzzz} \def\itemzzz #1{\begingroup % \advance\hsize by -\rightskip \advance\hsize by -\tableindent \setbox0=\hbox{\itemindicate{#1}}% \itemindex{#1}% \nobreak % This prevents a break before @itemx. % % If the item text does not fit in the space we have, put it on a line % by itself, and do not allow a page break either before or after that % line. We do not start a paragraph here because then if the next % command is, e.g., @kindex, the whatsit would get put into the % horizontal list on a line by itself, resulting in extra blank space. \ifdim \wd0>\itemmax % % Make this a paragraph so we get the \parskip glue and wrapping, % but leave it ragged-right. \begingroup \advance\leftskip by-\tableindent \advance\hsize by\tableindent \advance\rightskip by0pt plus1fil\relax \leavevmode\unhbox0\par \endgroup % % We're going to be starting a paragraph, but we don't want the % \parskip glue -- logically it's part of the @item we just started. \nobreak \vskip-\parskip % % Stop a page break at the \parskip glue coming up. However, if % what follows is an environment such as @example, there will be no % \parskip glue; then the negative vskip we just inserted would % cause the example and the item to crash together. So we use this % bizarre value of 10001 as a signal to \aboveenvbreak to insert % \parskip glue after all. Section titles are handled this way also. % \penalty 10001 \endgroup \itemxneedsnegativevskipfalse \else % The item text fits into the space. Start a paragraph, so that the % following text (if any) will end up on the same line. \noindent % Do this with kerns and \unhbox so that if there is a footnote in % the item text, it can migrate to the main vertical list and % eventually be printed. \nobreak\kern-\tableindent \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 \unhbox0 \nobreak\kern\dimen0 \endgroup \itemxneedsnegativevskiptrue \fi } \def\item{\errmessage{@item while not in a list environment}} \def\itemx{\errmessage{@itemx while not in a list environment}} % @table, @ftable, @vtable. \envdef\table{% \let\itemindex\gobble \tablecheck{table}% } \envdef\ftable{% \def\itemindex ##1{\doind {fn}{\code{##1}}}% \tablecheck{ftable}% } \envdef\vtable{% \def\itemindex ##1{\doind {vr}{\code{##1}}}% \tablecheck{vtable}% } \def\tablecheck#1{% \ifnum \the\catcode`\^^M=\active \endgroup \errmessage{This command won't work in this context; perhaps the problem is that we are \inenvironment\thisenv}% \def\next{\doignore{#1}}% \else \let\next\tablex \fi \next } \def\tablex#1{% \def\itemindicate{#1}% \parsearg\tabley } \def\tabley#1{% {% \makevalueexpandable \edef\temp{\noexpand\tablez #1\space\space\space}% \expandafter }\temp \endtablez } \def\tablez #1 #2 #3 #4\endtablez{% \aboveenvbreak \ifnum 0#1>0 \advance \leftskip by #1\mil \fi \ifnum 0#2>0 \tableindent=#2\mil \fi \ifnum 0#3>0 \advance \rightskip by #3\mil \fi \itemmax=\tableindent \advance \itemmax by -\itemmargin \advance \leftskip by \tableindent \exdentamount=\tableindent \parindent = 0pt \parskip = \smallskipamount \ifdim \parskip=0pt \parskip=2pt \fi \let\item = \internalBitem \let\itemx = \internalBitemx } \def\Etable{\endgraf\afterenvbreak} \let\Eftable\Etable \let\Evtable\Etable \let\Eitemize\Etable \let\Eenumerate\Etable % This is the counter used by @enumerate, which is really @itemize \newcount \itemno \envdef\itemize{\parsearg\doitemize} \def\doitemize#1{% \aboveenvbreak \itemmax=\itemindent \advance\itemmax by -\itemmargin \advance\leftskip by \itemindent \exdentamount=\itemindent \parindent=0pt \parskip=\smallskipamount \ifdim\parskip=0pt \parskip=2pt \fi % % Try typesetting the item mark that if the document erroneously says % something like @itemize @samp (intending @table), there's an error % right away at the @itemize. It's not the best error message in the % world, but it's better than leaving it to the @item. This means if % the user wants an empty mark, they have to say @w{} not just @w. \def\itemcontents{#1}% \setbox0 = \hbox{\itemcontents}% % % @itemize with no arg is equivalent to @itemize @bullet. \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi % \let\item=\itemizeitem } % Definition of @item while inside @itemize and @enumerate. % \def\itemizeitem{% \advance\itemno by 1 % for enumerations {\let\par=\endgraf \smallbreak}% reasonable place to break {% % If the document has an @itemize directly after a section title, a % \nobreak will be last on the list, and \sectionheading will have % done a \vskip-\parskip. In that case, we don't want to zero % parskip, or the item text will crash with the heading. On the % other hand, when there is normal text preceding the item (as there % usually is), we do want to zero parskip, or there would be too much % space. In that case, we won't have a \nobreak before. At least % that's the theory. \ifnum\lastpenalty<10000 \parskip=0in \fi \noindent \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% % \vadjust{\penalty 1200}}% not good to break after first line of item. \flushcr } % \splitoff TOKENS\endmark defines \first to be the first token in % TOKENS, and \rest to be the remainder. % \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% % Allow an optional argument of an uppercase letter, lowercase letter, % or number, to specify the first label in the enumerated list. No % argument is the same as `1'. % \envparseargdef\enumerate{\enumeratey #1 \endenumeratey} \def\enumeratey #1 #2\endenumeratey{% % If we were given no argument, pretend we were given `1'. \def\thearg{#1}% \ifx\thearg\empty \def\thearg{1}\fi % % Detect if the argument is a single token. If so, it might be a % letter. Otherwise, the only valid thing it can be is a number. % (We will always have one token, because of the test we just made. % This is a good thing, since \splitoff doesn't work given nothing at % all -- the first parameter is undelimited.) \expandafter\splitoff\thearg\endmark \ifx\rest\empty % Only one token in the argument. It could still be anything. % A ``lowercase letter'' is one whose \lccode is nonzero. % An ``uppercase letter'' is one whose \lccode is both nonzero, and % not equal to itself. % Otherwise, we assume it's a number. % % We need the \relax at the end of the \ifnum lines to stop TeX from % continuing to look for a . % \ifnum\lccode\expandafter`\thearg=0\relax \numericenumerate % a number (we hope) \else % It's a letter. \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax \lowercaseenumerate % lowercase letter \else \uppercaseenumerate % uppercase letter \fi \fi \else % Multiple tokens in the argument. We hope it's a number. \numericenumerate \fi } % An @enumerate whose labels are integers. The starting integer is % given in \thearg. % \def\numericenumerate{% \itemno = \thearg \startenumeration{\the\itemno}% } % The starting (lowercase) letter is in \thearg. \def\lowercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more lowercase letters in @enumerate; get a bigger alphabet}% \fi \char\lccode\itemno }% } % The starting (uppercase) letter is in \thearg. \def\uppercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more uppercase letters in @enumerate; get a bigger alphabet} \fi \char\uccode\itemno }% } % Call \doitemize, adding a period to the first argument and supplying the % common last two arguments. Also subtract one from the initial value in % \itemno, since @item increments \itemno. % \def\startenumeration#1{% \advance\itemno by -1 \doitemize{#1.}\flushcr } % @alphaenumerate and @capsenumerate are abbreviations for giving an arg % to @enumerate. % \def\alphaenumerate{\enumerate{a}} \def\capsenumerate{\enumerate{A}} \def\Ealphaenumerate{\Eenumerate} \def\Ecapsenumerate{\Eenumerate} % @multitable macros % Amy Hendrickson, 8/18/94, 3/6/96 % % @multitable ... @end multitable will make as many columns as desired. % Contents of each column will wrap at width given in preamble. Width % can be specified either with sample text given in a template line, % or in percent of \hsize, the current width of text on page. % Table can continue over pages but will only break between lines. % To make preamble: % % Either define widths of columns in terms of percent of \hsize: % @multitable @columnfractions .25 .3 .45 % @item ... % % Numbers following @columnfractions are the percent of the total % current hsize to be used for each column. You may use as many % columns as desired. % Or use a template: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item ... % using the widest term desired in each column. % Each new table line starts with @item, each subsequent new column % starts with @tab. Empty columns may be produced by supplying @tab's % with nothing between them for as many times as empty columns are needed, % ie, @tab@tab@tab will produce two empty columns. % @item, @tab do not need to be on their own lines, but it will not hurt % if they are. % Sample multitable: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item first col stuff @tab second col stuff @tab third col % @item % first col stuff % @tab % second col stuff % @tab % third col % @item first col stuff @tab second col stuff % @tab Many paragraphs of text may be used in any column. % % They will wrap at the width determined by the template. % @item@tab@tab This will be in third column. % @end multitable % Default dimensions may be reset by user. % @multitableparskip is vertical space between paragraphs in table. % @multitableparindent is paragraph indent in table. % @multitablecolmargin is horizontal space to be left between columns. % @multitablelinespace is space to leave between table items, baseline % to baseline. % 0pt means it depends on current normal line spacing. % \newskip\multitableparskip \newskip\multitableparindent \newdimen\multitablecolspace \newskip\multitablelinespace \multitableparskip=0pt \multitableparindent=6pt \multitablecolspace=12pt \multitablelinespace=0pt % Macros used to set up halign preamble: % \let\endsetuptable\relax \def\xendsetuptable{\endsetuptable} \let\columnfractions\relax \def\xcolumnfractions{\columnfractions} \newif\ifsetpercent % #1 is the @columnfraction, usually a decimal number like .5, but might % be just 1. We just use it, whatever it is. % \def\pickupwholefraction#1 {% \global\advance\colcount by 1 \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}% \setuptable } \newcount\colcount \def\setuptable#1{% \def\firstarg{#1}% \ifx\firstarg\xendsetuptable \let\go = \relax \else \ifx\firstarg\xcolumnfractions \global\setpercenttrue \else \ifsetpercent \let\go\pickupwholefraction \else \global\advance\colcount by 1 \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a % separator; typically that is always in the input, anyway. \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% \fi \fi \ifx\go\pickupwholefraction % Put the argument back for the \pickupwholefraction call, so % we'll always have a period there to be parsed. \def\go{\pickupwholefraction#1}% \else \let\go = \setuptable \fi% \fi \go } % multitable-only commands. % % @headitem starts a heading row, which we typeset in bold. % Assignments have to be global since we are inside the implicit group % of an alignment entry. \everycr resets \everytab so we don't have to % undo it ourselves. \def\headitemfont{\b}% for people to use in the template row; not changeable \def\headitem{% \checkenv\multitable \crcr \global\everytab={\bf}% can't use \headitemfont since the parsing differs \the\everytab % for the first item }% % % A \tab used to include \hskip1sp. But then the space in a template % line is not enough. That is bad. So let's go back to just `&' until % we again encounter the problem the 1sp was intended to solve. % --karl, nathan@acm.org, 20apr99. \def\tab{\checkenv\multitable &\the\everytab}% % @multitable ... @end multitable definitions: % \newtoks\everytab % insert after every tab. % \envdef\multitable{% \vskip\parskip \startsavinginserts % % @item within a multitable starts a normal row. % We use \def instead of \let so that if one of the multitable entries % contains an @itemize, we don't choke on the \item (seen as \crcr aka % \endtemplate) expanding \doitemize. \def\item{\crcr}% % \tolerance=9500 \hbadness=9500 \setmultitablespacing \parskip=\multitableparskip \parindent=\multitableparindent \overfullrule=0pt \global\colcount=0 % \everycr = {% \noalign{% \global\everytab={}% \global\colcount=0 % Reset the column counter. % Check for saved footnotes, etc. \checkinserts % Keeps underfull box messages off when table breaks over pages. %\filbreak % Maybe so, but it also creates really weird page breaks when the % table breaks over pages. Wouldn't \vfil be better? Wait until the % problem manifests itself, so it can be fixed for real --karl. }% }% % \parsearg\domultitable } \def\domultitable#1{% % To parse everything between @multitable and @item: \setuptable#1 \endsetuptable % % This preamble sets up a generic column definition, which will % be used as many times as user calls for columns. % \vtop will set a single line and will also let text wrap and % continue for many paragraphs if desired. \halign\bgroup &% \global\advance\colcount by 1 \multistrut \vtop{% % Use the current \colcount to find the correct column width: \hsize=\expandafter\csname col\the\colcount\endcsname % % In order to keep entries from bumping into each other % we will add a \leftskip of \multitablecolspace to all columns after % the first one. % % If a template has been used, we will add \multitablecolspace % to the width of each template entry. % % If the user has set preamble in terms of percent of \hsize we will % use that dimension as the width of the column, and the \leftskip % will keep entries from bumping into each other. Table will start at % left margin and final column will justify at right margin. % % Make sure we don't inherit \rightskip from the outer environment. \rightskip=0pt \ifnum\colcount=1 % The first column will be indented with the surrounding text. \advance\hsize by\leftskip \else \ifsetpercent \else % If user has not set preamble in terms of percent of \hsize % we will advance \hsize by \multitablecolspace. \advance\hsize by \multitablecolspace \fi % In either case we will make \leftskip=\multitablecolspace: \leftskip=\multitablecolspace \fi % Ignoring space at the beginning and end avoids an occasional spurious % blank line, when TeX decides to break the line at the space before the % box from the multistrut, so the strut ends up on a line by itself. % For example: % @multitable @columnfractions .11 .89 % @item @code{#} % @tab Legal holiday which is valid in major parts of the whole country. % Is automatically provided with highlighting sequences respectively % marking characters. \noindent\ignorespaces##\unskip\multistrut }\cr } \def\Emultitable{% \crcr \egroup % end the \halign \global\setpercentfalse } \def\setmultitablespacing{% \def\multistrut{\strut}% just use the standard line spacing % % Compute \multitablelinespace (if not defined by user) for use in % \multitableparskip calculation. We used define \multistrut based on % this, but (ironically) that caused the spacing to be off. % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100. \ifdim\multitablelinespace=0pt \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip \global\advance\multitablelinespace by-\ht0 \fi % Test to see if parskip is larger than space between lines of % table. If not, do nothing. % If so, set to same dimension as multitablelinespace. \ifdim\multitableparskip>\multitablelinespace \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller % than skip between lines in the table. \fi% \ifdim\multitableparskip=0pt \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller % than skip between lines in the table. \fi} \message{conditionals,} % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext, % @ifnotxml always succeed. They currently do nothing; we don't % attempt to check whether the conditionals are properly nested. But we % have to remember that they are conditionals, so that @end doesn't % attempt to close an environment group. % \def\makecond#1{% \expandafter\let\csname #1\endcsname = \relax \expandafter\let\csname iscond.#1\endcsname = 1 } \makecond{iftex} \makecond{ifnotdocbook} \makecond{ifnothtml} \makecond{ifnotinfo} \makecond{ifnotplaintext} \makecond{ifnotxml} % Ignore @ignore, @ifhtml, @ifinfo, and the like. % \def\direntry{\doignore{direntry}} \def\documentdescription{\doignore{documentdescription}} \def\docbook{\doignore{docbook}} \def\html{\doignore{html}} \def\ifdocbook{\doignore{ifdocbook}} \def\ifhtml{\doignore{ifhtml}} \def\ifinfo{\doignore{ifinfo}} \def\ifnottex{\doignore{ifnottex}} \def\ifplaintext{\doignore{ifplaintext}} \def\ifxml{\doignore{ifxml}} \def\ignore{\doignore{ignore}} \def\menu{\doignore{menu}} \def\xml{\doignore{xml}} % Ignore text until a line `@end #1', keeping track of nested conditionals. % % A count to remember the depth of nesting. \newcount\doignorecount \def\doignore#1{\begingroup % Scan in ``verbatim'' mode: \obeylines \catcode`\@ = \other \catcode`\{ = \other \catcode`\} = \other % % Make sure that spaces turn into tokens that match what \doignoretext wants. \spaceisspace % % Count number of #1's that we've seen. \doignorecount = 0 % % Swallow text until we reach the matching `@end #1'. \dodoignore{#1}% } { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source. \obeylines % % \gdef\dodoignore#1{% % #1 contains the command name as a string, e.g., `ifinfo'. % % Define a command to find the next `@end #1'. \long\def\doignoretext##1^^M@end #1{% \doignoretextyyy##1^^M@#1\_STOP_}% % % And this command to find another #1 command, at the beginning of a % line. (Otherwise, we would consider a line `@c @ifset', for % example, to count as an @ifset for nesting.) \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% % % And now expand that command. \doignoretext ^^M% }% } \def\doignoreyyy#1{% \def\temp{#1}% \ifx\temp\empty % Nothing found. \let\next\doignoretextzzz \else % Found a nested condition, ... \advance\doignorecount by 1 \let\next\doignoretextyyy % ..., look for another. % If we're here, #1 ends with ^^M\ifinfo (for example). \fi \next #1% the token \_STOP_ is present just after this macro. } % We have to swallow the remaining "\_STOP_". % \def\doignoretextzzz#1{% \ifnum\doignorecount = 0 % We have just found the outermost @end. \let\next\enddoignore \else % Still inside a nested condition. \advance\doignorecount by -1 \let\next\doignoretext % Look for the next @end. \fi \next } % Finish off ignored text. { \obeylines% % Ignore anything after the last `@end #1'; this matters in verbatim % environments, where otherwise the newline after an ignored conditional % would result in a blank line in the output. \gdef\enddoignore#1^^M{\endgroup\ignorespaces}% } % @set VAR sets the variable VAR to an empty value. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. % % Since we want to separate VAR from REST-OF-LINE (which might be % empty), we can't just use \parsearg; we have to insert a space of our % own to delimit the rest of the line, and then take it out again if we % didn't need it. % We rely on the fact that \parsearg sets \catcode`\ =10. % \parseargdef\set{\setyyy#1 \endsetyyy} \def\setyyy#1 #2\endsetyyy{% {% \makevalueexpandable \def\temp{#2}% \edef\next{\gdef\makecsname{SET#1}}% \ifx\temp\empty \next{}% \else \setzzz#2\endsetzzz \fi }% } % Remove the trailing space \setxxx inserted. \def\setzzz#1 \endsetzzz{\next{#1}} % @clear VAR clears (i.e., unsets) the variable VAR. % \parseargdef\clear{% {% \makevalueexpandable \global\expandafter\let\csname SET#1\endcsname=\relax }% } % @value{foo} gets the text saved in variable foo. \def\value{\begingroup\makevalueexpandable\valuexxx} \def\valuexxx#1{\expandablevalue{#1}\endgroup} { \catcode`\- = \active \catcode`\_ = \active % \gdef\makevalueexpandable{% \let\value = \expandablevalue % We don't want these characters active, ... \catcode`\-=\other \catcode`\_=\other % ..., but we might end up with active ones in the argument if % we're called from @code, as @code{@value{foo-bar_}}, though. % So \let them to their normal equivalents. \let-\normaldash \let_\normalunderscore } } % We have this subroutine so that we can handle at least some @value's % properly in indexes (we call \makevalueexpandable in \indexdummies). % The command has to be fully expandable (if the variable is set), since % the result winds up in the index file. This means that if the % variable's value contains other Texinfo commands, it's almost certain % it will fail (although perhaps we could fix that with sufficient work % to do a one-level expansion on the result, instead of complete). % \def\expandablevalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax {[No value for ``#1'']}% \message{Variable `#1', used in @value, is not set.}% \else \csname SET#1\endcsname \fi } % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. % % To get special treatment of `@end ifset,' call \makeond and the redefine. % \makecond{ifset} \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} \def\doifset#1#2{% {% \makevalueexpandable \let\next=\empty \expandafter\ifx\csname SET#2\endcsname\relax #1% If not set, redefine \next. \fi \expandafter }\next } \def\ifsetfail{\doignore{ifset}} % @ifclear VAR ... @end executes the `...' iff VAR has never been % defined with @set, or has been undefined with @clear. % % The `\else' inside the `\doifset' parameter is a trick to reuse the % above code: if the variable is not set, do nothing, if it is set, % then redefine \next to \ifclearfail. % \makecond{ifclear} \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} \def\ifclearfail{\doignore{ifclear}} % @ifcommandisdefined CMD ... @end executes the `...' if CMD (written % without the @) is in fact defined. We can only feasibly check at the % TeX level, so something like `mathcode' is going to considered % defined even though it is not a Texinfo command. % \makecond{ifcommanddefined} \def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}} % \def\doifcmddefined#1#2{{% \makevalueexpandable \let\next=\empty \expandafter\ifx\csname #2\endcsname\relax #1% If not defined, \let\next as above. \fi \expandafter }\next } \def\ifcmddefinedfail{\doignore{ifcommanddefined}} % @ifcommandnotdefined CMD ... handled similar to @ifclear above. \makecond{ifcommandnotdefined} \def\ifcommandnotdefined{% \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}} \def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}} % Set the `txicommandconditionals' variable, so documents have a way to % test if the @ifcommand...defined conditionals are available. \set txicommandconditionals % @dircategory CATEGORY -- specify a category of the dir file % which this file should belong to. Ignore this in TeX. \let\dircategory=\comment % @defininfoenclose. \let\definfoenclose=\comment \message{indexing,} % Index generation facilities % Define \newwrite to be identical to plain tex's \newwrite % except not \outer, so it can be used within macros and \if's. \edef\newwrite{\makecsname{ptexnewwrite}} % \newindex {foo} defines an index named foo. % It automatically defines \fooindex such that % \fooindex ...rest of line... puts an entry in the index foo. % It also defines \fooindfile to be the number of the output channel for % the file that accumulates this index. The file's extension is foo. % The name of an index should be no more than 2 characters long % for the sake of vms. % \def\newindex#1{% \iflinks \expandafter\newwrite \csname#1indfile\endcsname \openout \csname#1indfile\endcsname \jobname.#1 % Open the file \fi \expandafter\xdef\csname#1index\endcsname{% % Define @#1index \noexpand\doindex{#1}} } % @defindex foo == \newindex{foo} % \def\defindex{\parsearg\newindex} % Define @defcodeindex, like @defindex except put all entries in @code. % \def\defcodeindex{\parsearg\newcodeindex} % \def\newcodeindex#1{% \iflinks \expandafter\newwrite \csname#1indfile\endcsname \openout \csname#1indfile\endcsname \jobname.#1 \fi \expandafter\xdef\csname#1index\endcsname{% \noexpand\docodeindex{#1}}% } % @synindex foo bar makes index foo feed into index bar. % Do this instead of @defindex foo if you don't want it as a separate index. % % @syncodeindex foo bar similar, but put all entries made for index foo % inside @code. % \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), % #3 the target index (bar). \def\dosynindex#1#2#3{% % Only do \closeout if we haven't already done it, else we'll end up % closing the target index. \expandafter \ifx\csname donesynindex#2\endcsname \relax % The \closeout helps reduce unnecessary open files; the limit on the % Acorn RISC OS is a mere 16 files. \expandafter\closeout\csname#2indfile\endcsname \expandafter\let\csname donesynindex#2\endcsname = 1 \fi % redefine \fooindfile: \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname \expandafter\let\csname#2indfile\endcsname=\temp % redefine \fooindex: \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% } % Define \doindex, the driver for all \fooindex macros. % Argument #1 is generated by the calling \fooindex macro, % and it is "foo", the name of the index. % \doindex just uses \parsearg; it calls \doind for the actual work. % This is because \doind is more useful to call from other macros. % There is also \dosubind {index}{topic}{subtopic} % which makes an entry in a two-level index such as the operation index. \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} \def\singleindexer #1{\doind{\indexname}{#1}} % like the previous two, but they put @code around the argument. \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} % Take care of Texinfo commands that can appear in an index entry. % Since there are some commands we want to expand, and others we don't, % we have to laboriously prevent expansion for those that we don't. % \def\indexdummies{% \escapechar = `\\ % use backslash in output files. \def\@{@}% change to @@ when we switch to @ as escape char in index files. \def\ {\realbackslash\space }% % % Need these unexpandable (because we define \tt as a dummy) % definitions when @{ or @} appear in index entry text. Also, more % complicated, when \tex is in effect and \{ is a \delimiter again. % We can't use \lbracecmd and \rbracecmd because texindex assumes % braces and backslashes are used only as delimiters. Perhaps we % should define @lbrace and @rbrace commands a la @comma. \def\{{{\tt\char123}}% \def\}{{\tt\char125}}% % % I don't entirely understand this, but when an index entry is % generated from a macro call, the \endinput which \scanmacro inserts % causes processing to be prematurely terminated. This is, % apparently, because \indexsorttmp is fully expanded, and \endinput % is an expandable command. The redefinition below makes \endinput % disappear altogether for that purpose -- although logging shows that % processing continues to some further point. On the other hand, it % seems \endinput does not hurt in the printed index arg, since that % is still getting written without apparent harm. % % Sample source (mac-idx3.tex, reported by Graham Percival to % help-texinfo, 22may06): % @macro funindex {WORD} % @findex xyz % @end macro % ... % @funindex commtest % % The above is not enough to reproduce the bug, but it gives the flavor. % % Sample whatsit resulting: % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}} % % So: \let\endinput = \empty % % Do the redefinitions. \commondummies } % For the aux and toc files, @ is the escape character. So we want to % redefine everything using @ as the escape character (instead of % \realbackslash, still used for index files). When everything uses @, % this will be simpler. % \def\atdummies{% \def\@{@@}% \def\ {@ }% \let\{ = \lbraceatcmd \let\} = \rbraceatcmd % % Do the redefinitions. \commondummies \otherbackslash } % Called from \indexdummies and \atdummies. % \def\commondummies{% % % \definedummyword defines \#1 as \string\#1\space, thus effectively % preventing its expansion. This is used only for control words, % not control letters, because the \space would be incorrect for % control characters, but is needed to separate the control word % from whatever follows. % % For control letters, we have \definedummyletter, which omits the % space. % % These can be used both for control words that take an argument and % those that do not. If it is followed by {arg} in the input, then % that will dutifully get written to the index (or wherever). % \def\definedummyword ##1{\def##1{\string##1\space}}% \def\definedummyletter##1{\def##1{\string##1}}% \let\definedummyaccent\definedummyletter % \commondummiesnofonts % \definedummyletter\_% \definedummyletter\-% % % Non-English letters. \definedummyword\AA \definedummyword\AE \definedummyword\DH \definedummyword\L \definedummyword\O \definedummyword\OE \definedummyword\TH \definedummyword\aa \definedummyword\ae \definedummyword\dh \definedummyword\exclamdown \definedummyword\l \definedummyword\o \definedummyword\oe \definedummyword\ordf \definedummyword\ordm \definedummyword\questiondown \definedummyword\ss \definedummyword\th % % Although these internal commands shouldn't show up, sometimes they do. \definedummyword\bf \definedummyword\gtr \definedummyword\hat \definedummyword\less \definedummyword\sf \definedummyword\sl \definedummyword\tclose \definedummyword\tt % \definedummyword\LaTeX \definedummyword\TeX % % Assorted special characters. \definedummyword\arrow \definedummyword\bullet \definedummyword\comma \definedummyword\copyright \definedummyword\registeredsymbol \definedummyword\dots \definedummyword\enddots \definedummyword\entrybreak \definedummyword\equiv \definedummyword\error \definedummyword\euro \definedummyword\expansion \definedummyword\geq \definedummyword\guillemetleft \definedummyword\guillemetright \definedummyword\guilsinglleft \definedummyword\guilsinglright \definedummyword\lbracechar \definedummyword\leq \definedummyword\minus \definedummyword\ogonek \definedummyword\pounds \definedummyword\point \definedummyword\print \definedummyword\quotedblbase \definedummyword\quotedblleft \definedummyword\quotedblright \definedummyword\quoteleft \definedummyword\quoteright \definedummyword\quotesinglbase \definedummyword\rbracechar \definedummyword\result \definedummyword\textdegree % % We want to disable all macros so that they are not expanded by \write. \macrolist % \normalturnoffactive % % Handle some cases of @value -- where it does not contain any % (non-fully-expandable) commands. \makevalueexpandable } % \commondummiesnofonts: common to \commondummies and \indexnofonts. % \def\commondummiesnofonts{% % Control letters and accents. \definedummyletter\!% \definedummyaccent\"% \definedummyaccent\'% \definedummyletter\*% \definedummyaccent\,% \definedummyletter\.% \definedummyletter\/% \definedummyletter\:% \definedummyaccent\=% \definedummyletter\?% \definedummyaccent\^% \definedummyaccent\`% \definedummyaccent\~% \definedummyword\u \definedummyword\v \definedummyword\H \definedummyword\dotaccent \definedummyword\ogonek \definedummyword\ringaccent \definedummyword\tieaccent \definedummyword\ubaraccent \definedummyword\udotaccent \definedummyword\dotless % % Texinfo font commands. \definedummyword\b \definedummyword\i \definedummyword\r \definedummyword\sansserif \definedummyword\sc \definedummyword\slanted \definedummyword\t % % Commands that take arguments. \definedummyword\abbr \definedummyword\acronym \definedummyword\anchor \definedummyword\cite \definedummyword\code \definedummyword\command \definedummyword\dfn \definedummyword\dmn \definedummyword\email \definedummyword\emph \definedummyword\env \definedummyword\file \definedummyword\image \definedummyword\indicateurl \definedummyword\inforef \definedummyword\kbd \definedummyword\key \definedummyword\math \definedummyword\option \definedummyword\pxref \definedummyword\ref \definedummyword\samp \definedummyword\strong \definedummyword\tie \definedummyword\uref \definedummyword\url \definedummyword\var \definedummyword\verb \definedummyword\w \definedummyword\xref } % \indexnofonts is used when outputting the strings to sort the index % by, and when constructing control sequence names. It eliminates all % control sequences and just writes whatever the best ASCII sort string % would be for a given command (usually its argument). % \def\indexnofonts{% % Accent commands should become @asis. \def\definedummyaccent##1{\let##1\asis}% % We can just ignore other control letters. \def\definedummyletter##1{\let##1\empty}% % All control words become @asis by default; overrides below. \let\definedummyword\definedummyaccent % \commondummiesnofonts % % Don't no-op \tt, since it isn't a user-level command % and is used in the definitions of the active chars like <, >, |, etc. % Likewise with the other plain tex font commands. %\let\tt=\asis % \def\ { }% \def\@{@}% \def\_{\normalunderscore}% \def\-{}% @- shouldn't affect sorting % % Unfortunately, texindex is not prepared to handle braces in the % content at all. So for index sorting, we map @{ and @} to strings % starting with |, since that ASCII character is between ASCII { and }. \def\{{|a}% \def\lbracechar{|a}% % \def\}{|b}% \def\rbracechar{|b}% % % Non-English letters. \def\AA{AA}% \def\AE{AE}% \def\DH{DZZ}% \def\L{L}% \def\OE{OE}% \def\O{O}% \def\TH{ZZZ}% \def\aa{aa}% \def\ae{ae}% \def\dh{dzz}% \def\exclamdown{!}% \def\l{l}% \def\oe{oe}% \def\ordf{a}% \def\ordm{o}% \def\o{o}% \def\questiondown{?}% \def\ss{ss}% \def\th{zzz}% % \def\LaTeX{LaTeX}% \def\TeX{TeX}% % % Assorted special characters. % (The following {} will end up in the sort string, but that's ok.) \def\arrow{->}% \def\bullet{bullet}% \def\comma{,}% \def\copyright{copyright}% \def\dots{...}% \def\enddots{...}% \def\equiv{==}% \def\error{error}% \def\euro{euro}% \def\expansion{==>}% \def\geq{>=}% \def\guillemetleft{<<}% \def\guillemetright{>>}% \def\guilsinglleft{<}% \def\guilsinglright{>}% \def\leq{<=}% \def\minus{-}% \def\point{.}% \def\pounds{pounds}% \def\print{-|}% \def\quotedblbase{"}% \def\quotedblleft{"}% \def\quotedblright{"}% \def\quoteleft{`}% \def\quoteright{'}% \def\quotesinglbase{,}% \def\registeredsymbol{R}% \def\result{=>}% \def\textdegree{o}% % \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax \else \indexlquoteignore \fi % % We need to get rid of all macros, leaving only the arguments (if present). % Of course this is not nearly correct, but it is the best we can do for now. % makeinfo does not expand macros in the argument to @deffn, which ends up % writing an index entry, and texindex isn't prepared for an index sort entry % that starts with \. % % Since macro invocations are followed by braces, we can just redefine them % to take a single TeX argument. The case of a macro invocation that % goes to end-of-line is not handled. % \macrolist } % Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us % ignore left quotes in the sort term. {\catcode`\`=\active \gdef\indexlquoteignore{\let`=\empty}} \let\indexbackslash=0 %overridden during \printindex. \let\SETmarginindex=\relax % put index entries in margin (undocumented)? % Most index entries go through here, but \dosubind is the general case. % #1 is the index name, #2 is the entry text. \def\doind#1#2{\dosubind{#1}{#2}{}} % Workhorse for all \fooindexes. % #1 is name of index, #2 is stuff to put there, #3 is subentry -- % empty if called from \doind, as we usually are (the main exception % is with most defuns, which call us directly). % \def\dosubind#1#2#3{% \iflinks {% % Store the main index entry text (including the third arg). \toks0 = {#2}% % If third arg is present, precede it with a space. \def\thirdarg{#3}% \ifx\thirdarg\empty \else \toks0 = \expandafter{\the\toks0 \space #3}% \fi % \edef\writeto{\csname#1indfile\endcsname}% % \safewhatsit\dosubindwrite }% \fi } % Write the entry in \toks0 to the index file: % \def\dosubindwrite{% % Put the index entry in the margin if desired. \ifx\SETmarginindex\relax\else \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% \fi % % Remember, we are within a group. \indexdummies % Must do this here, since \bf, etc expand at this stage \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now % so it will be output as is; and it will print as backslash. % % Process the index entry with all font commands turned off, to % get the string to sort by. {\indexnofonts \edef\temp{\the\toks0}% need full expansion \xdef\indexsorttmp{\temp}% }% % % Set up the complete index entry, with both the sort key and % the original text, including any font commands. We write % three arguments to \entry to the .?? file (four in the % subentry case), texindex reduces to two when writing the .??s % sorted result. \edef\temp{% \write\writeto{% \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% }% \temp } % Take care of unwanted page breaks/skips around a whatsit: % % If a skip is the last thing on the list now, preserve it % by backing up by \lastskip, doing the \write, then inserting % the skip again. Otherwise, the whatsit generated by the % \write or \pdfdest will make \lastskip zero. The result is that % sequences like this: % @end defun % @tindex whatever % @defun ... % will have extra space inserted, because the \medbreak in the % start of the @defun won't see the skip inserted by the @end of % the previous defun. % % But don't do any of this if we're not in vertical mode. We % don't want to do a \vskip and prematurely end a paragraph. % % Avoid page breaks due to these extra skips, too. % % But wait, there is a catch there: % We'll have to check whether \lastskip is zero skip. \ifdim is not % sufficient for this purpose, as it ignores stretch and shrink parts % of the skip. The only way seems to be to check the textual % representation of the skip. % % The following is almost like \def\zeroskipmacro{0.0pt} except that % the ``p'' and ``t'' characters have catcode \other, not 11 (letter). % \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} % \newskip\whatsitskip \newcount\whatsitpenalty % % ..., ready, GO: % \def\safewhatsit#1{\ifhmode #1% \else % \lastskip and \lastpenalty cannot both be nonzero simultaneously. \whatsitskip = \lastskip \edef\lastskipmacro{\the\lastskip}% \whatsitpenalty = \lastpenalty % % If \lastskip is nonzero, that means the last item was a % skip. And since a skip is discardable, that means this % -\whatsitskip glue we're inserting is preceded by a % non-discardable item, therefore it is not a potential % breakpoint, therefore no \nobreak needed. \ifx\lastskipmacro\zeroskipmacro \else \vskip-\whatsitskip \fi % #1% % \ifx\lastskipmacro\zeroskipmacro % If \lastskip was zero, perhaps the last item was a penalty, and % perhaps it was >=10000, e.g., a \nobreak. In that case, we want % to re-insert the same penalty (values >10000 are used for various % signals); since we just inserted a non-discardable item, any % following glue (such as a \parskip) would be a breakpoint. For example: % @deffn deffn-whatever % @vindex index-whatever % Description. % would allow a break between the index-whatever whatsit % and the "Description." paragraph. \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi \else % On the other hand, if we had a nonzero \lastskip, % this make-up glue would be preceded by a non-discardable item % (the whatsit from the \write), so we must insert a \nobreak. \nobreak\vskip\whatsitskip \fi \fi} % The index entry written in the file actually looks like % \entry {sortstring}{page}{topic} % or % \entry {sortstring}{page}{topic}{subtopic} % The texindex program reads in these files and writes files % containing these kinds of lines: % \initial {c} % before the first topic whose initial is c % \entry {topic}{pagelist} % for a topic that is used without subtopics % \primary {topic} % for the beginning of a topic that is used with subtopics % \secondary {subtopic}{pagelist} % for each subtopic. % Define the user-accessible indexing commands % @findex, @vindex, @kindex, @cindex. \def\findex {\fnindex} \def\kindex {\kyindex} \def\cindex {\cpindex} \def\vindex {\vrindex} \def\tindex {\tpindex} \def\pindex {\pgindex} \def\cindexsub {\begingroup\obeylines\cindexsub} {\obeylines % \gdef\cindexsub "#1" #2^^M{\endgroup % \dosubind{cp}{#2}{#1}}} % Define the macros used in formatting output of the sorted index material. % @printindex causes a particular index (the ??s file) to get printed. % It does not print any chapter heading (usually an @unnumbered). % \parseargdef\printindex{\begingroup \dobreak \chapheadingskip{10000}% % \smallfonts \rm \tolerance = 9500 \plainfrenchspacing \everypar = {}% don't want the \kern\-parindent from indentation suppression. % % See if the index file exists and is nonempty. % Change catcode of @ here so that if the index file contains % \initial {@} % as its first line, TeX doesn't complain about mismatched braces % (because it thinks @} is a control sequence). \catcode`\@ = 11 \openin 1 \jobname.#1s \ifeof 1 % \enddoublecolumns gets confused if there is no text in the index, % and it loses the chapter title and the aux file entries for the % index. The easiest way to prevent this problem is to make sure % there is some text. \putwordIndexNonexistent \else % % If the index file exists but is empty, then \openin leaves \ifeof % false. We have to make TeX try to read something from the file, so % it can discover if there is anything in it. \read 1 to \temp \ifeof 1 \putwordIndexIsEmpty \else % Index files are almost Texinfo source, but we use \ as the escape % character. It would be better to use @, but that's too big a change % to make right now. \def\indexbackslash{\backslashcurfont}% \catcode`\\ = 0 \escapechar = `\\ \begindoublecolumns \input \jobname.#1s \enddoublecolumns \fi \fi \closein 1 \endgroup} % These macros are used by the sorted index file itself. % Change them to control the appearance of the index. \def\initial#1{{% % Some minor font changes for the special characters. \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt % % Remove any glue we may have, we'll be inserting our own. \removelastskip % % We like breaks before the index initials, so insert a bonus. \nobreak \vskip 0pt plus 3\baselineskip \penalty 0 \vskip 0pt plus -3\baselineskip % % Typeset the initial. Making this add up to a whole number of % baselineskips increases the chance of the dots lining up from column % to column. It still won't often be perfect, because of the stretch % we need before each entry, but it's better. % % No shrink because it confuses \balancecolumns. \vskip 1.67\baselineskip plus .5\baselineskip \leftline{\secbf #1}% % Do our best not to break after the initial. \nobreak \vskip .33\baselineskip plus .1\baselineskip }} % \entry typesets a paragraph consisting of the text (#1), dot leaders, and % then page number (#2) flushed to the right margin. It is used for index % and table of contents entries. The paragraph is indented by \leftskip. % % A straightforward implementation would start like this: % \def\entry#1#2{... % But this freezes the catcodes in the argument, and can cause problems to % @code, which sets - active. This problem was fixed by a kludge--- % ``-'' was active throughout whole index, but this isn't really right. % The right solution is to prevent \entry from swallowing the whole text. % --kasal, 21nov03 \def\entry{% \begingroup % % Start a new paragraph if necessary, so our assignments below can't % affect previous text. \par % % Do not fill out the last line with white space. \parfillskip = 0in % % No extra space above this paragraph. \parskip = 0in % % Do not prefer a separate line ending with a hyphen to fewer lines. \finalhyphendemerits = 0 % % \hangindent is only relevant when the entry text and page number % don't both fit on one line. In that case, bob suggests starting the % dots pretty far over on the line. Unfortunately, a large % indentation looks wrong when the entry text itself is broken across % lines. So we use a small indentation and put up with long leaders. % % \hangafter is reset to 1 (which is the value we want) at the start % of each paragraph, so we need not do anything with that. \hangindent = 2em % % When the entry text needs to be broken, just fill out the first line % with blank space. \rightskip = 0pt plus1fil % % A bit of stretch before each entry for the benefit of balancing % columns. \vskip 0pt plus1pt % % When reading the text of entry, convert explicit line breaks % from @* into spaces. The user might give these in long section % titles, for instance. \def\*{\unskip\space\ignorespaces}% \def\entrybreak{\hfil\break}% % % Swallow the left brace of the text (first parameter): \afterassignment\doentry \let\temp = } \def\entrybreak{\unskip\space\ignorespaces}% \def\doentry{% \bgroup % Instead of the swallowed brace. \noindent \aftergroup\finishentry % And now comes the text of the entry. } \def\finishentry#1{% % #1 is the page number. % % The following is kludged to not output a line of dots in the index if % there are no page numbers. The next person who breaks this will be % cursed by a Unix daemon. \setbox\boxA = \hbox{#1}% \ifdim\wd\boxA = 0pt \ % \else % % If we must, put the page number on a line of its own, and fill out % this line with blank space. (The \hfil is overwhelmed with the % fill leaders glue in \indexdotfill if the page number does fit.) \hfil\penalty50 \null\nobreak\indexdotfill % Have leaders before the page number. % % The `\ ' here is removed by the implicit \unskip that TeX does as % part of (the primitive) \par. Without it, a spurious underfull % \hbox ensues. \ifpdf \pdfgettoks#1.% \ \the\toksA \else \ #1% \fi \fi \par \endgroup } % Like plain.tex's \dotfill, except uses up at least 1 em. \def\indexdotfill{\cleaders \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill} \def\primary #1{\line{#1\hfil}} \newskip\secondaryindent \secondaryindent=0.5cm \def\secondary#1#2{{% \parfillskip=0in \parskip=0in \hangindent=1in \hangafter=1 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill \ifpdf \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. \else #2 \fi \par }} % Define two-column mode, which we use to typeset indexes. % Adapted from the TeXbook, page 416, which is to say, % the manmac.tex format used to print the TeXbook itself. \catcode`\@=11 \newbox\partialpage \newdimen\doublecolumnhsize \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns % Grab any single-column material above us. \output = {% % % Here is a possibility not foreseen in manmac: if we accumulate a % whole lot of material, we might end up calling this \output % routine twice in a row (see the doublecol-lose test, which is % essentially a couple of indexes with @setchapternewpage off). In % that case we just ship out what is in \partialpage with the normal % output routine. Generally, \partialpage will be empty when this % runs and this will be a no-op. See the indexspread.tex test case. \ifvoid\partialpage \else \onepageout{\pagecontents\partialpage}% \fi % \global\setbox\partialpage = \vbox{% % Unvbox the main output page. \unvbox\PAGE \kern-\topskip \kern\baselineskip }% }% \eject % run that output routine to set \partialpage % % Use the double-column output routine for subsequent pages. \output = {\doublecolumnout}% % % Change the page size parameters. We could do this once outside this % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 % format, but then we repeat the same computation. Repeating a couple % of assignments once per index is clearly meaningless for the % execution time, so we may as well do it in one place. % % First we halve the line length, less a little for the gutter between % the columns. We compute the gutter based on the line length, so it % changes automatically with the paper format. The magic constant % below is chosen so that the gutter has the same value (well, +-<1pt) % as it did when we hard-coded it. % % We put the result in a separate register, \doublecolumhsize, so we % can restore it in \pagesofar, after \hsize itself has (potentially) % been clobbered. % \doublecolumnhsize = \hsize \advance\doublecolumnhsize by -.04154\hsize \divide\doublecolumnhsize by 2 \hsize = \doublecolumnhsize % % Double the \vsize as well. (We don't need a separate register here, % since nobody clobbers \vsize.) \vsize = 2\vsize } % The double-column output routine for all double-column pages except % the last. % \def\doublecolumnout{% \splittopskip=\topskip \splitmaxdepth=\maxdepth % Get the available space for the double columns -- the normal % (undoubled) page height minus any material left over from the % previous page. \dimen@ = \vsize \divide\dimen@ by 2 \advance\dimen@ by -\ht\partialpage % % box0 will be the left-hand column, box2 the right. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ \onepageout\pagesofar \unvbox255 \penalty\outputpenalty } % % Re-output the contents of the output page -- any previous material, % followed by the two boxes we just split, in box0 and box2. \def\pagesofar{% \unvbox\partialpage % \hsize = \doublecolumnhsize \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% } % % All done with double columns. \def\enddoublecolumns{% % The following penalty ensures that the page builder is exercised % _before_ we change the output routine. This is necessary in the % following situation: % % The last section of the index consists only of a single entry. % Before this section, \pagetotal is less than \pagegoal, so no % break occurs before the last section starts. However, the last % section, consisting of \initial and the single \entry, does not % fit on the page and has to be broken off. Without the following % penalty the page builder will not be exercised until \eject % below, and by that time we'll already have changed the output % routine to the \balancecolumns version, so the next-to-last % double-column page will be processed with \balancecolumns, which % is wrong: The two columns will go to the main vertical list, with % the broken-off section in the recent contributions. As soon as % the output routine finishes, TeX starts reconsidering the page % break. The two columns and the broken-off section both fit on the % page, because the two columns now take up only half of the page % goal. When TeX sees \eject from below which follows the final % section, it invokes the new output routine that we've set after % \balancecolumns below; \onepageout will try to fit the two columns % and the final section into the vbox of \pageheight (see % \pagebody), causing an overfull box. % % Note that glue won't work here, because glue does not exercise the % page builder, unlike penalties (see The TeXbook, pp. 280-281). \penalty0 % \output = {% % Split the last of the double-column material. Leave it on the % current page, no automatic page break. \balancecolumns % % If we end up splitting too much material for the current page, % though, there will be another page break right after this \output % invocation ends. Having called \balancecolumns once, we do not % want to call it again. Therefore, reset \output to its normal % definition right away. (We hope \balancecolumns will never be % called on to balance too much material, but if it is, this makes % the output somewhat more palatable.) \global\output = {\onepageout{\pagecontents\PAGE}}% }% \eject \endgroup % started in \begindoublecolumns % % \pagegoal was set to the doubled \vsize above, since we restarted % the current page. We're now back to normal single-column % typesetting, so reset \pagegoal to the normal \vsize (after the % \endgroup where \vsize got restored). \pagegoal = \vsize } % % Called at the end of the double column material. \def\balancecolumns{% \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. \dimen@ = \ht0 \advance\dimen@ by \topskip \advance\dimen@ by-\baselineskip \divide\dimen@ by 2 % target to split to %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% \splittopskip = \topskip % Loop until we get a decent breakpoint. {% \vbadness = 10000 \loop \global\setbox3 = \copy0 \global\setbox1 = \vsplit3 to \dimen@ \ifdim\ht3>\dimen@ \global\advance\dimen@ by 1pt \repeat }% %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% \setbox0=\vbox to\dimen@{\unvbox1}% \setbox2=\vbox to\dimen@{\unvbox3}% % \pagesofar } \catcode`\@ = \other \message{sectioning,} % Chapters, sections, etc. % Let's start with @part. \outer\parseargdef\part{\partzzz{#1}} \def\partzzz#1{% \chapoddpage \null \vskip.3\vsize % move it down on the page a bit \begingroup \noindent \titlefonts\rmisbold #1\par % the text \let\lastnode=\empty % no node to associate with \writetocentry{part}{#1}{}% but put it in the toc \headingsoff % no headline or footline on the part page \chapoddpage \endgroup } % \unnumberedno is an oxymoron. But we count the unnumbered % sections so that we can refer to them unambiguously in the pdf % outlines by their "section number". We avoid collisions with chapter % numbers by starting them at 10000. (If a document ever has 10000 % chapters, we're in trouble anyway, I'm sure.) \newcount\unnumberedno \unnumberedno = 10000 \newcount\chapno \newcount\secno \secno=0 \newcount\subsecno \subsecno=0 \newcount\subsubsecno \subsubsecno=0 % This counter is funny since it counts through charcodes of letters A, B, ... \newcount\appendixno \appendixno = `\@ % % \def\appendixletter{\char\the\appendixno} % We do the following ugly conditional instead of the above simple % construct for the sake of pdftex, which needs the actual % letter in the expansion, not just typeset. % \def\appendixletter{% \ifnum\appendixno=`A A% \else\ifnum\appendixno=`B B% \else\ifnum\appendixno=`C C% \else\ifnum\appendixno=`D D% \else\ifnum\appendixno=`E E% \else\ifnum\appendixno=`F F% \else\ifnum\appendixno=`G G% \else\ifnum\appendixno=`H H% \else\ifnum\appendixno=`I I% \else\ifnum\appendixno=`J J% \else\ifnum\appendixno=`K K% \else\ifnum\appendixno=`L L% \else\ifnum\appendixno=`M M% \else\ifnum\appendixno=`N N% \else\ifnum\appendixno=`O O% \else\ifnum\appendixno=`P P% \else\ifnum\appendixno=`Q Q% \else\ifnum\appendixno=`R R% \else\ifnum\appendixno=`S S% \else\ifnum\appendixno=`T T% \else\ifnum\appendixno=`U U% \else\ifnum\appendixno=`V V% \else\ifnum\appendixno=`W W% \else\ifnum\appendixno=`X X% \else\ifnum\appendixno=`Y Y% \else\ifnum\appendixno=`Z Z% % The \the is necessary, despite appearances, because \appendixletter is % expanded while writing the .toc file. \char\appendixno is not % expandable, thus it is written literally, thus all appendixes come out % with the same letter (or @) in the toc without it. \else\char\the\appendixno \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} % Each @chapter defines these (using marks) as the number+name, number % and name of the chapter. Page headings and footings can use % these. @section does likewise. \def\thischapter{} \def\thischapternum{} \def\thischaptername{} \def\thissection{} \def\thissectionnum{} \def\thissectionname{} \newcount\absseclevel % used to calculate proper heading level \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count % @raisesections: treat @section as chapter, @subsection as section, etc. \def\raisesections{\global\advance\secbase by -1} \let\up=\raisesections % original BFox name % @lowersections: treat @chapter as section, @section as subsection, etc. \def\lowersections{\global\advance\secbase by 1} \let\down=\lowersections % original BFox name % we only have subsub. \chardef\maxseclevel = 3 % % A numbered section within an unnumbered changes to unnumbered too. % To achieve this, remember the "biggest" unnum. sec. we are currently in: \chardef\unnlevel = \maxseclevel % % Trace whether the current chapter is an appendix or not: % \chapheadtype is "N" or "A", unnumbered chapters are ignored. \def\chapheadtype{N} % Choose a heading macro % #1 is heading type % #2 is heading level % #3 is text for heading \def\genhead#1#2#3{% % Compute the abs. sec. level: \absseclevel=#2 \advance\absseclevel by \secbase % Make sure \absseclevel doesn't fall outside the range: \ifnum \absseclevel < 0 \absseclevel = 0 \else \ifnum \absseclevel > 3 \absseclevel = 3 \fi \fi % The heading type: \def\headtype{#1}% \if \headtype U% \ifnum \absseclevel < \unnlevel \chardef\unnlevel = \absseclevel \fi \else % Check for appendix sections: \ifnum \absseclevel = 0 \edef\chapheadtype{\headtype}% \else \if \headtype A\if \chapheadtype N% \errmessage{@appendix... within a non-appendix chapter}% \fi\fi \fi % Check for numbered within unnumbered: \ifnum \absseclevel > \unnlevel \def\headtype{U}% \else \chardef\unnlevel = 3 \fi \fi % Now print the heading: \if \headtype U% \ifcase\absseclevel \unnumberedzzz{#3}% \or \unnumberedseczzz{#3}% \or \unnumberedsubseczzz{#3}% \or \unnumberedsubsubseczzz{#3}% \fi \else \if \headtype A% \ifcase\absseclevel \appendixzzz{#3}% \or \appendixsectionzzz{#3}% \or \appendixsubseczzz{#3}% \or \appendixsubsubseczzz{#3}% \fi \else \ifcase\absseclevel \chapterzzz{#3}% \or \seczzz{#3}% \or \numberedsubseczzz{#3}% \or \numberedsubsubseczzz{#3}% \fi \fi \fi \suppressfirstparagraphindent } % an interface: \def\numhead{\genhead N} \def\apphead{\genhead A} \def\unnmhead{\genhead U} % @chapter, @appendix, @unnumbered. Increment top-level counter, reset % all lower-level sectioning counters to zero. % % Also set \chaplevelprefix, which we prepend to @float sequence numbers % (e.g., figures), q.v. By default (before any chapter), that is empty. \let\chaplevelprefix = \empty % \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz \def\chapterzzz#1{% % section resetting is \global in case the chapter is in a group, such % as an @include file. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\chapno by 1 % % Used for \float. \gdef\chaplevelprefix{\the\chapno.}% \resetallfloatnos % % \putwordChapter can contain complex things in translations. \toks0=\expandafter{\putwordChapter}% \message{\the\toks0 \space \the\chapno}% % % Write the actual heading. \chapmacro{#1}{Ynumbered}{\the\chapno}% % % So @section and the like are numbered underneath this chapter. \global\let\section = \numberedsec \global\let\subsection = \numberedsubsec \global\let\subsubsection = \numberedsubsubsec } \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz % \def\appendixzzz#1{% \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\appendixno by 1 \gdef\chaplevelprefix{\appendixletter.}% \resetallfloatnos % % \putwordAppendix can contain complex things in translations. \toks0=\expandafter{\putwordAppendix}% \message{\the\toks0 \space \appendixletter}% % \chapmacro{#1}{Yappendix}{\appendixletter}% % \global\let\section = \appendixsec \global\let\subsection = \appendixsubsec \global\let\subsubsection = \appendixsubsubsec } % normally unnmhead0 calls unnumberedzzz: \outer\parseargdef\unnumbered{\unnmhead0{#1}} \def\unnumberedzzz#1{% \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\unnumberedno by 1 % % Since an unnumbered has no number, no prefix for figures. \global\let\chaplevelprefix = \empty \resetallfloatnos % % This used to be simply \message{#1}, but TeX fully expands the % argument to \message. Therefore, if #1 contained @-commands, TeX % expanded them. For example, in `@unnumbered The @cite{Book}', TeX % expanded @cite (which turns out to cause errors because \cite is meant % to be executed, not expanded). % % Anyway, we don't want the fully-expanded definition of @cite to appear % as a result of the \message, we just want `@cite' itself. We use % \the to achieve this: TeX expands \the only once, % simply yielding the contents of . (We also do this for % the toc entries.) \toks0 = {#1}% \message{(\the\toks0)}% % \chapmacro{#1}{Ynothing}{\the\unnumberedno}% % \global\let\section = \unnumberedsec \global\let\subsection = \unnumberedsubsec \global\let\subsubsection = \unnumberedsubsubsec } % @centerchap is like @unnumbered, but the heading is centered. \outer\parseargdef\centerchap{% % Well, we could do the following in a group, but that would break % an assumption that \chapmacro is called at the outermost level. % Thus we are safer this way: --kasal, 24feb04 \let\centerparametersmaybe = \centerparameters \unnmhead0{#1}% \let\centerparametersmaybe = \relax } % @top is like @unnumbered. \let\top\unnumbered % Sections. % \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz \def\seczzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% } % normally calls appendixsectionzzz: \outer\parseargdef\appendixsection{\apphead1{#1}} \def\appendixsectionzzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% } \let\appendixsec\appendixsection % normally calls unnumberedseczzz: \outer\parseargdef\unnumberedsec{\unnmhead1{#1}} \def\unnumberedseczzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% } % Subsections. % % normally calls numberedsubseczzz: \outer\parseargdef\numberedsubsec{\numhead2{#1}} \def\numberedsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% } % normally calls appendixsubseczzz: \outer\parseargdef\appendixsubsec{\apphead2{#1}} \def\appendixsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Yappendix}% {\appendixletter.\the\secno.\the\subsecno}% } % normally calls unnumberedsubseczzz: \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} \def\unnumberedsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Ynothing}% {\the\unnumberedno.\the\secno.\the\subsecno}% } % Subsubsections. % % normally numberedsubsubseczzz: \outer\parseargdef\numberedsubsubsec{\numhead3{#1}} \def\numberedsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Ynumbered}% {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% } % normally appendixsubsubseczzz: \outer\parseargdef\appendixsubsubsec{\apphead3{#1}} \def\appendixsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Yappendix}% {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% } % normally unnumberedsubsubseczzz: \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} \def\unnumberedsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Ynothing}% {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% } % These macros control what the section commands do, according % to what kind of chapter we are in (ordinary, appendix, or unnumbered). % Define them by default for a numbered chapter. \let\section = \numberedsec \let\subsection = \numberedsubsec \let\subsubsection = \numberedsubsubsec % Define @majorheading, @heading and @subheading \def\majorheading{% {\advance\chapheadingskip by 10pt \chapbreak }% \parsearg\chapheadingzzz } \def\chapheading{\chapbreak \parsearg\chapheadingzzz} \def\chapheadingzzz#1{% \vbox{\chapfonts \raggedtitlesettings #1\par}% \nobreak\bigskip \nobreak \suppressfirstparagraphindent } % @heading, @subheading, @subsubheading. \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{} \suppressfirstparagraphindent} \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{} \suppressfirstparagraphindent} \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} \suppressfirstparagraphindent} % These macros generate a chapter, section, etc. heading only % (including whitespace, linebreaking, etc. around it), % given all the information in convenient, parsed form. % Args are the skip and penalty (usually negative) \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} % Parameter controlling skip before chapter headings (if needed) \newskip\chapheadingskip % Define plain chapter starts, and page on/off switching for it. \def\chapbreak{\dobreak \chapheadingskip {-4000}} \def\chappager{\par\vfill\supereject} % Because \domark is called before \chapoddpage, the filler page will % get the headings for the next chapter, which is wrong. But we don't % care -- we just disable all headings on the filler page. \def\chapoddpage{% \chappager \ifodd\pageno \else \begingroup \headingsoff \null \chappager \endgroup \fi } \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} \def\CHAPPAGoff{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chapbreak \global\let\pagealignmacro=\chappager} \def\CHAPPAGon{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chappager \global\let\pagealignmacro=\chappager \global\def\HEADINGSon{\HEADINGSsingle}} \def\CHAPPAGodd{% \global\let\contentsalignmacro = \chapoddpage \global\let\pchapsepmacro=\chapoddpage \global\let\pagealignmacro=\chapoddpage \global\def\HEADINGSon{\HEADINGSdouble}} \CHAPPAGon % Chapter opening. % % #1 is the text, #2 is the section type (Ynumbered, Ynothing, % Yappendix, Yomitfromtoc), #3 the chapter number. % % To test against our argument. \def\Ynothingkeyword{Ynothing} \def\Yomitfromtockeyword{Yomitfromtoc} \def\Yappendixkeyword{Yappendix} % \def\chapmacro#1#2#3{% % Insert the first mark before the heading break (see notes for \domark). \let\prevchapterdefs=\lastchapterdefs \let\prevsectiondefs=\lastsectiondefs \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% \gdef\thissection{}}% % \def\temptype{#2}% \ifx\temptype\Ynothingkeyword \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% \gdef\thischapter{\thischaptername}}% \else\ifx\temptype\Yomitfromtockeyword \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% \gdef\thischapter{}}% \else\ifx\temptype\Yappendixkeyword \toks0={#1}% \xdef\lastchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\appendixletter}% % \noexpand\putwordAppendix avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thischapter{\noexpand\putwordAppendix{} \noexpand\thischapternum: \noexpand\thischaptername}% }% \else \toks0={#1}% \xdef\lastchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\the\chapno}% % \noexpand\putwordChapter avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thischapter{\noexpand\putwordChapter{} \noexpand\thischapternum: \noexpand\thischaptername}% }% \fi\fi\fi % % Output the mark. Pass it through \safewhatsit, to take care of % the preceding space. \safewhatsit\domark % % Insert the chapter heading break. \pchapsepmacro % % Now the second mark, after the heading break. No break points % between here and the heading. \let\prevchapterdefs=\lastchapterdefs \let\prevsectiondefs=\lastsectiondefs \domark % {% \chapfonts \rmisbold % % Have to define \lastsection before calling \donoderef, because the % xref code eventually uses it. On the other hand, it has to be called % after \pchapsepmacro, or the headline will change too soon. \gdef\lastsection{#1}% % % Only insert the separating space if we have a chapter/appendix % number, and don't print the unnumbered ``number''. \ifx\temptype\Ynothingkeyword \setbox0 = \hbox{}% \def\toctype{unnchap}% \else\ifx\temptype\Yomitfromtockeyword \setbox0 = \hbox{}% contents like unnumbered, but no toc entry \def\toctype{omit}% \else\ifx\temptype\Yappendixkeyword \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% \def\toctype{app}% \else \setbox0 = \hbox{#3\enspace}% \def\toctype{numchap}% \fi\fi\fi % % Write the toc entry for this chapter. Must come before the % \donoderef, because we include the current node name in the toc % entry, and \donoderef resets it to empty. \writetocentry{\toctype}{#1}{#3}% % % For pdftex, we have to write out the node definition (aka, make % the pdfdest) after any page break, but before the actual text has % been typeset. If the destination for the pdf outline is after the % text, then jumping from the outline may wind up with the text not % being visible, for instance under high magnification. \donoderef{#2}% % % Typeset the actual heading. \nobreak % Avoid page breaks at the interline glue. \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe \unhbox0 #1\par}% }% \nobreak\bigskip % no page break after a chapter title \nobreak } % @centerchap -- centered and unnumbered. \let\centerparametersmaybe = \relax \def\centerparameters{% \advance\rightskip by 3\rightskip \leftskip = \rightskip \parfillskip = 0pt } % I don't think this chapter style is supported any more, so I'm not % updating it with the new noderef stuff. We'll see. --karl, 11aug03. % \def\setchapterstyle #1 {\csname CHAPF#1\endcsname} % \def\unnchfopen #1{% \chapoddpage \vbox{\chapfonts \raggedtitlesettings #1\par}% \nobreak\bigskip\nobreak } \def\chfopen #1#2{\chapoddpage {\chapfonts \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% \par\penalty 5000 % } \def\centerchfopen #1{% \chapoddpage \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}% \nobreak\bigskip \nobreak } \def\CHAPFopen{% \global\let\chapmacro=\chfopen \global\let\centerchapmacro=\centerchfopen} % Section titles. These macros combine the section number parts and % call the generic \sectionheading to do the printing. % \newskip\secheadingskip \def\secheadingbreak{\dobreak \secheadingskip{-1000}} % Subsection titles. \newskip\subsecheadingskip \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}} % Subsubsection titles. \def\subsubsecheadingskip{\subsecheadingskip} \def\subsubsecheadingbreak{\subsecheadingbreak} % Print any size, any type, section title. % % #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is % the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the % section number. % \def\seckeyword{sec} % \def\sectionheading#1#2#3#4{% {% \checkenv{}% should not be in an environment. % % Switch to the right set of fonts. \csname #2fonts\endcsname \rmisbold % \def\sectionlevel{#2}% \def\temptype{#3}% % % Insert first mark before the heading break (see notes for \domark). \let\prevsectiondefs=\lastsectiondefs \ifx\temptype\Ynothingkeyword \ifx\sectionlevel\seckeyword \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% \gdef\thissection{\thissectionname}}% \fi \else\ifx\temptype\Yomitfromtockeyword % Don't redefine \thissection. \else\ifx\temptype\Yappendixkeyword \ifx\sectionlevel\seckeyword \toks0={#1}% \xdef\lastsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% % \noexpand\putwordSection avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thissection{\noexpand\putwordSection{} \noexpand\thissectionnum: \noexpand\thissectionname}% }% \fi \else \ifx\sectionlevel\seckeyword \toks0={#1}% \xdef\lastsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% % \noexpand\putwordSection avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thissection{\noexpand\putwordSection{} \noexpand\thissectionnum: \noexpand\thissectionname}% }% \fi \fi\fi\fi % % Go into vertical mode. Usually we'll already be there, but we % don't want the following whatsit to end up in a preceding paragraph % if the document didn't happen to have a blank line. \par % % Output the mark. Pass it through \safewhatsit, to take care of % the preceding space. \safewhatsit\domark % % Insert space above the heading. \csname #2headingbreak\endcsname % % Now the second mark, after the heading break. No break points % between here and the heading. \let\prevsectiondefs=\lastsectiondefs \domark % % Only insert the space after the number if we have a section number. \ifx\temptype\Ynothingkeyword \setbox0 = \hbox{}% \def\toctype{unn}% \gdef\lastsection{#1}% \else\ifx\temptype\Yomitfromtockeyword % for @headings -- no section number, don't include in toc, % and don't redefine \lastsection. \setbox0 = \hbox{}% \def\toctype{omit}% \let\sectionlevel=\empty \else\ifx\temptype\Yappendixkeyword \setbox0 = \hbox{#4\enspace}% \def\toctype{app}% \gdef\lastsection{#1}% \else \setbox0 = \hbox{#4\enspace}% \def\toctype{num}% \gdef\lastsection{#1}% \fi\fi\fi % % Write the toc entry (before \donoderef). See comments in \chapmacro. \writetocentry{\toctype\sectionlevel}{#1}{#4}% % % Write the node reference (= pdf destination for pdftex). % Again, see comments in \chapmacro. \donoderef{#3}% % % Interline glue will be inserted when the vbox is completed. % That glue will be a valid breakpoint for the page, since it'll be % preceded by a whatsit (usually from the \donoderef, or from the % \writetocentry if there was no node). We don't want to allow that % break, since then the whatsits could end up on page n while the % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000. \nobreak % % Output the actual section heading. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright \hangindent=\wd0 % zero if no section number \unhbox0 #1}% }% % Add extra space after the heading -- half of whatever came above it. % Don't allow stretch, though. \kern .5 \csname #2headingskip\endcsname % % Do not let the kern be a potential breakpoint, as it would be if it % was followed by glue. \nobreak % % We'll almost certainly start a paragraph next, so don't let that % glue accumulate. (Not a breakpoint because it's preceded by a % discardable item.) However, when a paragraph is not started next % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out % or the negative glue will cause weirdly wrong output, typically % obscuring the section heading with something else. \vskip-\parskip % % This is so the last item on the main vertical list is a known % \penalty > 10000, so \startdefun, etc., can recognize the situation % and do the needful. \penalty 10001 } \message{toc,} % Table of contents. \newwrite\tocfile % Write an entry to the toc file, opening it if necessary. % Called from @chapter, etc. % % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno} % We append the current node name (if any) and page number as additional % arguments for the \{chap,sec,...}entry macros which will eventually % read this. The node name is used in the pdf outlines as the % destination to jump to. % % We open the .toc file for writing here instead of at @setfilename (or % any other fixed time) so that @contents can be anywhere in the document. % But if #1 is `omit', then we don't do anything. This is used for the % table of contents chapter openings themselves. % \newif\iftocfileopened \def\omitkeyword{omit}% % \def\writetocentry#1#2#3{% \edef\writetoctype{#1}% \ifx\writetoctype\omitkeyword \else \iftocfileopened\else \immediate\openout\tocfile = \jobname.toc \global\tocfileopenedtrue \fi % \iflinks {\atdummies \edef\temp{% \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}% \temp }% \fi \fi % % Tell \shipout to create a pdf destination on each page, if we're % writing pdf. These are used in the table of contents. We can't % just write one on every page because the title pages are numbered % 1 and 2 (the page numbers aren't printed), and so are the first % two pages of the document. Thus, we'd have two destinations named % `1', and two named `2'. \ifpdf \global\pdfmakepagedesttrue \fi } % These characters do not print properly in the Computer Modern roman % fonts, so we must take special care. This is more or less redundant % with the Texinfo input format setup at the end of this file. % \def\activecatcodes{% \catcode`\"=\active \catcode`\$=\active \catcode`\<=\active \catcode`\>=\active \catcode`\\=\active \catcode`\^=\active \catcode`\_=\active \catcode`\|=\active \catcode`\~=\active } % Read the toc file, which is essentially Texinfo input. \def\readtocfile{% \setupdatafile \activecatcodes \input \tocreadfilename } \newskip\contentsrightmargin \contentsrightmargin=1in \newcount\savepageno \newcount\lastnegativepageno \lastnegativepageno = -1 % Prepare to read what we've written to \tocfile. % \def\startcontents#1{% % If @setchapternewpage on, and @headings double, the contents should % start on an odd page, unlike chapters. Thus, we maintain % \contentsalignmacro in parallel with \pagealignmacro. % From: Torbjorn Granlund \contentsalignmacro \immediate\closeout\tocfile % % Don't need to put `Contents' or `Short Contents' in the headline. % It is abundantly clear what they are. \chapmacro{#1}{Yomitfromtoc}{}% % \savepageno = \pageno \begingroup % Set up to handle contents files properly. \raggedbottom % Worry more about breakpoints than the bottom. \advance\hsize by -\contentsrightmargin % Don't use the full line length. % % Roman numerals for page numbers. \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi } % redefined for the two-volume lispref. We always output on % \jobname.toc even if this is redefined. % \def\tocreadfilename{\jobname.toc} % Normal (long) toc. % \def\contents{% \startcontents{\putwordTOC}% \openin 1 \tocreadfilename\space \ifeof 1 \else \readtocfile \fi \vfill \eject \contentsalignmacro % in case @setchapternewpage odd is in effect \ifeof 1 \else \pdfmakeoutlines \fi \closein 1 \endgroup \lastnegativepageno = \pageno \global\pageno = \savepageno } % And just the chapters. \def\summarycontents{% \startcontents{\putwordShortTOC}% % \let\partentry = \shortpartentry \let\numchapentry = \shortchapentry \let\appentry = \shortchapentry \let\unnchapentry = \shortunnchapentry % We want a true roman here for the page numbers. \secfonts \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl \let\tt=\shortconttt \rm \hyphenpenalty = 10000 \advance\baselineskip by 1pt % Open it up a little. \def\numsecentry##1##2##3##4{} \let\appsecentry = \numsecentry \let\unnsecentry = \numsecentry \let\numsubsecentry = \numsecentry \let\appsubsecentry = \numsecentry \let\unnsubsecentry = \numsecentry \let\numsubsubsecentry = \numsecentry \let\appsubsubsecentry = \numsecentry \let\unnsubsubsecentry = \numsecentry \openin 1 \tocreadfilename\space \ifeof 1 \else \readtocfile \fi \closein 1 \vfill \eject \contentsalignmacro % in case @setchapternewpage odd is in effect \endgroup \lastnegativepageno = \pageno \global\pageno = \savepageno } \let\shortcontents = \summarycontents % Typeset the label for a chapter or appendix for the short contents. % The arg is, e.g., `A' for an appendix, or `3' for a chapter. % \def\shortchaplabel#1{% % This space should be enough, since a single number is .5em, and the % widest letter (M) is 1em, at least in the Computer Modern fonts. % But use \hss just in case. % (This space doesn't include the extra space that gets added after % the label; that gets put in by \shortchapentry above.) % % We'd like to right-justify chapter numbers, but that looks strange % with appendix letters. And right-justifying numbers and % left-justifying letters looks strange when there is less than 10 % chapters. Have to read the whole toc once to know how many chapters % there are before deciding ... \hbox to 1em{#1\hss}% } % These macros generate individual entries in the table of contents. % The first argument is the chapter or section name. % The last argument is the page number. % The arguments in between are the chapter number, section number, ... % Parts, in the main contents. Replace the part number, which doesn't % exist, with an empty box. Let's hope all the numbers have the same width. % Also ignore the page number, which is conventionally not printed. \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}} \def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}} % % Parts, in the short toc. \def\shortpartentry#1#2#3#4{% \penalty-300 \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip \shortchapentry{{\bf #1}}{\numeralbox}{}{}% } % Chapters, in the main contents. \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} % % Chapters, in the short toc. % See comments in \dochapentry re vbox and related settings. \def\shortchapentry#1#2#3#4{% \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}% } % Appendices, in the main contents. % Need the word Appendix, and a fixed-size box. % \def\appendixbox#1{% % We use M since it's probably the widest letter. \setbox0 = \hbox{\putwordAppendix{} M}% \hbox to \wd0{\putwordAppendix{} #1\hss}} % \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}} % Unnumbered chapters. \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}} % Sections. \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} \let\appsecentry=\numsecentry \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} % Subsections. \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} \let\appsubsecentry=\numsubsecentry \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} % And subsubsections. \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} \let\appsubsubsecentry=\numsubsubsecentry \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} % This parameter controls the indentation of the various levels. % Same as \defaultparindent. \newdimen\tocindent \tocindent = 15pt % Now for the actual typesetting. In all these, #1 is the text and #2 is the % page number. % % If the toc has to be broken over pages, we want it to be at chapters % if at all possible; hence the \penalty. \def\dochapentry#1#2{% \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip \begingroup \chapentryfonts \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup \nobreak\vskip .25\baselineskip plus.1\baselineskip } \def\dosecentry#1#2{\begingroup \secentryfonts \leftskip=\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} \def\dosubsecentry#1#2{\begingroup \subsecentryfonts \leftskip=2\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} \def\dosubsubsecentry#1#2{\begingroup \subsubsecentryfonts \leftskip=3\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} % We use the same \entry macro as for the index entries. \let\tocentry = \entry % Space between chapter (or whatever) number and the title. \def\labelspace{\hskip1em \relax} \def\dopageno#1{{\rm #1}} \def\doshortpageno#1{{\rm #1}} \def\chapentryfonts{\secfonts \rm} \def\secentryfonts{\textfonts} \def\subsecentryfonts{\textfonts} \def\subsubsecentryfonts{\textfonts} \message{environments,} % @foo ... @end foo. % @tex ... @end tex escapes into raw TeX temporarily. % One exception: @ is still an escape character, so that @end tex works. % But \@ or @@ will get a plain @ character. \envdef\tex{% \setupmarkupstyle{tex}% \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie \catcode `\%=14 \catcode `\+=\other \catcode `\"=\other \catcode `\|=\other \catcode `\<=\other \catcode `\>=\other \catcode`\`=\other \catcode`\'=\other \escapechar=`\\ % % ' is active in math mode (mathcode"8000). So reset it, and all our % other math active characters (just in case), to plain's definitions. \mathactive % \let\b=\ptexb \let\bullet=\ptexbullet \let\c=\ptexc \let\,=\ptexcomma \let\.=\ptexdot \let\dots=\ptexdots \let\equiv=\ptexequiv \let\!=\ptexexclam \let\i=\ptexi \let\indent=\ptexindent \let\noindent=\ptexnoindent \let\{=\ptexlbrace \let\+=\tabalign \let\}=\ptexrbrace \let\/=\ptexslash \let\*=\ptexstar \let\t=\ptext \expandafter \let\csname top\endcsname=\ptextop % outer \let\frenchspacing=\plainfrenchspacing % \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% \def\@{@}% } % There is no need to define \Etex. % Define @lisp ... @end lisp. % @lisp environment forms a group so it can rebind things, % including the definition of @end lisp (which normally is erroneous). % Amount to narrow the margins by for @lisp. \newskip\lispnarrowing \lispnarrowing=0.4in % This is the definition that ^^M gets inside @lisp, @example, and other % such environments. \null is better than a space, since it doesn't % have any width. \def\lisppar{\null\endgraf} % This space is always present above and below environments. \newskip\envskipamount \envskipamount = 0pt % Make spacing and below environment symmetrical. We use \parskip here % to help in doing that, since in @example-like environments \parskip % is reset to zero; thus the \afterenvbreak inserts no space -- but the % start of the next paragraph will insert \parskip. % \def\aboveenvbreak{{% % =10000 instead of <10000 because of a special case in \itemzzz and % \sectionheading, q.v. \ifnum \lastpenalty=10000 \else \advance\envskipamount by \parskip \endgraf \ifdim\lastskip<\envskipamount \removelastskip % it's not a good place to break if the last penalty was \nobreak % or better ... \ifnum\lastpenalty<10000 \penalty-50 \fi \vskip\envskipamount \fi \fi }} \let\afterenvbreak = \aboveenvbreak % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will % also clear it, so that its embedded environments do the narrowing again. \let\nonarrowing=\relax % @cartouche ... @end cartouche: draw rectangle w/rounded corners around % environment contents. \font\circle=lcircle10 \newdimen\circthick \newdimen\cartouter\newdimen\cartinner \newskip\normbskip\newskip\normpskip\newskip\normlskip \circthick=\fontdimen8\circle % \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth \def\ctr{{\hskip 6pt\circle\char'010}} \def\cbl{{\circle\char'012\hskip -6pt}} \def\cbr{{\hskip 6pt\circle\char'011}} \def\carttop{\hbox to \cartouter{\hskip\lskip \ctl\leaders\hrule height\circthick\hfil\ctr \hskip\rskip}} \def\cartbot{\hbox to \cartouter{\hskip\lskip \cbl\leaders\hrule height\circthick\hfil\cbr \hskip\rskip}} % \newskip\lskip\newskip\rskip \envdef\cartouche{% \ifhmode\par\fi % can't be in the midst of a paragraph. \startsavinginserts \lskip=\leftskip \rskip=\rightskip \leftskip=0pt\rightskip=0pt % we want these *outside*. \cartinner=\hsize \advance\cartinner by-\lskip \advance\cartinner by-\rskip \cartouter=\hsize \advance\cartouter by 18.4pt % allow for 3pt kerns on either % side, and for 6pt waste from % each corner char, and rule thickness \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip % Flag to tell @lisp, etc., not to narrow margin. \let\nonarrowing = t% % % If this cartouche directly follows a sectioning command, we need the % \parskip glue (backspaced over by default) or the cartouche can % collide with the section heading. \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi % \vbox\bgroup \baselineskip=0pt\parskip=0pt\lineskip=0pt \carttop \hbox\bgroup \hskip\lskip \vrule\kern3pt \vbox\bgroup \kern3pt \hsize=\cartinner \baselineskip=\normbskip \lineskip=\normlskip \parskip=\normpskip \vskip -\parskip \comment % For explanation, see the end of def\group. } \def\Ecartouche{% \ifhmode\par\fi \kern3pt \egroup \kern3pt\vrule \hskip\rskip \egroup \cartbot \egroup \checkinserts } % This macro is called at the beginning of all the @example variants, % inside a group. \newdimen\nonfillparindent \def\nonfillstart{% \aboveenvbreak \hfuzz = 12pt % Don't be fussy \sepspaces % Make spaces be word-separators rather than space tokens. \let\par = \lisppar % don't ignore blank lines \obeylines % each line of input is a line of output \parskip = 0pt % Turn off paragraph indentation but redefine \indent to emulate % the normal \indent. \nonfillparindent=\parindent \parindent = 0pt \let\indent\nonfillindent % \emergencystretch = 0pt % don't try to avoid overfull boxes \ifx\nonarrowing\relax \advance \leftskip by \lispnarrowing \exdentamount=\lispnarrowing \else \let\nonarrowing = \relax \fi \let\exdent=\nofillexdent } \begingroup \obeyspaces % We want to swallow spaces (but not other tokens) after the fake % @indent in our nonfill-environments, where spaces are normally % active and set to @tie, resulting in them not being ignored after % @indent. \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}% \gdef\nonfillindentcheck{% \ifx\temp % \expandafter\nonfillindentgobble% \else% \leavevmode\nonfillindentbox% \fi% }% \endgroup \def\nonfillindentgobble#1{\nonfillindent} \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}} % If you want all examples etc. small: @set dispenvsize small. % If you want even small examples the full size: @set dispenvsize nosmall. % This affects the following displayed environments: % @example, @display, @format, @lisp % \def\smallword{small} \def\nosmallword{nosmall} \let\SETdispenvsize\relax \def\setnormaldispenv{% \ifx\SETdispenvsize\smallword % end paragraph for sake of leading, in case document has no blank % line. This is redundant with what happens in \aboveenvbreak, but % we need to do it before changing the fonts, and it's inconvenient % to change the fonts afterward. \ifnum \lastpenalty=10000 \else \endgraf \fi \smallexamplefonts \rm \fi } \def\setsmalldispenv{% \ifx\SETdispenvsize\nosmallword \else \ifnum \lastpenalty=10000 \else \endgraf \fi \smallexamplefonts \rm \fi } % We often define two environments, @foo and @smallfoo. % Let's do it in one command. #1 is the env name, #2 the definition. \def\makedispenvdef#1#2{% \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}% \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}% \expandafter\let\csname E#1\endcsname \afterenvbreak \expandafter\let\csname Esmall#1\endcsname \afterenvbreak } % Define two environment synonyms (#1 and #2) for an environment. \def\maketwodispenvdef#1#2#3{% \makedispenvdef{#1}{#3}% \makedispenvdef{#2}{#3}% } % % @lisp: indented, narrowed, typewriter font; % @example: same as @lisp. % % @smallexample and @smalllisp: use smaller fonts. % Originally contributed by Pavel@xerox. % \maketwodispenvdef{lisp}{example}{% \nonfillstart \tt\setupmarkupstyle{example}% \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. \gobble % eat return } % @display/@smalldisplay: same as @lisp except keep current font. % \makedispenvdef{display}{% \nonfillstart \gobble } % @format/@smallformat: same as @display except don't narrow margins. % \makedispenvdef{format}{% \let\nonarrowing = t% \nonfillstart \gobble } % @flushleft: same as @format, but doesn't obey \SETdispenvsize. \envdef\flushleft{% \let\nonarrowing = t% \nonfillstart \gobble } \let\Eflushleft = \afterenvbreak % @flushright. % \envdef\flushright{% \let\nonarrowing = t% \nonfillstart \advance\leftskip by 0pt plus 1fill\relax \gobble } \let\Eflushright = \afterenvbreak % @raggedright does more-or-less normal line breaking but no right % justification. From plain.tex. \envdef\raggedright{% \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax } \let\Eraggedright\par \envdef\raggedleft{% \parindent=0pt \leftskip0pt plus2em \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt \hbadness=10000 % Last line will usually be underfull, so turn off % badness reporting. } \let\Eraggedleft\par \envdef\raggedcenter{% \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt \hbadness=10000 % Last line will usually be underfull, so turn off % badness reporting. } \let\Eraggedcenter\par % @quotation does normal linebreaking (hence we can't use \nonfillstart) % and narrows the margins. We keep \parskip nonzero in general, since % we're doing normal filling. So, when using \aboveenvbreak and % \afterenvbreak, temporarily make \parskip 0. % \makedispenvdef{quotation}{\quotationstart} % \def\quotationstart{% \indentedblockstart % same as \indentedblock, but increase right margin too. \ifx\nonarrowing\relax \advance\rightskip by \lispnarrowing \fi \parsearg\quotationlabel } % We have retained a nonzero parskip for the environment, since we're % doing normal filling. % \def\Equotation{% \par \ifx\quotationauthor\thisisundefined\else % indent a bit. \leftline{\kern 2\leftskip \sl ---\quotationauthor}% \fi {\parskip=0pt \afterenvbreak}% } \def\Esmallquotation{\Equotation} % If we're given an argument, typeset it in bold with a colon after. \def\quotationlabel#1{% \def\temp{#1}% \ifx\temp\empty \else {\bf #1: }% \fi } % @indentedblock is like @quotation, but indents only on the left and % has no optional argument. % \makedispenvdef{indentedblock}{\indentedblockstart} % \def\indentedblockstart{% {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip \parindent=0pt % % @cartouche defines \nonarrowing to inhibit narrowing at next level down. \ifx\nonarrowing\relax \advance\leftskip by \lispnarrowing \exdentamount = \lispnarrowing \else \let\nonarrowing = \relax \fi } % Keep a nonzero parskip for the environment, since we're doing normal filling. % \def\Eindentedblock{% \par {\parskip=0pt \afterenvbreak}% } \def\Esmallindentedblock{\Eindentedblock} % LaTeX-like @verbatim...@end verbatim and @verb{...} % If we want to allow any as delimiter, % we need the curly braces so that makeinfo sees the @verb command, eg: % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org % % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. % % [Knuth] p.344; only we need to do the other characters Texinfo sets % active too. Otherwise, they get lost as the first character on a % verbatim line. \def\dospecials{% \do\ \do\\\do\{\do\}\do\$\do\&% \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% \do\<\do\>\do\|\do\@\do+\do\"% % Don't do the quotes -- if we do, @set txicodequoteundirected and % @set txicodequotebacktick will not have effect on @verb and % @verbatim, and ?` and !` ligatures won't get disabled. %\do\`\do\'% } % % [Knuth] p. 380 \def\uncatcodespecials{% \def\do##1{\catcode`##1=\other}\dospecials} % % Setup for the @verb command. % % Eight spaces for a tab \begingroup \catcode`\^^I=\active \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }} \endgroup % \def\setupverb{% \tt % easiest (and conventionally used) font for verbatim \def\par{\leavevmode\endgraf}% \setupmarkupstyle{verb}% \tabeightspaces % Respect line breaks, % print special symbols as themselves, and % make each space count % must do in this order: \obeylines \uncatcodespecials \sepspaces } % Setup for the @verbatim environment % % Real tab expansion. \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount % % We typeset each line of the verbatim in an \hbox, so we can handle % tabs. The \global is in case the verbatim line starts with an accent, % or some other command that starts with a begin-group. Otherwise, the % entire \verbbox would disappear at the corresponding end-group, before % it is typeset. Meanwhile, we can't have nested verbatim commands % (can we?), so the \global won't be overwriting itself. \newbox\verbbox \def\starttabbox{\global\setbox\verbbox=\hbox\bgroup} % \begingroup \catcode`\^^I=\active \gdef\tabexpand{% \catcode`\^^I=\active \def^^I{\leavevmode\egroup \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab \divide\dimen\verbbox by\tabw \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox }% } \endgroup % start the verbatim environment. \def\setupverbatim{% \let\nonarrowing = t% \nonfillstart \tt % easiest (and conventionally used) font for verbatim % The \leavevmode here is for blank lines. Otherwise, we would % never \starttabox and the \egroup would end verbatim mode. \def\par{\leavevmode\egroup\box\verbbox\endgraf}% \tabexpand \setupmarkupstyle{verbatim}% % Respect line breaks, % print special symbols as themselves, and % make each space count. % Must do in this order: \obeylines \uncatcodespecials \sepspaces \everypar{\starttabbox}% } % Do the @verb magic: verbatim text is quoted by unique % delimiter characters. Before first delimiter expect a % right brace, after last delimiter expect closing brace: % % \def\doverb'{'#1'}'{#1} % % [Knuth] p. 382; only eat outer {} \begingroup \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] \endgroup % \def\verb{\begingroup\setupverb\doverb} % % % Do the @verbatim magic: define the macro \doverbatim so that % the (first) argument ends when '@end verbatim' is reached, ie: % % \def\doverbatim#1@end verbatim{#1} % % For Texinfo it's a lot easier than for LaTeX, % because texinfo's \verbatim doesn't stop at '\end{verbatim}': % we need not redefine '\', '{' and '}'. % % Inspired by LaTeX's verbatim command set [latex.ltx] % \begingroup \catcode`\ =\active \obeylines % % ignore everything up to the first ^^M, that's the newline at the end % of the @verbatim input line itself. Otherwise we get an extra blank % line in the output. \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% % We really want {...\end verbatim} in the body of the macro, but % without the active space; thus we have to use \xdef and \gobble. \endgroup % \envdef\verbatim{% \setupverbatim\doverbatim } \let\Everbatim = \afterenvbreak % @verbatiminclude FILE - insert text of file in verbatim environment. % \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude} % \def\doverbatiminclude#1{% {% \makevalueexpandable \setupverbatim \indexnofonts % Allow `@@' and other weird things in file names. \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}% \input #1 \afterenvbreak }% } % @copying ... @end copying. % Save the text away for @insertcopying later. % % We save the uninterpreted tokens, rather than creating a box. % Saving the text in a box would be much easier, but then all the % typesetting commands (@smallbook, font changes, etc.) have to be done % beforehand -- and a) we want @copying to be done first in the source % file; b) letting users define the frontmatter in as flexible order as % possible is very desirable. % \def\copying{\checkenv{}\begingroup\scanargctxt\docopying} \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} % \def\insertcopying{% \begingroup \parindent = 0pt % paragraph indentation looks wrong on title page \scanexp\copyingtext \endgroup } \message{defuns,} % @defun etc. \newskip\defbodyindent \defbodyindent=.4in \newskip\defargsindent \defargsindent=50pt \newskip\deflastargmargin \deflastargmargin=18pt \newcount\defunpenalty % Start the processing of @deffn: \def\startdefun{% \ifnum\lastpenalty<10000 \medbreak \defunpenalty=10003 % Will keep this @deffn together with the % following @def command, see below. \else % If there are two @def commands in a row, we'll have a \nobreak, % which is there to keep the function description together with its % header. But if there's nothing but headers, we need to allow a % break somewhere. Check specifically for penalty 10002, inserted % by \printdefunline, instead of 10000, since the sectioning % commands also insert a nobreak penalty, and we don't want to allow % a break between a section heading and a defun. % % As a further refinement, we avoid "club" headers by signalling % with penalty of 10003 after the very first @deffn in the % sequence (see above), and penalty of 10002 after any following % @def command. \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi % % Similarly, after a section heading, do not allow a break. % But do insert the glue. \medskip % preceded by discardable penalty, so not a breakpoint \fi % \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent } \def\dodefunx#1{% % First, check whether we are in the right environment: \checkenv#1% % % As above, allow line break if we have multiple x headers in a row. % It's not a great place, though. \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi % % And now, it's time to reuse the body of the original defun: \expandafter\gobbledefun#1% } \def\gobbledefun#1\startdefun{} % \printdefunline \deffnheader{text} % \def\printdefunline#1#2{% \begingroup % call \deffnheader: #1#2 \endheader % common ending: \interlinepenalty = 10000 \advance\rightskip by 0pt plus 1fil\relax \endgraf \nobreak\vskip -\parskip \penalty\defunpenalty % signal to \startdefun and \dodefunx % Some of the @defun-type tags do not enable magic parentheses, % rendering the following check redundant. But we don't optimize. \checkparencounts \endgroup } \def\Edefun{\endgraf\medbreak} % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; % the only thing remaining is to define \deffnheader. % \def\makedefun#1{% \expandafter\let\csname E#1\endcsname = \Edefun \edef\temp{\noexpand\domakedefun \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% \temp } % \domakedefun \deffn \deffnx \deffnheader % % Define \deffn and \deffnx, without parameters. % \deffnheader has to be defined explicitly. % \def\domakedefun#1#2#3{% \envdef#1{% \startdefun \doingtypefnfalse % distinguish typed functions from all else \parseargusing\activeparens{\printdefunline#3}% }% \def#2{\dodefunx#1}% \def#3% } \newif\ifdoingtypefn % doing typed function? \newif\ifrettypeownline % typeset return type on its own line? % @deftypefnnewline on|off says whether the return type of typed functions % are printed on their own line. This affects @deftypefn, @deftypefun, % @deftypeop, and @deftypemethod. % \parseargdef\deftypefnnewline{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETtxideftypefnnl\endcsname = \empty \else\ifx\temp\offword \expandafter\let\csname SETtxideftypefnnl\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @txideftypefnnl value `\temp', must be on|off}% \fi\fi } % Untyped functions: % @deffn category name args \makedefun{deffn}{\deffngeneral{}} % @deffn category class name args \makedefun{defop}#1 {\defopon{#1\ \putwordon}} % \defopon {category on}class name args \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } % \deffngeneral {subind}category name args % \def\deffngeneral#1#2 #3 #4\endheader{% % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. \dosubind{fn}{\code{#3}}{#1}% \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% } % Typed functions: % @deftypefn category type name args \makedefun{deftypefn}{\deftypefngeneral{}} % @deftypeop category class type name args \makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}} % \deftypeopon {category on}class type name args \def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } % \deftypefngeneral {subind}category type name args % \def\deftypefngeneral#1#2 #3 #4 #5\endheader{% \dosubind{fn}{\code{#4}}{#1}% \doingtypefntrue \defname{#2}{#3}{#4}\defunargs{#5\unskip}% } % Typed variables: % @deftypevr category type var args \makedefun{deftypevr}{\deftypecvgeneral{}} % @deftypecv category class type var args \makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}} % \deftypecvof {category of}class type var args \def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} } % \deftypecvgeneral {subind}category type var args % \def\deftypecvgeneral#1#2 #3 #4 #5\endheader{% \dosubind{vr}{\code{#4}}{#1}% \defname{#2}{#3}{#4}\defunargs{#5\unskip}% } % Untyped variables: % @defvr category var args \makedefun{defvr}#1 {\deftypevrheader{#1} {} } % @defcv category class var args \makedefun{defcv}#1 {\defcvof{#1\ \putwordof}} % \defcvof {category of}class var args \def\defcvof#1#2 {\deftypecvof{#1}#2 {} } % Types: % @deftp category name args \makedefun{deftp}#1 #2 #3\endheader{% \doind{tp}{\code{#2}}% \defname{#1}{}{#2}\defunargs{#3\unskip}% } % Remaining @defun-like shortcuts: \makedefun{defun}{\deffnheader{\putwordDeffunc} } \makedefun{defmac}{\deffnheader{\putwordDefmac} } \makedefun{defspec}{\deffnheader{\putwordDefspec} } \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} } \makedefun{defvar}{\defvrheader{\putwordDefvar} } \makedefun{defopt}{\defvrheader{\putwordDefopt} } \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} } \makedefun{defmethod}{\defopon\putwordMethodon} \makedefun{deftypemethod}{\deftypeopon\putwordMethodon} \makedefun{defivar}{\defcvof\putwordInstanceVariableof} \makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof} % \defname, which formats the name of the @def (not the args). % #1 is the category, such as "Function". % #2 is the return type, if any. % #3 is the function name. % % We are followed by (but not passed) the arguments, if any. % \def\defname#1#2#3{% \par % Get the values of \leftskip and \rightskip as they were outside the @def... \advance\leftskip by -\defbodyindent % % Determine if we are typesetting the return type of a typed function % on a line by itself. \rettypeownlinefalse \ifdoingtypefn % doing a typed function specifically? % then check user option for putting return type on its own line: \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else \rettypeownlinetrue \fi \fi % % How we'll format the category name. Putting it in brackets helps % distinguish it from the body text that may end up on the next line % just below it. \def\temp{#1}% \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} % % Figure out line sizes for the paragraph shape. We'll always have at % least two. \tempnum = 2 % % The first line needs space for \box0; but if \rightskip is nonzero, % we need only space for the part of \box0 which exceeds it: \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip % % If doing a return type on its own line, we'll have another line. \ifrettypeownline \advance\tempnum by 1 \def\maybeshapeline{0in \hsize}% \else \def\maybeshapeline{}% \fi % % The continuations: \dimen2=\hsize \advance\dimen2 by -\defargsindent % % The final paragraph shape: \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2 % % Put the category name at the right margin. \noindent \hbox to 0pt{% \hfil\box0 \kern-\hsize % \hsize has to be shortened this way: \kern\leftskip % Intentionally do not respect \rightskip, since we need the space. }% % % Allow all lines to be underfull without complaint: \tolerance=10000 \hbadness=10000 \exdentamount=\defbodyindent {% % defun fonts. We use typewriter by default (used to be bold) because: % . we're printing identifiers, they should be in tt in principle. % . in languages with many accents, such as Czech or French, it's % common to leave accents off identifiers. The result looks ok in % tt, but exceedingly strange in rm. % . we don't want -- and --- to be treated as ligatures. % . this still does not fix the ?` and !` ligatures, but so far no % one has made identifiers using them :). \df \tt \def\temp{#2}% text of the return type \ifx\temp\empty\else \tclose{\temp}% typeset the return type \ifrettypeownline % put return type on its own line; prohibit line break following: \hfil\vadjust{\nobreak}\break \else \space % type on same line, so just followed by a space \fi \fi % no return type #3% output function name }% {\rm\enskip}% hskip 0.5 em of \tenrm % \boldbrax % arguments will be output next, if any. } % Print arguments in slanted roman (not ttsl), inconsistently with using % tt for the name. This is because literal text is sometimes needed in % the argument list (groff manual), and ttsl and tt are not very % distinguishable. Prevent hyphenation at `-' chars. % \def\defunargs#1{% % use sl by default (not ttsl), % tt for the names. \df \sl \hyphenchar\font=0 % % On the other hand, if an argument has two dashes (for instance), we % want a way to get ttsl. We used to recommend @var for that, so % leave the code in, but it's strange for @var to lead to typewriter. % Nowadays we recommend @code, since the difference between a ttsl hyphen % and a tt hyphen is pretty tiny. @code also disables ?` !`. \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}% #1% \sl\hyphenchar\font=45 } % We want ()&[] to print specially on the defun line. % \def\activeparens{% \catcode`\(=\active \catcode`\)=\active \catcode`\[=\active \catcode`\]=\active \catcode`\&=\active } % Make control sequences which act like normal parenthesis chars. \let\lparen = ( \let\rparen = ) % Be sure that we always have a definition for `(', etc. For example, % if the fn name has parens in it, \boldbrax will not be in effect yet, % so TeX would otherwise complain about undefined control sequence. { \activeparens \global\let(=\lparen \global\let)=\rparen \global\let[=\lbrack \global\let]=\rbrack \global\let& = \& \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} \gdef\magicamp{\let&=\amprm} } \newcount\parencount % If we encounter &foo, then turn on ()-hacking afterwards \newif\ifampseen \def\amprm#1 {\ampseentrue{\bf\ }} \def\parenfont{% \ifampseen % At the first level, print parens in roman, % otherwise use the default font. \ifnum \parencount=1 \rm \fi \else % The \sf parens (in \boldbrax) actually are a little bolder than % the contained text. This is especially needed for [ and ] . \sf \fi } \def\infirstlevel#1{% \ifampseen \ifnum\parencount=1 #1% \fi \fi } \def\bfafterword#1 {#1 \bf} \def\opnr{% \global\advance\parencount by 1 {\parenfont(}% \infirstlevel \bfafterword } \def\clnr{% {\parenfont)}% \infirstlevel \sl \global\advance\parencount by -1 } \newcount\brackcount \def\lbrb{% \global\advance\brackcount by 1 {\bf[}% } \def\rbrb{% {\bf]}% \global\advance\brackcount by -1 } \def\checkparencounts{% \ifnum\parencount=0 \else \badparencount \fi \ifnum\brackcount=0 \else \badbrackcount \fi } % these should not use \errmessage; the glibc manual, at least, actually % has such constructs (when documenting function pointers). \def\badparencount{% \message{Warning: unbalanced parentheses in @def...}% \global\parencount=0 } \def\badbrackcount{% \message{Warning: unbalanced square brackets in @def...}% \global\brackcount=0 } \message{macros,} % @macro. % To do this right we need a feature of e-TeX, \scantokens, % which we arrange to emulate with a temporary file in ordinary TeX. \ifx\eTeXversion\thisisundefined \newwrite\macscribble \def\scantokens#1{% \toks0={#1}% \immediate\openout\macscribble=\jobname.tmp \immediate\write\macscribble{\the\toks0}% \immediate\closeout\macscribble \input \jobname.tmp } \fi \def\scanmacro#1{\begingroup \newlinechar`\^^M \let\xeatspaces\eatspaces % % Undo catcode changes of \startcontents and \doprintindex % When called from @insertcopying or (short)caption, we need active % backslash to get it printed correctly. Previously, we had % \catcode`\\=\other instead. We'll see whether a problem appears % with macro expansion. --kasal, 19aug04 \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ % % ... and for \example: \spaceisspace % % The \empty here causes a following catcode 5 newline to be eaten as % part of reading whitespace after a control sequence. It does not % eat a catcode 13 newline. There's no good way to handle the two % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX % would then have different behavior). See the Macro Details node in % the manual for the workaround we recommend for macros and % line-oriented commands. % \scantokens{#1\empty}% \endgroup} \def\scanexp#1{% \edef\temp{\noexpand\scanmacro{#1}}% \temp } \newcount\paramno % Count of parameters \newtoks\macname % Macro name \newif\ifrecursive % Is it recursive? % List of all defined macros in the form % \definedummyword\macro1\definedummyword\macro2... % Currently is also contains all @aliases; the list can be split % if there is a need. \def\macrolist{} % Add the macro to \macrolist \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname} \def\addtomacrolistxxx#1{% \toks0 = \expandafter{\macrolist\definedummyword#1}% \xdef\macrolist{\the\toks0}% } % Utility routines. % This does \let #1 = #2, with \csnames; that is, % \let \csname#1\endcsname = \csname#2\endcsname % (except of course we have to play expansion games). % \def\cslet#1#2{% \expandafter\let \csname#1\expandafter\endcsname \csname#2\endcsname } % Trim leading and trailing spaces off a string. % Concepts from aro-bend problem 15 (see CTAN). {\catcode`\@=11 \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} \def\unbrace#1{#1} \unbrace{\gdef\trim@@@ #1 } #2@{#1} } % Trim a single trailing ^^M off a string. {\catcode`\^^M=\other \catcode`\Q=3% \gdef\eatcr #1{\eatcra #1Q^^MQ}% \gdef\eatcra#1^^MQ{\eatcrb#1Q}% \gdef\eatcrb#1Q#2Q{#1}% } % Macro bodies are absorbed as an argument in a context where % all characters are catcode 10, 11 or 12, except \ which is active % (as in normal texinfo). It is necessary to change the definition of \ % to recognize macro arguments; this is the job of \mbodybackslash. % % Non-ASCII encodings make 8-bit characters active, so un-activate % them to avoid their expansion. Must do this non-globally, to % confine the change to the current group. % % It's necessary to have hard CRs when the macro is executed. This is % done by making ^^M (\endlinechar) catcode 12 when reading the macro % body, and then making it the \newlinechar in \scanmacro. % \def\scanctxt{% used as subroutine \catcode`\"=\other \catcode`\+=\other \catcode`\<=\other \catcode`\>=\other \catcode`\@=\other \catcode`\^=\other \catcode`\_=\other \catcode`\|=\other \catcode`\~=\other \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi } \def\scanargctxt{% used for copying and captions, not macros. \scanctxt \catcode`\\=\other \catcode`\^^M=\other } \def\macrobodyctxt{% used for @macro definitions \scanctxt \catcode`\{=\other \catcode`\}=\other \catcode`\^^M=\other \usembodybackslash } \def\macroargctxt{% used when scanning invocations \scanctxt \catcode`\\=0 } % why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes" % for the single characters \ { }. Thus, we end up with the "commands" % that would be written @\ @{ @} in a Texinfo document. % % We already have @{ and @}. For @\, we define it here, and only for % this purpose, to produce a typewriter backslash (so, the @\ that we % define for @math can't be used with @macro calls): % \def\\{\normalbackslash}% % % We would like to do this for \, too, since that is what makeinfo does. % But it is not possible, because Texinfo already has a command @, for a % cedilla accent. Documents must use @comma{} instead. % % \anythingelse will almost certainly be an error of some kind. % \mbodybackslash is the definition of \ in @macro bodies. % It maps \foo\ => \csname macarg.foo\endcsname => #N % where N is the macro parameter number. % We define \csname macarg.\endcsname to be \realbackslash, so % \\ in macro replacement text gets you a backslash. % {\catcode`@=0 @catcode`@\=@active @gdef@usembodybackslash{@let\=@mbodybackslash} @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} } \expandafter\def\csname macarg.\endcsname{\realbackslash} \def\margbackslash#1{\char`\#1 } \def\macro{\recursivefalse\parsearg\macroxxx} \def\rmacro{\recursivetrue\parsearg\macroxxx} \def\macroxxx#1{% \getargs{#1}% now \macname is the macname and \argl the arglist \ifx\argl\empty % no arguments \paramno=0\relax \else \expandafter\parsemargdef \argl;% \if\paramno>256\relax \ifx\eTeXversion\thisisundefined \errhelp = \EMsimple \errmessage{You need eTeX to compile a file with macros with more than 256 arguments} \fi \fi \fi \if1\csname ismacro.\the\macname\endcsname \message{Warning: redefining \the\macname}% \else \expandafter\ifx\csname \the\macname\endcsname \relax \else \errmessage{Macro name \the\macname\space already defined}\fi \global\cslet{macsave.\the\macname}{\the\macname}% \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% \addtomacrolist{\the\macname}% \fi \begingroup \macrobodyctxt \ifrecursive \expandafter\parsermacbody \else \expandafter\parsemacbody \fi} \parseargdef\unmacro{% \if1\csname ismacro.#1\endcsname \global\cslet{#1}{macsave.#1}% \global\expandafter\let \csname ismacro.#1\endcsname=0% % Remove the macro name from \macrolist: \begingroup \expandafter\let\csname#1\endcsname \relax \let\definedummyword\unmacrodo \xdef\macrolist{\macrolist}% \endgroup \else \errmessage{Macro #1 not defined}% \fi } % Called by \do from \dounmacro on each macro. The idea is to omit any % macro definitions that have been changed to \relax. % \def\unmacrodo#1{% \ifx #1\relax % remove this \else \noexpand\definedummyword \noexpand#1% \fi } % This makes use of the obscure feature that if the last token of a % is #, then the preceding argument is delimited by % an opening brace, and that opening brace is not consumed. \def\getargs#1{\getargsxxx#1{}} \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} \def\getmacname#1 #2\relax{\macname={#1}} \def\getmacargs#1{\def\argl{#1}} % For macro processing make @ a letter so that we can make Texinfo private macro names. \edef\texiatcatcode{\the\catcode`\@} \catcode `@=11\relax % Parse the optional {params} list. Set up \paramno and \paramlist % so \defmacro knows what to do. Define \macarg.BLAH for each BLAH % in the params list to some hook where the argument si to be expanded. If % there are less than 10 arguments that hook is to be replaced by ##N where N % is the position in that list, that is to say the macro arguments are to be % defined `a la TeX in the macro body. % % That gets used by \mbodybackslash (above). % % We need to get `macro parameter char #' into several definitions. % The technique used is stolen from LaTeX: let \hash be something % unexpandable, insert that wherever you need a #, and then redefine % it to # just before using the token list produced. % % The same technique is used to protect \eatspaces till just before % the macro is used. % % If there are 10 or more arguments, a different technique is used, where the % hook remains in the body, and when macro is to be expanded the body is % processed again to replace the arguments. % % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the % argument N value and then \edef the body (nothing else will expand because of % the catcode regime underwhich the body was input). % % If you compile with TeX (not eTeX), and you have macros with 10 or more % arguments, you need that no macro has more than 256 arguments, otherwise an % error is produced. \def\parsemargdef#1;{% \paramno=0\def\paramlist{}% \let\hash\relax \let\xeatspaces\relax \parsemargdefxxx#1,;,% % In case that there are 10 or more arguments we parse again the arguments % list to set new definitions for the \macarg.BLAH macros corresponding to % each BLAH argument. It was anyhow needed to parse already once this list % in order to count the arguments, and as macros with at most 9 arguments % are by far more frequent than macro with 10 or more arguments, defining % twice the \macarg.BLAH macros does not cost too much processing power. \ifnum\paramno<10\relax\else \paramno0\relax \parsemmanyargdef@@#1,;,% 10 or more arguments \fi } \def\parsemargdefxxx#1,{% \if#1;\let\next=\relax \else \let\next=\parsemargdefxxx \advance\paramno by 1 \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname {\xeatspaces{\hash\the\paramno}}% \edef\paramlist{\paramlist\hash\the\paramno,}% \fi\next} \def\parsemmanyargdef@@#1,{% \if#1;\let\next=\relax \else \let\next=\parsemmanyargdef@@ \edef\tempb{\eatspaces{#1}}% \expandafter\def\expandafter\tempa \expandafter{\csname macarg.\tempb\endcsname}% % Note that we need some extra \noexpand\noexpand, this is because we % don't want \the to be expanded in the \parsermacbody as it uses an % \xdef . \expandafter\edef\tempa {\noexpand\noexpand\noexpand\the\toks\the\paramno}% \advance\paramno by 1\relax \fi\next} % These two commands read recursive and nonrecursive macro bodies. % (They're different since rec and nonrec macros end differently.) % \catcode `\@\texiatcatcode \long\def\parsemacbody#1@end macro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% \long\def\parsermacbody#1@end rmacro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% \catcode `\@=11\relax \let\endargs@\relax \let\nil@\relax \def\nilm@{\nil@}% \long\def\nillm@{\nil@}% % This macro is expanded during the Texinfo macro expansion, not during its % definition. It gets all the arguments values and assigns them to macros % macarg.ARGNAME % % #1 is the macro name % #2 is the list of argument names % #3 is the list of argument values \def\getargvals@#1#2#3{% \def\macargdeflist@{}% \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion. \def\paramlist{#2,\nil@}% \def\macroname{#1}% \begingroup \macroargctxt \def\argvaluelist{#3,\nil@}% \def\@tempa{#3}% \ifx\@tempa\empty \setemptyargvalues@ \else \getargvals@@ \fi } % \def\getargvals@@{% \ifx\paramlist\nilm@ % Some sanity check needed here that \argvaluelist is also empty. \ifx\argvaluelist\nillm@ \else \errhelp = \EMsimple \errmessage{Too many arguments in macro `\macroname'!}% \fi \let\next\macargexpandinbody@ \else \ifx\argvaluelist\nillm@ % No more arguments values passed to macro. Set remaining named-arg % macros to empty. \let\next\setemptyargvalues@ \else % pop current arg name into \@tempb \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}% \expandafter\@tempa\expandafter{\paramlist}% % pop current argument value into \@tempc \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}% \expandafter\@tempa\expandafter{\argvaluelist}% % Here \@tempb is the current arg name and \@tempc is the current arg value. % First place the new argument macro definition into \@tempd \expandafter\macname\expandafter{\@tempc}% \expandafter\let\csname macarg.\@tempb\endcsname\relax \expandafter\def\expandafter\@tempe\expandafter{% \csname macarg.\@tempb\endcsname}% \edef\@tempd{\long\def\@tempe{\the\macname}}% \push@\@tempd\macargdeflist@ \let\next\getargvals@@ \fi \fi \next } \def\push@#1#2{% \expandafter\expandafter\expandafter\def \expandafter\expandafter\expandafter#2% \expandafter\expandafter\expandafter{% \expandafter#1#2}% } % Replace arguments by their values in the macro body, and place the result % in macro \@tempa \def\macvalstoargs@{% % To do this we use the property that token registers that are \the'ed % within an \edef expand only once. So we are going to place all argument % values into respective token registers. % % First we save the token context, and initialize argument numbering. \begingroup \paramno0\relax % Then, for each argument number #N, we place the corresponding argument % value into a new token list register \toks#N \expandafter\putargsintokens@\saveparamlist@,;,% % Then, we expand the body so that argument are replaced by their % values. The trick for values not to be expanded themselves is that they % are within tokens and that tokens expand only once in an \edef . \edef\@tempc{\csname mac.\macroname .body\endcsname}% % Now we restore the token stack pointer to free the token list registers % which we have used, but we make sure that expanded body is saved after % group. \expandafter \endgroup \expandafter\def\expandafter\@tempa\expandafter{\@tempc}% } \def\macargexpandinbody@{% %% Define the named-macro outside of this group and then close this group. \expandafter \endgroup \macargdeflist@ % First the replace in body the macro arguments by their values, the result % is in \@tempa . \macvalstoargs@ % Then we point at the \norecurse or \gobble (for recursive) macro value % with \@tempb . \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname % Depending on whether it is recursive or not, we need some tailing % \egroup . \ifx\@tempb\gobble \let\@tempc\relax \else \let\@tempc\egroup \fi % And now we do the real job: \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}% \@tempd } \def\putargsintokens@#1,{% \if#1;\let\next\relax \else \let\next\putargsintokens@ % First we allocate the new token list register, and give it a temporary % alias \@tempb . \toksdef\@tempb\the\paramno % Then we place the argument value into that token list register. \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname \expandafter\@tempb\expandafter{\@tempa}% \advance\paramno by 1\relax \fi \next } % Save the token stack pointer into macro #1 \def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}} % Restore the token stack pointer from number in macro #1 \def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax} % newtoks that can be used non \outer . \def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi} % Tailing missing arguments are set to empty \def\setemptyargvalues@{% \ifx\paramlist\nilm@ \let\next\macargexpandinbody@ \else \expandafter\setemptyargvaluesparser@\paramlist\endargs@ \let\next\setemptyargvalues@ \fi \next } \def\setemptyargvaluesparser@#1,#2\endargs@{% \expandafter\def\expandafter\@tempa\expandafter{% \expandafter\def\csname macarg.#1\endcsname{}}% \push@\@tempa\macargdeflist@ \def\paramlist{#2}% } % #1 is the element target macro % #2 is the list macro % #3,#4\endargs@ is the list value \def\pop@#1#2#3,#4\endargs@{% \def#1{#3}% \def#2{#4}% } \long\def\longpop@#1#2#3,#4\endargs@{% \long\def#1{#3}% \long\def#2{#4}% } % This defines a Texinfo @macro. There are eight cases: recursive and % nonrecursive macros of zero, one, up to nine, and many arguments. % Much magic with \expandafter here. % \xdef is used so that macro definitions will survive the file % they're defined in; @include reads the file inside a group. % \def\defmacro{% \let\hash=##% convert placeholders to macro parameter chars \ifrecursive \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\scanmacro{\temp}}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\braceorline \expandafter\noexpand\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup\noexpand\scanmacro{\temp}}% \else \ifnum\paramno<10\relax % at most 9 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\csname\the\macname xx\endcsname}% \expandafter\xdef\csname\the\macname xx\endcsname##1{% \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter \csname\the\macname xxx\endcsname \paramlist{\egroup\noexpand\scanmacro{\temp}}% \else % 10 or more \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\getargvals@{\the\macname}{\argl}% }% \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble \fi \fi \else \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\braceorline \expandafter\noexpand\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \else % at most 9 \ifnum\paramno<10\relax \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \expandafter\noexpand\csname\the\macname xx\endcsname}% \expandafter\xdef\csname\the\macname xx\endcsname##1{% \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter \csname\the\macname xxx\endcsname \paramlist{% \egroup \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \else % 10 or more: \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\getargvals@{\the\macname}{\argl}% }% \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse \fi \fi \fi} \catcode `\@\texiatcatcode\relax \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} % \braceorline decides whether the next nonwhitespace character is a % {. If so it reads up to the closing }, if not, it reads the whole % line. Whatever was read is then fed to the next control sequence % as an argument (by \parsebrace or \parsearg). % \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} \def\braceorlinexxx{% \ifx\nchar\bgroup\else \expandafter\parsearg \fi \macnamexxx} % @alias. % We need some trickery to remove the optional spaces around the equal % sign. Make them active and then expand them all to nothing. % \def\alias{\parseargusing\obeyspaces\aliasxxx} \def\aliasxxx #1{\aliasyyy#1\relax} \def\aliasyyy #1=#2\relax{% {% \expandafter\let\obeyedspace=\empty \addtomacrolist{#1}% \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}% }% \next } \message{cross references,} \newwrite\auxfile \newif\ifhavexrefs % True if xref values are known. \newif\ifwarnedxrefs % True if we warned once that they aren't known. % @inforef is relatively simple. \def\inforef #1{\inforefzzz #1,,,,**} \def\inforefzzz #1,#2,#3,#4**{% \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, node \samp{\ignorespaces#1{}}} % @node's only job in TeX is to define \lastnode, which is used in % cross-references. The @node line might or might not have commas, and % might or might not have spaces before the first comma, like: % @node foo , bar , ... % We don't want such trailing spaces in the node name. % \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse} % % also remove a trailing comma, in case of something like this: % @node Help-Cross, , , Cross-refs \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} \let\nwnode=\node \let\lastnode=\empty % Write a cross-reference definition for the current node. #1 is the % type (Ynumbered, Yappendix, Ynothing). % \def\donoderef#1{% \ifx\lastnode\empty\else \setref{\lastnode}{#1}% \global\let\lastnode=\empty \fi } % @anchor{NAME} -- define xref target at arbitrary point. % \newcount\savesfregister % \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an % anchor), which consists of three parts: % 1) NAME-title - the current sectioning name taken from \lastsection, % or the anchor name. % 2) NAME-snt - section number and type, passed as the SNT arg, or % empty for anchors. % 3) NAME-pg - the page number. % % This is called from \donoderef, \anchor, and \dofloat. In the case of % floats, there is an additional part, which is not written here: % 4) NAME-lof - the text as it should appear in a @listoffloats. % \def\setref#1#2{% \pdfmkdest{#1}% \iflinks {% \atdummies % preserve commands, but don't expand them \edef\writexrdef##1##2{% \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef ##1}{##2}}% these are parameters of \writexrdef }% \toks0 = \expandafter{\lastsection}% \immediate \writexrdef{title}{\the\toks0 }% \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout }% \fi } % @xrefautosectiontitle on|off says whether @section(ing) names are used % automatically in xrefs, if the third arg is not explicitly specified. % This was provided as a "secret" @set xref-automatic-section-title % variable, now it's official. % \parseargdef\xrefautomaticsectiontitle{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETxref-automatic-section-title\endcsname = \empty \else\ifx\temp\offword \expandafter\let\csname SETxref-automatic-section-title\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @xrefautomaticsectiontitle value `\temp', must be on|off}% \fi\fi } % % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is % the node name, #2 the name of the Info cross-reference, #3 the printed % node name, #4 the name of the Info file, #5 the name of the printed % manual. All but the node name can be omitted. % \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} \def\ref#1{\xrefX[#1,,,,,,,]} % \newbox\toprefbox \newbox\printedrefnamebox \newbox\infofilenamebox \newbox\printedmanualbox % \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup \unsepspaces % % Get args without leading/trailing spaces. \def\printedrefname{\ignorespaces #3}% \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}% % \def\infofilename{\ignorespaces #4}% \setbox\infofilenamebox = \hbox{\infofilename\unskip}% % \def\printedmanual{\ignorespaces #5}% \setbox\printedmanualbox = \hbox{\printedmanual\unskip}% % % If the printed reference name (arg #3) was not explicitly given in % the @xref, figure out what we want to use. \ifdim \wd\printedrefnamebox = 0pt % No printed node name was explicitly given. \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax % Not auto section-title: use node name inside the square brackets. \def\printedrefname{\ignorespaces #1}% \else % Auto section-title: use chapter/section title inside % the square brackets if we have it. \ifdim \wd\printedmanualbox > 0pt % It is in another manual, so we don't have it; use node name. \def\printedrefname{\ignorespaces #1}% \else \ifhavexrefs % We (should) know the real title if we have the xref values. \def\printedrefname{\refx{#1-title}{}}% \else % Otherwise just copy the Info node name. \def\printedrefname{\ignorespaces #1}% \fi% \fi \fi \fi % % Make link in pdf output. \ifpdf {\indexnofonts \turnoffactive \makevalueexpandable % This expands tokens, so do it after making catcode changes, so _ % etc. don't get their TeX definitions. This ignores all spaces in % #4, including (wrongly) those in the middle of the filename. \getfilename{#4}% % % This (wrongly) does not take account of leading or trailing % spaces in #1, which should be ignored. \edef\pdfxrefdest{#1}% \ifx\pdfxrefdest\empty \def\pdfxrefdest{Top}% no empty targets \else \txiescapepdf\pdfxrefdest % escape PDF special chars \fi % \leavevmode \startlink attr{/Border [0 0 0]}% \ifnum\filenamelength>0 goto file{\the\filename.pdf} name{\pdfxrefdest}% \else goto name{\pdfmkpgn{\pdfxrefdest}}% \fi }% \setcolor{\linkcolor}% \fi % % Float references are printed completely differently: "Figure 1.2" % instead of "[somenode], p.3". We distinguish them by the % LABEL-title being set to a magic string. {% % Have to otherify everything special to allow the \csname to % include an _ in the xref name, etc. \indexnofonts \turnoffactive \expandafter\global\expandafter\let\expandafter\Xthisreftitle \csname XR#1-title\endcsname }% \iffloat\Xthisreftitle % If the user specified the print name (third arg) to the ref, % print it instead of our usual "Figure 1.2". \ifdim\wd\printedrefnamebox = 0pt \refx{#1-snt}{}% \else \printedrefname \fi % % If the user also gave the printed manual name (fifth arg), append % "in MANUALNAME". \ifdim \wd\printedmanualbox > 0pt \space \putwordin{} \cite{\printedmanual}% \fi \else % node/anchor (non-float) references. % % If we use \unhbox to print the node names, TeX does not insert % empty discretionaries after hyphens, which means that it will not % find a line break at a hyphen in a node names. Since some manuals % are best written with fairly long node names, containing hyphens, % this is a loss. Therefore, we give the text of the node name % again, so it is as if TeX is seeing it for the first time. % \ifdim \wd\printedmanualbox > 0pt % Cross-manual reference with a printed manual name. % \crossmanualxref{\cite{\printedmanual\unskip}}% % \else\ifdim \wd\infofilenamebox > 0pt % Cross-manual reference with only an info filename (arg 4), no % printed manual name (arg 5). This is essentially the same as % the case above; we output the filename, since we have nothing else. % \crossmanualxref{\code{\infofilename\unskip}}% % \else % Reference within this manual. % % _ (for example) has to be the character _ for the purposes of the % control sequence corresponding to the node, but it has to expand % into the usual \leavevmode...\vrule stuff for purposes of % printing. So we \turnoffactive for the \refx-snt, back on for the % printing, back off for the \refx-pg. {\turnoffactive % Only output a following space if the -snt ref is nonempty; for % @unnumbered and @anchor, it won't be. \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi }% % output the `[mynode]' via the macro below so it can be overridden. \xrefprintnodename\printedrefname % % But we always want a comma and a space: ,\space % % output the `page 3'. \turnoffactive \putwordpage\tie\refx{#1-pg}{}% \fi\fi \fi \endlink \endgroup} % Output a cross-manual xref to #1. Used just above (twice). % % Only include the text "Section ``foo'' in" if the foo is neither % missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply % "see The Foo Manual", the idea being to refer to the whole manual. % % But, this being TeX, we can't easily compare our node name against the % string "Top" while ignoring the possible spaces before and after in % the input. By adding the arbitrary 7sp below, we make it much less % likely that a real node name would have the same width as "Top" (e.g., % in a monospaced font). Hopefully it will never happen in practice. % % For the same basic reason, we retypeset the "Top" at every % reference, since the current font is indeterminate. % \def\crossmanualxref#1{% \setbox\toprefbox = \hbox{Top\kern7sp}% \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}% \ifdim \wd2 > 7sp % nonempty? \ifdim \wd2 = \wd\toprefbox \else % same as Top? \putwordSection{} ``\printedrefname'' \putwordin{}\space \fi \fi #1% } % This macro is called from \xrefX for the `[nodename]' part of xref % output. It's a separate macro only so it can be changed more easily, % since square brackets don't work well in some documents. Particularly % one that Bob is working on :). % \def\xrefprintnodename#1{[#1]} % Things referred to by \setref. % \def\Ynothing{} \def\Yomitfromtoc{} \def\Ynumbered{% \ifnum\secno=0 \putwordChapter@tie \the\chapno \else \ifnum\subsecno=0 \putwordSection@tie \the\chapno.\the\secno \else \ifnum\subsubsecno=0 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno \else \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno \fi\fi\fi } \def\Yappendix{% \ifnum\secno=0 \putwordAppendix@tie @char\the\appendixno{}% \else \ifnum\subsecno=0 \putwordSection@tie @char\the\appendixno.\the\secno \else \ifnum\subsubsecno=0 \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno \else \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno \fi\fi\fi } % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. % If its value is nonempty, SUFFIX is output afterward. % \def\refx#1#2{% {% \indexnofonts \otherbackslash \expandafter\global\expandafter\let\expandafter\thisrefX \csname XR#1\endcsname }% \ifx\thisrefX\relax % If not defined, say something at least. \angleleft un\-de\-fined\angleright \iflinks \ifhavexrefs {\toks0 = {#1}% avoid expansion of possibly-complex value \message{\linenumber Undefined cross reference `\the\toks0'.}}% \else \ifwarnedxrefs\else \global\warnedxrefstrue \message{Cross reference values unknown; you must run TeX again.}% \fi \fi \fi \else % It's defined, so just use it. \thisrefX \fi #2% Output the suffix in any case. } % This is the macro invoked by entries in the aux file. Usually it's % just a \def (we prepend XR to the control sequence name to avoid % collisions). But if this is a float type, we have more work to do. % \def\xrdef#1#2{% {% The node name might contain 8-bit characters, which in our current % implementation are changed to commands like @'e. Don't let these % mess up the control sequence name. \indexnofonts \turnoffactive \xdef\safexrefname{#1}% }% % \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref % % Was that xref control sequence that we just defined for a float? \expandafter\iffloat\csname XR\safexrefname\endcsname % it was a float, and we have the (safe) float type in \iffloattype. \expandafter\let\expandafter\floatlist \csname floatlist\iffloattype\endcsname % % Is this the first time we've seen this float type? \expandafter\ifx\floatlist\relax \toks0 = {\do}% yes, so just \do \else % had it before, so preserve previous elements in list. \toks0 = \expandafter{\floatlist\do}% \fi % % Remember this xref in the control sequence \floatlistFLOATTYPE, % for later use in \listoffloats. \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0 {\safexrefname}}% \fi } % Read the last existing aux file, if any. No error if none exists. % \def\tryauxfile{% \openin 1 \jobname.aux \ifeof 1 \else \readdatafile{aux}% \global\havexrefstrue \fi \closein 1 } \def\setupdatafile{% \catcode`\^^@=\other \catcode`\^^A=\other \catcode`\^^B=\other \catcode`\^^C=\other \catcode`\^^D=\other \catcode`\^^E=\other \catcode`\^^F=\other \catcode`\^^G=\other \catcode`\^^H=\other \catcode`\^^K=\other \catcode`\^^L=\other \catcode`\^^N=\other \catcode`\^^P=\other \catcode`\^^Q=\other \catcode`\^^R=\other \catcode`\^^S=\other \catcode`\^^T=\other \catcode`\^^U=\other \catcode`\^^V=\other \catcode`\^^W=\other \catcode`\^^X=\other \catcode`\^^Z=\other \catcode`\^^[=\other \catcode`\^^\=\other \catcode`\^^]=\other \catcode`\^^^=\other \catcode`\^^_=\other % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. % in xref tags, i.e., node names. But since ^^e4 notation isn't % supported in the main text, it doesn't seem desirable. Furthermore, % that is not enough: for node names that actually contain a ^ % character, we would end up writing a line like this: 'xrdef {'hat % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first % argument, and \hat is not an expandable control sequence. It could % all be worked out, but why? Either we support ^^ or we don't. % % The other change necessary for this was to define \auxhat: % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter % and then to call \auxhat in \setq. % \catcode`\^=\other % % Special characters. Should be turned off anyway, but... \catcode`\~=\other \catcode`\[=\other \catcode`\]=\other \catcode`\"=\other \catcode`\_=\other \catcode`\|=\other \catcode`\<=\other \catcode`\>=\other \catcode`\$=\other \catcode`\#=\other \catcode`\&=\other \catcode`\%=\other \catcode`+=\other % avoid \+ for paranoia even though we've turned it off % % This is to support \ in node names and titles, since the \ % characters end up in a \csname. It's easier than % leaving it active and making its active definition an actual \ % character. What I don't understand is why it works in the *value* % of the xrdef. Seems like it should be a catcode12 \, and that % should not typeset properly. But it works, so I'm moving on for % now. --karl, 15jan04. \catcode`\\=\other % % Make the characters 128-255 be printing characters. {% \count1=128 \def\loop{% \catcode\count1=\other \advance\count1 by 1 \ifnum \count1<256 \loop \fi }% }% % % @ is our escape character in .aux files, and we need braces. \catcode`\{=1 \catcode`\}=2 \catcode`\@=0 } \def\readdatafile#1{% \begingroup \setupdatafile \input\jobname.#1 \endgroup} \message{insertions,} % including footnotes. \newcount \footnoteno % The trailing space in the following definition for supereject is % vital for proper filling; pages come out unaligned when you do a % pagealignmacro call if that space before the closing brace is % removed. (Generally, numeric constants should always be followed by a % space to prevent strange expansion errors.) \def\supereject{\par\penalty -20000\footnoteno =0 } % @footnotestyle is meaningful for Info output only. \let\footnotestyle=\comment {\catcode `\@=11 % % Auto-number footnotes. Otherwise like plain. \gdef\footnote{% \let\indent=\ptexindent \let\noindent=\ptexnoindent \global\advance\footnoteno by \@ne \edef\thisfootno{$^{\the\footnoteno}$}% % % In case the footnote comes at the end of a sentence, preserve the % extra spacing after we do the footnote number. \let\@sf\empty \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi % % Remove inadvertent blank space before typesetting the footnote number. \unskip \thisfootno\@sf \dofootnote }% % Don't bother with the trickery in plain.tex to not require the % footnote text as a parameter. Our footnotes don't need to be so general. % % Oh yes, they do; otherwise, @ifset (and anything else that uses % \parseargline) fails inside footnotes because the tokens are fixed when % the footnote is read. --karl, 16nov96. % \gdef\dofootnote{% \insert\footins\bgroup % We want to typeset this text as a normal paragraph, even if the % footnote reference occurs in (for example) a display environment. % So reset some parameters. \hsize=\pagewidth \interlinepenalty\interfootnotelinepenalty \splittopskip\ht\strutbox % top baseline for broken footnotes \splitmaxdepth\dp\strutbox \floatingpenalty\@MM \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip \parindent\defaultparindent % \smallfonts \rm % % Because we use hanging indentation in footnotes, a @noindent appears % to exdent this text, so make it be a no-op. makeinfo does not use % hanging indentation so @noindent can still be needed within footnote % text after an @example or the like (not that this is good style). \let\noindent = \relax % % Hang the footnote text off the number. Use \everypar in case the % footnote extends for more than one paragraph. \everypar = {\hang}% \textindent{\thisfootno}% % % Don't crash into the line above the footnote text. Since this % expands into a box, it must come within the paragraph, lest it % provide a place where TeX can split the footnote. \footstrut % % Invoke rest of plain TeX footnote routine. \futurelet\next\fo@t } }%end \catcode `\@=11 % In case a @footnote appears in a vbox, save the footnote text and create % the real \insert just after the vbox finished. Otherwise, the insertion % would be lost. % Similarly, if a @footnote appears inside an alignment, save the footnote % text to a box and make the \insert when a row of the table is finished. % And the same can be done for other insert classes. --kasal, 16nov03. % Replace the \insert primitive by a cheating macro. % Deeper inside, just make sure that the saved insertions are not spilled % out prematurely. % \def\startsavinginserts{% \ifx \insert\ptexinsert \let\insert\saveinsert \else \let\checkinserts\relax \fi } % This \insert replacement works for both \insert\footins{foo} and % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}. % \def\saveinsert#1{% \edef\next{\noexpand\savetobox \makeSAVEname#1}% \afterassignment\next % swallow the left brace \let\temp = } \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}} \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1} \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi} \def\placesaveins#1{% \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname {\box#1}% } % eat @SAVE -- beware, all of them have catcode \other: { \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-) \gdef\gobblesave @SAVE{} } % initialization: \def\newsaveins #1{% \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}% \next } \def\newsaveinsX #1{% \csname newbox\endcsname #1% \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts \checksaveins #1}% } % initialize: \let\checkinserts\empty \newsaveins\footins \newsaveins\margin % @image. We use the macros from epsf.tex to support this. % If epsf.tex is not installed and @image is used, we complain. % % Check for and read epsf.tex up front. If we read it only at @image % time, we might be inside a group, and then its definitions would get % undone and the next image would fail. \openin 1 = epsf.tex \ifeof 1 \else % Do not bother showing banner with epsf.tex v2.7k (available in % doc/epsf.tex and on ctan). \def\epsfannounce{\toks0 = }% \input epsf.tex \fi \closein 1 % % We will only complain once about lack of epsf.tex. \newif\ifwarnednoepsf \newhelp\noepsfhelp{epsf.tex must be installed for images to work. It is also included in the Texinfo distribution, or you can get it from ftp://tug.org/tex/epsf.tex.} % \def\image#1{% \ifx\epsfbox\thisisundefined \ifwarnednoepsf \else \errhelp = \noepsfhelp \errmessage{epsf.tex not found, images will be ignored}% \global\warnednoepsftrue \fi \else \imagexxx #1,,,,,\finish \fi } % % Arguments to @image: % #1 is (mandatory) image filename; we tack on .eps extension. % #2 is (optional) width, #3 is (optional) height. % #4 is (ignored optional) html alt text. % #5 is (ignored optional) extension. % #6 is just the usual extra ignored arg for parsing stuff. \newif\ifimagevmode \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup \catcode`\^^M = 5 % in case we're inside an example \normalturnoffactive % allow _ et al. in names % If the image is by itself, center it. \ifvmode \imagevmodetrue \else \ifx\centersub\centerV % for @center @image, we need a vbox so we can have our vertical space \imagevmodetrue \vbox\bgroup % vbox has better behavior than vtop herev \fi\fi % \ifimagevmode \nobreak\medskip % Usually we'll have text after the image which will insert % \parskip glue, so insert it here too to equalize the space % above and below. \nobreak\vskip\parskip \nobreak \fi % % Leave vertical mode so that indentation from an enclosing % environment such as @quotation is respected. % However, if we're at the top level, we don't want the % normal paragraph indentation. % On the other hand, if we are in the case of @center @image, we don't % want to start a paragraph, which will create a hsize-width box and % eradicate the centering. \ifx\centersub\centerV\else \noindent \fi % % Output the image. \ifpdf \dopdfimage{#1}{#2}{#3}% \else % \epsfbox itself resets \epsf?size at each figure. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi \epsfbox{#1.eps}% \fi % \ifimagevmode \medskip % space after a standalone image \fi \ifx\centersub\centerV \egroup \fi \endgroup} % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables, % etc. We don't actually implement floating yet, we always include the % float "here". But it seemed the best name for the future. % \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish} % There may be a space before second and/or third parameter; delete it. \def\eatcommaspace#1, {#1,} % #1 is the optional FLOATTYPE, the text label for this float, typically % "Figure", "Table", "Example", etc. Can't contain commas. If omitted, % this float will not be numbered and cannot be referred to. % % #2 is the optional xref label. Also must be present for the float to % be referable. % % #3 is the optional positioning argument; for now, it is ignored. It % will somehow specify the positions allowed to float to (here, top, bottom). % % We keep a separate counter for each FLOATTYPE, which we reset at each % chapter-level command. \let\resetallfloatnos=\empty % \def\dofloat#1,#2,#3,#4\finish{% \let\thiscaption=\empty \let\thisshortcaption=\empty % % don't lose footnotes inside @float. % % BEWARE: when the floats start float, we have to issue warning whenever an % insert appears inside a float which could possibly float. --kasal, 26may04 % \startsavinginserts % % We can't be used inside a paragraph. \par % \vtop\bgroup \def\floattype{#1}% \def\floatlabel{#2}% \def\floatloc{#3}% we do nothing with this yet. % \ifx\floattype\empty \let\safefloattype=\empty \else {% % the floattype might have accents or other special characters, % but we need to use it in a control sequence name. \indexnofonts \turnoffactive \xdef\safefloattype{\floattype}% }% \fi % % If label is given but no type, we handle that as the empty type. \ifx\floatlabel\empty \else % We want each FLOATTYPE to be numbered separately (Figure 1, % Table 1, Figure 2, ...). (And if no label, no number.) % \expandafter\getfloatno\csname\safefloattype floatno\endcsname \global\advance\floatno by 1 % {% % This magic value for \lastsection is output by \setref as the % XREFLABEL-title value. \xrefX uses it to distinguish float % labels (which have a completely different output format) from % node and anchor labels. And \xrdef uses it to construct the % lists of floats. % \edef\lastsection{\floatmagic=\safefloattype}% \setref{\floatlabel}{Yfloat}% }% \fi % % start with \parskip glue, I guess. \vskip\parskip % % Don't suppress indentation if a float happens to start a section. \restorefirstparagraphindent } % we have these possibilities: % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap % @float Foo,lbl & no caption: Foo 1.1 % @float Foo & @caption{Cap}: Foo: Cap % @float Foo & no caption: Foo % @float ,lbl & Caption{Cap}: 1.1: Cap % @float ,lbl & no caption: 1.1 % @float & @caption{Cap}: Cap % @float & no caption: % \def\Efloat{% \let\floatident = \empty % % In all cases, if we have a float type, it comes first. \ifx\floattype\empty \else \def\floatident{\floattype}\fi % % If we have an xref label, the number comes next. \ifx\floatlabel\empty \else \ifx\floattype\empty \else % if also had float type, need tie first. \appendtomacro\floatident{\tie}% \fi % the number. \appendtomacro\floatident{\chaplevelprefix\the\floatno}% \fi % % Start the printed caption with what we've constructed in % \floatident, but keep it separate; we need \floatident again. \let\captionline = \floatident % \ifx\thiscaption\empty \else \ifx\floatident\empty \else \appendtomacro\captionline{: }% had ident, so need a colon between \fi % % caption text. \appendtomacro\captionline{\scanexp\thiscaption}% \fi % % If we have anything to print, print it, with space before. % Eventually this needs to become an \insert. \ifx\captionline\empty \else \vskip.5\parskip \captionline % % Space below caption. \vskip\parskip \fi % % If have an xref label, write the list of floats info. Do this % after the caption, to avoid chance of it being a breakpoint. \ifx\floatlabel\empty \else % Write the text that goes in the lof to the aux file as % \floatlabel-lof. Besides \floatident, we include the short % caption if specified, else the full caption if specified, else nothing. {% \atdummies % % since we read the caption text in the macro world, where ^^M % is turned into a normal character, we have to scan it back, so % we don't write the literal three characters "^^M" into the aux file. \scanexp{% \xdef\noexpand\gtemp{% \ifx\thisshortcaption\empty \thiscaption \else \thisshortcaption \fi }% }% \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident \ifx\gtemp\empty \else : \gtemp \fi}}% }% \fi \egroup % end of \vtop % % place the captured inserts % % BEWARE: when the floats start floating, we have to issue warning % whenever an insert appears inside a float which could possibly % float. --kasal, 26may04 % \checkinserts } % Append the tokens #2 to the definition of macro #1, not expanding either. % \def\appendtomacro#1#2{% \expandafter\def\expandafter#1\expandafter{#1#2}% } % @caption, @shortcaption % \def\caption{\docaption\thiscaption} \def\shortcaption{\docaption\thisshortcaption} \def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption} \def\defcaption#1#2{\egroup \def#1{#2}} % The parameter is the control sequence identifying the counter we are % going to use. Create it if it doesn't exist and assign it to \floatno. \def\getfloatno#1{% \ifx#1\relax % Haven't seen this figure type before. \csname newcount\endcsname #1% % % Remember to reset this floatno at the next chap. \expandafter\gdef\expandafter\resetallfloatnos \expandafter{\resetallfloatnos #1=0 }% \fi \let\floatno#1% } % \setref calls this to get the XREFLABEL-snt value. We want an @xref % to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we % first read the @float command. % \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}% % Magic string used for the XREFLABEL-title value, so \xrefX can % distinguish floats from other xref types. \def\floatmagic{!!float!!} % #1 is the control sequence we are passed; we expand into a conditional % which is true if #1 represents a float ref. That is, the magic % \lastsection value which we \setref above. % \def\iffloat#1{\expandafter\doiffloat#1==\finish} % % #1 is (maybe) the \floatmagic string. If so, #2 will be the % (safe) float type for this float. We set \iffloattype to #2. % \def\doiffloat#1=#2=#3\finish{% \def\temp{#1}% \def\iffloattype{#2}% \ifx\temp\floatmagic } % @listoffloats FLOATTYPE - print a list of floats like a table of contents. % \parseargdef\listoffloats{% \def\floattype{#1}% floattype {% % the floattype might have accents or other special characters, % but we need to use it in a control sequence name. \indexnofonts \turnoffactive \xdef\safefloattype{\floattype}% }% % % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE. \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax \ifhavexrefs % if the user said @listoffloats foo but never @float foo. \message{\linenumber No `\safefloattype' floats to list.}% \fi \else \begingroup \leftskip=\tocindent % indent these entries like a toc \let\do=\listoffloatsdo \csname floatlist\safefloattype\endcsname \endgroup \fi } % This is called on each entry in a list of floats. We're passed the % xref label, in the form LABEL-title, which is how we save it in the % aux file. We strip off the -title and look up \XRLABEL-lof, which % has the text we're supposed to typeset here. % % Figures without xref labels will not be included in the list (since % they won't appear in the aux file). % \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish} \def\listoffloatsdoentry#1-title\finish{{% % Can't fully expand XR#1-lof because it can contain anything. Just % pass the control sequence. On the other hand, XR#1-pg is just the % page number, and we want to fully expand that so we can get a link % in pdf output. \toksA = \expandafter{\csname XR#1-lof\endcsname}% % % use the same \entry macro we use to generate the TOC and index. \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% \writeentry }} \message{localization,} % For single-language documents, @documentlanguage is usually given very % early, just after @documentencoding. Single argument is the language % (de) or locale (de_DE) abbreviation. % { \catcode`\_ = \active \globaldefs=1 \parseargdef\documentlanguage{\begingroup \let_=\normalunderscore % normal _ character for filenames \tex % read txi-??.tex file in plain TeX. % Read the file by the name they passed if it exists. \openin 1 txi-#1.tex \ifeof 1 \documentlanguagetrywithoutunderscore{#1_\finish}% \else \globaldefs = 1 % everything in the txi-LL files needs to persist \input txi-#1.tex \fi \closein 1 \endgroup % end raw TeX \endgroup} % % If they passed de_DE, and txi-de_DE.tex doesn't exist, % try txi-de.tex. % \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{% \openin 1 txi-#1.tex \ifeof 1 \errhelp = \nolanghelp \errmessage{Cannot read language file txi-#1.tex}% \else \globaldefs = 1 % everything in the txi-LL files needs to persist \input txi-#1.tex \fi \closein 1 } }% end of special _ catcode % \newhelp\nolanghelp{The given language definition file cannot be found or is empty. Maybe you need to install it? Putting it in the current directory should work if nowhere else does.} % This macro is called from txi-??.tex files; the first argument is the % \language name to set (without the "\lang@" prefix), the second and % third args are \{left,right}hyphenmin. % % The language names to pass are determined when the format is built. % See the etex.log file created at that time, e.g., % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log. % % With TeX Live 2008, etex now includes hyphenation patterns for all % available languages. This means we can support hyphenation in % Texinfo, at least to some extent. (This still doesn't solve the % accented characters problem.) % \catcode`@=11 \def\txisetlanguage#1#2#3{% % do not set the language if the name is undefined in the current TeX. \expandafter\ifx\csname lang@#1\endcsname \relax \message{no patterns for #1}% \else \global\language = \csname lang@#1\endcsname \fi % but there is no harm in adjusting the hyphenmin values regardless. \global\lefthyphenmin = #2\relax \global\righthyphenmin = #3\relax } % Helpers for encodings. % Set the catcode of characters 128 through 255 to the specified number. % \def\setnonasciicharscatcode#1{% \count255=128 \loop\ifnum\count255<256 \global\catcode\count255=#1\relax \advance\count255 by 1 \repeat } \def\setnonasciicharscatcodenonglobal#1{% \count255=128 \loop\ifnum\count255<256 \catcode\count255=#1\relax \advance\count255 by 1 \repeat } % @documentencoding sets the definition of non-ASCII characters % according to the specified encoding. % \parseargdef\documentencoding{% % Encoding being declared for the document. \def\declaredencoding{\csname #1.enc\endcsname}% % % Supported encodings: names converted to tokens in order to be able % to compare them with \ifx. \def\ascii{\csname US-ASCII.enc\endcsname}% \def\latnine{\csname ISO-8859-15.enc\endcsname}% \def\latone{\csname ISO-8859-1.enc\endcsname}% \def\lattwo{\csname ISO-8859-2.enc\endcsname}% \def\utfeight{\csname UTF-8.enc\endcsname}% % \ifx \declaredencoding \ascii \asciichardefs % \else \ifx \declaredencoding \lattwo \setnonasciicharscatcode\active \lattwochardefs % \else \ifx \declaredencoding \latone \setnonasciicharscatcode\active \latonechardefs % \else \ifx \declaredencoding \latnine \setnonasciicharscatcode\active \latninechardefs % \else \ifx \declaredencoding \utfeight \setnonasciicharscatcode\active \utfeightchardefs % \else \message{Unknown document encoding #1, ignoring.}% % \fi % utfeight \fi % latnine \fi % latone \fi % lattwo \fi % ascii } % A message to be logged when using a character that isn't available % the default font encoding (OT1). % \def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}} % Take account of \c (plain) vs. \, (Texinfo) difference. \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} % First, make active non-ASCII characters in order for them to be % correctly categorized when TeX reads the replacement text of % macros containing the character definitions. \setnonasciicharscatcode\active % % Latin1 (ISO-8859-1) character definitions. \def\latonechardefs{% \gdef^^a0{\tie} \gdef^^a1{\exclamdown} \gdef^^a2{\missingcharmsg{CENT SIGN}} \gdef^^a3{{\pounds}} \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} \gdef^^a5{\missingcharmsg{YEN SIGN}} \gdef^^a6{\missingcharmsg{BROKEN BAR}} \gdef^^a7{\S} \gdef^^a8{\"{}} \gdef^^a9{\copyright} \gdef^^aa{\ordf} \gdef^^ab{\guillemetleft} \gdef^^ac{$\lnot$} \gdef^^ad{\-} \gdef^^ae{\registeredsymbol} \gdef^^af{\={}} % \gdef^^b0{\textdegree} \gdef^^b1{$\pm$} \gdef^^b2{$^2$} \gdef^^b3{$^3$} \gdef^^b4{\'{}} \gdef^^b5{$\mu$} \gdef^^b6{\P} % \gdef^^b7{$^.$} \gdef^^b8{\cedilla\ } \gdef^^b9{$^1$} \gdef^^ba{\ordm} % \gdef^^bb{\guillemetright} \gdef^^bc{$1\over4$} \gdef^^bd{$1\over2$} \gdef^^be{$3\over4$} \gdef^^bf{\questiondown} % \gdef^^c0{\`A} \gdef^^c1{\'A} \gdef^^c2{\^A} \gdef^^c3{\~A} \gdef^^c4{\"A} \gdef^^c5{\ringaccent A} \gdef^^c6{\AE} \gdef^^c7{\cedilla C} \gdef^^c8{\`E} \gdef^^c9{\'E} \gdef^^ca{\^E} \gdef^^cb{\"E} \gdef^^cc{\`I} \gdef^^cd{\'I} \gdef^^ce{\^I} \gdef^^cf{\"I} % \gdef^^d0{\DH} \gdef^^d1{\~N} \gdef^^d2{\`O} \gdef^^d3{\'O} \gdef^^d4{\^O} \gdef^^d5{\~O} \gdef^^d6{\"O} \gdef^^d7{$\times$} \gdef^^d8{\O} \gdef^^d9{\`U} \gdef^^da{\'U} \gdef^^db{\^U} \gdef^^dc{\"U} \gdef^^dd{\'Y} \gdef^^de{\TH} \gdef^^df{\ss} % \gdef^^e0{\`a} \gdef^^e1{\'a} \gdef^^e2{\^a} \gdef^^e3{\~a} \gdef^^e4{\"a} \gdef^^e5{\ringaccent a} \gdef^^e6{\ae} \gdef^^e7{\cedilla c} \gdef^^e8{\`e} \gdef^^e9{\'e} \gdef^^ea{\^e} \gdef^^eb{\"e} \gdef^^ec{\`{\dotless i}} \gdef^^ed{\'{\dotless i}} \gdef^^ee{\^{\dotless i}} \gdef^^ef{\"{\dotless i}} % \gdef^^f0{\dh} \gdef^^f1{\~n} \gdef^^f2{\`o} \gdef^^f3{\'o} \gdef^^f4{\^o} \gdef^^f5{\~o} \gdef^^f6{\"o} \gdef^^f7{$\div$} \gdef^^f8{\o} \gdef^^f9{\`u} \gdef^^fa{\'u} \gdef^^fb{\^u} \gdef^^fc{\"u} \gdef^^fd{\'y} \gdef^^fe{\th} \gdef^^ff{\"y} } % Latin9 (ISO-8859-15) encoding character definitions. \def\latninechardefs{% % Encoding is almost identical to Latin1. \latonechardefs % \gdef^^a4{\euro} \gdef^^a6{\v S} \gdef^^a8{\v s} \gdef^^b4{\v Z} \gdef^^b8{\v z} \gdef^^bc{\OE} \gdef^^bd{\oe} \gdef^^be{\"Y} } % Latin2 (ISO-8859-2) character definitions. \def\lattwochardefs{% \gdef^^a0{\tie} \gdef^^a1{\ogonek{A}} \gdef^^a2{\u{}} \gdef^^a3{\L} \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} \gdef^^a5{\v L} \gdef^^a6{\'S} \gdef^^a7{\S} \gdef^^a8{\"{}} \gdef^^a9{\v S} \gdef^^aa{\cedilla S} \gdef^^ab{\v T} \gdef^^ac{\'Z} \gdef^^ad{\-} \gdef^^ae{\v Z} \gdef^^af{\dotaccent Z} % \gdef^^b0{\textdegree} \gdef^^b1{\ogonek{a}} \gdef^^b2{\ogonek{ }} \gdef^^b3{\l} \gdef^^b4{\'{}} \gdef^^b5{\v l} \gdef^^b6{\'s} \gdef^^b7{\v{}} \gdef^^b8{\cedilla\ } \gdef^^b9{\v s} \gdef^^ba{\cedilla s} \gdef^^bb{\v t} \gdef^^bc{\'z} \gdef^^bd{\H{}} \gdef^^be{\v z} \gdef^^bf{\dotaccent z} % \gdef^^c0{\'R} \gdef^^c1{\'A} \gdef^^c2{\^A} \gdef^^c3{\u A} \gdef^^c4{\"A} \gdef^^c5{\'L} \gdef^^c6{\'C} \gdef^^c7{\cedilla C} \gdef^^c8{\v C} \gdef^^c9{\'E} \gdef^^ca{\ogonek{E}} \gdef^^cb{\"E} \gdef^^cc{\v E} \gdef^^cd{\'I} \gdef^^ce{\^I} \gdef^^cf{\v D} % \gdef^^d0{\DH} \gdef^^d1{\'N} \gdef^^d2{\v N} \gdef^^d3{\'O} \gdef^^d4{\^O} \gdef^^d5{\H O} \gdef^^d6{\"O} \gdef^^d7{$\times$} \gdef^^d8{\v R} \gdef^^d9{\ringaccent U} \gdef^^da{\'U} \gdef^^db{\H U} \gdef^^dc{\"U} \gdef^^dd{\'Y} \gdef^^de{\cedilla T} \gdef^^df{\ss} % \gdef^^e0{\'r} \gdef^^e1{\'a} \gdef^^e2{\^a} \gdef^^e3{\u a} \gdef^^e4{\"a} \gdef^^e5{\'l} \gdef^^e6{\'c} \gdef^^e7{\cedilla c} \gdef^^e8{\v c} \gdef^^e9{\'e} \gdef^^ea{\ogonek{e}} \gdef^^eb{\"e} \gdef^^ec{\v e} \gdef^^ed{\'{\dotless{i}}} \gdef^^ee{\^{\dotless{i}}} \gdef^^ef{\v d} % \gdef^^f0{\dh} \gdef^^f1{\'n} \gdef^^f2{\v n} \gdef^^f3{\'o} \gdef^^f4{\^o} \gdef^^f5{\H o} \gdef^^f6{\"o} \gdef^^f7{$\div$} \gdef^^f8{\v r} \gdef^^f9{\ringaccent u} \gdef^^fa{\'u} \gdef^^fb{\H u} \gdef^^fc{\"u} \gdef^^fd{\'y} \gdef^^fe{\cedilla t} \gdef^^ff{\dotaccent{}} } % UTF-8 character definitions. % % This code to support UTF-8 is based on LaTeX's utf8.def, with some % changes for Texinfo conventions. It is included here under the GPL by % permission from Frank Mittelbach and the LaTeX team. % \newcount\countUTFx \newcount\countUTFy \newcount\countUTFz \gdef\UTFviiiTwoOctets#1#2{\expandafter \UTFviiiDefined\csname u8:#1\string #2\endcsname} % \gdef\UTFviiiThreeOctets#1#2#3{\expandafter \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname} % \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname} \gdef\UTFviiiDefined#1{% \ifx #1\relax \message{\linenumber Unicode char \string #1 not defined for Texinfo}% \else \expandafter #1% \fi } \begingroup \catcode`\~13 \catcode`\"12 \def\UTFviiiLoop{% \global\catcode\countUTFx\active \uccode`\~\countUTFx \uppercase\expandafter{\UTFviiiTmp}% \advance\countUTFx by 1 \ifnum\countUTFx < \countUTFy \expandafter\UTFviiiLoop \fi} \countUTFx = "C2 \countUTFy = "E0 \def\UTFviiiTmp{% \xdef~{\noexpand\UTFviiiTwoOctets\string~}} \UTFviiiLoop \countUTFx = "E0 \countUTFy = "F0 \def\UTFviiiTmp{% \xdef~{\noexpand\UTFviiiThreeOctets\string~}} \UTFviiiLoop \countUTFx = "F0 \countUTFy = "F4 \def\UTFviiiTmp{% \xdef~{\noexpand\UTFviiiFourOctets\string~}} \UTFviiiLoop \endgroup \begingroup \catcode`\"=12 \catcode`\<=12 \catcode`\.=12 \catcode`\,=12 \catcode`\;=12 \catcode`\!=12 \catcode`\~=13 \gdef\DeclareUnicodeCharacter#1#2{% \countUTFz = "#1\relax %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% \begingroup \parseXMLCharref \def\UTFviiiTwoOctets##1##2{% \csname u8:##1\string ##2\endcsname}% \def\UTFviiiThreeOctets##1##2##3{% \csname u8:##1\string ##2\string ##3\endcsname}% \def\UTFviiiFourOctets##1##2##3##4{% \csname u8:##1\string ##2\string ##3\string ##4\endcsname}% \expandafter\expandafter\expandafter\expandafter \expandafter\expandafter\expandafter \gdef\UTFviiiTmp{#2}% \endgroup} \gdef\parseXMLCharref{% \ifnum\countUTFz < "A0\relax \errhelp = \EMsimple \errmessage{Cannot define Unicode char value < 00A0}% \else\ifnum\countUTFz < "800\relax \parseUTFviiiA,% \parseUTFviiiB C\UTFviiiTwoOctets.,% \else\ifnum\countUTFz < "10000\relax \parseUTFviiiA;% \parseUTFviiiA,% \parseUTFviiiB E\UTFviiiThreeOctets.{,;}% \else \parseUTFviiiA;% \parseUTFviiiA,% \parseUTFviiiA!% \parseUTFviiiB F\UTFviiiFourOctets.{!,;}% \fi\fi\fi } \gdef\parseUTFviiiA#1{% \countUTFx = \countUTFz \divide\countUTFz by 64 \countUTFy = \countUTFz \multiply\countUTFz by 64 \advance\countUTFx by -\countUTFz \advance\countUTFx by 128 \uccode `#1\countUTFx \countUTFz = \countUTFy} \gdef\parseUTFviiiB#1#2#3#4{% \advance\countUTFz by "#10\relax \uccode `#3\countUTFz \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} \endgroup \def\utfeightchardefs{% \DeclareUnicodeCharacter{00A0}{\tie} \DeclareUnicodeCharacter{00A1}{\exclamdown} \DeclareUnicodeCharacter{00A3}{\pounds} \DeclareUnicodeCharacter{00A8}{\"{ }} \DeclareUnicodeCharacter{00A9}{\copyright} \DeclareUnicodeCharacter{00AA}{\ordf} \DeclareUnicodeCharacter{00AB}{\guillemetleft} \DeclareUnicodeCharacter{00AD}{\-} \DeclareUnicodeCharacter{00AE}{\registeredsymbol} \DeclareUnicodeCharacter{00AF}{\={ }} \DeclareUnicodeCharacter{00B0}{\ringaccent{ }} \DeclareUnicodeCharacter{00B4}{\'{ }} \DeclareUnicodeCharacter{00B8}{\cedilla{ }} \DeclareUnicodeCharacter{00BA}{\ordm} \DeclareUnicodeCharacter{00BB}{\guillemetright} \DeclareUnicodeCharacter{00BF}{\questiondown} \DeclareUnicodeCharacter{00C0}{\`A} \DeclareUnicodeCharacter{00C1}{\'A} \DeclareUnicodeCharacter{00C2}{\^A} \DeclareUnicodeCharacter{00C3}{\~A} \DeclareUnicodeCharacter{00C4}{\"A} \DeclareUnicodeCharacter{00C5}{\AA} \DeclareUnicodeCharacter{00C6}{\AE} \DeclareUnicodeCharacter{00C7}{\cedilla{C}} \DeclareUnicodeCharacter{00C8}{\`E} \DeclareUnicodeCharacter{00C9}{\'E} \DeclareUnicodeCharacter{00CA}{\^E} \DeclareUnicodeCharacter{00CB}{\"E} \DeclareUnicodeCharacter{00CC}{\`I} \DeclareUnicodeCharacter{00CD}{\'I} \DeclareUnicodeCharacter{00CE}{\^I} \DeclareUnicodeCharacter{00CF}{\"I} \DeclareUnicodeCharacter{00D0}{\DH} \DeclareUnicodeCharacter{00D1}{\~N} \DeclareUnicodeCharacter{00D2}{\`O} \DeclareUnicodeCharacter{00D3}{\'O} \DeclareUnicodeCharacter{00D4}{\^O} \DeclareUnicodeCharacter{00D5}{\~O} \DeclareUnicodeCharacter{00D6}{\"O} \DeclareUnicodeCharacter{00D8}{\O} \DeclareUnicodeCharacter{00D9}{\`U} \DeclareUnicodeCharacter{00DA}{\'U} \DeclareUnicodeCharacter{00DB}{\^U} \DeclareUnicodeCharacter{00DC}{\"U} \DeclareUnicodeCharacter{00DD}{\'Y} \DeclareUnicodeCharacter{00DE}{\TH} \DeclareUnicodeCharacter{00DF}{\ss} \DeclareUnicodeCharacter{00E0}{\`a} \DeclareUnicodeCharacter{00E1}{\'a} \DeclareUnicodeCharacter{00E2}{\^a} \DeclareUnicodeCharacter{00E3}{\~a} \DeclareUnicodeCharacter{00E4}{\"a} \DeclareUnicodeCharacter{00E5}{\aa} \DeclareUnicodeCharacter{00E6}{\ae} \DeclareUnicodeCharacter{00E7}{\cedilla{c}} \DeclareUnicodeCharacter{00E8}{\`e} \DeclareUnicodeCharacter{00E9}{\'e} \DeclareUnicodeCharacter{00EA}{\^e} \DeclareUnicodeCharacter{00EB}{\"e} \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}} \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}} \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}} \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}} \DeclareUnicodeCharacter{00F0}{\dh} \DeclareUnicodeCharacter{00F1}{\~n} \DeclareUnicodeCharacter{00F2}{\`o} \DeclareUnicodeCharacter{00F3}{\'o} \DeclareUnicodeCharacter{00F4}{\^o} \DeclareUnicodeCharacter{00F5}{\~o} \DeclareUnicodeCharacter{00F6}{\"o} \DeclareUnicodeCharacter{00F8}{\o} \DeclareUnicodeCharacter{00F9}{\`u} \DeclareUnicodeCharacter{00FA}{\'u} \DeclareUnicodeCharacter{00FB}{\^u} \DeclareUnicodeCharacter{00FC}{\"u} \DeclareUnicodeCharacter{00FD}{\'y} \DeclareUnicodeCharacter{00FE}{\th} \DeclareUnicodeCharacter{00FF}{\"y} \DeclareUnicodeCharacter{0100}{\=A} \DeclareUnicodeCharacter{0101}{\=a} \DeclareUnicodeCharacter{0102}{\u{A}} \DeclareUnicodeCharacter{0103}{\u{a}} \DeclareUnicodeCharacter{0104}{\ogonek{A}} \DeclareUnicodeCharacter{0105}{\ogonek{a}} \DeclareUnicodeCharacter{0106}{\'C} \DeclareUnicodeCharacter{0107}{\'c} \DeclareUnicodeCharacter{0108}{\^C} \DeclareUnicodeCharacter{0109}{\^c} \DeclareUnicodeCharacter{0118}{\ogonek{E}} \DeclareUnicodeCharacter{0119}{\ogonek{e}} \DeclareUnicodeCharacter{010A}{\dotaccent{C}} \DeclareUnicodeCharacter{010B}{\dotaccent{c}} \DeclareUnicodeCharacter{010C}{\v{C}} \DeclareUnicodeCharacter{010D}{\v{c}} \DeclareUnicodeCharacter{010E}{\v{D}} \DeclareUnicodeCharacter{0112}{\=E} \DeclareUnicodeCharacter{0113}{\=e} \DeclareUnicodeCharacter{0114}{\u{E}} \DeclareUnicodeCharacter{0115}{\u{e}} \DeclareUnicodeCharacter{0116}{\dotaccent{E}} \DeclareUnicodeCharacter{0117}{\dotaccent{e}} \DeclareUnicodeCharacter{011A}{\v{E}} \DeclareUnicodeCharacter{011B}{\v{e}} \DeclareUnicodeCharacter{011C}{\^G} \DeclareUnicodeCharacter{011D}{\^g} \DeclareUnicodeCharacter{011E}{\u{G}} \DeclareUnicodeCharacter{011F}{\u{g}} \DeclareUnicodeCharacter{0120}{\dotaccent{G}} \DeclareUnicodeCharacter{0121}{\dotaccent{g}} \DeclareUnicodeCharacter{0124}{\^H} \DeclareUnicodeCharacter{0125}{\^h} \DeclareUnicodeCharacter{0128}{\~I} \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}} \DeclareUnicodeCharacter{012A}{\=I} \DeclareUnicodeCharacter{012B}{\={\dotless{i}}} \DeclareUnicodeCharacter{012C}{\u{I}} \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}} \DeclareUnicodeCharacter{0130}{\dotaccent{I}} \DeclareUnicodeCharacter{0131}{\dotless{i}} \DeclareUnicodeCharacter{0132}{IJ} \DeclareUnicodeCharacter{0133}{ij} \DeclareUnicodeCharacter{0134}{\^J} \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}} \DeclareUnicodeCharacter{0139}{\'L} \DeclareUnicodeCharacter{013A}{\'l} \DeclareUnicodeCharacter{0141}{\L} \DeclareUnicodeCharacter{0142}{\l} \DeclareUnicodeCharacter{0143}{\'N} \DeclareUnicodeCharacter{0144}{\'n} \DeclareUnicodeCharacter{0147}{\v{N}} \DeclareUnicodeCharacter{0148}{\v{n}} \DeclareUnicodeCharacter{014C}{\=O} \DeclareUnicodeCharacter{014D}{\=o} \DeclareUnicodeCharacter{014E}{\u{O}} \DeclareUnicodeCharacter{014F}{\u{o}} \DeclareUnicodeCharacter{0150}{\H{O}} \DeclareUnicodeCharacter{0151}{\H{o}} \DeclareUnicodeCharacter{0152}{\OE} \DeclareUnicodeCharacter{0153}{\oe} \DeclareUnicodeCharacter{0154}{\'R} \DeclareUnicodeCharacter{0155}{\'r} \DeclareUnicodeCharacter{0158}{\v{R}} \DeclareUnicodeCharacter{0159}{\v{r}} \DeclareUnicodeCharacter{015A}{\'S} \DeclareUnicodeCharacter{015B}{\'s} \DeclareUnicodeCharacter{015C}{\^S} \DeclareUnicodeCharacter{015D}{\^s} \DeclareUnicodeCharacter{015E}{\cedilla{S}} \DeclareUnicodeCharacter{015F}{\cedilla{s}} \DeclareUnicodeCharacter{0160}{\v{S}} \DeclareUnicodeCharacter{0161}{\v{s}} \DeclareUnicodeCharacter{0162}{\cedilla{t}} \DeclareUnicodeCharacter{0163}{\cedilla{T}} \DeclareUnicodeCharacter{0164}{\v{T}} \DeclareUnicodeCharacter{0168}{\~U} \DeclareUnicodeCharacter{0169}{\~u} \DeclareUnicodeCharacter{016A}{\=U} \DeclareUnicodeCharacter{016B}{\=u} \DeclareUnicodeCharacter{016C}{\u{U}} \DeclareUnicodeCharacter{016D}{\u{u}} \DeclareUnicodeCharacter{016E}{\ringaccent{U}} \DeclareUnicodeCharacter{016F}{\ringaccent{u}} \DeclareUnicodeCharacter{0170}{\H{U}} \DeclareUnicodeCharacter{0171}{\H{u}} \DeclareUnicodeCharacter{0174}{\^W} \DeclareUnicodeCharacter{0175}{\^w} \DeclareUnicodeCharacter{0176}{\^Y} \DeclareUnicodeCharacter{0177}{\^y} \DeclareUnicodeCharacter{0178}{\"Y} \DeclareUnicodeCharacter{0179}{\'Z} \DeclareUnicodeCharacter{017A}{\'z} \DeclareUnicodeCharacter{017B}{\dotaccent{Z}} \DeclareUnicodeCharacter{017C}{\dotaccent{z}} \DeclareUnicodeCharacter{017D}{\v{Z}} \DeclareUnicodeCharacter{017E}{\v{z}} \DeclareUnicodeCharacter{01C4}{D\v{Z}} \DeclareUnicodeCharacter{01C5}{D\v{z}} \DeclareUnicodeCharacter{01C6}{d\v{z}} \DeclareUnicodeCharacter{01C7}{LJ} \DeclareUnicodeCharacter{01C8}{Lj} \DeclareUnicodeCharacter{01C9}{lj} \DeclareUnicodeCharacter{01CA}{NJ} \DeclareUnicodeCharacter{01CB}{Nj} \DeclareUnicodeCharacter{01CC}{nj} \DeclareUnicodeCharacter{01CD}{\v{A}} \DeclareUnicodeCharacter{01CE}{\v{a}} \DeclareUnicodeCharacter{01CF}{\v{I}} \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}} \DeclareUnicodeCharacter{01D1}{\v{O}} \DeclareUnicodeCharacter{01D2}{\v{o}} \DeclareUnicodeCharacter{01D3}{\v{U}} \DeclareUnicodeCharacter{01D4}{\v{u}} \DeclareUnicodeCharacter{01E2}{\={\AE}} \DeclareUnicodeCharacter{01E3}{\={\ae}} \DeclareUnicodeCharacter{01E6}{\v{G}} \DeclareUnicodeCharacter{01E7}{\v{g}} \DeclareUnicodeCharacter{01E8}{\v{K}} \DeclareUnicodeCharacter{01E9}{\v{k}} \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}} \DeclareUnicodeCharacter{01F1}{DZ} \DeclareUnicodeCharacter{01F2}{Dz} \DeclareUnicodeCharacter{01F3}{dz} \DeclareUnicodeCharacter{01F4}{\'G} \DeclareUnicodeCharacter{01F5}{\'g} \DeclareUnicodeCharacter{01F8}{\`N} \DeclareUnicodeCharacter{01F9}{\`n} \DeclareUnicodeCharacter{01FC}{\'{\AE}} \DeclareUnicodeCharacter{01FD}{\'{\ae}} \DeclareUnicodeCharacter{01FE}{\'{\O}} \DeclareUnicodeCharacter{01FF}{\'{\o}} \DeclareUnicodeCharacter{021E}{\v{H}} \DeclareUnicodeCharacter{021F}{\v{h}} \DeclareUnicodeCharacter{0226}{\dotaccent{A}} \DeclareUnicodeCharacter{0227}{\dotaccent{a}} \DeclareUnicodeCharacter{0228}{\cedilla{E}} \DeclareUnicodeCharacter{0229}{\cedilla{e}} \DeclareUnicodeCharacter{022E}{\dotaccent{O}} \DeclareUnicodeCharacter{022F}{\dotaccent{o}} \DeclareUnicodeCharacter{0232}{\=Y} \DeclareUnicodeCharacter{0233}{\=y} \DeclareUnicodeCharacter{0237}{\dotless{j}} \DeclareUnicodeCharacter{02DB}{\ogonek{ }} \DeclareUnicodeCharacter{1E02}{\dotaccent{B}} \DeclareUnicodeCharacter{1E03}{\dotaccent{b}} \DeclareUnicodeCharacter{1E04}{\udotaccent{B}} \DeclareUnicodeCharacter{1E05}{\udotaccent{b}} \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}} \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}} \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}} \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}} \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}} \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}} \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}} \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}} \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}} \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}} \DeclareUnicodeCharacter{1E20}{\=G} \DeclareUnicodeCharacter{1E21}{\=g} \DeclareUnicodeCharacter{1E22}{\dotaccent{H}} \DeclareUnicodeCharacter{1E23}{\dotaccent{h}} \DeclareUnicodeCharacter{1E24}{\udotaccent{H}} \DeclareUnicodeCharacter{1E25}{\udotaccent{h}} \DeclareUnicodeCharacter{1E26}{\"H} \DeclareUnicodeCharacter{1E27}{\"h} \DeclareUnicodeCharacter{1E30}{\'K} \DeclareUnicodeCharacter{1E31}{\'k} \DeclareUnicodeCharacter{1E32}{\udotaccent{K}} \DeclareUnicodeCharacter{1E33}{\udotaccent{k}} \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}} \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}} \DeclareUnicodeCharacter{1E36}{\udotaccent{L}} \DeclareUnicodeCharacter{1E37}{\udotaccent{l}} \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}} \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}} \DeclareUnicodeCharacter{1E3E}{\'M} \DeclareUnicodeCharacter{1E3F}{\'m} \DeclareUnicodeCharacter{1E40}{\dotaccent{M}} \DeclareUnicodeCharacter{1E41}{\dotaccent{m}} \DeclareUnicodeCharacter{1E42}{\udotaccent{M}} \DeclareUnicodeCharacter{1E43}{\udotaccent{m}} \DeclareUnicodeCharacter{1E44}{\dotaccent{N}} \DeclareUnicodeCharacter{1E45}{\dotaccent{n}} \DeclareUnicodeCharacter{1E46}{\udotaccent{N}} \DeclareUnicodeCharacter{1E47}{\udotaccent{n}} \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}} \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}} \DeclareUnicodeCharacter{1E54}{\'P} \DeclareUnicodeCharacter{1E55}{\'p} \DeclareUnicodeCharacter{1E56}{\dotaccent{P}} \DeclareUnicodeCharacter{1E57}{\dotaccent{p}} \DeclareUnicodeCharacter{1E58}{\dotaccent{R}} \DeclareUnicodeCharacter{1E59}{\dotaccent{r}} \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}} \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}} \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}} \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}} \DeclareUnicodeCharacter{1E60}{\dotaccent{S}} \DeclareUnicodeCharacter{1E61}{\dotaccent{s}} \DeclareUnicodeCharacter{1E62}{\udotaccent{S}} \DeclareUnicodeCharacter{1E63}{\udotaccent{s}} \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}} \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}} \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}} \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}} \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}} \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}} \DeclareUnicodeCharacter{1E7C}{\~V} \DeclareUnicodeCharacter{1E7D}{\~v} \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}} \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}} \DeclareUnicodeCharacter{1E80}{\`W} \DeclareUnicodeCharacter{1E81}{\`w} \DeclareUnicodeCharacter{1E82}{\'W} \DeclareUnicodeCharacter{1E83}{\'w} \DeclareUnicodeCharacter{1E84}{\"W} \DeclareUnicodeCharacter{1E85}{\"w} \DeclareUnicodeCharacter{1E86}{\dotaccent{W}} \DeclareUnicodeCharacter{1E87}{\dotaccent{w}} \DeclareUnicodeCharacter{1E88}{\udotaccent{W}} \DeclareUnicodeCharacter{1E89}{\udotaccent{w}} \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}} \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}} \DeclareUnicodeCharacter{1E8C}{\"X} \DeclareUnicodeCharacter{1E8D}{\"x} \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}} \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}} \DeclareUnicodeCharacter{1E90}{\^Z} \DeclareUnicodeCharacter{1E91}{\^z} \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}} \DeclareUnicodeCharacter{1E93}{\udotaccent{z}} \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}} \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}} \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}} \DeclareUnicodeCharacter{1E97}{\"t} \DeclareUnicodeCharacter{1E98}{\ringaccent{w}} \DeclareUnicodeCharacter{1E99}{\ringaccent{y}} \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}} \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}} \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}} \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}} \DeclareUnicodeCharacter{1EBC}{\~E} \DeclareUnicodeCharacter{1EBD}{\~e} \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}} \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}} \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}} \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}} \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}} \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}} \DeclareUnicodeCharacter{1EF2}{\`Y} \DeclareUnicodeCharacter{1EF3}{\`y} \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}} \DeclareUnicodeCharacter{1EF8}{\~Y} \DeclareUnicodeCharacter{1EF9}{\~y} \DeclareUnicodeCharacter{2013}{--} \DeclareUnicodeCharacter{2014}{---} \DeclareUnicodeCharacter{2018}{\quoteleft} \DeclareUnicodeCharacter{2019}{\quoteright} \DeclareUnicodeCharacter{201A}{\quotesinglbase} \DeclareUnicodeCharacter{201C}{\quotedblleft} \DeclareUnicodeCharacter{201D}{\quotedblright} \DeclareUnicodeCharacter{201E}{\quotedblbase} \DeclareUnicodeCharacter{2022}{\bullet} \DeclareUnicodeCharacter{2026}{\dots} \DeclareUnicodeCharacter{2039}{\guilsinglleft} \DeclareUnicodeCharacter{203A}{\guilsinglright} \DeclareUnicodeCharacter{20AC}{\euro} \DeclareUnicodeCharacter{2192}{\expansion} \DeclareUnicodeCharacter{21D2}{\result} \DeclareUnicodeCharacter{2212}{\minus} \DeclareUnicodeCharacter{2217}{\point} \DeclareUnicodeCharacter{2261}{\equiv} }% end of \utfeightchardefs % US-ASCII character definitions. \def\asciichardefs{% nothing need be done \relax } % Make non-ASCII characters printable again for compatibility with % existing Texinfo documents that may use them, even without declaring a % document encoding. % \setnonasciicharscatcode \other \message{formatting,} \newdimen\defaultparindent \defaultparindent = 15pt \chapheadingskip = 15pt plus 4pt minus 2pt \secheadingskip = 12pt plus 3pt minus 2pt \subsecheadingskip = 9pt plus 2pt minus 2pt % Prevent underfull vbox error messages. \vbadness = 10000 % Don't be very finicky about underfull hboxes, either. \hbadness = 6666 % Following George Bush, get rid of widows and orphans. \widowpenalty=10000 \clubpenalty=10000 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're % using an old version of TeX, don't do anything. We want the amount of % stretch added to depend on the line length, hence the dependence on % \hsize. We call this whenever the paper size is set. % \def\setemergencystretch{% \ifx\emergencystretch\thisisundefined % Allow us to assign to \emergencystretch anyway. \def\emergencystretch{\dimen0}% \else \emergencystretch = .15\hsize \fi } % Parameters in order: 1) textheight; 2) textwidth; % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip; % 7) physical page height; 8) physical page width. % % We also call \setleading{\textleading}, so the caller should define % \textleading. The caller should also set \parskip. % \def\internalpagesizes#1#2#3#4#5#6#7#8{% \voffset = #3\relax \topskip = #6\relax \splittopskip = \topskip % \vsize = #1\relax \advance\vsize by \topskip \outervsize = \vsize \advance\outervsize by 2\topandbottommargin \pageheight = \vsize % \hsize = #2\relax \outerhsize = \hsize \advance\outerhsize by 0.5in \pagewidth = \hsize % \normaloffset = #4\relax \bindingoffset = #5\relax % \ifpdf \pdfpageheight #7\relax \pdfpagewidth #8\relax % if we don't reset these, they will remain at "1 true in" of % whatever layout pdftex was dumped with. \pdfhorigin = 1 true in \pdfvorigin = 1 true in \fi % \setleading{\textleading} % \parindent = \defaultparindent \setemergencystretch } % @letterpaper (the default). \def\letterpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \textleading = 13.2pt % % If page is nothing but text, make it come out even. \internalpagesizes{607.2pt}{6in}% that's 46 lines {\voffset}{.25in}% {\bindingoffset}{36pt}% {11in}{8.5in}% }} % Use @smallbook to reset parameters for 7x9.25 trim size. \def\smallbook{{\globaldefs = 1 \parskip = 2pt plus 1pt \textleading = 12pt % \internalpagesizes{7.5in}{5in}% {-.2in}{0in}% {\bindingoffset}{16pt}% {9.25in}{7in}% % \lispnarrowing = 0.3in \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = .5cm }} % Use @smallerbook to reset parameters for 6x9 trim size. % (Just testing, parameters still in flux.) \def\smallerbook{{\globaldefs = 1 \parskip = 1.5pt plus 1pt \textleading = 12pt % \internalpagesizes{7.4in}{4.8in}% {-.2in}{-.4in}% {0pt}{14pt}% {9in}{6in}% % \lispnarrowing = 0.25in \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = .4cm }} % Use @afourpaper to print on European A4 paper. \def\afourpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \textleading = 13.2pt % % Double-side printing via postscript on Laserjet 4050 % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm. % To change the settings for a different printer or situation, adjust % \normaloffset until the front-side and back-side texts align. Then % do the same for \bindingoffset. You can set these for testing in % your texinfo source file like this: % @tex % \global\normaloffset = -6mm % \global\bindingoffset = 10mm % @end tex \internalpagesizes{673.2pt}{160mm}% that's 51 lines {\voffset}{\hoffset}% {\bindingoffset}{44pt}% {297mm}{210mm}% % \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = 5mm }} % Use @afivepaper to print on European A5 paper. % From romildo@urano.iceb.ufop.br, 2 July 2000. % He also recommends making @example and @lisp be small. \def\afivepaper{{\globaldefs = 1 \parskip = 2pt plus 1pt minus 0.1pt \textleading = 12.5pt % \internalpagesizes{160mm}{120mm}% {\voffset}{\hoffset}% {\bindingoffset}{8pt}% {210mm}{148mm}% % \lispnarrowing = 0.2in \tolerance = 800 \hfuzz = 1.2pt \contentsrightmargin = 0pt \defbodyindent = 2mm \tableindent = 12mm }} % A specific text layout, 24x15cm overall, intended for A4 paper. \def\afourlatex{{\globaldefs = 1 \afourpaper \internalpagesizes{237mm}{150mm}% {\voffset}{4.6mm}% {\bindingoffset}{7mm}% {297mm}{210mm}% % % Must explicitly reset to 0 because we call \afourpaper. \globaldefs = 0 }} % Use @afourwide to print on A4 paper in landscape format. \def\afourwide{{\globaldefs = 1 \afourpaper \internalpagesizes{241mm}{165mm}% {\voffset}{-2.95mm}% {\bindingoffset}{7mm}% {297mm}{210mm}% \globaldefs = 0 }} % @pagesizes TEXTHEIGHT[,TEXTWIDTH] % Perhaps we should allow setting the margins, \topskip, \parskip, % and/or leading, also. Or perhaps we should compute them somehow. % \parseargdef\pagesizes{\pagesizesyyy #1,,\finish} \def\pagesizesyyy#1,#2,#3\finish{{% \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi \globaldefs = 1 % \parskip = 3pt plus 2pt minus 1pt \setleading{\textleading}% % \dimen0 = #1\relax \advance\dimen0 by \voffset % \dimen2 = \hsize \advance\dimen2 by \normaloffset % \internalpagesizes{#1}{\hsize}% {\voffset}{\normaloffset}% {\bindingoffset}{44pt}% {\dimen0}{\dimen2}% }} % Set default to letter. % \letterpaper \message{and turning on texinfo input format.} \def^^L{\par} % remove \outer, so ^L can appear in an @comment % DEL is a comment character, in case @c does not suffice. \catcode`\^^? = 14 % Define macros to output various characters with catcode for normal text. \catcode`\"=\other \def\normaldoublequote{"} \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix \catcode`\+=\other \def\normalplus{+} \catcode`\<=\other \def\normalless{<} \catcode`\>=\other \def\normalgreater{>} \catcode`\^=\other \def\normalcaret{^} \catcode`\_=\other \def\normalunderscore{_} \catcode`\|=\other \def\normalverticalbar{|} \catcode`\~=\other \def\normaltilde{~} % This macro is used to make a character print one way in \tt % (where it can probably be output as-is), and another way in other fonts, % where something hairier probably needs to be done. % % #1 is what to print if we are indeed using \tt; #2 is what to print % otherwise. Since all the Computer Modern typewriter fonts have zero % interword stretch (and shrink), and it is reasonable to expect all % typewriter fonts to have this, we can check that font parameter. % \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} % Same as above, but check for italic font. Actually this also catches % non-italic slanted fonts since it is impossible to distinguish them from % italic fonts. But since this is only used by $ and it uses \sl anyway % this is not a problem. \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} % Turn off all special characters except @ % (and those which the user can use as if they were ordinary). % Most of these we simply print from the \tt font, but for some, we can % use math or other variants that look better in normal text. \catcode`\"=\active \def\activedoublequote{{\tt\char34}} \let"=\activedoublequote \catcode`\~=\active \def~{{\tt\char126}} \chardef\hat=`\^ \catcode`\^=\active \def^{{\tt \hat}} \catcode`\_=\active \def_{\ifusingtt\normalunderscore\_} \let\realunder=_ % Subroutine for the previous macro. \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } \catcode`\|=\active \def|{{\tt\char124}} \chardef \less=`\< \catcode`\<=\active \def<{{\tt \less}} \chardef \gtr=`\> \catcode`\>=\active \def>{{\tt \gtr}} \catcode`\+=\active \def+{{\tt \char 43}} \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix % If a .fmt file is being used, characters that might appear in a file % name cannot be active until we have parsed the command line. % So turn them off again, and have \everyjob (or @setfilename) turn them on. % \otherifyactive is called near the end of this file. \def\otherifyactive{\catcode`+=\other \catcode`\_=\other} % Used sometimes to turn off (effectively) the active characters even after % parsing them. \def\turnoffactive{% \normalturnoffactive \otherbackslash } \catcode`\@=0 % \backslashcurfont outputs one backslash character in current font, % as in \char`\\. \global\chardef\backslashcurfont=`\\ \global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work % \realbackslash is an actual character `\' with catcode other, and % \doublebackslash is two of them (for the pdf outlines). {\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} % In texinfo, backslash is an active character; it prints the backslash % in fixed width font. \catcode`\\=\active % @ for escape char from now on. % The story here is that in math mode, the \char of \backslashcurfont % ends up printing the roman \ from the math symbol font (because \char % in math mode uses the \mathcode, and plain.tex sets % \mathcode`\\="026E). It seems better for @backslashchar{} to always % print a typewriter backslash, hence we use an explicit \mathchar, % which is the decimal equivalent of "715c (class 7, e.g., use \fam; % ignored family value; char position "5C). We can't use " for the % usual hex value because it has already been made active. @def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} @let@backslashchar = @normalbackslash % @backslashchar{} is for user documents. % On startup, @fixbackslash assigns: % @let \ = @normalbackslash % \rawbackslash defines an active \ to do \backslashcurfont. % \otherbackslash defines an active \ to be a literal `\' character with % catcode other. We switch back and forth between these. @gdef@rawbackslash{@let\=@backslashcurfont} @gdef@otherbackslash{@let\=@realbackslash} % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of % the literal character `\'. Also revert - to its normal character, in % case the active - from code has slipped in. % {@catcode`- = @active @gdef@normalturnoffactive{% @let-=@normaldash @let"=@normaldoublequote @let$=@normaldollar %$ font-lock fix @let+=@normalplus @let<=@normalless @let>=@normalgreater @let\=@normalbackslash @let^=@normalcaret @let_=@normalunderscore @let|=@normalverticalbar @let~=@normaltilde @markupsetuplqdefault @markupsetuprqdefault @unsepspaces } } % Make _ and + \other characters, temporarily. % This is canceled by @fixbackslash. @otherifyactive % If a .fmt file is being used, we don't want the `\input texinfo' to show up. % That is what \eatinput is for; after that, the `\' should revert to printing % a backslash. % @gdef@eatinput input texinfo{@fixbackslash} @global@let\ = @eatinput % On the other hand, perhaps the file did not have a `\input texinfo'. Then % the first `\' in the file would cause an error. This macro tries to fix % that, assuming it is called before the first `\' could plausibly occur. % Also turn back on active characters that might appear in the input % file name, in case not using a pre-dumped format. % @gdef@fixbackslash{% @ifx\@eatinput @let\ = @normalbackslash @fi @catcode`+=@active @catcode`@_=@active } % Say @foo, not \foo, in error messages. @escapechar = `@@ % These (along with & and #) are made active for url-breaking, so need % active definitions as the normal characters. @def@normaldot{.} @def@normalquest{?} @def@normalslash{/} % These look ok in all fonts, so just make them not special. % @hashchar{} gets its own user-level command, because of #line. @catcode`@& = @other @def@normalamp{&} @catcode`@# = @other @def@normalhash{#} @catcode`@% = @other @def@normalpercent{%} @let @hashchar = @normalhash @c Finally, make ` and ' active, so that txicodequoteundirected and @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we @c don't make ` and ' active, @code will not get them as active chars. @c Do this last of all since we use ` in the previous @catcode assignments. @catcode`@'=@active @catcode`@`=@active @markupsetuplqdefault @markupsetuprqdefault @c Local variables: @c eval: (add-hook 'write-file-hooks 'time-stamp) @c page-delimiter: "^\\\\message" @c time-stamp-start: "def\\\\texinfoversion{" @c time-stamp-format: "%:y-%02m-%02d.%02H" @c time-stamp-end: "}" @c End: @c vim:sw=2: @ignore arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 @end ignore gnuchess-6.2.2/doc/version.texi000644 000766 000024 00000000142 12606706442 017304 0ustar00antoniostaff000000 000000 @set UPDATED 4 January 2015 @set UPDATED-MONTH January 2015 @set EDITION 6.2.2 @set VERSION 6.2.2